Certificate Service
Component Detail
Service Layer
high complexity
backend
0
Dependencies
0
Dependents
7
Entities
0
Integrations
Description
Core business logic service responsible for certificate lifecycle management including creation, renewal, expiry checking, and physical card tracking. Integrates with Certificate Storage for secure file hosting and triggers push notifications via Push Notification Service at configurable lead times before expiry. Also coordinates with the peer mentor pause flow to flag mentors with expired certificates as unavailable.
certificate-service
Responsibilities
- Create and renew certificates with Supabase row-level policy enforcement
- Run scheduled expiry checks and trigger push notifications at 60, 30, and 7 day thresholds
- Manage physical card issuance flag on certification records
- Coordinate with Peer Mentor Pause Management to deactivate mentors on certificate expiry
- Enforce coordinator and admin write permissions via Supabase RLS
Interfaces
getCertificatesForUser(userId)
getCertificateById(certificateId)
createCertificate(data)
renewCertificate(certificateId, renewalData)
checkExpiringCertificates(thresholds)
scheduleExpiryNotifications(certificateId)
markPhysicalCardIssued(certificateId)
flagExpiredMentorUnavailable(userId)
downloadCertificateAsset(certificateId)
validateCertificateAccess(userId, certificateId)
Related Data Entities (7)
Data entities managed by this component