const router = require('express').Router();
const { paymentLimiter } = require('../app');
const TransactionController = require('../controllers/transaction');
const { authenticate } = require('../middleware/auth');


router.get('/banks', TransactionController.getBanks);


// Transaction routes
router.post('/deposit', authenticate, paymentLimiter, TransactionController.depositFunds);
router.get('/verify-deposit', authenticate, paymentLimiter, TransactionController.verifyDeposit);
router.post('/transfer', authenticate, paymentLimiter, TransactionController.transferFunds);
router.post('/withdraw', authenticate, paymentLimiter, TransactionController.withdrawFunds);
router.get(
  '/wallets/:walletId/transactions',
  authenticate,
  TransactionController.getTransactionHistory
);
router.get(
  '/:transactionId',
  authenticate,
  TransactionController.getTransactionById
);
router.get('/wallet/:walletId/balance', authenticate, TransactionController.getWalletBalance);
router.get('/wallet/:userId/transactions', authenticate, TransactionController.getWalletTransactions);



module.exports = router;