Certifications Expiring This Month Widget
Component Detail
Description
A coordinator dashboard widget that lists peer mentors whose certifications are expiring within the current calendar month. Each entry is tappable and navigates to the peer mentor's certification status screen. Designed to be embedded in the coordinator home screen.
certifications-expiring-widget
Summaries
The Certifications Expiring This Month Widget provides coordinators with a prioritised, at-a-glance view of upcoming compliance deadlines directly on their home dashboard. By surfacing expiry risks in the most-visited screen of the application, coordinators can act before a certification lapses rather than reacting after the fact. This proactive visibility directly reduces the operational cost of expired credential incidents, protects programme integrity, and ensures that peer mentors remain eligible to deliver services without interruption. The widget's empty state also provides positive confirmation when no action is required.
This is a low-complexity dashboard widget with a narrow scope: fetch expiring certifications for a coordinator, render a list with relative date labels, and navigate on tap. Dependencies are limited to certification-repository and certification-bloc, both shared with other certification screens. Development is straightforward but requires coordination on the coordinator home screen layout to confirm embedding approach and available space. Test scenarios include: no expiring mentors (empty state), single and multiple entries, tap navigation to certification status screen, and widget refresh on return from detail screen.
Can be built and tested independently before home screen integration.
buildExpiringCertificationsWidget(coordinatorId) invokes certification-bloc to query certifications expiring within the current calendar month. Each mentor is rendered via renderMentorExpiryRow(mentor, expiresAt), which computes relative labels (e.g. '7 days left') using a local date utility — keep this logic consistent with computeExpiryUrgency() in CertificationExpiryBadge to avoid drift. onMentorRowTap(mentorId) pushes to CertificationStatusScreen with the selected mentorId.
refreshWidget() triggers a bloc reload, called on widget resumption via WidgetsBindingObserver. Handle loading, error, and empty states explicitly; do not silently swallow bloc stream errors.
Responsibilities
- Fetch and display peer mentors with certifications expiring this month
- Render expiry date relative labels (e.g. '7 days left')
- Navigate to certification status screen on tap
- Show empty state when no certifications are expiring
Interfaces
buildExpiringCertificationsWidget(coordinatorId)
renderMentorExpiryRow(mentor, expiresAt)
onMentorRowTap(mentorId)
refreshWidget()
Relationships
Dependencies (2)
Components this component depends on
Related Data Entities (1)
Data entities managed by this component