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.

Feature: Certification Expiry Auto-Pause

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.

  • HLF kobler dette til sertifisering: ved utgĂĄtt sertifikat forsvinner likepersonen fra lokallagets nettsider automatisk.
  • Kursadministrasjon 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>