core PK: id 6 required 1 unique

Description

Join entity recording attendance of contacts or users in a workshop session, with attendance confirmation status. Enables participant list management and aggregated session counts for Bufdir reporting integration.

12
Attributes
8
Indexes
8
Validation Rules
15
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key, auto-generated UUID for each participant record
PKrequiredunique
session_id uuid Foreign key referencing workshop_sessions.id — the session this participant belongs to
required
contact_id uuid Foreign key referencing contacts.id — the contact record representing the attendee. Nullable when participant is an internal user rather than an external contact.
-
user_id uuid Foreign key referencing users.id — populated when the participant is a registered app user (e.g. peer mentor) rather than an external contact. Nullable.
-
added_by uuid Foreign key referencing users.id — the coordinator or peer mentor who added this participant to the session
required
added_at datetime UTC timestamp when the participant was added to the session. Used for audit trail and ordering.
required
attendance_confirmed boolean Whether the participant's attendance has been confirmed by the session facilitator. Defaults to false at creation.
required
confirmed_at datetime UTC timestamp when attendance was confirmed. Null until attendance_confirmed is set to true.
-
confirmed_by uuid Foreign key referencing users.id — the user who confirmed attendance. Null until attendance is confirmed.
-
display_name string Optional override display name for the participant as recorded at time of session. Useful when contact record is unavailable or participant is external. Max 200 characters.
-
notes text Optional facilitator notes about this specific participant's engagement or follow-up actions needed during the session.
-
organization_id uuid Foreign key referencing organizations.id — the organization context for RLS scoping. Denormalized from the parent session for query performance.
required

Database Indexes

idx_workshop_participants_session_id
btree

Columns: session_id

idx_workshop_participants_contact_id
btree

Columns: contact_id

idx_workshop_participants_user_id
btree

Columns: user_id

idx_workshop_participants_session_contact_unique
btree unique

Columns: session_id, contact_id

idx_workshop_participants_session_user_unique
btree unique

Columns: session_id, user_id

idx_workshop_participants_organization_id
btree

Columns: organization_id

idx_workshop_participants_attendance_confirmed
btree

Columns: session_id, attendance_confirmed

idx_workshop_participants_added_at
btree

Columns: added_at

Validation Rules

session_id_must_exist error

Validation failed

contact_id_must_exist_if_provided error

Validation failed

user_id_must_exist_if_provided error

Validation failed

display_name_max_length error

Validation failed

confirmed_at_not_in_future error

Validation failed

added_at_not_in_future error

Validation failed

organization_id_matches_session error

Validation failed

rls_coordinator_scope error

Validation failed

Business Rules

no_duplicate_participant_per_session
on_create

A contact or user may only appear once in any given workshop session. Attempting to add the same contact_id or user_id to the same session_id must be rejected.

participant_requires_contact_or_user
on_create

Each participant record must reference either a contact_id or a user_id (or a display_name as fallback for external attendees). Both contact_id and user_id cannot be null simultaneously unless display_name is provided.

confirmed_at_requires_attendance_confirmed
on_update

The confirmed_at timestamp must only be set when attendance_confirmed is true. If attendance_confirmed is reset to false, confirmed_at and confirmed_by must be cleared.

coordinator_or_admin_only_add_participants
on_create

Only users with coordinator or admin roles may add participants to a session. Peer mentors cannot modify the participant list.

organization_scope_enforcement
on_create

Participants may only be added from contacts or users belonging to the same organization as the workshop session. Cross-organization participant addition is prohibited.

session_must_be_active_or_scheduled_to_add_participants
on_create

Participants can only be added to sessions in 'scheduled' or 'active' status. Archived or completed sessions are locked from participant modifications.

bufdir_participant_count_aggregation
always

The count of confirmed participants (attendance_confirmed = true) per session is used in Bufdir reporting aggregation. Only confirmed attendees contribute to official grant reporting figures.

cascade_delete_on_session_removal
on_delete

When a workshop session is deleted, all associated participant records must be deleted via CASCADE to maintain referential integrity.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage

Entity Relationships

contacts
outgoing many_to_one

Workshop participants are linked to contact records representing the attendees

optional
workshop_sessions
incoming one_to_many

A workshop session tracks attendance for multiple participants with confirmation status

optional cascade delete