event

Franchise Partner Removed

A person stopped being a partner of a franchise unit. One message per partner. Consumed by cna-nexus to invalidate the economic group statistics cache, which cannot see hard-deleted rows otherwise, and by cna-one to revoke the partner's 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 deleted. Same payload as Franchise Partner AddedFranchise Partner AddedEventv1.2.0A person became a partner of a franchise unit, with their roles and whether they are a primary contact of the unit. One ...Ownercna-platformSchemaMapView docs, with the roles, the primary contact flag and the person as they were. Since 1.2.0 isPrimaryContact is the flag the partner had when removed; the flag goes with the row. 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 +15SubscribesContractActivationRequested, AmendmentApplyRequested +5Ownercna-platformMapRepoView docs, in removePartners, inside replaceFranchisePartners or when an audit reversal undoes the addition of a partner, registered with manager.afterCommit(), one message per removed partner. Partner rows are hard-deleted, which is exactly why this event matters: the statistics cache is versioned by MAX(updated_at) across groups, franchises and partners, and a deleted row cannot move that timestamp.

What the consumer does. Same as for FranchisePartnerAdded: cna-nexus bumps the updatedAt of the franchise’s economic group, if any, so the statistics cache is recomputed on the next read. 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 revokeFranchisePartner, cna-br/cna-one#903, in production since v0.4.0): correlates the partner by document and revokes their access to that franchise, ending the contract today in the franchise’s timezone; the person, the employee and their other links stay. Since cna-br/cna-one#1156 the revocation also clears the primary contact flag of that link, as does 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 that stops naming the partner, so a link reactivated later comes back unflagged until cna-nexus flags it again; the flag the event carries is not read. Changes to the person’s own data are a different fact, 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.

Kafka

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

Payload schema

Same payload type as FranchisePartnerAdded (FranchisePartnerEventPayload).

Source of truth

import { FranchisePartnerEventPayload } from 'events/nexus/franchise/FranchisePartnerAdded';
export class FranchisePartnerRemoved 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/FranchisePartnerRemoved.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.

Custom properties

PropertyValue
Contract Ownerx-contract-ownerNEXUS
Kafka Topicx-kafka-topicFranchise
Message Keyx-message-keyfranchiseId
Sourcex-sourcecna-nexus api/app/events/nexus/franchise/FranchisePartnerRemoved.ts
Driftx-driftcna-one's copy types roles and person.documentType as string instead of the enums, with the same wire payload.
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 was a primary contact of this franchise for the franchisor team when removed. Belongs to the link with this franchise, not to the person.

personobject
required

Snapshot of the person (common.persons).