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
| ID | Context | Description | Lead entities |
|---|---|---|---|
| CTX-001 | Identity | Platform-level user accounts + per-user preferences | User |
| CTX-002 | Companies | Tenants, staff (members), customers, invitations, whitelabel | Company, Company member, Company customer |
| CTX-003 | Billing | Platform-level SaaS billing for companies — subscriptions, renewals | Company subscription |
| CTX-004 | Spheres | Super-admin-owned taxonomy root, mounted on all three surfaces | Sphere |
| CTX-005 | Catalog | Bookable offerings — activities, sessions, time slots + supporting cast | Activity, Session, Time slot |
| CTX-006 | Passes | Membership-style products — template tier + customer-instance tier | Pass, Customer pass |
| CTX-007 | Bookings | Customer reservations against sessions — central cross-context pivot | Booking |
| CTX-008 | Wallet | Per-customer prepaid balance, ledger, refund-request workflow | Wallet |
| CTX-009 | Payments | Gateway adapters (LiqPay, Mono) + gateway-level money records | Payment, Payment settings |
| CTX-010 | Notifications | Device tokens, per-user inbox, broadcast pipeline | Notification, Message |
Adding a new entity
- Copy
../../templates/_entity-template.mdxinto the right context folder; rename to{entity-slug}.mdx. - Ask
docs-writerfor the next freeENT-NNNID, or pick it manually asmax(existing) + 1. - Fill frontmatter — at minimum:
title,id,type: entity,context,surfaces,sources,glossary_blurb. - Fill the body —
Purpose,Identity & key fields,Invariants,Lifecycle,Relationships. - Keep
status: draftuntil 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:
- Create
content/domain/{context}/index.mdxfrom../../templates/_context-template.mdx. - Assign the next
CTX-NNNID. - List the entities, the lead entities, and the backend modules it covers.
- 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.