CertificateService
Component Detail
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.
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.
-
docs/source/likeperson.md · line 114digitale sertifikater. Det fysiske kortet er et «adelsmerke» og skal leve parallelt.
-
docs/source/likeperson.md · line 360Digitalt likepersonsbevis
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