Pass price
Purpose
TBD by human
Identity & key fields
- Primary key:
id(uuid, defaultgen_random_uuid()). passId(uuid, NOT NULL, FK →passes.pass.id, on-delete restrict).name(text, NOT NULL) — tier label.price(decimal 10,2, NOT NULL).isActive(boolean, NOT NULL, defaulttrue).
business meaning: TBD by human
Invariants
passIdNOT NULL with ON DELETE RESTRICT (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/passes.schema.ts).name,price,isActiveNOT NULL (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/passes.schema.ts).
business invariants: TBD by human
Lifecycle
No status column; soft-deactivated via isActive=false.
Relationships
- Pass (ENT-029) —
passId→passes.pass.id, on-delete restrict. N:1. - Snapshot into Customer pass at purchase via
priceName+price/currencycolumns (no FK).
API surfaces
| Surface | Exposed | Notes |
|---|---|---|
| client | yes — PassPriceClientDto referenced from pass detail / purchase request | Swagger UI |
| business | yes — PassPriceResponseDto, CreatePassPriceDto, UpdatePassPriceDto | Swagger UI |
| super-admin | no | — |
Known gotchas / open questions
currencylives on the parentpass.currency, not per-price — all prices on a pass share the currency.