Activity extra
Purpose
TBD by human
Identity & key fields
- Primary key:
id(uuid, defaultgen_random_uuid()). activityId(uuid, FK →activities.activities.id, on-delete cascade).name,description,imageUrl.price(decimal 10,2, default'0').isActive(boolean, defaulttrue).order(integer, default0).
business meaning: TBD by human
Invariants
activityIdON DELETE CASCADE — extras vanish with the activity (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/activities.schema.ts).name,price,isActive,orderNOT NULL (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/activities.schema.ts).
business invariants: TBD by human
Lifecycle
No explicit state machine — soft-deactivated via isActive.
Relationships
- Activity (ENT-005) —
activityId→activities.activities.id, on-delete cascade. N:1. - Booking extra (ENT-004) — referenced by
bookings.booking_extras.extra_idwith on-delete restrict (cannot delete an extra while booking snapshots exist). - Pass entitlement covered extra (ENT-030) — referenced by
passes.pass_entitlement_covered_extras.extra_idwith on-delete restrict.
API surfaces
| Surface | Exposed | Notes |
|---|---|---|
| client | yes — ActivityExtraClientDto referenced from activity detail | Swagger UI |
| business | no — not separately exposed as a DTO; managed via activity create/update | Swagger UI |
| super-admin | no | — |
Known gotchas / open questions
- ON DELETE RESTRICT from
booking_extrasandpass_entitlement_covered_extrasmeans extras cannot be hard-deleted while history exists — useisActive=falseinstead. - OPEN: business surface management of extras — is it inline via activity DTOs only, or is there a dedicated endpoint missing from the contract?