const { body } = require('express-validator');
const {
  getUserTransactions,
  getTransactions,
  updateTransaction,
} = require('../../../controllers/customers/v1.1/transactions');
const { isAuth, validation } = require('../../../middlewares');

const router = require('express').Router();

router.get('/', isAuth, getUserTransactions);
router.get('/all', isAuth, getTransactions); // For super admin use only
router.patch(
  '/:id',
  body('status').isIn(['Pending', 'Completed', 'Paid']),
  validation,
  isAuth,
  updateTransaction,
); // For super admin use only

module.exports = router;
