const express = require('express');
const router = express.Router();
const { requireAuth, requireSupportTeam, requirePage } = require('../middleware/auth');
const ctrl = require('../controllers/companyHolidayController');

router.use(requireAuth);

router.get('/holidays', ctrl.getHolidays);
router.post('/holidays', requireSupportTeam, requirePage('support_company_holidays'), ctrl.createHoliday);
router.delete('/holidays/:id', requireSupportTeam, requirePage('support_company_holidays'), ctrl.deleteHoliday);
router.post('/holidays/:id/apply-deduction', requireSupportTeam, requirePage('support_company_holidays'), ctrl.applyDeduction);

module.exports = router;
