Certification Status Repository
Component Detail
Description
Supabase data access layer for peer mentor certification records. Stores certification type, issue date, expiry date, and renewal status. Used by the expiry checker service and coordinator roster to surface upcoming expirations.
certification-status-repository
Summaries
The Certification Status Repository ensures the organization maintains an accurate, up-to-date record of each peer mentor's training credentials. Expired certifications represent both a compliance risk and a quality risk — mentors operating beyond their certification window may not meet program standards. By reliably tracking issue dates, expiry dates, and renewal history, this component enables proactive outreach before certifications lapse, reducing program disruptions and maintaining the quality bar that families and referral partners expect. Its low complexity makes it a high-confidence, low-cost foundation for the broader certification management workflow.
This is a low-complexity data component with no external dependencies, making it one of the lowest-risk items in the delivery plan and suitable for early development to unblock dependent services. The getExpiringCertifications(beforeDate) query is the primary integration point for the nightly scheduler and expiry checker — define this interface early so those services can be developed in parallel. Testing requires seeding realistic certification records with varied expiry windows and validating that boundary date queries return correct results. No external API coordination is needed.
Recommend delivering this component in the first sprint as a foundation for downstream certification alerting features.
A straightforward Supabase repository over the certification table, exposing read and write interfaces for certification lifecycle management. getCertification(mentorId) and getExpiringCertifications(beforeDate) are the primary read paths consumed by the expiry checker service and coordinator roster UI. recordRenewal() must atomically update both renewalDate and newExpiryDate to prevent partial state writes — use a single upsert or transaction. getCertificationHistory() should return an ordered log of past certifications for audit display.
Since this component is shared across features, apply Supabase RLS at the table level and ensure all queries include coordinator_id scoping where applicable. Low complexity but high data integrity requirements given compliance implications.
Responsibilities
- Read and update certification records for peer mentors
- Query certifications expiring within a given date window
- Record certification renewal events and new issue dates
- Support coordinator-scoped certification status queries
Interfaces
getCertification(mentorId)
getExpiringCertifications(beforeDate)
updateCertificationExpiry(mentorId, newExpiryDate)
recordRenewal(mentorId, renewalDate, newExpiryDate)
getCertificationHistory(mentorId)
Relationships
Dependents (1)
Components that depend on this component
Related Data Entities (1)
Data entities managed by this component