event

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.

Event Topic: FranchiseKey: idPayload drift

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 ownerNEXUS
metadata.eventEconomicGroupUpdated
Consumer groupfranchise-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

PropertyValue
Contract Ownerx-contract-ownerNEXUS
Kafka Topicx-kafka-topicFranchise
Message Keyx-message-keyid
Sourcex-sourcecna-nexus api/app/events/nexus/franchise/EconomicGroupUpdated.ts
Driftx-driftcna-one's copy of EconomicGroupPayload lacks createdAt and updatedAt.
6 properties
idstring
required

Economic group id (UUID). Kafka message key; cna-one mirrors the group under this id.

namestring
required

Group name, unique among non-deleted groups.

isActiveboolean
required

Whether the group is active. False after a soft delete.

createdAtstring<date-time>
required

Creation instant. Absent from cna-one's copy of the type.

updatedAtstring<date-time>
required

Last update instant. Absent from cna-one's copy of the type.

deletedAtstring | null<date-time>
required

Soft-delete instant, or null. Always present as a key.