core PK: id 11 required 2 unique

Description

Records the certification status of peer mentors, tracking when a certification was issued, its validity period, renewal history, and the issuing organization. Each certification links a user to a certification type and serves as the authoritative source for whether a peer mentor is currently qualified to perform their role.

19
Attributes
8
Indexes
9
Validation Rules
11
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the certification record
PKrequiredunique
user_id uuid Reference to the certified user (peer mentor or coordinator)
required
certification_type_id uuid Reference to the certification type definition specifying requirements and validity rules
required
organization_id uuid Organization that issued or administers this certification
required
status enum Current certification status
required
issued_at datetime Timestamp when the certification was officially issued
required
expires_at datetime Timestamp when the certification expires and must be renewed
required
renewed_at datetime Timestamp of the most recent renewal, null if never renewed
-
renewal_count integer Number of times this certification has been renewed
required
certificate_number string Human-readable certificate identifier displayed on the digital certificate card
requiredunique
issuing_course_id uuid Reference to the course that led to this certification, null if issued manually
-
issued_by_user_id uuid Admin or coordinator who approved or issued the certification
-
revoked_at datetime Timestamp when the certification was revoked, null if not revoked
-
revocation_reason text Reason for revocation, required when status is revoked
-
notes text Administrative notes about this certification
-
metadata json Extensible metadata for organization-specific certification attributes such as specialization areas or completion scores
-
summaries json AI-generated summaries for executive, project manager, and developer audiences
-
created_at datetime Record creation timestamp
required
updated_at datetime Record last modification timestamp
required

Database Indexes

idx_certifications_user_id
btree

Columns: user_id

idx_certifications_certification_type_id
btree

Columns: certification_type_id

idx_certifications_organization_id
btree

Columns: organization_id

idx_certifications_status
btree

Columns: status

idx_certifications_expires_at
btree

Columns: expires_at

idx_certifications_user_type_unique
btree unique

Columns: user_id, certification_type_id, organization_id

idx_certifications_certificate_number
btree unique

Columns: certificate_number

idx_certifications_status_expires
btree

Columns: status, expires_at

Validation Rules

valid_user_reference error

Validation failed

valid_certification_type_reference error

Validation failed

expires_after_issued error

Validation failed

issued_at_not_future error

Validation failed

certificate_number_format error

Validation failed

revocation_fields_consistency error

Validation failed

renewal_count_non_negative error

Validation failed

status_enum_valid error

Validation failed

metadata_valid_json error

Validation failed

Business Rules

one_active_certification_per_type
on_create

A user may hold at most one active (non-revoked, non-expired) certification of each type within an organization. Renewal replaces the existing record rather than creating a duplicate.

Enforced by: Certificate Service
expiry_status_transition
always

Certifications transition to 'expiring' status automatically when within 30 days of expiry, and to 'expired' when the expires_at date passes. This drives UI indicators and notification triggers.

expired_removes_from_listings
on_update

When a peer mentor's certification expires, they are automatically removed from public-facing local association listings (HLF requirement). Renewal restores visibility.

Enforced by: Certificate Service
revocation_requires_reason
on_update

Setting status to 'revoked' requires a non-empty revocation_reason and sets revoked_at timestamp. Revocation is irreversible; a new certification must be issued instead.

Enforced by: Certificate Service
renewal_extends_expiry
on_update

Renewing a certification updates expires_at based on the certification type's validity_period, increments renewal_count, and sets renewed_at. Status resets to 'active'.

course_completion_triggers_certification
on_create

Completing a qualifying course (as defined by the certification type's prerequisites) automatically creates or renews the associated certification for the user.

expiry_notification_30_days
always

A push notification is sent to the certified user 30 days before certificate expiration, reminding them to renew. Additional reminders at 14 and 7 days.

organization_scoped_access
always

Certifications are scoped to the issuing organization. Users can only view and manage certifications within their own organization context. Global admins can view across organizations for system management.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage