const express = require('express'); const router = express.Router(); const { getAllProviderTransactions, getUnreconciledProviderTransactions, reconcileProviderTransaction, ignoreProviderTransaction } = require('../controllers/providerTransactionsController'); const { protect, supervisor} = require('../middleware/authMiddleware'); const { unscopedOnly } = require('../utils/campusScope'); // Mounted at /api/provider-transactions (and /api/yoco-transactions, the older name). // GET all payment provider transactions (admin/supervisor) router.get('/', protect, supervisor, unscopedOnly, getAllProviderTransactions); // GET all unreconciled transactions (admin/supervisor) router.get('/unreconciled', protect, supervisor, unscopedOnly, getUnreconciledProviderTransactions); // POST reconcile a transaction router.post('/:id/reconcile', protect, supervisor, unscopedOnly, reconcileProviderTransaction); // POST ignore a transaction router.post('/:id/ignore', protect, supervisor, unscopedOnly, ignoreProviderTransaction); module.exports = router;