channel

Franchise (Kafka topic)

Kafka topic for the Franchise aggregate. Carries the nine NEXUS events about franchise units, their addresses, economic groups and partners, published by cna-nexus and consumed by cna-one (to mirror the network) and by cna-nexus itself, keyed by the franchise or economic group id.

Channel Kafka

Overview

Franchise is the verbatim static aggregateRoot of nine event classes owned by NexusNexusDomainv1.0.0Franchise network back-office bounded context. Owns the NEXUS message contracts for franchises, economic groups, partner...Ownercna-platformMapView docs. It is the busiest topic of the platform and the one that crosses applications the most: 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 publishes everything that changes in the franchise network, 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 mirrors franchises, their addresses and economic groups into its own database (franchise-franchise-events, fromBeginning: true), and cna-nexus listens to its own partner events to invalidate a statistics cache (economic-group-partner-touch, fromBeginning: true).

| Event | Key | Consumed by | | ------- | ------------------------- | --------------------- | --------- | | [[event | FranchiseCreated]] | id (franchise) | cna-one | | [[event | FranchiseUpdated]] | id (franchise) | nobody | | [[event | FranchiseAddressCreated]] | franchiseId | cna-one | | [[event | FranchiseAddressUpdated]] | franchiseId | cna-one | | [[event | EconomicGroupCreated]] | id (economic group) | cna-one | | [[event | EconomicGroupUpdated]] | id (economic group) | cna-one | | [[event | FranchisePartnerAdded]] | franchiseId | cna-nexus | | [[event | FranchisePartnerRemoved]] | franchiseId | cna-nexus | | [[event | FranchisePartnerUpdated]] | franchiseId | cna-nexus |

Events the consumer has no class for are skipped with a debug log: cna-one drops FranchiseUpdated and the three partner events.

Message key

Franchise, address and partner events are keyed by the franchise id (id or franchiseId), so everything about one unit stays in order. Economic group events are keyed by the economic group id, a different key space on the same topic.

Envelope

{
"payload": { "...": "see the schema on each message page" },
"metadata": {
"event": "FranchiseCreated",
"producedAt": "2026-09-18T12:00:00.000Z",
"owner": "NEXUS",
"producedBy": "NEXUS"
}
}

owner is the contract owner from the class; producedBy is the application that emitted the message (see The envelope in docs/modelling/02-mapping.md). Today. cna-nexus hard-codes owner to NEXUS, which coincides with the contract owner on this topic; producedBy is not sent yet.

Franchise, address and partner events are registered with manager.afterCommit(), so they only go out after the transaction commits, and FranchiseCreated / FranchiseUpdated re-read the aggregate after commit: they are full snapshots, not deltas. Economic group events are published right after the write, without afterCommit.

Channel information

Address: Franchise
Protocol:
  • kafka

Custom properties

PropertyValue
Message Keyx-message-keyid / franchiseId
Aggregate Rootx-aggregate-rootFranchise