Skip to content

Company whitelabel app

Purpose

TBD by human

Identity & key fields

  • Primary key: id (uuid, default gen_random_uuid()).
  • companyId (uuid, NOT NULL, FK → companies.company.id, on-delete cascade).
  • name (text, NOT NULL).
  • type (enum whitelabel_app_type: TICKETS, GYM).
  • supabaseUrl, supabaseAnonKey (text, NOT NULL).

business meaning: TBD by human

Invariants

  • companyId ON DELETE CASCADE (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/companies.schema.ts).
  • name, type, supabaseUrl, supabaseAnonKey NOT 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) — companyIdcompanies.company.id, on-delete cascade. N:1.

API surfaces

SurfaceExposedNotes
clientyes — /whitelabel-apps/{id}/config (WhitelabelAppConfigDto) returns the Supabase URL + anon key for app bootstrapSwagger UI
businessinferred yes — managed via libs/features/companies/src/lib/companies.module.tsSwagger UI
super-adminno

Known gotchas / open questions

  • supabaseAnonKey is 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.