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>
14 lines
758 B
JavaScript
14 lines
758 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { getEventCosts, createEventCost, updateEventCost, deleteEventCost } = require('../controllers/costController');
|
|
const { protect, supervisor, admin } = require('../middleware/authMiddleware');
|
|
const { scopeEvent } = require('../utils/campusScope');
|
|
|
|
// Mounted at /api — paths below match the documented /api/events/:eventId/costs and /api/costs/:id shape
|
|
router.get('/events/:eventId/costs', protect, supervisor, scopeEvent({ need: 'manage' }), getEventCosts);
|
|
router.post('/events/:eventId/costs', protect, admin, createEventCost);
|
|
router.put('/costs/:id', protect, admin, updateEventCost);
|
|
router.delete('/costs/:id', protect, admin, deleteEventCost);
|
|
|
|
module.exports = router;
|