package org.dromara.main.service;

import java.math.BigDecimal;

/**
 * 企业账户服务接口
 */
public interface ICompanyAccountService {

    /**
     * 检查可用余额是否充足
     */
    Boolean checkAvailableBalance(Long companyId, BigDecimal amount);

    /**
     * 增加可用余额
     */
    Boolean addCommission(Long companyId, BigDecimal amount, Long orderId, String orderNo, String remark);

    /**
     * 余额支付：可用余额 -> 使用中余额
     */
    Boolean payByBalance(Long companyId, BigDecimal amount, Long orderId, String orderNo, String remark);

    /**
     * 订单完成：使用中余额 -> 累计消费
     */
    Boolean deductInUseBalance(Long companyId, BigDecimal amount, Long orderId, String orderNo, String remark);

    /**
     * 订单退款：使用中余额 -> 可用余额
     */
    Boolean refundToAvailable(Long companyId, BigDecimal amount, Long orderId, String orderNo, String remark);

    /**
     * 申请提现：可用余额 -> 提现中余额
     */
    Boolean applyWithdraw(Long companyId, BigDecimal amount, String withdrawNo, String remark);

    /**
     * 提现成功：扣减提现中余额
     */
    Boolean deductWithdrawingBalance(Long companyId, BigDecimal amount, String withdrawNo, String remark);

    /**
     * 提现失败：提现中余额 -> 可用余额
     */
    Boolean refundWithdrawToAvailable(Long companyId, BigDecimal amount, String withdrawNo, String remark);
}
