const express = require('express'); const router = express.Router(); const { getEventCosts, createEventCost, updateEventCost, deleteEventCost } = require('../controllers/costController'); const { protect, supervisor, admin } = require('../middleware/authMiddleware'); // Mounted at /api — paths below match the documented /api/events/:eventId/costs and /api/costs/:id shape router.get('/events/:eventId/costs', protect, supervisor, 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;