const adminTransactionsService = require("../../services/admin/adminTransactionsService");
const ApiResponse = require("../../utils/apiResponse");
const { asyncHandler } = require("../../middleware/errorHandler");

exports.getTransactions = asyncHandler(async (req, res) => {
  const data = await adminTransactionsService.getTransactions(req.query);
  ApiResponse.success(res, data);
});

exports.getTransactionById = asyncHandler(async (req, res) => {
  const { txId } = req.params;
  const data = await adminTransactionsService.getTransactionById(txId);
  ApiResponse.success(res, data);
});
