Event
Data Entity
Description
An organized gathering or activity created by peer mentors or coordinators within an organization, supporting scheduling, participant registration, and reporting.
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
Columns: organization_id
idx_events_created_by_user_id
Columns: created_by_user_id
idx_events_event_date
Columns: event_date
idx_events_organization_status_date
Columns: organization_id, status, event_date
idx_events_bufdir_reportable
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
Events are only visible to users belonging to the same organization. Cross-organization event access is forbidden.
participant_cap_enforcement
When max_participants is set, sign-ups must be rejected once the cap is reached.
cancel_notifies_participants
Cancelling a published event must trigger notifications to all registered participants.
completed_events_immutable
Events with status 'completed' cannot be edited or deleted — only notes may be appended.
bufdir_reportable_default
All events created within an active organization default to bufdir_reportable=true unless explicitly overridden.
coordinator_or_peer_mentor_only
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.