Skip to content

Domain

The product is organised into bounded contexts — clusters of entities that share a vocabulary and a lifecycle. Each context is a folder under content/domain/; each entity inside it is one .mdx file.

Contexts

IDContextDescriptionLead entities
CTX-001IdentityPlatform-level user accounts + per-user preferencesUser
CTX-002CompaniesTenants, staff (members), customers, invitations, whitelabelCompany, Company member, Company customer
CTX-003BillingPlatform-level SaaS billing for companies — subscriptions, renewalsCompany subscription
CTX-004SpheresSuper-admin-owned taxonomy root, mounted on all three surfacesSphere
CTX-005CatalogBookable offerings — activities, sessions, time slots + supporting castActivity, Session, Time slot
CTX-006PassesMembership-style products — template tier + customer-instance tierPass, Customer pass
CTX-007BookingsCustomer reservations against sessions — central cross-context pivotBooking
CTX-008WalletPer-customer prepaid balance, ledger, refund-request workflowWallet
CTX-009PaymentsGateway adapters (LiqPay, Mono) + gateway-level money recordsPayment, Payment settings
CTX-010NotificationsDevice tokens, per-user inbox, broadcast pipelineNotification, Message

Adding a new entity

  1. Copy ../../templates/_entity-template.mdx into the right context folder; rename to {entity-slug}.mdx.
  2. Ask docs-writer for the next free ENT-NNN ID, or pick it manually as max(existing) + 1.
  3. Fill frontmatter — at minimum: title, id, type: entity, context, surfaces, sources, glossary_blurb.
  4. Fill the body — Purpose, Identity & key fields, Invariants, Lifecycle, Relationships.
  5. Keep status: draft until a human has reviewed Purpose / Invariants / Lifecycle. The agent never promotes status on its own.

Adding a new context

A new context is justified when 3 or more entities share a lifecycle, terminology, or owning team. Don’t create a context for a single entity — put it in the closest existing context and add a ## Open questions note suggesting the split.

To add a context:

  1. Create content/domain/{context}/index.mdx from ../../templates/_context-template.mdx.
  2. Assign the next CTX-NNN ID.
  3. List the entities, the lead entities, and the backend modules it covers.
  4. Update this page’s Contexts table.

Cross-context relationships

When an entity in one context references one in another (e.g. Booking references User), list it in the entity’s related_entities frontmatter array using its ID. Resist the urge to copy fields across contexts — describe the boundary instead.