core PK: id 10 required 1 unique

Description

An organized gathering or activity created by peer mentors or coordinators within an organization, supporting scheduling, participant registration, and reporting.

18
Attributes
5
Indexes
7
Validation Rules
16
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
organization_id uuid Foreign key to the owning organization
required
created_by_user_id uuid User who created the event (peer mentor or coordinator)
required
title string Event title
required
description text Optional free-text description of the event
-
event_date datetime Scheduled start date and time of the event
required
duration_minutes integer Expected duration in minutes
-
location string Physical or virtual location of the event
-
status enum Lifecycle status of the event
required
max_participants integer Optional cap on registered participants; null means unlimited
-
is_recurring boolean Whether this event is part of a recurring series
required
recurrence_rule string iCalendar RRULE string describing recurrence pattern; null for non-recurring events
-
bufdir_reportable boolean Whether this event counts toward Bufdir activity reporting
required
notes text Internal coordinator notes about the event
-
created_at datetime Record creation timestamp
required
updated_at datetime Last modification timestamp
required
cancelled_at datetime Timestamp when the event was cancelled; null if not cancelled
-
cancelled_by_user_id uuid User who cancelled the event
-

Database Indexes

idx_events_organization_id
btree

Columns: organization_id

idx_events_created_by_user_id
btree

Columns: created_by_user_id

idx_events_event_date
btree

Columns: event_date

idx_events_organization_status_date
btree

Columns: organization_id, status, event_date

idx_events_bufdir_reportable
btree

Columns: organization_id, bufdir_reportable, event_date

Validation Rules

title_not_empty error

Validation failed

event_date_not_in_past error

Validation failed

duration_positive error

Validation failed

max_participants_positive error

Validation failed

recurrence_rule_valid_rrule error

Validation failed

cancelled_at_requires_cancelled_status error

Validation failed

organization_id_matches_creator error

Validation failed

Business Rules

org_scoped_visibility
always

Events are only visible to users belonging to the same organization. Cross-organization event access is forbidden.

participant_cap_enforcement
on_create

When max_participants is set, sign-ups must be rejected once the cap is reached.

cancel_notifies_participants
on_update

Cancelling a published event must trigger notifications to all registered participants.

completed_events_immutable
on_update

Events with status 'completed' cannot be edited or deleted — only notes may be appended.

Enforced by: EventService
bufdir_reportable_default
on_create

All events created within an active organization default to bufdir_reportable=true unless explicitly overridden.

Enforced by: EventService
coordinator_or_peer_mentor_only
on_create

Only users with the Peer Mentor or Coordinator role may create events. Global Admins and Org Admins who appear as Coordinators in the mobile app are included.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage