CertificateRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Manages persistence and retrieval of certificate records stored in the database. Provides typed CRUD operations for certificate entities, including queries by mentor ID and expiry range. Isolates all database access patterns for certificate data from higher application layers.
certificate-repository
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
- Retrieve a certificate record by mentor ID
- Persist new or updated certificate records issued by HLF or Barnekreftforeningen
- Query certificates approaching expiry for notification or renewal workflows
- Delete or archive revoked certificates
Interfaces
findByMentorId(mentorId: string): Promise<Certificate | null>
save(certificate: Certificate): Promise<Certificate>
findExpiringSoon(beforeDate: Date): Promise<Certificate[]>
revoke(certificateId: string): Promise<void>