const express = require('express'); const router = express.Router(); const { getEventCashup, getCashByRecordedUser, savePersonCash, saveEventCashupDraft, closeEvent, reopenEvent, getCashupAudit } = require('../controllers/cashupController'); const { protect, supervisor, admin } = require('../middleware/authMiddleware'); router.get('/audit', protect, supervisor, getCashupAudit); router.get('/event/:eventId', protect, supervisor, getEventCashup); router.get('/event/:eventId/cash-by-user', protect, supervisor, getCashByRecordedUser); router.put('/event/:eventId/person-cash/:userId', protect, supervisor, 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); module.exports = router;