Skip to content

Pass price

Purpose

TBD by human

Identity & key fields

  • Primary key: id (uuid, default gen_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, default true).

business meaning: TBD by human

Invariants

  • passId NOT NULL with ON DELETE RESTRICT (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/passes.schema.ts).
  • name, price, isActive NOT 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) — passIdpasses.pass.id, on-delete restrict. N:1.
  • Snapshot into Customer pass at purchase via priceName + price/currency columns (no FK).

API surfaces

SurfaceExposedNotes
clientyes — PassPriceClientDto referenced from pass detail / purchase requestSwagger UI
businessyes — PassPriceResponseDto, CreatePassPriceDto, UpdatePassPriceDtoSwagger UI
super-adminno

Known gotchas / open questions

  • currency lives on the parent pass.currency, not per-price — all prices on a pass share the currency.