import express from 'express';
import clubPaymentClaimController from '../controllers/clubPaymentClaimController.js';
import { authenticate } from '../middleware/authMiddleware.js';
import { authorize } from '../middleware/authorizationMiddleware.js';

const router = express.Router();

router.use(authenticate);

router.get('/:clubId', authorize('finance_accounts', 'read'), clubPaymentClaimController.list);
router.post('/:clubId', authorize('finance_accounts', 'write'), clubPaymentClaimController.create);
router.put('/:clubId/:claimId', authorize('finance_accounts', 'write'), clubPaymentClaimController.update);
router.patch('/:clubId/:claimId/payment', authorize('finance_accounts', 'write'), clubPaymentClaimController.registerPayment);
router.patch('/:clubId/:claimId/status', authorize('finance_accounts', 'write'), clubPaymentClaimController.updateStatus);
router.delete('/:clubId/:claimId', authorize('finance_accounts', 'write'), clubPaymentClaimController.delete);

export default router;
