CNA One
Franchise operating system (franchises and employees, pricing, products and learning books, school operations). Publishes access grants, employee, learning book, price table and audit messages; consumes the User, Franchise, LearningBook and PriceTable topics.
Overview
cna-one is the application franchises and the franchisor use to run the schools: franchise and employee management, pricing, products and learning books, classrooms, students and calendar. It serves three scopes (franchise, franchisor, multi) through one GraphQL API. On the Kafka bus it is the busiest participant: it mirrors data published by 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, asks CNA AuthCNA AuthServicev1.0.0Authentication and identity provider for the CNA platform (accounts, tokens, OTP/2FA, per-application access grants). Co...SubscribesGrantApplicationAccess, RevokeApplicationAccess +2Ownercna-platformMapRepoView docs to grant application access and to sync accounts, and uses the LearningBook and PriceTable topics as an internal work queue for pricing.
cna-one is the only application whose producer already reads owner from the event class, as the envelope contract requires, and the only one that guards against a missing routing key. Like the others it does not send producedBy yet.
Messages
Messages for this service
Sends messages (8)
Quickly find the message you need by searching for the name, type, or summary.Receives messages (11)
Quickly find the message you need by searching for the name, type, or summary.Kafka consumers
Consumers run as separate processes: api/scripts/consumers/commonConsumer.ts, franchiseConsumer.ts and pricingConsumer.ts.
| Consumer group | Topics | Handler |
| ---------------------------- | -------------- | -------------------------------------------------------------------- | ----------------------------- |
| common-person-events | User | api/app/domains/common/person/consumers/personConsumer.ts |
| franchise-franchise-events | Franchise | api/app/domains/franchise/franchise/consumers/franchiseConsumer.ts |
| pricing-price-events | LearningBook | api/app/domains/pricing/price/consumers/priceConsumer.ts |
| pricing-price-table-events | PriceTable | api/app/domains/pricing/priceTable/consumers/priceTableConsumer.ts |
| (to be created) | Partner | target consumer of [[event | PartnerUpdated]], no code yet |
Custom properties
| Property | Value |
|---|---|
| Runtimex-runtime | Express 5 + GraphQL Yoga + TypeORM/Postgres + kafkajs |
| Events Pathx-events-path | api/app/events/<owner>/<aggregateRoot>/<EventName>.ts |