Skip to content

Event Planning Data Models

Overview

The current event schema supports organization-owned events, plans, blocks, tasks, budgets, collaboration records, personnel, comments, and permission records. The API currently exposes event create/show/update and draft plan creation. Later sections keep planned designs separate from the current schema.

Implementation Status

Current Schema and Models

  • Event (recurrence fields exist; current API creates one-off events)
  • Address (polymorphic schema, currently used by Event API operations)
  • EventPlan
  • EventBlock
  • EventTask & EventTaskAssignee
  • EventBudgetItem (amount stored as string for decimal precision)
  • EventCollaborator
  • EventPermission (schema and model only; runtime authorization does not use it yet)
  • EventPersonnel
  • EventComment (schema and model; no comment API yet)

Planned Models and Relationships

  • Vendor & EventBlockVendor
  • EventGuestList
  • Resource
  • Personnel-address relationship
  • Reusable event-template and template-block design

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
  • Text Fields: Description and comment columns store text; rich-text rendering is a product-level decision
  • Extensible Metadata: The event table persists validated event details in JSONB. See the Events API for the accepted request shape.

Entity Schemas

Core Event Tables

Event

EventPlan

Constraints and invariants:

  • event_id + name is unique. Duplicate plan names for the same event return model.event_plan.duplicate_name.
  • Only one plan per event can have state = ACTIVE; the model hook returns model.event_plan.duplicate_active if another active plan exists.
  • New plans created through the API default to DRAFT.

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 Design (Planned)

The diagrams in this section describe the intended future design. These tables and relationships do not exist in current migrations, models, or routes. Every field below is a proposed design detail, and all are subject to change.

Vendor Tables (Planned)

Vendor & Block Associations

Current Support Models

Polymorphic Support Tables

Address (Polymorphic)

Address location-detail columns are nullable in persistence. The event API applies stricter input rules; see the address request schema.

EventBudgetItem (Polymorphic)

Collaboration & Access Management

EventCollaborator

EventPermission (Zanzibar-style)

The table and model are current, but the action and cascade semantics are planned. Current event policies authorize organization membership without consulting these rows. subject_type and subject_id form a polymorphic reference; the database does not define a foreign key from a permission to a member, team, assignee, or role.

EventPersonnel

Personnel records are current. Linking personnel to an Address through the polymorphic address columns remains planned.

EventComment (Polymorphic + Nested)

Planned Extensions

EventGuestList (Planned)

Proposed field-level design: This table does not exist. Field names, types, status values, and metadata may change before implementation.

Resource (Planned)

Resources are intended to attach files, links, or shared planning references to event content. The exact storage fields and polymorphic targets must be finalized before migration work. The fields below are a proposed design, not a current or committed schema.

Event Template and Template Block (Planned)

Templates will provide reusable starting points without changing the current EventPlan and EventBlock ownership rules. Instantiating a template is expected to copy template blocks into a new event or plan rather than make live event blocks depend on the template. The fields and copy semantics below are proposed and may change before implementation.

Reference Tables

User & Organization

Entity Relationships

Planned nodes: Vendor, EventBlockVendor, EventGuestList, Resource, EventTemplate, EventTemplateBlock, and personnel-address links have no current migrations, models, or routes. Planned nodes have dashed borders, and planned relationships use dashed edges. Current nodes may also lack public API operations; see the implementation status above.

See Also

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

Built with ❤️ by the Jubiloop team