const express = require('express');
const router = express.Router();
const { authenticateToken } = require('../middleware/auth');
const { requireAdmin } = require('../middleware/roleCheck');
const ctrl = require('../controllers/portalGuide.controller');

router.use(authenticateToken);

router.get('/',          ctrl.getAll);
router.get('/:id',       ctrl.getById);
router.get('/:id/html',  ctrl.getHtml);
router.post('/',         requireAdmin, ctrl.create);
router.put('/:id',       requireAdmin, ctrl.update);
router.delete('/:id',    requireAdmin, ctrl.remove);

module.exports = router;
