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

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

module.exports = router;
