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

router.post('/', purchaseController.createMultiItemPurchase);
router.get('/', purchaseController.getFilteredPurchases);
router.get('/archived', purchaseController.getArchivedPurchases);
router.get('/:id', purchaseController.getPurchaseById);
router.put('/:id', purchaseController.updatePurchase);
router.delete('/:id', purchaseController.softDeletePurchase);
router.put('/:id/restore', purchaseController.restorePurchase);
router.post('/:id/add-payment', purchaseController.addPurchasePayment);
router.get('/:id/payments', purchaseController.getPurchasePaymentHistory);

// router.get('/export/pdf', purchaseController.exportSalesPdf); // or similar
// router.get('/export/excel', purchaseController.exportSalesExcel);
router.get('/export/print', purchaseController.exportPurchasesPrint);

module.exports = router;
