package com.sonic.lion.service;

import com.sonic.lion.domain.entity.FreeWithdrawConfig;
import com.sonic.lion.domain.entity.PayTrade;
import com.sonic.lion.domain.input.WithdrawFeeInput;
import com.sonic.lion.domain.output.WithdrawFeeReduceInfoOutput;
import com.sonic.lion.domain.req.FreeWithdrawReq;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 计算 提现费用 和 免费的费用都 写在这块
 */
public interface FreeWithdrawConfigService {

    void setFreeWithdraw(FreeWithdrawReq freeWithdraw);

    /**
     * 是否免费 如果免费 返回免费的配置 否则返回null
     *
     * @param uid
     * @param withdrawRequestTime
     * @return
     */
    FreeWithdrawConfig isFree(Long uid, LocalDateTime withdrawRequestTime);

    List<Long> getAllFreeUserIds();

    FreeWithdrawConfig getFreeReson(Long uid);


    /**
     * 计算提现的费用
     *
     * @param payTrade
     * @return
     */
    WithdrawFeeInput calculateWithdrawFee(PayTrade payTrade);

    /**
     * 获取用户的提现减免信息
     *
     * @param userId
     * @return
     */
    WithdrawFeeReduceInfoOutput getWithdrawFeeReduceInfo(Long userId);
}
