core PK: id 9 required 1 unique

Description

Records a contact's registration for an event, tracking who registered them, their attendance status, and any cancellation details. Serves as the join table between events and contacts with additional registration metadata.

14
Attributes
7
Indexes
7
Validation Rules
15
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key — unique registration record identifier
PKrequiredunique
event_id uuid Foreign key referencing the event this registration belongs to
required
contact_id uuid Foreign key referencing the contact who is registered for the event
required
registered_by_user_id uuid Foreign key referencing the user (peer mentor or coordinator) who performed the registration action. May differ from the contact's assigned peer mentor if a coordinator registered on their behalf.
required
organization_id uuid Foreign key to the organization — enforces tenant isolation. Denormalized for query performance on multi-tenant reads.
required
status enum Current status of the registration in its lifecycle
required
registration_type enum How the registration was created — self-registration, proxy registration by a coordinator, or bulk registration
required
notes text Optional free-text notes added at registration time, e.g. accessibility requirements, dietary needs, or coordinator remarks
-
cancelled_at datetime Timestamp when the registration was cancelled. Null if not cancelled.
-
cancellation_reason text Optional reason provided when cancelling. Helps coordinators track patterns.
-
checked_in_at datetime Timestamp when the contact was marked as attended/checked in. Null until attendance is confirmed.
-
waitlist_position integer Position in the waitlist if status is 'waitlisted'. Null for non-waitlisted registrations.
-
created_at datetime Timestamp when the registration record was created
required
updated_at datetime Timestamp of the last modification to this record
required

Database Indexes

idx_event_registrations_event_contact
btree unique

Columns: event_id, contact_id

idx_event_registrations_event_id
btree

Columns: event_id

idx_event_registrations_contact_id
btree

Columns: contact_id

idx_event_registrations_organization_id
btree

Columns: organization_id

idx_event_registrations_status
btree

Columns: status

idx_event_registrations_registered_by
btree

Columns: registered_by_user_id

idx_event_registrations_created_at
btree

Columns: created_at

Validation Rules

event_id_exists error

Validation failed

contact_id_exists error

Validation failed

valid_status_transition error

Validation failed

cancellation_reason_on_late_cancel error

Validation failed

notes_max_length error

Validation failed

waitlist_position_consistency error

Validation failed

checked_in_at_requires_registered_status error

Validation failed

Business Rules

no_duplicate_registration
on_create

A contact may not be registered for the same event more than once. The unique index on (event_id, contact_id) enforces this at the database level; the service layer returns a user-friendly error before attempting insert.

org_tenant_isolation
on_create

A contact may only be registered for events belonging to the same organization. The backend validates organization_id matches between the event and the contact before creating the record.

event_must_be_open
on_create

Registrations can only be created for events with status 'published' or 'open'. Attempting to register for a cancelled, completed, or draft event returns an error.

capacity_check_and_waitlist
on_create

If the event has a max_participants limit and that limit is reached, new registrations are automatically assigned status 'waitlisted' with an incremented waitlist_position rather than being rejected.

cancellation_deadline
on_update

Cancellations by peer mentors are only permitted up to the event's configured cancellation_deadline. After that, only a coordinator may cancel a registration. The system records who performed the cancellation via registered_by_user_id on the updated record.

waitlist_promotion
on_update

When a registration is cancelled, the next waitlisted contact (lowest waitlist_position) is automatically promoted to 'registered' status and a push notification is dispatched.

proxy_requires_coordinator_role
on_create

A registration with registration_type 'proxy' or 'bulk' may only be created by a user holding the Coordinator role within the same organization. The RBAC service enforces this before the service layer proceeds.

attendance_only_on_event_day
on_update

The checked_in_at timestamp and status transition to 'attended' or 'no_show' may only be set on or after the event's scheduled start date. This prevents premature attendance confirmation.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage