configuration PK: id 10 required 2 unique

Description

Configuration entity defining the types of certifications available within the platform, such as peer mentor certificates, course completion certificates, and specialized training credentials. Each certification type specifies validity periods, renewal requirements, and issuing rules that govern how certifications are awarded and maintained.

17
Attributes
4
Indexes
6
Validation Rules
10
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the certification type
PKrequiredunique
organization_id uuid Organization that owns this certification type. Null for platform-wide certification types.
-
name string Display name of the certification type (e.g., 'Peer Mentor Certificate', 'Advanced Counseling Certificate')
required
slug string URL-safe identifier for the certification type, used in API paths and deep links
requiredunique
description text Detailed description of what this certification represents and its requirements
-
validity_period_months integer Number of months a certification of this type remains valid after issuance. Null means permanent (no expiry).
-
is_renewable boolean Whether certifications of this type can be renewed upon expiry
required
renewal_requirements json JSON object specifying what is needed to renew (e.g., course completion, activity threshold, manual approval). Structure: {type: 'course'|'activity_count'|'manual', course_id?: string, min_activities?: number}
-
prerequisite_certification_type_id uuid If set, a valid certification of this type is required before this certification can be issued
-
required_course_id uuid If set, completion of this course is required to earn this certification
-
badge_image_url string URL to the badge or certificate image template used for digital display and sharing
-
expiry_warning_days integer Number of days before expiry to trigger a notification warning to the certificate holder
required
auto_deactivate_on_expiry boolean Whether the peer mentor is automatically removed from public listings when their certification of this type expires (HLF requirement)
required
is_active boolean Whether this certification type is currently available for issuance
required
display_order integer Sort order for displaying certification types in listings
required
created_at datetime Timestamp when the certification type was created
required
updated_at datetime Timestamp of the last update to this certification type
required

Database Indexes

idx_certification_types_slug
btree unique

Columns: slug

idx_certification_types_organization
btree

Columns: organization_id

idx_certification_types_active_org
btree

Columns: organization_id, is_active

idx_certification_types_prerequisite
btree

Columns: prerequisite_certification_type_id

Validation Rules

unique_slug error

Validation failed

validity_period_positive error

Validation failed

renewal_requirements_schema error

Validation failed

prerequisite_exists error

Validation failed

name_not_blank error

Validation failed

organization_exists error

Validation failed

Business Rules

org_scoped_or_global
always

Certification types with null organization_id are platform-wide defaults. Organization-specific types are visible only within that organization.

expiry_triggers_deactivation
always

When auto_deactivate_on_expiry is true and a peer mentor's certification of this type expires, the mentor must be automatically removed from public-facing listings (HLF requirement for expired sertifikat).

prerequisite_chain_no_cycles
on_create

Prerequisite certification type references must not form circular dependency chains.

Enforced by: Organization Service
expiry_warning_notification
always

A push notification must be sent to the certificate holder expiry_warning_days before their certification expires, prompting renewal.

deactivation_preserves_history
on_update

Setting is_active to false prevents new issuance but does not invalidate existing certifications of this type.

renewal_requires_valid_config
on_create

If is_renewable is true, renewal_requirements must be a valid JSON object specifying at least one renewal path.

Enforced by: Organization Service

Storage Configuration

Storage Type
lookup_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage