specs
Event Management

Event Management — House of Legends

Documented: 2026-05-11


Overview

Admin creates and manages scheduled events (experience occurrences) via the dashboard. Events link experiences to specific dates, times, and venues.


Event vs Experience

ConceptTableDescription
ExperienceexperiencesShow template (static) — title, description, images
EventexperienceEventsScheduled instance (dynamic) — date, time, venue, capacity, price

Experiences Table

experiences: defineTable({
  title: v.string(),
  slug: v.string(),
  tagline: v.string(),
  description: v.string(),
  heroImage: v.string(),
  galleryImages: v.array(v.string()),
  enabled: v.boolean(),
  sortOrder: v.number(),
})
  .index("by_slug", ["slug"])
  .index("by_enabled", ["enabled"]);

Admin manages experiences at /dashboard/experiences.


Events Table

experienceEvents: defineTable({
  experienceId: v.id("experiences"),
  date: v.string(), // ISO date "2026-05-15"
  time: v.string(), // "11:00" or "19:00"
  venue: v.string(),
  dinnerPrice: v.number(), // VND
  experienceOnlyPrice: v.number(), // VND
  capacity: v.number(),
  bookedCount: v.number(),
  enabled: v.boolean(),
})
  .index("by_experience", ["experienceId"])
  .index("by_date", ["date"])
  .index("by_date_time", ["date", "time"]);

Admin CRUD

Event List (/dashboard/events)

Table columns:

  • Experience name
  • Date
  • Time
  • Venue
  • Capacity
  • Booked / Available
  • Status (Enabled/Disabled)

Filters:

  • By experience
  • By date range
  • By status

Create Event

Form fields:

  • Experience (dropdown)
  • Date (date picker)
  • Time (time picker)
  • Venue (text)
  • Capacity (number)
  • Dinner Price (VND)
  • Show Only Price (VND)
  • Enabled (toggle)

Batch Create

Admin can generate multiple events at once:

  • Select experience
  • Select days of week (Mon, Wed, Fri)
  • Select time (11:00, 19:00)
  • Select date range
  • Capacity (inherit or override)
  • Generate all occurrences

Edit Event

Same fields as create. Can update:

  • Time, venue, capacity
  • Prices (for future events)
  • Enabled/disabled status

Cancel Event

  • Sets enabled: false
  • Triggers notification to all booked guests
  • Releases seats (increases available capacity conceptually)

Availability Calculation

availableSeats = event.capacity - event.bookedCount;

bookedCount is incremented on reservations.createPending and decremented on reservations.cancel.


Components

ComponentPurpose
event-list.tsxTable of events with filters
event-form.tsxCreate/edit event form
batch-event-generator.tsxGenerate multiple events
event-calendar.tsxCalendar view of events

Backend Functions

FunctionPurpose
experiences.listActiveGet all enabled experiences
experiences.getBySlugGet experience by slug
events.listUpcomingGet events for date range
events.getAvailabilityGet available seats for event
events.createCreate single event
events.batchCreateCreate multiple events
events.updateUpdate event fields
events.archiveDisable event