event

Franchise Partner Added

A person became a partner of a franchise unit, with their roles and whether they are a primary contact of the unit. One message per partner. Consumed by cna-nexus to invalidate the economic group statistics cache and by cna-one to give the partner access to the franchise.

Event Topic: FranchiseKey: franchiseIdPayload drift

Overview

Fact: a Franchise PartnerFranchise PartnerEntityv1.1.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 row was added. The payload carries the unit, the partner’s roles, whether the partner is a primary contact of the unit and a snapshot of the person.

Since 1.2.0 isPrimaryContact says whether the partner is a primary contact of the franchise, the partner the franchisor team usually talks to. It belongs to the link with this franchise, not to the person: the same person may be a contact of one unit and not of another, so it is not part of 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. A franchise may have none, one or several. Operations and Implementation set it by hand in cna-nexus; contracts never set it, so a partner added by a contract or a legal info edit arrives with false, and a partner recreated by an audit reversal arrives with the flag they had.

Since 1.1.0 person.birthDate is a calendar day, YYYY-MM-DD, with no time zone: the column is a date, and a consumer that built a Date from the former midnight-UTC timestamp and stored it in a negative offset landed on the day before.

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 +15SubscribesContractActivationRequested, AmendmentApplyRequested +5Ownercna-platformMapRepoView docs, in addPartners, which runs inside replaceFranchisePartners whenever a franchise is created from a contract, its legal information is edited, or a contract is applied onto it, and when an audit reversal recreates a removed partner. Registered with manager.afterCommit(), one message per added partner, batched in a single send. The same commit may also carry Franchise Partner RemovedFranchise Partner RemovedEventv1.2.0A person stopped being a partner of a franchise unit. One message per partner. Consumed by cna-nexus to invalidate the e...Ownercna-platformSchemaMapView docs and Franchise Partner UpdatedFranchise Partner UpdatedEventv1.2.0The roles or the primary contact flag of a franchise partner changed. Carries both before and after. Consumed by cna-nex...Ownercna-platformSchemaMapView docs messages. A later change to the person’s own data does not republish 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.

What the consumer does. cna-nexus (touchEconomicGroupOnFranchisePartnerChange, group economic-group-partner-touch): loads the franchise; if it has an economic group, bumps the group’s updatedAt. That timestamp versions the Redis cache of the economic group statistics (units, franchisees, active groups), so the next read recomputes them. Franchises without a group are ignored. CNA OneCNA OneServicev1.0.0Franchise operating system (franchises and employees, pricing, products and learning books, school operations, receivabl...PublishesGrantApplicationAccess, EmployeeCreated +19SubscribesInviteUser, FranchiseCreated +17Ownercna-platformMapRepoView docs (group franchise-franchise-events, handler syncFranchisePartner, cna-br/cna-one#903, in production since v0.4.0): mirrors the partner as an employee with the FRANCHISEE job role and access to the franchise; a partner of a franchise cna-one does not carry is logged and dropped. Since cna-br/cna-one#1156 it stores the flag on the partner’s link with that franchise (franchise.staff.is_primary_contact, read-only as Staff.isPrimaryContact), so the same person holds a separate flag in each franchise. The flag is written only when the payload carries it: a Franchise CreatedFranchise CreatedEventv2.1.0A franchise unit was created in CNA Nexus by activating an opening contract. Full snapshot of the unit; cna-one mirrors ...Ownercna-platformSchemaMapView docs or Franchise UpdatedFranchise UpdatedEventv2.1.0A franchise unit changed in CNA Nexus - edited in one of the franchise screens, re-activated from a contract, or amended...Ownercna-platformSchemaMapView docs snapshot, whose partners carry none, keeps the stored flag and brings a new partner in unflagged. With cna-br/cna-one#1489 (not in production yet) the handler publishes, after the Employee CreatedEmployee CreatedEventv1.0.0An employee was created in CNA One, with the person it points at. Consumed by cna-auth to provision the account and the ...Ownercna-platformSchemaMapView docs or Employee UpdatedEmployee UpdatedEventv1.0.0An employee or the person it points at changed in CNA One. Consumed by cna-auth to update the account and the user, incl...Ownercna-platformSchemaMapView docs of the partner, a Grant Application AccessGrant Application AccessCommandv1.0.0Asks CNA Auth to give a person access to an application, provisioning the account and user when they are new. Published ...Ownercna-platformSchemaMapView docs for cna-one when the person is identified by a CPF, and runs again, up to 3 attempts inside the same message, when another consumer stored the person of the partner, or their employee or staff link, during its write; every other failure is still logged, reported and dropped.

Kafka

Topic (aggregateRoot)Franchise
Message key (routingKey)payload.franchiseId
Contract ownerNEXUS
metadata.eventFranchisePartnerAdded
Consumer groupseconomic-group-partner-touch (cna-nexus), franchise-franchise-events (cna-one)

Payload schema

Source of truth

export type FranchisePartnerEventPerson = {
id: string;
document: string;
documentType: PersonsDocumentType;
name: string;
email?: string | null;
phone?: string | null;
birthDate?: string | null;
legalName?: string | null;
isFranchisee: boolean;
};
export type FranchisePartnerEventPayload = {
franchiseId: string;
roles: FranchisePartnerRole[];
isPrimaryContact: boolean;
person: FranchisePartnerEventPerson;
};
export class FranchisePartnerAdded extends Event<FranchisePartnerEventPayload> {
static readonly owner = 'NEXUS';
static readonly aggregateRoot = 'Franchise';
static readonly routingKey = 'franchiseId';
static readonly version = '1.2.0';
}

Known drift

Observed 2026-11-17 on cna-nexus v0.17.0 and cna-one v0.4.0. cna-nexus sends and declares 1.2.0 since v0.16.0 (cna-br/cna-nexus#619).

  • cna-one api/app/events/nexus/franchise/FranchisePartnerAdded.ts (cna-br/cna-one#903, moved to 1.2.0 by cna-br/cna-one#1156) declares version = '1.2.0' and carries the same fields; it types roles and person.documentType as string instead of the enums, which changes nothing on the wire.
  • person.isFranchisee is true when the person holds FRANCHISEE in any franchise, not only in franchiseId.

Custom properties

PropertyValue
Contract Ownerx-contract-ownerNEXUS
Kafka Topicx-kafka-topicFranchise
Message Keyx-message-keyfranchiseId
Sourcex-sourcecna-nexus api/app/events/nexus/franchise/FranchisePartnerAdded.ts
Driftx-driftcna-one's copy types roles and person.documentType as string instead of the enums, with the same wire payload; isFranchisee is global across franchises, not scoped to franchiseId.
13 properties
franchiseIdstring
required

Franchise id (UUID). Kafka message key.

rolesarray[string]
required

Roles of the partner in this unit (FranchisePartnerRole). Never empty.

isPrimaryContactboolean
required

Whether the partner is a primary contact of this franchise for the franchisor team. Belongs to the link with this franchise, not to the person. Set by hand in cna-nexus: false for a partner added by a contract or a legal info edit; a reverted removal brings back the flag the partner had.

personobject
required

Snapshot of the person (common.persons).