configuration PK: id 6 required 1 unique

Description

Defines the classification schema for peer mentor certifications, specifying validity periods, renewal requirements, and issuing authority metadata. Acts as the configuration backbone for the Digital Peer Mentor Certificate feature, enabling organizations to define platform-wide or org-scoped certification categories (e.g., 'Peer Mentor Certificate', 'Course Completion', 'Career Workshop Completion').

13
Attributes
3
Indexes
5
Validation Rules
6
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key, generated server-side on creation
PKrequiredunique
name string Human-readable certification type name (e.g., 'Digital Peer Mentor Certificate', 'Course Completion Certificate'). Unique within the scope of an organization or globally when organization_id is null.
required
description text Optional detailed description of what the certification represents, what criteria must be met, and who the issuing authority is
-
organization_id uuid FK to organizations. NULL means this is a global platform-level type available to all organizations. Non-null means org-scoped type. Org-scoped types with the same name shadow global types for that organization.
-
validity_period_days integer Number of days the certification remains valid after issuance. NULL means the certification never expires. Required when requires_renewal is true.
-
requires_renewal boolean Whether certifications of this type expire and require renewal. When true, validity_period_days must be set.
required
renewal_reminder_days integer Days before expiry to trigger a renewal reminder notification. Defaults to 30 when requires_renewal is true and not explicitly set.
-
is_active boolean Soft-delete flag. Inactive types are not shown in course registration or certificate issuance flows, but existing certifications referencing this type remain valid.
required
certificate_template_key string Reference key for the certificate visual template used when rendering the digital certificate card in the mobile app. Maps to a template definition in the Certificate Service.
-
issuing_authority string Name of the entity that issues this certification (e.g., 'Hørselsforbundet', 'Norse Digital Products'). Displayed on the certificate card.
-
sort_order integer Display ordering for certification type lists in the mobile app and admin portal. Lower values appear first.
-
created_at datetime Timestamp when this certification type was created
required
updated_at datetime Timestamp of the most recent update to this certification type record
required

Database Indexes

idx_certification_type_org_id
btree

Columns: organization_id

idx_certification_type_name_org
btree unique

Columns: name, organization_id

idx_certification_type_active
btree

Columns: is_active

Validation Rules

name_not_empty error

Validation failed

validity_period_positive error

Validation failed

unique_name_per_scope error

Validation failed

renewal_reminder_not_exceeding_validity error

Validation failed

organization_id_exists error

Validation failed

Business Rules

no_hard_delete_when_certifications_exist
on_delete

A certification type cannot be hard-deleted if any certification records reference it. Instead, is_active must be set to false. This preserves historical audit integrity for issued certificates.

Enforced by: Course Service
validity_period_required_when_renewal_required
on_create

When requires_renewal is true, validity_period_days must be a positive integer. A certification type that expires must define how long it is valid.

Enforced by: Course Service
org_scoped_type_shadows_global
always

When a certification type with the same name exists at both the global level (organization_id IS NULL) and the org level, the org-scoped type takes precedence for that organization's workflows. Course Service applies this resolution when fetching applicable types.

inactive_type_not_selectable
always

Certification types with is_active = false must not appear in course registration or certificate issuance dropdowns. Existing certifications of this type remain valid and readable.

renewal_reminder_default
on_create

If requires_renewal is true and renewal_reminder_days is not provided on create, it defaults to 30 days. The Course Notification Adapter uses this value to schedule reminder notifications.

Enforced by: Course Service

CRUD Operations

create allowed
update allowed
delete allowed

Storage Configuration

Storage Type
lookup_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage