Skip to content

Time slot attendee

Purpose

TBD by human

Identity & key fields

  • Primary key: id (uuid, default gen_random_uuid()).
  • timeSlotId (uuid, FK → activities.time_slots.id, on-delete cascade).
  • customerId (uuid, FK → companies.company_customer.id, on-delete cascade).
  • validFrom (timestamp, default now()), validUntil (nullable timestamp).
  • status (enum time_slot_attendee_status: ACTIVE, PAUSED, CANCELLED, default ACTIVE).

business meaning: TBD by human

Invariants

  • timeSlotId and customerId both ON DELETE CASCADE (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/activities.schema.ts).
  • status defaults to ACTIVE; validFrom defaults to now(); both NOT NULL (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/activities.schema.ts).

business invariants: TBD by human

Lifecycle

Status enum values: ACTIVE, PAUSED, CANCELLED.

transitions: TBD by human

Relationships

  • Time slot (ENT-013) — timeSlotIdactivities.time_slots.id, on-delete cascade. N:1.
  • Company customer (ENT-017) — customerIdcompanies.company_customer.id, on-delete cascade. N:1.

API surfaces

SurfaceExposedNotes
clientno
businessinferred yes — but no dedicated TimeSlotAttendee* DTO appears in business.openapi.yaml at audit timeSwagger UI
super-adminno

Known gotchas / open questions

  • This is the structural backing for “coach adds the customer to a recurring slot” → SLOT_ATTENDEE booking source (see Booking). The booking lifecycle for these is post-fact billing.
  • OPEN: how is (timeSlotId, customerId) uniqueness handled when an attendee is paused and re-added? No DB UNIQUE is declared.