Automatic Mentor Pause on Certificate Expiry (HLF Compliance)
A Supabase Edge Function (Certificate Expiry Scheduler) runs on a daily cron schedule. Each run queries all HLF peer mentors with certifications expiring on or before the current date and whose availability status is currently active. For each such mentor, the scheduler calls the Pause Management Service to transition their status to paused with a system-generated reason of 'Certificate expired'. The Coordinator Notification Service is then triggered for each affected mentor, sending the coordinator a push notification listing the mentor's name and the expiry-triggered reason. Affected mentors are also notified that their availability has been automatically paused and directed to renew their certification. This mechanism replaces the current manual tracking process described in the workshops, where coordinators manually monitor certificate expiry dates across potentially large cohorts.
User Story
Acceptance Criteria
- Given a peer mentor's certification expires, when the daily Certificate Expiry Scheduler runs, then the mentor's availability status is automatically updated to paused with reason 'Certificate expired'
- Given the automatic pause is applied, when the scheduler completes, then I receive a push notification for each affected mentor in my organisation listing their name and the expiry reason
- Given a mentor is automatically paused due to certificate expiry, when I view the member overview, then a certificate expiry indicator is shown on their entry distinguishing them from self-paused mentors
- Given a mentor renews their certificate and is manually resumed, when the next scheduler run occurs, then already-active mentors with valid certificates are not re-paused
- Given the scheduler runs, when no certificates have expired, then no status changes or notifications are generated
- Given the scheduler fails partway through a batch, when it resumes, then previously processed mentors are not double-notified and the remaining mentors are processed correctly
Business Value
HLF explicitly requires that expired-certificate mentors are automatically removed from their public website listing and from assignment matching. Manual tracking of certificate expiry across a large volunteer cohort is unsustainable and error-prone — an oversight directly exposes the organisation to assigning work to uncertified volunteers, creating compliance and liability risk. Automated expiry-triggered pausing is therefore both a compliance mechanism and a coordinator productivity improvement.
Components
- Certificate Expiry Scheduler infrastructure
- Pause Management Service service
- Availability Repository data
- Coordinator Notification Service service