Staff can lock a section (or the whole event) to their device, download its tickets and keep scanning with no connection. Scans are queued in IndexedDB and synced idempotently when back online; conflicts go into a sync report for supervisors, who can also force-release a lost device. The server now validates scan sections and refuses scans in a scope locked to another device. Adds a web app manifest and a service worker for the scanner page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
784 B
JavaScript
16 lines
784 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { listLocks, createLock, getSnapshot, syncLock, releaseLock, forceRelease, listReports, reviewReport } = require('../controllers/scanLockController');
|
|
const { protect, staff, supervisor } = require('../middleware/authMiddleware');
|
|
|
|
router.get('/', protect, staff, listLocks);
|
|
router.post('/', protect, staff, createLock);
|
|
router.get('/reports', protect, supervisor, listReports);
|
|
router.post('/reports/:id/review', protect, supervisor, reviewReport);
|
|
router.get('/:id/snapshot', protect, staff, getSnapshot);
|
|
router.post('/:id/sync', protect, staff, syncLock);
|
|
router.post('/:id/force-release', protect, supervisor, forceRelease);
|
|
router.delete('/:id', protect, staff, releaseLock);
|
|
|
|
module.exports = router;
|