const router = require('express').Router();
const ctrl = require('../controllers/auditLog.controller');
const { authenticate, authorize } = require('../middlewares/auth');

// All audit log routes require authentication + admin role
router.use(authenticate);
router.use(authorize('admin'));

router.get('/', ctrl.getAll);
router.get('/summary', ctrl.getSummary);
router.get('/entity/:type/:id', ctrl.getEntityHistory);

module.exports = router;
