Event
Data Entity
Description
A group activity record representing gatherings such as training sessions, group meetings, and community activities that involve multiple attendees. Events are a distinct Bufdir reporting category from individual peer mentor contacts. Can be created by peer mentors or coordinators and supports both pre-registration and post-event attendance capture.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Globally unique identifier for the event record | PKrequiredunique |
creator_id |
uuid |
Foreign key referencing the user (peer mentor or coordinator) who created the event | required |
local_association_id |
uuid |
Foreign key referencing the local association that hosts this event; scopes the event to a specific operational unit for Bufdir reporting and access control | required |
title |
string |
Human-readable name describing the event (e.g., 'Monthly Group Meeting', 'Training Session: First Aid') | required |
event_date |
datetime |
The calendar date on which the event takes place; stored as a date (no time component) to allow separate start_time handling | required |
start_time |
string |
Scheduled start time of the event in HH:MM 24-hour format (e.g., '09:00', '14:30') | - |
duration_minutes |
integer |
Duration of the event in minutes; used for Bufdir reporting totals and calendar export | required |
location |
string |
Free-text description of the event venue or meeting place (e.g., 'NHF Office, Oslo', 'Zoom Meeting') | - |
event_type |
enum |
Categorizes the event for Bufdir reporting and internal analytics | - |
status |
enum |
Lifecycle state of the event controlling attendee registration availability and Bufdir reporting inclusion | required |
description |
text |
Optional freeform description of the event agenda, purpose, or notes for attendees | - |
max_attendees |
integer |
Optional capacity limit for pre-registration; if set, registration is closed once reached | - |
pre_registration_enabled |
boolean |
Whether the event accepts pre-registration of expected attendees before the event occurs; if false, attendance is captured only post-event | required |
attendance_confirmed |
boolean |
Whether post-event actual attendance has been finalized by the creator or coordinator; gates Bufdir reporting inclusion | required |
bufdir_report_category |
string |
Bufdir-specific category label assigned to this event for grant reporting; maps to the Norwegian grant reporting taxonomy (e.g., 'gruppemøte', 'kurs', 'arrangement') | - |
cancelled_at |
datetime |
Timestamp when the event was cancelled; null if not cancelled | - |
cancellation_reason |
text |
Optional free-text explanation for why the event was cancelled; recorded for coordinator audit purposes | - |
created_at |
datetime |
Timestamp when the event record was first persisted; set automatically on insert | required |
updated_at |
datetime |
Timestamp of the most recent update to the event record; auto-updated by database trigger | required |
Database Indexes
idx_event_creator_id
Columns: creator_id
idx_event_local_association_id
Columns: local_association_id
idx_event_event_date
Columns: event_date
idx_event_status
Columns: status
idx_event_local_association_date
Columns: local_association_id, event_date
idx_event_local_association_status
Columns: local_association_id, status
Validation Rules
title_required_non_empty
error
Validation failed
event_date_required
error
Validation failed
duration_positive_integer
error
Validation failed
start_time_format
error
Validation failed
creator_id_valid_user
error
Validation failed
local_association_id_valid
error
Validation failed
status_transition_valid
error
Validation failed
cancellation_reason_on_cancel
error
Validation failed
max_attendees_positive
error
Validation failed
attendance_confirmed_requires_completed_status
error
Validation failed
Business Rules
creator_role_restriction
Only users with the Peer Mentor or Coordinator role may create events; Organization Administrators and Global Administrators may create events only via the admin panel
local_association_scoping
Every event must be associated with a local association; coordinators may only create events for local associations they are assigned to via user_organization_roles
cancelled_event_no_new_attendees
Once an event's status is 'cancelled', no new attendee records (pre-registration or post-event) may be added; existing event_attendee records are retained for audit history
attendance_confirmation_gates_bufdir
An event is included in Bufdir reporting aggregations only when attendance_confirmed is true; this prevents draft or unfinished events from distorting grant report figures
capacity_enforcement
When max_attendees is set, the system rejects new pre-registration attendees once the confirmed pre-registration count reaches max_attendees; post-event attendance confirmation is never capacity-gated
distinct_bufdir_category
Events are reported as a distinct category in Bufdir reports separate from individual peer mentor contact activities; the report aggregation must not conflate events with individual activity records
soft_cancel_only
Events that have any associated event_attendee records must not be hard-deleted; they must be transitioned to 'cancelled' status with a reason; only events with no attendees may be physically deleted
calendar_sync_on_create_update
When an event is created or its date/time/location is updated, the calendar integration service is notified to synchronize with any subscribed iCal feeds or native device calendars
CRUD Operations
Storage Configuration
Entity Relationships
An event has many attendee records tracking registration and attendance
A local association hosts many group events within its scope
A user (peer mentor or coordinator) creates and owns group events