const express = require('express');
const {
  getDashboardStats,
  getInventoryReport,
  getLowStockReport,
  getMovementReport,
  downloadInventoryPdf,
  downloadCsvReport,
} = require('../controllers/reportController');
const { authenticateToken, authorizeRoles } = require('../middleware/auth');

const router = express.Router();

router.use(authenticateToken);

router.get('/dashboard', getDashboardStats);
router.get('/inventory', getInventoryReport);
router.get('/low-stock', getLowStockReport);
router.get('/movements', getMovementReport);
router.get('/inventory/pdf', authorizeRoles('admin', 'manager'), downloadInventoryPdf);
router.get('/export/csv', authorizeRoles('admin', 'manager'), downloadCsvReport);

module.exports = router;
