Franchise Address Updated
The address of a franchise unit changed in CNA Nexus. The address block of the franchise snapshot plus the franchise id. Published by cna-nexus, consumed by cna-one to mirror the change.
Overview
Fact: the address row of a franchise unit changed in common.addresses. Same payload as Franchise Address CreatedFranchise Address CreatedEventv1.0.0A franchise unit received its address in CNA Nexus. The address block of the franchise snapshot plus the franchise id. P...Ownercna-platformSchemaMapView docs: the full address after the change (FranchiseAddressData) plus franchiseId, never a delta. See Franchise AddressFranchise AddressEntityv1.0.0The address of a franchise unit - street, number, complement, neighborhood, postal code, IBGE city or foreign city and s...Ownercna-platformView docs.
When it is published. CNA NexusCNA NexusServicev1.0.0Franchise network back-office (franchises, economic groups, partners, contracts and amendments, document storage, AI doc...PublishesInviteUser, ContractActivationRequested +13SubscribesContractActivationRequested, AmendmentApplyRequested +4Ownercna-platformMapRepoView docs, always through manager.afterCommit(), whenever an existing address row of a franchise is updated: the updateAddress GraphQL mutation (updateFranchiseAddress), applyContractToFranchiseAggregate (a renewal, resale or re-activation projecting a ContractContractEntityv1.0.0A franchise contract in CNA Nexus - opening, renewal or resale - uploaded as a document, analysed by AI, reviewed by a p...Ownercna-platformView docs onto the unit, see Contract Activation RequestedContract Activation RequestedEventv1.0.0A user saved a contract for activation. cna-nexus's activation consumer turns it ACTIVE and creates or updates the franc...Ownercna-platformSchemaMapView docs) and the amendment handler handleAddressChange (an ADDRESS Contract AmendmentContract AmendmentEntityv1.0.0A supplementary document attached to a contract - attachment, addendum or rescission - carrying one change per contract ...Ownercna-platformView docs, see Amendment Apply RequestedAmendment Apply RequestedEventv1.0.0A user finished reviewing a contract amendment and asked for its changes to be applied. cna-nexus's amendment consumer e...Ownercna-platformSchemaMapView docs). The last two commits also emit Franchise UpdatedFranchise UpdatedEventv1.2.0A franchise unit changed in CNA Nexus - edited in one of the franchise screens, re-activated from a contract, or amended...Ownercna-platformSchemaMapView docs with the same address in payload.address; the consumer’s upsert is idempotent. refreshAddressLocation, the post-commit geocoding that rewrites only the coordinates, emits nothing of its own: the producer is registered after it, afterCommit callbacks run in order, and the producer re-reads the row, so the message carries the geocoded latitude and longitude. Through the mutation the coordinates are resolved before the write.
What the consumer does. CNA OneCNA OneServicev1.0.0Franchise operating system (franchises and employees, pricing, products and learning books, school operations). Publishe...PublishesGrantApplicationAccess, EmployeeCreated +6SubscribesInviteUser, FranchiseCreated +9Ownercna-platformMapRepoView docs (franchiseConsumer, group franchise-franchise-events, handler syncFranchiseAddress): the same as for FranchiseAddressCreated. It loads the franchise by franchiseId and, when the unit is not mirrored yet, logs a warning and drops the message (the unit has no CNPJ yet, see FranchiseAddressCreated); otherwise requires street, number, neighborhood, postalCode and an IBGE cityId known to cna-one, turns latitude and longitude into one PostGIS point when both are present and on the globe — a broken pair is logged and the address keeps no point — and updates the unit’s row in place. cityName, state, countryId, foreignCity and foreignState are ignored. Failures are logged and reported to Sentry, never rethrown.
Kafka
Topic (aggregateRoot) | Franchise |
Message key (routingKey) | payload.franchiseId |
| Contract owner | NEXUS |
metadata.event | FranchiseAddressUpdated |
| Consumer group | franchise-franchise-events |
Payload schema
Same payload type as FranchiseAddressCreated (FranchiseAddressPayload).
Source of truth
import { FranchiseAddressPayload } from 'events/nexus/franchise/FranchiseAddressCreated';
export class FranchiseAddressUpdated extends Event<FranchiseAddressPayload> { static readonly owner = 'NEXUS'; static readonly aggregateRoot = 'Franchise'; static readonly routingKey = 'franchiseId'; static readonly version = '1.0.0';}Known drift
Observed 2026-09-23.
- cna-nexus, the canonical repository, has no
FranchiseAddressUpdatedclass and emits nothing from the address write paths yet. The class above is the target; this page is written against the pending cna-nexus pull request and the link goes here when it opens. - cna-one
api/app/events/nexus/franchise/FranchiseAddressUpdated.tsexists only on branchjl/feature/CWH-48874-consume-franchise-address-events(not merged intostaging) and matches the class above: same fields, key and version.
Custom properties
| Property | Value |
|---|---|
| Contract Ownerx-contract-owner | NEXUS |
| Kafka Topicx-kafka-topic | Franchise |
| Message Keyx-message-key | franchiseId |
| Sourcex-source | cna-nexus api/app/events/nexus/franchise/FranchiseAddressUpdated.ts |
| Driftx-drift | cna-nexus has no class yet: the contract is written against the pending cna-nexus pull request. cna-one's copy matches the class above and lives on branch jl/feature/CWH-48874-consume-franchise-address-events, not merged. |
Franchise id (UUID). Kafka message key; cna-one upserts the address of the unit it mirrors under this id and, when the unit is not mirrored yet (no CNPJ), logs a warning and drops the message.
Street. cna-one requires it (streetAddress).
Number. cna-one requires it.
Complement. Mirrored by cna-one as additionalAddress.
Neighborhood. cna-one requires it (district).
Postal code as stored; cna-one requires it and strips it to 8 digits.
IBGE city code (common.cities.id). cna-one requires it and the city must exist there. Null for an address outside Brazil.
City name. Null for an address outside Brazil. Ignored by cna-one.
State code (UF). Null for an address outside Brazil. Ignored by cna-one.
Country as an ISO 3166-1 alpha-2 code (BR for Brazil). Always present. Ignored by cna-one.
Free-text city name for an address outside Brazil; null for a Brazilian address. Ignored by cna-one.
Free-text state or province name for an address outside Brazil; null for a Brazilian address. Ignored by cna-one.
Latitude in WGS84 as decimal text (ST_Y over the location point), or null when the address has no coordinates. cna-one stores latitude and longitude as one PostGIS point; a pair with one side missing, unreadable or off the globe is logged and the address is stored without a point.
Longitude in WGS84 as decimal text (ST_X over the location point), or null when the address has no coordinates. cna-one stores latitude and longitude as one PostGIS point; a pair with one side missing, unreadable or off the globe is logged and the address is stored without a point.