Service Layer medium complexity backend
0
Dependencies
0
Dependents
4
Entities
0
Integrations

Description

Service that receives certification-expired events and executes the full auto-pause workflow for an affected mentor. It transitions the mentor to paused status, sends notifications to both the mentor and their coordinator, and writes an audit trail entry recording the automated reason for the state change.

Feature: Certification Expiry Auto-Pause

auto-pause-trigger-service

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

  • Transition a mentor's status to paused when a certification-expired event is received
  • Notify the affected mentor via the appropriate notification channel
  • Notify the mentor's assigned coordinator of the automated pause action
  • Create an audit trail entry with the automated reason, timestamp, and triggering event reference
  • Integrate with the pause-function dependency to reuse core pause logic

Interfaces

handleExpiryEvent(event: CertificationExpiredEvent): Promise<AutoPauseResult>
pauseMentor(mentorId: string, reason: AutoPauseReason): Promise<void>
notifyMentor(mentorId: string, context: ExpiryNotificationContext): Promise<void>
notifyCoordinator(coordinatorId: string, mentorId: string, context: ExpiryNotificationContext): Promise<void>
writeAuditEntry(mentorId: string, action: AuditAction, metadata: AutoPauseMetadata): Promise<void>