Course
Data Entity
Description
Represents a training or certification course that peer mentors and coordinators can register for. Supports formal certification workflows (HLF, Barnekreftforeningen) and mentor program sessions.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key | PKrequiredunique |
organization_id |
uuid |
Owning organization — courses are org-scoped | required |
title |
string |
Display name of the course | required |
description |
text |
Full description of course content and objectives | - |
course_type |
enum |
Category of course — certification courses issue peer mentor certificates; onboarding courses are for new peer mentor training; workshop courses are for group mentoring sessions | required |
status |
enum |
Lifecycle status of the course | required |
start_date |
datetime |
When the course begins | - |
end_date |
datetime |
When the course ends | - |
location |
string |
Physical or virtual location of the course | - |
is_virtual |
boolean |
Whether the course is held online | required |
max_participants |
integer |
Maximum number of participants allowed; null means unlimited | - |
issues_certificate |
boolean |
Whether completing this course issues a peer mentor certificate | required |
certificate_validity_months |
integer |
How many months a certificate issued by this course remains valid before renewal is required; null if no expiry | - |
registration_deadline |
datetime |
Last date/time users can register for the course | - |
created_by |
uuid |
User ID of the admin who created the course record | required |
created_at |
datetime |
Record creation timestamp | required |
updated_at |
datetime |
Last modification timestamp | required |
Database Indexes
idx_courses_organization_id
Columns: organization_id
idx_courses_status
Columns: status
idx_courses_organization_status
Columns: organization_id, status
idx_courses_start_date
Columns: start_date
idx_courses_issues_certificate
Columns: issues_certificate
Validation Rules
end_date_after_start_date
error
Validation failed
registration_deadline_before_start
error
Validation failed
title_not_empty
error
Validation failed
max_participants_positive
error
Validation failed
certificate_validity_positive
error
Validation failed
Business Rules
registration_deadline_enforced
Users cannot register for a course after its registration_deadline has passed
max_participants_cap
If max_participants is set, new registrations are rejected once the confirmed registration count reaches the cap
certificate_validity_required_when_issues_certificate
If issues_certificate is true, certificate_validity_months must be provided unless the certificate has no expiry by design
org_scoped_course_access
Users may only view and register for courses belonging to their own organization
published_only_visible_to_users
Only courses with status=published are shown in the course list to peer mentors and coordinators; draft and archived courses are admin-only
certificate_renewal_reminder_triggered
When a course that issues_certificate is completed and a peer_mentor_certificate is created, the renewal reminder scheduler is notified to schedule a reminder at (issued_at + certificate_validity_months - 30 days)