/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.distribution.comment.dto.DistributionWithdrawCashDto;
import com.yami.shop.distribution.comment.model.DistributionUser;
import com.yami.shop.distribution.comment.model.DistributionUserWallet;
import com.yami.shop.distribution.comment.model.DistributionWithdrawCash;
import com.yami.shop.distribution.comment.param.RangeTimeParam;
import com.yami.shop.security.comment.model.AppConnect;

/**
 * @author lgh on 2019/04/01.
 */
public interface DistributionWithdrawCashService extends IService<DistributionWithdrawCash> {
    IPage<DistributionWithdrawCash> distributionWithdrawCashsPage(Page page, Long shopId, RangeTimeParam rangeTimeParam, String userMobile, DistributionWithdrawCash distributionWithdrawCash);

    IPage<DistributionWithdrawCashDto> distributionWithdrawCashDtoPageByUserId(Page page, Long distributionUserId);


    /**
     * 发起提现
     */
    void apply(Double amount, DistributionUser distributionUser, AppConnect appConnect);

    /**
     * 根据时间区间获取用户的提现次数
     *
     * @param rangeTimeParam
     * @param distributionUserId
     * @return
     */
    Integer getCountByRangeTimeAndDistributionUserId(RangeTimeParam rangeTimeParam, Long distributionUserId);

    Double getUserTotalWithdrawCash(Long walletId);

}
