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.

Feature: Digital Peer Mentor Certificate

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.

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>

Related Data Entities (1)

Data entities managed by this component