Franchise Partner Removed(v1.0.0)
A person stopped being a partner of a franchise unit. One message per partner. Consumed by cna-nexus itself to invalidate the economic group statistics cache, which cannot see hard-deleted rows otherwise.
You are looking at a previous version of the event Franchise Partner Removed. The latest version of this event isv1.1.0 →
Overview
Fact: 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 row was deleted. Same payload as 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, with the roles and person as they were.
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 removePartners inside replaceFranchisePartners, 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.
Kafka
Topic (aggregateRoot) | Franchise |
Message key (routingKey) | payload.franchiseId |
| Contract owner | NEXUS |
metadata.event | FranchisePartnerRemoved |
| Consumer group | economic-group-partner-touch |
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';}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/FranchisePartnerRemoved.ts |
Franchise id (UUID). Kafka message key.
Roles of the partner in this unit (FranchisePartnerRole). Never empty.
Snapshot of the person (common.persons).