event

Franchise Partner Updated

The roles of a franchise partner changed - roles are the only mutable field. Carries the roles before and after. Consumed by cna-nexus itself to invalidate the economic group statistics cache.

Event Topic: FranchiseKey: franchiseIdPayload drift

Overview

Fact: the roles of a Franchise PartnerFranchise PartnerEntityv1.0.0The link between a franchise unit and a person behind it, with one or more roles - FRANCHISEE (leads the unit) or OPERAT...Ownercna-platformView docs changed. The payload is the Franchise Partner AddedFranchise Partner AddedEventv1.1.0A person became a partner of a franchise unit, with their roles. One message per partner. Consumed by cna-nexus itself t...Ownercna-platformSchemaMapView docs payload plus previousRoles. Since 1.1.0 person.birthDate is a calendar day, YYYY-MM-DD, as on FranchisePartnerAdded.

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, in updatePartners inside replaceFranchisePartners, only for partners whose incoming roles differ from the stored ones. Registered with manager.afterCommit(), one message per changed partner. A change to the person’s own data (name, contacts, birth date) is not a role change and does not publish this event; it travels as Partner UpdatedPartner UpdatedEventv1.0.0The personal data of a franchise partner changed in CNA Nexus - name, legal name, e-mail, phone or birth date. Snapshot ...Ownercna-platformSchemaMapView docs on Partner (Kafka topic)Partner (Kafka topic)Channelv1.0.0Kafka topic for the Partner aggregate - a person in their capacity as partner of one or more franchise units. Carries Pa...Ownercna-platformView docs (target contract).

What the consumer does. Same as for FranchisePartnerAdded: cna-nexus bumps the updatedAt of the franchise’s economic group, if any. A role change can move a person in or out of the franchisee count.

Kafka

Topic (aggregateRoot)Franchise
Message key (routingKey)payload.franchiseId
Contract ownerNEXUS
metadata.eventFranchisePartnerUpdated
Consumer groupeconomic-group-partner-touch

Payload schema

Source of truth

export type FranchisePartnerUpdatedPayload = {
franchiseId: string;
roles: FranchisePartnerRole[];
previousRoles: FranchisePartnerRole[];
person: FranchisePartnerEventPerson;
};
export class FranchisePartnerUpdated extends Event<FranchisePartnerUpdatedPayload> {
static readonly owner = 'NEXUS';
static readonly aggregateRoot = 'Franchise';
static readonly routingKey = 'franchiseId';
static readonly version = '1.0.0'; // wire format is 1.1.0, bump pending (Known drift)
}

Known drift

Observed 2026-09-24.

  • cna-nexus api/app/events/nexus/franchise/FranchisePartnerUpdated.ts on staging (cna-br/cna-nexus#562) sends person.birthDate as YYYY-MM-DD, the 1.1.0 contract, but still declares static readonly version = '1.0.0', so metadata.version will read 1.0.0. Production (v0.13.0) runs the 1.0.0 contract, with the ISO timestamp, until the next release. No pin: cna-nexus is the producer and the only consumer, and its handler reads only franchiseId. The badge and this note go when the class declares 1.1.0 in production.
  • cna-one has no class for this event on main and drops it. Branch jl/feature/CWH-49388-consume-franchise-partner-events (not merged) types birthDate as YYYY-MM-DD text, has no static version, and does not carry roles or isFranchisee.

Custom properties

PropertyValue
Contract Ownerx-contract-ownerNEXUS
Kafka Topicx-kafka-topicFranchise
Message Keyx-message-keyfranchiseId
Sourcex-sourcecna-nexus api/app/events/nexus/franchise/FranchisePartnerUpdated.ts
Driftx-driftcna-nexus publishes birthDate as YYYY-MM-DD (cna-br/cna-nexus#562, staging) but its class still declares version 1.0.0, and production sends the ISO timestamp until the next release.
13 properties
franchiseIdstring
required

Franchise id (UUID). Kafka message key.

rolesarray[string]
required

Roles after the change (FranchisePartnerRole). Never empty.

previousRolesarray[string]
required

Roles before the change.

personobject
required

Snapshot of the person (common.persons).