const express = require('express');
const router = express.Router();
const positionController = require('../controllers/positionController');
const { requireAuth, requireRole } = require('../middleware/auth');

router.use(requireAuth);

router.get('/', positionController.getAll);
router.get('/:id', positionController.getById);
router.post('/', requireRole('admin'), positionController.create);
router.put('/:id', requireRole('admin'), positionController.update);
router.delete('/:id', requireRole('admin'), positionController.remove);

module.exports = router;
