Company whitelabel app
Purpose
TBD by human
Identity & key fields
- Primary key:
id(uuid, defaultgen_random_uuid()). companyId(uuid, NOT NULL, FK →companies.company.id, on-delete cascade).name(text, NOT NULL).type(enumwhitelabel_app_type:TICKETS,GYM).supabaseUrl,supabaseAnonKey(text, NOT NULL).
business meaning: TBD by human
Invariants
companyIdON DELETE CASCADE (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/companies.schema.ts).name,type,supabaseUrl,supabaseAnonKeyNOT NULL (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/companies.schema.ts).
business invariants: TBD by human
Lifecycle
No explicit lifecycle.
Relationships
- Company (ENT-016) —
companyId→companies.company.id, on-delete cascade. N:1.
API surfaces
| Surface | Exposed | Notes |
|---|---|---|
| client | yes — /whitelabel-apps/{id}/config (WhitelabelAppConfigDto) returns the Supabase URL + anon key for app bootstrap | Swagger UI |
| business | inferred yes — managed via libs/features/companies/src/lib/companies.module.ts | Swagger UI |
| super-admin | no | — |
Known gotchas / open questions
supabaseAnonKeyis returned by a client endpoint — by design, since it is the public anon key, not the service key. Confirm naming hasn’t drifted.- OPEN: is there a per-company uniqueness on
(companyId, type)? Not enforced at DB level.