Archived
Events can run over several sessions: per-session check-in with a whole-day or session-time window, late joining with pro-rata or fixed late pricing, an attendance register (Excel/PDF), session reminders, and completion certificates (four templates, public verify page). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.3 KiB
JavaScript
26 lines
1.3 KiB
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const {
|
|
getRegister, markAttendance, exportRegister,
|
|
issueCertificates, revokeCertificate, sendCertificatesHandler, downloadEventCertificates, previewCertificate,
|
|
myCertificates, downloadCertificate, verifyCertificate,
|
|
} = require('../controllers/attendanceController');
|
|
const { protect, staff, supervisor } = require('../middleware/authMiddleware');
|
|
|
|
// Certificates — fixed paths first so they aren't taken as an :eventId
|
|
router.get('/certificates/verify/:code', verifyCertificate);
|
|
router.get('/certificates/mine', protect, myCertificates);
|
|
router.post('/certificates/preview', protect, supervisor, previewCertificate);
|
|
router.get('/certificates/:id/pdf', protect, downloadCertificate);
|
|
router.post('/certificates/:id/revoke', protect, supervisor, revokeCertificate);
|
|
|
|
// Attendance register
|
|
router.get('/:eventId', protect, staff, getRegister);
|
|
router.get('/:eventId/export', protect, staff, exportRegister);
|
|
router.post('/:eventId/mark', protect, supervisor, markAttendance);
|
|
router.post('/:eventId/certificates', protect, supervisor, issueCertificates);
|
|
router.post('/:eventId/certificates/send', protect, supervisor, sendCertificatesHandler);
|
|
router.get('/:eventId/certificates.pdf', protect, supervisor, downloadEventCertificates);
|
|
|
|
module.exports = router;
|