CertificationExpiryMonitor
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
5
Entities
0
Integrations
Description
Scheduled server-side service that monitors certification expiry dates for all active peer mentors. It queries the database for mentors whose certifications expire on or before the current date and surfaces them for automated processing. Runs on a configurable cron schedule and emits expiry events consumed by downstream trigger services.
certification-expiry-monitor
Sources & reasoning
Line 80 explicitly ties HLF's pause requirement to certification expiry with automatic removal from visibility. Certification-training is Fase 3 per section 5 (line 355), ordinal Fase 3 maps to v1.1, consistent with the blueprint's [v1.1] tag for this feature.
-
docs/source/likeperson.md · line 80HLF kobler dette til sertifisering: ved utgått sertifikat forsvinner likepersonen fra lokallagets nettsider automatisk.
-
docs/source/likeperson.md · line 114Kursadministrasjon og sertifisering: Påmelding til kurs i appen, automatisk påminnelse ved utløp, digitale sertifikater.
Responsibilities
- Query the database for peer mentors with certification expiry dates on or before today
- Emit certification-expired events for each identified mentor
- Track which mentors have already been processed to avoid duplicate triggers
- Log monitoring run results including checked count and expired count
- Support configurable polling intervals via environment or config settings
Interfaces
runExpiryCheck(): Promise<ExpiryCheckResult>
getExpiredMentors(asOf: Date): Promise<Mentor[]>
markAsProcessed(mentorId: string, runId: string): Promise<void>
getLastRunSummary(): Promise<MonitorRunSummary>
Related Data Entities (5)
Data entities managed by this component