Time slot attendee
Purpose
TBD by human
Identity & key fields
- Primary key:
id(uuid, defaultgen_random_uuid()). timeSlotId(uuid, FK →activities.time_slots.id, on-delete cascade).customerId(uuid, FK →companies.company_customer.id, on-delete cascade).validFrom(timestamp, defaultnow()),validUntil(nullable timestamp).status(enumtime_slot_attendee_status:ACTIVE,PAUSED,CANCELLED, defaultACTIVE).
business meaning: TBD by human
Invariants
timeSlotIdandcustomerIdboth ON DELETE CASCADE (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/activities.schema.ts).statusdefaults toACTIVE;validFromdefaults tonow(); 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) —
timeSlotId→activities.time_slots.id, on-delete cascade. N:1. - Company customer (ENT-017) —
customerId→companies.company_customer.id, on-delete cascade. N:1.
API surfaces
| Surface | Exposed | Notes |
|---|---|---|
| client | no | — |
| business | inferred yes — but no dedicated TimeSlotAttendee* DTO appears in business.openapi.yaml at audit time | Swagger UI |
| super-admin | no | — |
Known gotchas / open questions
- This is the structural backing for “coach adds the customer to a recurring slot” →
SLOT_ATTENDEEbooking 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.