const express = require('express');
const router = express.Router();
const { authenticate } = require('../middlewares/auth');
const approvalController = require('../controllers/approvalController');

// Approval Master Routes
router.get('/master', authenticate, approvalController.getApprovalMasters);
router.get('/master/:id', authenticate, approvalController.getApprovalMasterById);
router.post('/master', authenticate, approvalController.createApprovalMaster);
router.put('/master/:id', authenticate, approvalController.updateApprovalMaster);
router.delete('/master/:id', authenticate, approvalController.deleteApprovalMaster);

// Approval Transaction Routes
router.get('/transaction', authenticate, approvalController.getApprovalTransactions);
router.post('/transaction', authenticate, approvalController.createApprovalTransactions);
router.post('/transaction/:id/approve', authenticate, approvalController.approve);
router.post('/transaction/:id/reject', authenticate, approvalController.reject);

module.exports = router;

