Expiry Check Service
Component Detail
Description
Backend scheduled service that runs daily to query the certifications table for records within a configurable warning window or past the expiry date. Dispatches advance push notifications to mentors and coordinator dashboard alerts, then invokes the shared pause status-transition logic on confirmed expiry.
expiry-check-service
Sources & reasoning
The compliance requirement (line 80) demands automatic disappearance from listings when a certification expires, removing dependency on manual coordinator action. A daily scheduled backend job is the only viable enforcement mechanism for a time-based trigger. It bridges certifications and peer_mentor_statuses to enforce the rule without operator intervention.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Query certifications for expiry dates within the configurable warning window (default 30 days)
- Dispatch push notifications to mentors as expiry approaches
- Send coordinator dashboard alerts for impending and triggered auto-pauses
- Call pause status-transition logic to write peer_mentor_statuses on confirmed expiry
- Enforce module-toggle gate - only executes when both peer-mentor-status and certification-training modules are enabled for the tenant
Interfaces
runDailyExpiryCheck() -> Promise<void>
getExpiringCertifications(warningWindowDays: number) -> Certification[]
triggerAutoPause(userId: string, systemReason: string) -> void
sendExpiryWarningNotifications(certifications: Certification[]) -> void
isModuleEnabled(tenantId: string) -> boolean
Relationships
Dependencies (2)
Components this component depends on
Related Data Entities (5)
Data entities managed by this component