Service Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Orchestrates retrieval and business logic for peer mentor certificates, including validity checks and expiry calculations. Acts as the intermediary between the UI layer and CertificateRepository, enforcing certification rules from HLF and Barnekreftforeningen. Provides formatted certificate data ready for display and sharing.

Feature: Digital Peer Mentor Certificate

certificate-service

Sources & reasoning

HLF explicitly names digital certificates as a deliverable and requires the physical card to coexist with the digital version (line 114). 'Digitalt likepersonsbevis' appears directly in the Phase 3 roadmap (line 360), confirming v1.1 per third-phase normalization. The feature is the primary output artifact of the certification pipeline and logically depends on course completion records created by course-registration.

Responsibilities

  • Fetch certificate records for a given mentor via CertificateRepository
  • Compute and expose validity status (active, expiring, expired) based on expiry date
  • Assemble shareable certificate payload (PDF or structured data) for export
  • Validate certificate ownership before returning data to the caller

Interfaces

getCertificate(mentorId: string): Promise<Certificate>
getValidityStatus(certificate: Certificate): CertificateStatus
buildShareablePayload(certificate: Certificate): Promise<ShareablePayload>

Related Data Entities (3)

Data entities managed by this component