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

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

module.exports.updateKycStatus = asyncHandler(async (req, res) => {
  const { kycId } = req.params;
  const { status, reason } = req.body;
  const data = await adminKycService.updateKycStatus(kycId, status, reason, req.admin?.id);
  ApiResponse.success(res, data, "KYC status updated");
});     

module.exports.getKycDetails = asyncHandler(async (req, res) => {
  const { kycId } = req.params;
  const data = await adminKycService.getKycDetails(kycId);
  ApiResponse.success(res, data);
}); 
