const express = require('express');
const router = express.Router();
const reportController = require('../controllers/reportController');

router.get('/sales', reportController.salesReport); // ?start=YYYY-MM-DD&end=YYYY-MM-DD
router.get('/purchases', reportController.purchaseReport); // same query
router.get('/profit-loss', reportController.profitLossReport); // same query
router.get('/expenses', reportController.expenseReport); // ?start=YYYY-MM-DD&end=YYYY-MM-DD
router.get('/items-summary', reportController.itemSummary);
router.get('/customers-summary', reportController.customerSummary);
router.get('/suppliers-summary', reportController.supplierSummary);
router.get('/sales-invoice-profit', reportController.invoiceProfitReport);
// Sales exports
router.get('/sales/export/pdf', reportController.exportSalesPdf);
router.get('/sales/export/excel', reportController.exportSalesExcel);

// Purchase exports
router.get('/purchases/export/pdf', reportController.exportPurchasePdf);
router.get('/purchases/export/excel', reportController.exportPurchaseExcel);

// Expense exports
router.get('/expenses/export/pdf', reportController.exportExpensePdf);
router.get('/expenses/export/excel', reportController.exportExpenseExcel);

// Profit & Loss exports
router.get('/profit-loss/export/pdf', reportController.exportProfitLossPdf);
router.get('/profit-loss/export/excel', reportController.exportProfitLossExcel);

router.get('/sales-items-profit-summary', reportController.salesItemProfitSummary);
router.get('/unsold-items', reportController.unsoldItemsReport);
router.get('/items-stock', reportController.getItemValuationReport);
module.exports = router;
