Economic Group Updated
An economic group changed in CNA Nexus - renamed, toggled active or soft-deleted (there is no delete event). cna-one mirrors the new state by id.
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 changed. Same payload as Economic Group CreatedEconomic Group CreatedEventv1.0.0An economic group was created in CNA Nexus. cna-one mirrors it by id so that franchises can reference it.Ownercna-platformSchemaMapView docs.
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, after the write and without afterCommit, from updateEconomicGroup (name or isActive, including the toggle-status service) and from deleteEconomicGroup: a soft delete sets deletedAt and isActive = false and publishes this event with the deleted state, so consumers see the group leave the active set. There is no EconomicGroupDeleted event.
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 runs the same handler as for EconomicGroupCreated (syncEconomicGroup): upsert by id, storing name, isActive and deletedAt as they arrive.
Kafka
Topic (aggregateRoot) | Franchise |
Message key (routingKey) | payload.id |
| Contract owner | NEXUS |
metadata.event | EconomicGroupUpdated |
| Consumer group | franchise-franchise-events |
Payload schema
Same payload type as EconomicGroupCreated (EconomicGroupPayload).
Source of truth
import { EconomicGroupPayload } from 'events/nexus/franchise/EconomicGroupCreated';
export class EconomicGroupUpdated extends Event<EconomicGroupPayload> { static readonly owner = 'NEXUS'; static readonly aggregateRoot = 'Franchise'; static readonly routingKey = 'id';}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/EconomicGroupUpdated.ts |
| Driftx-drift | cna-one's copy of EconomicGroupPayload lacks createdAt and updatedAt. |
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.