Economic Group Created
An economic group was created in CNA Nexus. cna-one mirrors it by id so that franchises can reference it.
Overview
Fact: an Economic GroupEconomic GroupEntityv1.0.0A grouping of franchise units under one economic owner, used for reporting and statistics. Optional on a franchise; soft...Ownercna-platformView docs now exists in Nexus. The payload is the group row.
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 createEconomicGroup, right after the insert. Published after the write, without afterCommit.
What the consumer does. 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 (franchiseConsumer, handler syncEconomicGroup, shared with Economic Group UpdatedEconomic Group UpdatedEventv1.0.0An economic group changed in CNA Nexus - renamed, toggled active or soft-deleted (there is no delete event). cna-one mir...Ownercna-platformSchemaMapView docs): upserts the group by id with name, isActive and deletedAt, storing them as they arrive without validation. createdAt and updatedAt are ignored. The mirrored group is what a later Franchise CreatedFranchise CreatedEventv1.2.0A franchise unit was created in CNA Nexus by activating an opening contract. Full snapshot of the unit; cna-one mirrors ...Ownercna-platformSchemaMapView docs needs to resolve economicGroup.id; a franchise arriving before its group fails to mirror.
Failures are logged and reported to Sentry, never rethrown.
Kafka
Topic (aggregateRoot) | Franchise |
Message key (routingKey) | payload.id |
| Contract owner | NEXUS |
metadata.event | EconomicGroupCreated |
| Consumer group | franchise-franchise-events |
Payload schema
Source of truth
export type EconomicGroupPayload = { id: string; name: string; isActive: boolean; createdAt: string; updatedAt: string; deletedAt: string | null;};
export class EconomicGroupCreated extends Event<EconomicGroupPayload> { static readonly owner = 'NEXUS'; static readonly aggregateRoot = 'Franchise'; static readonly routingKey = 'id';}Known drift
cna-one api/app/events/nexus/economicGroup/EconomicGroupCreated.ts has no createdAt or updatedAt, and is stored under a different folder than the canonical copy.
Custom properties
| Property | Value |
|---|---|
| Contract Ownerx-contract-owner | NEXUS |
| Kafka Topicx-kafka-topic | Franchise |
| Message Keyx-message-key | id |
| Sourcex-source | cna-nexus api/app/events/nexus/franchise/EconomicGroupCreated.ts |
| Driftx-drift | cna-one's copy of EconomicGroupPayload lacks createdAt and updatedAt and lives under events/nexus/economicGroup/ instead of events/nexus/franchise/. |
Economic group id (UUID). Kafka message key; cna-one mirrors the group under this id.
Group name, unique among non-deleted groups.
Whether the group is active. False after a soft delete.
Creation instant. Absent from cna-one's copy of the type.
Last update instant. Absent from cna-one's copy of the type.
Soft-delete instant, or null. Always present as a key.