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

router.use(requireAuth);

router.get('/', ctrl.list);
router.get('/stats', ctrl.stats);
router.get('/:id', ctrl.getById);
router.post('/', requirePage('safety_education'), ctrl.create);
router.put('/:id', requirePage('safety_education'), ctrl.update);
router.delete('/:id', requirePage('safety_education'), ctrl.deleteReport);

module.exports = router;
