Courses
Data Entity
Description
Represents training courses and workshop sessions offered to peer mentors and coordinators, including peer mentor certification courses, skill-building workshops, and career development sessions. Courses are the central scheduling and enrollment entity for the Certification & Training area, linking to course_registrations for participant tracking and to certifications for completion-based certificate issuance.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Unique identifier for the course | PKrequiredunique |
organization_id |
uuid |
Organization that owns and offers this course, used for multi-tenant scoping | required |
title |
string |
Display title of the course shown in listings and detail views | required |
description |
text |
Full course description including objectives, target audience, and learning outcomes | - |
course_type |
enum |
Classification of the course determining UI presentation and business rules | required |
status |
enum |
Current lifecycle status of the course | required |
start_date |
datetime |
Scheduled start date and time of the course | required |
end_date |
datetime |
Scheduled end date and time of the course | required |
registration_deadline |
datetime |
Last date participants can register for the course | - |
location |
string |
Physical location or venue name for in-person courses | - |
location_type |
enum |
Whether the course is held in-person, online, or hybrid | required |
online_meeting_url |
string |
URL for online participation (Teams, Zoom, etc.) | - |
max_participants |
integer |
Maximum number of participants allowed to register | - |
current_participant_count |
integer |
Denormalized count of confirmed registrations for fast capacity checks | required |
facilitator_user_id |
uuid |
User ID of the coordinator or trainer facilitating the course | - |
local_association_id |
uuid |
Local association scope for the course, null means organization-wide | - |
certification_type_id |
uuid |
Linked certification type that completing this course grants, null if non-certifying | - |
prerequisites |
json |
Array of prerequisite conditions (certification type IDs, prior course completions) required for registration | - |
agenda |
json |
Structured agenda with time slots, topics, and facilitator notes for multi-session courses | - |
waitlist_enabled |
boolean |
Whether participants can join a waitlist when max capacity is reached | required |
is_workshop |
boolean |
Flag indicating this course is a career workshop subtype (Blindeforbundet mentorordning) | required |
created_by |
uuid |
User ID of the administrator or coordinator who created the course | required |
created_at |
datetime |
Timestamp of course creation | required |
updated_at |
datetime |
Timestamp of last course modification | required |
Database Indexes
idx_courses_organization_id
Columns: organization_id
idx_courses_organization_status
Columns: organization_id, status
idx_courses_start_date
Columns: start_date
idx_courses_course_type
Columns: course_type
idx_courses_facilitator
Columns: facilitator_user_id
idx_courses_certification_type
Columns: certification_type_id
idx_courses_local_association
Columns: local_association_id
idx_courses_registration_deadline
Columns: registration_deadline
Validation Rules
title_not_empty
error
Validation failed
end_date_after_start_date
error
Validation failed
registration_deadline_before_start
error
Validation failed
max_participants_positive
error
Validation failed
valid_organization_reference
error
Validation failed
valid_facilitator_reference
error
Validation failed
valid_certification_type_reference
error
Validation failed
online_url_required_for_online_courses
warning
Validation failed
prerequisites_json_schema
error
Validation failed
participant_count_non_negative
error
Validation failed
Business Rules
organization_scoped_access
Courses are scoped to the owning organization. Users can only view and register for courses within their own organization context.
capacity_enforcement
Registration must be rejected when current_participant_count reaches max_participants, unless waitlist_enabled is true in which case participants join a waitlist.
prerequisite_validation
Users must have completed all prerequisite certifications or courses before they can register. Validated against the user's certification and course_registration history.
registration_deadline_enforcement
New registrations are blocked once registration_deadline has passed or status is not open_for_registration.
certification_issuance_on_completion
When a course with a linked certification_type_id transitions to completed status, certifications are automatically issued to all registered participants with attended status.
status_transition_validation
Course status follows a defined state machine: draft → published → open_for_registration → closed → in_progress → completed. Cancelled is reachable from any non-completed state.
workshop_facilitator_scoping
Workshop-type courses require a facilitator_user_id. The facilitator's participant roster view is scoped to their local association.
participant_count_consistency
current_participant_count must be updated atomically when course_registrations are created or cancelled to prevent race conditions.
cancellation_notification
When a course is cancelled, all registered participants must be notified via push notification and optionally email.