const router = require('express').Router();
const ctrl = require('../controllers/purchaseController');
const { authenticate } = require('../middleware/auth');
const { authorizeMinRole } = require('../middleware/rbac');

router.use(authenticate, authorizeMinRole('admin'));
router.get('/', ctrl.getAll);
router.get('/:id', ctrl.getById);
router.post('/', ctrl.create);

module.exports = router;
