core PK: id 9 required 1 unique

Description

Records a peer mentor's sign-up for an event, tracking registration status, attendance confirmation, and withdrawal. Links users to events and supports coordinator oversight of event participation.

13
Attributes
5
Indexes
4
Validation Rules
11
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
event_id uuid Foreign key to the event being registered for
required
user_id uuid Foreign key to the peer mentor registering
required
status enum Current registration status
required
registered_at datetime Timestamp when the registration was created
required
cancelled_at datetime Timestamp when the registration was cancelled, if applicable
-
attended_at datetime Timestamp when attendance was confirmed
-
registered_by_user_id uuid User who created this registration (may differ from user_id if a coordinator registered on behalf of the peer mentor)
-
is_proxy_registration boolean True when a coordinator registered on behalf of a peer mentor
required
notes text Optional coordinator or system notes on this registration
-
organization_id uuid Organization context for tenant isolation
required
created_at datetime Record creation timestamp
required
updated_at datetime Record last-update timestamp
required

Database Indexes

idx_event_registrations_event_id
btree

Columns: event_id

idx_event_registrations_user_id
btree

Columns: user_id

idx_event_registrations_unique_user_event
btree unique

Columns: event_id, user_id

idx_event_registrations_organization_id
btree

Columns: organization_id

idx_event_registrations_status
btree

Columns: event_id, status

Validation Rules

event_id_required error

Validation failed

user_id_required error

Validation failed

valid_status_transition error

Validation failed

event_not_past error

Validation failed

Business Rules

no_duplicate_registration
on_create

A user may not register for the same event more than once. Attempting to register again returns the existing record or an error.

capacity_check
on_create

If the event has a max_capacity, registrations beyond the limit are placed on the waitlist rather than rejected outright.

Enforced by: EventSignUpService
proxy_requires_coordinator_role
on_create

Setting is_proxy_registration=true is only permitted when the acting user holds the Coordinator role for the same organization.

cancellation_sets_timestamp
on_update

When status transitions to 'cancelled', cancelled_at is automatically set to the current timestamp.

Enforced by: EventSignUpService
attendance_sets_timestamp
on_update

When status transitions to 'attended', attended_at is automatically set to the current timestamp.

Enforced by: EventSignUpService
tenant_isolation
on_create

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

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage