const express = require('express');
const { getAll, create, update, remove } = require('../controllers/categoryController');
const { authenticateToken, authorizeRoles } = require('../middleware/auth');

const router = express.Router();

router.use(authenticateToken);

router.get('/', getAll);
router.post('/', authorizeRoles('admin', 'manager'), create);
router.put('/:id', authorizeRoles('admin', 'manager'), update);
router.delete('/:id', authorizeRoles('admin'), remove);

module.exports = router;
