package com.tmerclub.cloud.user.service;

import com.tmerclub.cloud.api.payment.allinpay.order.resp.PayByBackSmsResp;
import com.tmerclub.cloud.api.payment.allinpay.order.resp.WithdrawApplyResp;
import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.user.dto.UserWithDrawDTO;
import com.tmerclub.cloud.user.model.UserWithdrawCash;
import com.tmerclub.cloud.user.vo.DateUserWithdrawCashVO;
import com.tmerclub.cloud.user.vo.UserWithdrawCashVO;

import java.math.BigDecimal;

/**
 * @author gaozijie
 * @date 2023-04-24
 */
public interface UserWithdrawCashService {

    /**
     * 提现申请
     * @param withDrawDTO
     * @return
     */
    WithdrawApplyResp withdrawApply(UserWithDrawDTO withDrawDTO);

    /**
     * 提现确认支付
     * @param userWithDrawDTO
     * @return
     */
    PayByBackSmsResp payConfirm(UserWithDrawDTO userWithDrawDTO);

    /**
     * 通过bizOrderNo获取提现记录
     * @param bizOrderNo 第三方订单号(通联)
     * @return
     */
    UserWithdrawCash getByBizOrderNo(String bizOrderNo);

    /**
     * 更新提现记录
     * @param userWithdrawCash
     */
    void update(UserWithdrawCash userWithdrawCash);

    /**
     * 获取用户提现总金额
     * @param userId
     * @return
     */
    BigDecimal getTotalWithdrawAmount(Long userId);

    /**
     * 分页获取用户提现记录
     * @param userId
     * @param pageDTO
     * @return
     */
    PageVO<UserWithdrawCashVO> pageUserWithdrawCashVOList(Long userId, PageDTO pageDTO);

    /**
     * 分页获取按年月分组的用户提现记录
     * @param userId
     * @param pageDTO
     * @return
     */
    PageVO<DateUserWithdrawCashVO> pageDateUserWithdrawCashVOList(Long userId, PageDTO pageDTO);
}
