core PK: id 11 required 1 unique

Description

Group activities organized by an organization that peer mentors, coordinators, and contacts can browse and sign up for. Events differ from logged activities in that they are pre-scheduled, organization-owned, and support multi-participant registration.

20
Attributes
5
Indexes
7
Validation Rules
11
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key identifier for the event.
PKrequiredunique
organization_id uuid Owning organization (tenant scope).
required
title string Human-readable title of the event.
required
description text Detailed description, agenda, or summary of the event.
-
event_type enum Category of event for filtering and reporting.
required
start_at datetime Scheduled start date and time (UTC, with timezone offset stored).
required
end_at datetime Scheduled end date and time (UTC).
required
duration_minutes integer Derived duration in minutes; cached for reporting.
-
location string Free-text location label (address, venue name, or 'Online').
-
location_geo json Optional geographic coordinates {lat, lng} for map display.
-
capacity integer Maximum number of participants; null means unlimited.
-
status enum Lifecycle status of the event.
required
visibility enum Who can see and sign up for the event.
required
created_by uuid User who created the event (typically a coordinator or org admin).
required
signup_deadline datetime Optional cutoff after which sign-up is closed.
-
registration_count integer Cached count of confirmed participants for fast listing.
-
metadata json Extensible bag for organization-specific event fields.
-
created_at datetime Timestamp when the event record was created.
required
updated_at datetime Timestamp of the last modification.
required
deleted_at datetime Soft-delete marker; null when active.
-

Database Indexes

idx_events_organization_id
btree

Columns: organization_id

idx_events_start_at
btree

Columns: start_at

idx_events_org_status_start
btree

Columns: organization_id, status, start_at

idx_events_created_by
btree

Columns: created_by

idx_events_visibility
btree

Columns: visibility

Validation Rules

title_required_nonblank error

Validation failed

end_after_start error

Validation failed

deadline_before_start error

Validation failed

capacity_positive error

Validation failed

valid_enum_values error

Validation failed

organization_exists error

Validation failed

geo_coordinates_valid warning

Validation failed

Business Rules

tenant_scoped_ownership
always

An event must belong to exactly one organization and is only visible to users within that organization (subject to visibility setting).

creator_role_authorized
on_create

Only Coordinators and Organization Admins may create or modify events; Peer Mentors may only read and sign up.

capacity_enforced_on_signup
always

When capacity is set, sign-ups beyond capacity must be rejected or placed on a waitlist via event_participants.

signup_window_respected
on_create

Sign-ups are blocked after signup_deadline (when set) or after start_at if no deadline is defined.

cancellation_notifies_participants
on_update

Cancelling an event must trigger participant notifications via the notifications module.

soft_delete_only
on_delete

Events with historical participant data must be soft-deleted (deleted_at) rather than hard-deleted to preserve audit and Bufdir reporting integrity.

Enforced by: Event Service
audit_logged_changes
always

Create, update, cancel, and delete operations on events must produce an audit log entry.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
archive_after_1year