Issue and Record New Certificate for a Peer Mentor
Coordinators are responsible for issuing certificates after a peer mentor completes the required course or programme. The Certificate Service provides write access to certificate records for coordinators and admin roles (enforced via Supabase RLS). The coordinator selects the peer mentor, specifies the certificate type linked to the relevant course, enters issue and expiry dates, uploads the digital certificate asset (PDF or image) to Certificate Storage, and sets the initial physical card status. On save, the Certificate Service validates the record, uploads the asset to the secure storage bucket, and triggers the expiry reminder schedule. The peer mentor immediately sees the new certificate on their Certificate Screen.
User Story
Acceptance Criteria
- Given a coordinator opens the certificate issuance form for a peer mentor, when all required fields (certificate type, issue date, expiry date) are completed and saved, then the certificate record is created and immediately visible on the peer mentor's Certificate Screen
- Given a coordinator uploads a digital certificate asset, when the file is saved, then it is stored securely in the Certificate Storage bucket with access scoped to the certificate owner and the coordinator
- Given a certificate record is created with an expiry date, when the record is saved, then the expiry reminder schedule is automatically initialized with the default lead-time intervals (60, 30, 7 days)
- Given a coordinator sets the physical card status to 'Dispatched', when the record is saved, then the physical card status badge on the peer mentor's certificate card reflects 'Physical card dispatched'
- Given a coordinator attempts to issue a certificate for a peer mentor outside their organizational scope, when the save action is submitted, then the Supabase RLS policy rejects the write and an authorization error is displayed
- Given a coordinator saves a certificate record without uploading a digital asset, when the record is created, then the certificate card displays 'Digital asset not yet available' with an option to upload later
- Given the certificate is created successfully, when the peer mentor next opens the app, then they see the new certificate card on their Certificate Screen with the correct validity status
Business Value
The ability for coordinators to issue and record certificates is the foundational write operation of the Digital Certificate Management feature. Without it, no certificate data exists in the system. Proper issuance with digital asset upload and automatic reminder scheduling eliminates manual coordinator follow-up and ensures peer mentors receive timely renewal alerts from the moment of certification.
Components
- Certificate Screen ui
- Certificate Card Widget ui
- Certificate Service service
- Certificate Repository data
- Certificate Storage infrastructure