Archived
UserCampusScope relation and audit action; scopeEvent/scopeList/unscopedOnly/ campusIndependent/scopeBroadcast markers; tests/campusScopeRoutes.test.js (still failing: events, payments, registrations, scan locks, tickets left). Can't delete a campus that has scoped staff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
1.1 KiB
JavaScript
17 lines
1.1 KiB
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { getEventCashup, getCashByRecordedUser, savePersonCash, saveEventCashupDraft, closeEvent, reopenEvent, resolvePending, getCashupAudit } = require('../controllers/cashupController');
|
|
const { protect, supervisor, admin } = require('../middleware/authMiddleware');
|
|
const { scopeEvent, scopeList } = require('../utils/campusScope');
|
|
|
|
router.get('/audit', protect, supervisor, scopeList, getCashupAudit);
|
|
router.get('/event/:eventId', protect, supervisor, scopeEvent({ need: 'manage' }), getEventCashup);
|
|
router.get('/event/:eventId/cash-by-user', protect, supervisor, scopeEvent({ need: 'manage' }), getCashByRecordedUser);
|
|
router.put('/event/:eventId/person-cash/:userId', protect, supervisor, scopeEvent({ need: 'manage' }), savePersonCash);
|
|
router.put('/event/:eventId/draft', protect, admin, saveEventCashupDraft);
|
|
router.post('/event/:eventId/close', protect, admin, closeEvent);
|
|
router.post('/event/:eventId/reopen', protect, admin, reopenEvent);
|
|
router.post('/lines/:lineId/pending', protect, admin, resolvePending);
|
|
|
|
module.exports = router;
|