package com.ruoyi.ss.withdraw.service;

import com.ruoyi.ss.withdraw.domain.Withdraw;
import com.ruoyi.ss.withdraw.domain.WithdrawQuery;
import com.ruoyi.ss.withdraw.domain.WithdrawVO;
import com.ruoyi.ss.withdraw.domain.dto.WithdrawApprovalDTO;

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

/**
 * 提现记录Service接口
 *
 * @author qzz
 * @date 2024-09-28
 */
public interface IWithdrawService
{
    /**
     * 查询提现记录
     *
     * @param id 提现记录主键
     * @return 提现记录
     */
    public WithdrawVO selectRlWithdrawById(Long id);

    /**
     * 查询提现记录列表
     *
     * @param rlWithdraw 提现记录
     * @return 提现记录集合
     */
    public List<Withdraw> selectRlWithdrawList(WithdrawQuery rlWithdraw);

    /**
     * 根据条件查询提现记录数量
     *
     * @param rlWithdraw 提现记录
     * @return 提现记录集合
     *  */
    public int selectCount(WithdrawQuery rlWithdraw);

    /**
     * 新增提现记录
     *
     * @param rlWithdraw 提现记录
     * @return 结果
     */
    public int insertRlWithdraw(Withdraw rlWithdraw);

    /**
     * 修改提现记录
     *
     * @param rlWithdraw 提现记录
     * @return 结果
     */
    public int updateRlWithdraw(Withdraw rlWithdraw);

    /**
     * 批量删除提现记录
     *
     * @param ids 需要删除的提现记录主键集合
     * @return 结果
     */
    public int deleteRlWithdrawByIds(Long[] ids);

    /**
     * 删除提现记录信息
     *
     * @param id 提现记录主键
     * @return 结果
     */
    public int deleteRlWithdrawById(Long id);

    /**
     * 累计提现金额
     *
     * @param userId 用户id
     * @return 结果
     */
    BigDecimal cumulativeWithdrawalAmount(Long userId);

    /**
     * 同意提现
     *
     * @param dto 提现审核DTO
     * @return 结果
     */
    int passWithdraw(WithdrawApprovalDTO dto);

    /**
     * 拒绝提现
     *
     * @param dto 提现审核DTO
     * @return 结果
     */
    boolean rejectWithdraw(WithdrawApprovalDTO dto);

    /**
     * 获取用户提现中金额
     *
     * @param userId 用户id
     * @return 结果
     */
    BigDecimal selectWithdrawingAmountByUserId(Long userId);

    /**
     * 根据条件查询提现金额
     *
     * @param query 查询条件
     * @return 结果
     */
    BigDecimal selectWithdrawAmount(WithdrawQuery query);

    /**
     * 根据条件查询提现服务费
     *
     * @param query 查询条件
     * @return 结果
     */
    BigDecimal selectHandlingCharge(WithdrawQuery query);

}
