Skip to content

Event Planning Data Models

Overview

The event planning system uses a flexible, block-based architecture that allows for multiple planning scenarios, polymorphic associations, and extensive customization.

Implementation Status

✅ Implemented Models

  • Event (with recurring event support)
  • Address (polymorphic, used by Event)
  • EventPlan
  • EventBlock
  • EventTask & EventTaskAssignee
  • EventBudgetItem (amount stored as string for decimal precision)
  • EventCollaborator
  • EventPermission (using strings for wildcard support)
  • EventPersonnel

⏳ Not Yet Implemented

  • Vendor & EventBlockVendor
  • EventGuestList
  • EventComment (stub exists, needs full implementation)

Core Architecture Patterns

  • Polymorphic Associations: Budget items, addresses, and block containers use polymorphic patterns for maximum flexibility
  • String Enums: Status and event type fields use strings for type safety and clarity
  • Rich Text Fields: Descriptions support rich text formatting for enhanced user experience
  • Extensible Metadata: JSONB fields provide flexibility for future feature additions (currently supports category, guestCount, budgetRange)

Entity Schemas

Core Event Tables

Event

Metadata Structure:

typescript
{
  category?: 'wedding' | 'birthday' | 'graduation' | 'proposal' | 'other'
  customCategory?: string | null
  guestCount?: {
    approximate?: number | null
    min?: number | null
    max?: number | null
  } | null
  budgetRange?: {
    min?: number | null
    max?: number | null
    currency?: string | null // ISO 4217 code, defaults to 'CAD'
  } | null
}

EventPlan

Block & Task Tables

EventBlock (Polymorphic Container)

Block Container Logic:

  • Draft blocks: blockable_type = 'Event' (belongs to event directly)
  • Plan blocks: blockable_type = 'EventPlan' (belongs to specific plan)
  • Future extensibility: Could support multiple draft areas per user/plan

EventTask & Assignments

Vendor Tables

Vendor & Block Associations

Polymorphic Support Tables

Address (Polymorphic)

Validation:

  • city is required
  • country must be a valid ISO 3166-1 alpha-2 code (e.g., CA, US, GB)
  • postalCode format is validated based on the country code
  • state is optional for global compatibility

EventBudgetItem (Polymorphic)

Collaboration & Access Management

EventCollaborator

EventPermission (Zanzibar-style)

EventPersonnel

EventComment (Polymorphic + Nested)

EventGuestList

Reference Tables

User & Organization

Entity Relationships

Not yet implemented: Vendor, EventBlockVendor, and EventGuestList nodes are shown for completeness but have no migrations, models, or routes in the codebase.

See Also

For actual migration files, see apps/server/database/migrations/

Built with ❤️ by the Jubiloop team