const express = require('express'); const router = express.Router(); const { getSections, createSection, deleteSection, updateSection } = require('../controllers/sectionController'); const { protect, admin, supervisor, staff } = require('../middleware/authMiddleware'); const { scopeEvent, scopeList } = require('../utils/campusScope'); router.get('/', protect, staff, scopeList, getSections); router.post('/', protect, supervisor, scopeEvent({ from: req => req.body?.eventId, need: 'manage' }), createSection); router.delete('/:id', protect, admin, deleteSection); router.put('/:id', protect, supervisor, scopeEvent({ resolve: 'section', need: 'manage' }), updateSection); module.exports = router;