Skip to main content

09 — Events

What it is: An event is a game or show that can be purchased. Events are global — not scoped to any program. Programs reference events; suites are checked against events at query time.


Table: tbl_events

FieldNotes
eventCodeUnique, immutable — comes from the vendor; everything (API calls, cart, booking) uses this
eventIdinternal auto-increment PK; rarely used externally
eventNamedisplay name (fan-facing)
eventDescriptionoptional longer description
statusdraft, published, archived
venueIdFK to tbl_venues — determines which map to load
eventDate / eventTimenullable for TBD/TBA cases
dateTbd / dateTbaTBD = not decided yet; TBA = decided, not announced
timeTbd / timeTbasame distinction for time
estimatedDatesorting only — not shown to fans; TBA events without this sort to the end
maxSeatPurchaseLimitanti-broker cap across multiple orders (may not be wired on FE yet)
minSeatPurchaseLimitminimum for first order (default: 1)
isFeaturedGameshown in a separate/prominent section
onSaleDateTime / offSaleDateTimesale window; stored without timezone; default visibility ends ~1h after game
timezoneOverrideper-event timezone override for sale window fields
opponentNamenullable

Timezone behavior: eventTime, onSaleDateTime, and offSaleDateTime default to the global timezone stored in tbl_base_configs (the generalSettings config row's JSON value — it's an EAV table, not a column), falling back to the app default when unset. Override per-event with timezoneOverride.


Categories

tbl_categories

Formal classification for events only (e.g. "Regular Season", "Playoffs", "Exhibition").

tbl_event_category_mapping

Junction: event ↔ category. An event can belong to multiple categories.

Tags vs Categories: Tags (see 10-tags.md) are lightweight/informal and work across many entity types. Categories are formal and event-only.


Key rules

  • eventCode is the universal identifier — use it everywhere, not eventId
  • TBD = team doesn't know the date; TBA = team knows but hasn't announced. Both result in a null eventDate; estimatedDate is used for sort order only
  • Events are not scoped to a program — programs reference events, not the other way around
  • Events are also not linked to suites directly — suite availability is determined at query time by joining suite seat mappings against tbl_seats with the event's eventCode