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
| Field | Notes |
|---|---|
eventCode | Unique, immutable — comes from the vendor; everything (API calls, cart, booking) uses this |
eventId | internal auto-increment PK; rarely used externally |
eventName | display name (fan-facing) |
eventDescription | optional longer description |
status | draft, published, archived |
venueId | FK to tbl_venues — determines which map to load |
eventDate / eventTime | nullable for TBD/TBA cases |
dateTbd / dateTba | TBD = not decided yet; TBA = decided, not announced |
timeTbd / timeTba | same distinction for time |
estimatedDate | sorting only — not shown to fans; TBA events without this sort to the end |
maxSeatPurchaseLimit | anti-broker cap across multiple orders (may not be wired on FE yet) |
minSeatPurchaseLimit | minimum for first order (default: 1) |
isFeaturedGame | shown in a separate/prominent section |
onSaleDateTime / offSaleDateTime | sale window; stored without timezone; default visibility ends ~1h after game |
timezoneOverride | per-event timezone override for sale window fields |
opponentName | nullable |
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
eventCodeis the universal identifier — use it everywhere, noteventId- TBD = team doesn't know the date; TBA = team knows but hasn't announced. Both result in a null
eventDate;estimatedDateis 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_seatswith the event'seventCode