UserCampusScope relation and audit action; scopeEvent/scopeList/unscopedOnly/ campusIndependent/scopeBroadcast markers; tests/campusScopeRoutes.test.js (still failing: events, payments, registrations, scan locks, tickets left). Can't delete a campus that has scoped staff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.0 KiB
JavaScript
22 lines
1.0 KiB
JavaScript
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;
|