// routes/categoryRoutes.js
const express = require('express');
const router = express.Router();
const categoryController = require('../controllers/categoryController');
const { authenticate, authorize } = require('../middleware/auth');

router.get('/', categoryController.getAllCategories);
router.get('/:id', categoryController.getCategoryById);

router.use(authenticate);
router.post('/', 
    // authorize(['admin', 'manager']),
     categoryController.createCategory);
router.put('/:id',
    //  authorize(['admin', 'manager']),
      categoryController.updateCategory);
router.delete('/:id', authorize(['admin']), categoryController.deleteCategory);

module.exports = router;