Event Attendee
Data Entity
Description
A join record linking a user to an event, tracking both pre-registration intent and actual post-event attendance. Supports the two-phase attendance model: pre-register before the event, then confirm actual attendance afterward for accurate Bufdir reporting.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Surrogate primary key uniquely identifying each attendee record | PKrequiredunique |
event_id |
uuid |
Foreign key referencing the events table. Identifies which event this attendee record belongs to. | required |
user_id |
uuid |
Foreign key referencing the users table. The platform user who is registered as an attendee. | required |
registered_at |
datetime |
Timestamp recording when the user (or a coordinator on their behalf) pre-registered for the event. Represents the first phase of the two-phase attendance model. | required |
registered_by |
uuid |
Foreign key referencing the users table for the actor who performed the registration. Equals user_id for self-registration; equals a coordinator's user ID for proxy/bulk registration on behalf of a peer mentor. | required |
attended |
boolean |
Indicates whether the registered user actually attended the event after it took place. NULL means not yet confirmed (event hasn't occurred or attendance hasn't been recorded). TRUE means confirmed attendance. FALSE means confirmed absence/no-show. | - |
confirmed_at |
datetime |
Timestamp recording when the attended field was last set (either to true or false). NULL when attendance has not yet been confirmed. Used to audit when post-event attendance capture occurred. | - |
status |
enum |
Derived lifecycle status of the attendee record, used for filtering and display without requiring attended/confirmed_at join logic in every query. | required |
notes |
text |
Optional free-text field for coordinator notes about this attendee's participation, e.g. arrived late, special accommodation needed, or reason for absence. | - |
created_at |
datetime |
Timestamp of row creation. Set automatically on insert. | required |
updated_at |
datetime |
Timestamp of last row modification. Updated automatically on any field change. | required |
Database Indexes
idx_event_attendee_event_user
Columns: event_id, user_id
idx_event_attendee_event_id
Columns: event_id
idx_event_attendee_user_id
Columns: user_id
idx_event_attendee_status
Columns: event_id, status
idx_event_attendee_registered_by
Columns: registered_by
Validation Rules
event_id_must_reference_existing_event
error
Validation failed
user_id_must_reference_existing_user
error
Validation failed
registered_by_must_reference_existing_user
error
Validation failed
status_enum_values_enforced
error
Validation failed
attended_is_boolean_or_null
error
Validation failed
notes_max_length
error
Validation failed
registered_at_not_future
error
Validation failed
Business Rules
one_registration_per_user_per_event
A user may only have a single event_attendee record per event. Attempting to register the same user for the same event twice must be rejected. Enforced by the unique index on (event_id, user_id).
attendance_confirmation_only_after_event
The attended field may only be set (to true or false) at or after the event's scheduled start datetime. Pre-event writes to attended must be rejected to preserve the integrity of the two-phase model.
confirmed_at_set_with_attended
Whenever attended is set to true or false, confirmed_at must be recorded as the current timestamp in the same operation. confirmed_at must remain NULL as long as attended is NULL.
status_kept_consistent_with_attended
The status column must remain in sync with the attended field: NULL attended → 'registered'; true → 'attended'; false → 'absent'. Cancelled status is set when the parent event is cancelled or the registration is explicitly withdrawn.
proxy_registration_coordinator_only
When registered_by differs from user_id (proxy registration), the actor performing the registration must hold a Coordinator role or higher within the same local association as the peer mentor being registered.
no_registration_on_cancelled_event
New attendee registrations may not be created for events whose status is cancelled. Existing registrations for a cancelled event must automatically transition to status 'cancelled'.
bufdir_attendance_reporting_requires_confirmation
Only attendee records with attended = true (status = 'attended') count toward Bufdir event participation figures. Unconfirmed registrations (attended IS NULL) are excluded from grant reporting aggregations.