Tenant & Organization Model¶
Status: FROZEN — Foundation v1.0
Organization relationships¶
flowchart TB
T[Tenant] --> B[Brands 0..N]
T --> L[Locations 0..N]
T --> BU[Business Units 0..N during provisioning]
T --> S[Sites 0..N]
T --> C[Customers 0..N]
BU --> PV[Exactly 1 Primary Vertical Preset]
BU --> AC[Additional Capabilities 0..N]
BU --> O[Offerings]
BU --> R[Resources]
BU <--> L
S --> B
S --> BU
An active operating tenant normally has at least one Business Unit; a newly provisioned tenant may temporarily have none.
Business Unit / Location relationship¶
Business Units and Locations are many-to-many.
Examples:
- one resort location may contain Hotel, Spa and Restaurant Business Units;
- one Vehicle Rental Business Unit may operate from several pickup/return Locations;
- one Excursions Business Unit may serve several departure Locations.
Tenant-wide customer identity¶
Customer identity is tenant-wide.
A customer who books a Hotel Business Unit and later a Spa Business Unit owned by the same Tenant remains the same tenant Customer record.
Authorization may still restrict a staff member to only the customer interactions, bookings or data they are permitted to view for assigned Business Units.
This rule does not create a cross-tenant customer record. The same real-world person may have separate Customer records with different Tenants.
Isolation invariant¶
Tenant-owned state must be isolated by a trusted server-side Tenant Context.
I1-B3 implementation baseline: tenant-owned relational state is stored in shared PostgreSQL 18, tenant-owned rows carry tenant_id, application access is tenant-scoped, and PostgreSQL Row-Level Security provides defense in depth. Tenant context is propagated into the database as transaction-local trusted context.
Every implementation must preserve these isolation properties:
- tenant identity is derived/validated server-side rather than trusted from arbitrary client payloads;
- repositories/data access cannot silently cross tenant boundaries;
- caches and asynchronous work retain tenant scope;
- media/object storage remains tenant scoped;
- audit records carry tenant identity;
- external integration/payment/advertising credentials are tenant scoped;
- support impersonation/delegated access is explicit and auditable.
User membership¶
I1-B4 identity realization: authentication is global to the Touriffique environment. A platform User is mapped from an external OIDC identity using issuer + subject; tenant membership remains Touriffique-owned.
A platform user account is not permanently attached to one Tenant.
User
└── TenantMembership(s)
├── Tenant A -> OWNER
└── Tenant B -> MANAGER
Platform staff identity/permissions remain separate from tenant membership.
Commercial boundary¶
The Tenant is the subscription/billing boundary.
Business Units and additional capabilities can affect effective entitlements and billing, but they remain inside the Tenant subscription/contract rather than becoming separate tenants.
Persistence realization — I1-B3¶
The accepted persistence realization is documented in Persistence Architecture and ADR-011.
Business/domain semantics in this document remain Foundation v1.0 rules; I1-B3 specifies how the initial implementation enforces them.
Identity-provider boundary — I1-B4¶
Keycloak realms are environment-scoped rather than Tenant-scoped.
Tenant identity, membership, role assignment, Business Unit/Site/Location scope and entitlement state are not delegated to Keycloak's realm/group/role model as the application source of truth.