const express = require('express');
const { authenticate, authorize } = require('../middleware/auth');
const UserController = require('../controllers/UserController');

const router = express.Router();

router.get('/', authenticate, authorize('admin', 'manager'), UserController.getAll);
router.get('/:id', authenticate, authorize('admin', 'manager'), UserController.getById);
router.put('/:id', authenticate, authorize('admin'), UserController.update);
router.delete('/:id', authenticate, authorize('admin'), UserController.delete);

module.exports = router;
