package com.red.circle.other.app.command.user.query;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.app.convertor.user.RedPacketInviteAppConvertor;
import com.red.circle.other.app.dto.clientobject.user.invite.InviteRedPacketWithdrawalCO;
import com.red.circle.other.infra.common.user.RedPacketInviteUserCommon;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 提现记录20条最新.
 * </p>
 *
 * @author pengshigang
 * @since 2023-12-20
 */
@Service
@AllArgsConstructor
public class InviteNewWithdrawQryExe {

  private final RedPacketInviteUserCommon redPacketInviteUserCommon;
  private final RedPacketInviteAppConvertor redPacketInviteAppConvertor;

  public InviteRedPacketWithdrawalCO execute(AppExtCommand cmd) {

    return redPacketInviteAppConvertor.toInviteNewWithdrawalCO(
        redPacketInviteUserCommon.getWithdrawTransitBalance(cmd.getReqUserId(),
            cmd.getReqSysOrigin().getOrigin()));
  }

}
