core PK: id 14 required 1 unique

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.

24
Attributes
8
Indexes
10
Validation Rules
12
CRUD Operations

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
btree

Columns: organization_id

idx_courses_organization_status
btree

Columns: organization_id, status

idx_courses_start_date
btree

Columns: start_date

idx_courses_course_type
btree

Columns: course_type

idx_courses_facilitator
btree

Columns: facilitator_user_id

idx_courses_certification_type
btree

Columns: certification_type_id

idx_courses_local_association
btree

Columns: local_association_id

idx_courses_registration_deadline
btree

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
always

Courses are scoped to the owning organization. Users can only view and register for courses within their own organization context.

capacity_enforcement
on_create

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
on_create

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
always

New registrations are blocked once registration_deadline has passed or status is not open_for_registration.

Enforced by: Course Service
certification_issuance_on_completion
on_update

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
on_update

Course status follows a defined state machine: draft → published → open_for_registration → closed → in_progress → completed. Cancelled is reachable from any non-completed state.

Enforced by: Course Service
workshop_facilitator_scoping
on_create

Workshop-type courses require a facilitator_user_id. The facilitator's participant roster view is scoped to their local association.

Enforced by: Workshop Service
participant_count_consistency
always

current_participant_count must be updated atomically when course_registrations are created or cancelled to prevent race conditions.

cancellation_notification
on_update

When a course is cancelled, all registered participants must be notified via push notification and optionally email.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage