import { number } from "zod";
import CONSTANTS from "../../config/constants";
import payoutBeneficiaryDB from "../../models/payoutBeneficiary.model";
import payoutTransactionDB from "../../models/payoutTransaction.model";
import cashfreePayout from "../../utils/cashfreePayout";
import generatePayOutTransId from "../../utils/generatePayoutTransId";
import { recordTransferInitiate } from "../../utils/walletHelper";
import { autopayLog } from "../serviceLog";
import autopayQueueDB from "./autopay.model";


async function makeTransactionsX() {
  const C = "Autopay Queue Worker";
  const F = "makeTransactionsX";

  try {
    
    let clientId = 519;

    const clientWallet = await autopayQueueDB.getWalletByClientIdAndStaffId({
      clientId: clientId,
      staffId: null,
    });

    const wallet = await autopayQueueDB.getWalletByClientIdAndStaffId({
      clientId: clientId,
      staffId: null,
    });

    autopayLog.info(`[${C}], [${F}], ClientId [${clientId}], Wallet [${JSON.stringify(wallet)}]`);
    autopayLog.info(`[${C}], [${F}], ClientId [${clientId}], Client Wallet [${JSON.stringify(clientWallet)}]`);

    autopayLog.info(`[${C}], [${F}], Queue Worker Completed`);

    process.exit();
  } catch (error) {
    autopayLog.info(`[${C}], [${F}], Error [${error}]`);
    process.exit()
  }
};

makeTransactionsX();