core PK: id 9 required 1 unique

Description

Records a user's registration and attendance status for a specific event, linking events to participating users with sign-up metadata and attendance tracking.

13
Attributes
4
Indexes
6
Validation Rules
15
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
event_id uuid Foreign key to events table
required
user_id uuid Foreign key to users table — the participant
required
status enum Participation status
required
registered_at datetime Timestamp when the user signed up for the event
required
cancelled_at datetime Timestamp of cancellation, null if not cancelled
-
attended_at datetime Timestamp attendance was confirmed, null if not yet attended
-
registered_by_user_id uuid User who performed the registration — may differ from user_id when a coordinator signs up a participant on their behalf
-
is_proxy_registration boolean True when registered_by_user_id differs from user_id (coordinator proxy sign-up)
required
notes text Optional coordinator or participant notes about this registration
-
organization_id uuid Tenant scope — organization the event belongs to
required
created_at datetime Row creation timestamp
required
updated_at datetime Row last-modified timestamp
required

Database Indexes

idx_event_participants_event_user
btree unique

Columns: event_id, user_id

idx_event_participants_user_id
btree

Columns: user_id

idx_event_participants_event_id
btree

Columns: event_id

idx_event_participants_org_status
btree

Columns: organization_id, status

Validation Rules

event_id_exists error

Validation failed

user_id_exists error

Validation failed

valid_status_transition error

Validation failed

registered_at_not_future error

Validation failed

cancelled_at_requires_cancelled_status error

Validation failed

attended_at_requires_attended_status error

Validation failed

Business Rules

unique_participant_per_event
on_create

A user can only have one participation record per event. Duplicate sign-ups are rejected.

no_sign_up_to_past_events
on_create

Users cannot register for events whose start time has already passed.

proxy_registration_coordinator_only
on_create

is_proxy_registration=true is only permitted when registered_by_user_id holds a Coordinator or Org Admin role in the same organization.

cancelled_clears_attended
on_update

Setting status to 'cancelled' must null out attended_at and set cancelled_at to now().

tenant_isolation
on_create

organization_id must match the event's organization_id. Cross-tenant registrations are rejected.

waitlist_promotion
on_update

When a participant cancels and the event has a capacity limit, the first waitlisted participant is automatically promoted to 'registered'.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage