package com.red.circle.wallet.app.service;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.common.business.dto.cmd.app.AppIdLongCmd;
import com.red.circle.framework.core.dto.CommonCommand;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.wallet.app.command.bank.UserBankExchangeGoldCmdExe;
import com.red.circle.wallet.app.command.bank.query.UserBankCheckExchangeGoldQryExe;
import com.red.circle.wallet.app.command.bank.query.UserBankCheckTransferQryExe;
import com.red.circle.wallet.app.command.bank.query.UserBankCheckWithdrawQryExe;
import com.red.circle.wallet.app.command.bank.query.UserBillAgentSalaryDiamondCheckExchangeGoldQryExe;
import com.red.circle.wallet.app.command.salaryDiamond.query.SalaryDiamondLatestOneMonthsFlowExe;
import com.red.circle.wallet.app.command.salaryDiamond.query.UserSalaryDiamondBalanceQryExe;
import com.red.circle.wallet.app.command.salaryDiamond.query.UserSalaryDiamondRunningWaterQryExe;
import com.red.circle.wallet.app.dto.clientobject.*;
import com.red.circle.wallet.app.dto.cmd.*;
import com.red.circle.wallet.infra.database.rds.entity.diamond.SalaryDiamondRunningWater;
import com.red.circle.wallet.inner.model.cmd.UserSalaryDiamondRunningWaterQryCmd;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户工资钻石余额
 *
 * @author zongpubin on 2024/3/27
 */
@Service
@RequiredArgsConstructor
public class SalaryDiamondServiceImpl implements SalaryDiamondService {

  private final UserBillAgentSalaryDiamondCheckExchangeGoldQryExe userBillAgentSalaryDiamondCheckExchangeGoldQryExe;
  private final UserSalaryDiamondBalanceQryExe userSalaryDiamondBalanceQryExe;
  private final UserSalaryDiamondRunningWaterQryExe userSalaryDiamondRunningWaterQryExe;
  private final UserBankCheckExchangeGoldQryExe userBankCheckExchangeGoldQryExe;
  private final UserBankCheckWithdrawQryExe userBankCheckWithdrawQryExe;
  private final UserBankCheckTransferQryExe userBankCheckTransferQryExe;
  private final UserBankExchangeGoldCmdExe userBankExchangeGoldCmdExe;
  private final SalaryDiamondLatestOneMonthsFlowExe salaryDiamondLatestOneMonthsFlowExe;

  @Override
  public UserSalaryDiamondCheckExchangeGoldCO checkBillAgentExchangeGold(AppIdLongCmd cmd) {
    return userBillAgentSalaryDiamondCheckExchangeGoldQryExe.execute(cmd);
  }

  @Override
  public BigDecimal getBalance(AppExtCommand cmd) {
    return userSalaryDiamondBalanceQryExe.execute(cmd);
  }

  @Override
  public List<UserBankWaterCO> listDetails(SalaryDiamondRunningWaterQueryCmd cmd) {
    return userSalaryDiamondRunningWaterQryExe.execute(cmd);
  }

  @Override
  public List<CommodityRunningWaterCO> latestOneMonthsFlow(DiamondRunningWaterQueryCmd cmd) {
    return salaryDiamondLatestOneMonthsFlowExe.execute(cmd);
  }

  @Override
  public List<UserBankWaterCO> billListDetails(SalaryDiamondRunningWaterQueryCmd cmd) {
    return userSalaryDiamondRunningWaterQryExe.executeBill(cmd);
  }

  @Override
  public List<UserBankWaterCO> salaryListDetails(SalaryDiamondRunningWaterQueryCmd cmd) {
    return userSalaryDiamondRunningWaterQryExe.executeSalary(cmd);
  }

  @Override
  public UserBankCheckWithdrawCO checkWithdraw(AppExtCommand cmd) {
    return userBankCheckWithdrawQryExe.executeDiamond(cmd);
  }

  @Override
  public UserBankCheckExchangeGoldCO checkExchangeGold(CommonCommand cmd) {
    return userBankCheckExchangeGoldQryExe.executeDiamond(cmd);
  }

  @Override
  public UserBankCheckTransferCO checkTransfer(AppExtCommand cmd) {
    return userBankCheckTransferQryExe.executeDiamond(cmd);
  }

  @Override
  public UserBankExchangeGoldResultCO exchangeGold(UserBankExchangeGoldCmd cmd) {
    return userBankExchangeGoldCmdExe.executeDiamond(cmd);
  }

  @Override
  public UserBankExchangeGoldResultCO exchangeGoldYolo(UserBankExchangeGoldCmd cmd) {
    return userBankExchangeGoldCmdExe.exchangeGoldYolo(cmd);
  }

  @Override
  public UserBankExchangeGoldResultCO agentBillExchangeGold(UserBillExchangeGoldCmd cmd) {
    return userBankExchangeGoldCmdExe.agentBillExchangeGold(cmd);
  }

  @Override
  public UserBankExchangeGoldResultCO memberWorkExchangeGold(UserBillExchangeGoldCmd cmd) {
    return userBankExchangeGoldCmdExe.memberWorkExchangeGold(cmd);
  }

  @Override
  public UserBankWithdrawResultCO withdraw(UserBankWithdrawCmd cmd) {
    return null;
  }

  @Override
  public UserBankWithdrawResultCO transfer(UserBankWithdrawTransferCmd cmd) {
    return null;
  }

}
