const express = require('express');
const router = express.Router();
const OffboardingController = require('../controllers/offboarding.controller');
const { authenticateToken } = require('../middleware/auth');
const { requireAdmin, canViewOnboarding } = require('../middleware/roleCheck');

router.use(authenticateToken);

router.get('/stats', canViewOnboarding, OffboardingController.getStatistics);
router.get('/', canViewOnboarding, OffboardingController.getAllProtocols);
router.get('/:id', canViewOnboarding, OffboardingController.getProtocolById);
router.post('/', canViewOnboarding, OffboardingController.createProtocol);
router.put('/:id', canViewOnboarding, OffboardingController.updateProtocol);
router.post('/:id/return-assets', canViewOnboarding, OffboardingController.returnAssets);
router.post('/:id/regenerate-pdf', canViewOnboarding, OffboardingController.regeneratePdf);
router.delete('/:id', canViewOnboarding, OffboardingController.deleteProtocol);

module.exports = router;
