AutoPauseTriggerService
Component Detail
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.
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.
-
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
- 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>
Related Data Entities (4)
Data entities managed by this component