
package com.tmerclub.cloud.supplier.service;

import com.tmerclub.cloud.api.multishop.bo.OrderChangeShopWalletAmountBO;
import com.tmerclub.cloud.api.payment.vo.SplitRuleVO;
import com.tmerclub.cloud.api.supplier.bo.SupplierWalletBO;
import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.common.order.vo.OrderSimpleAmountInfoBO;
import com.tmerclub.cloud.supplier.dto.SupplierWalletLogSearchDTO;
import com.tmerclub.cloud.supplier.vo.SupplierWalletVO;

import java.util.List;

/**
 * 供应商钱包信息
 *
 * @author lhd
 * @date 2022-03-14 17:04:32
 */
public interface SupplierWalletService {

    /**
     * 通过下单添加商家待结算金额，确认收货后进行结算
     * @param orderSimpleAmountInfos 订单id和供应商id关联信息
     */
    void addAmountByOrder(List<OrderSimpleAmountInfoBO> orderSimpleAmountInfos);

    /**
     * 结算给商家增加结算金额
     * @param orderId 订单id
     * @return 结算收入信息
     */
    void addAmountBySettledOrder(Long orderId);

    /**
     * 获取供应商结算信息
     * @param orderId 订单id
     * @return 结算收入信息
     */
    SplitRuleVO getSupplierSettledInfoByOrderId(Long orderId);

    /**
     * 通过退款，锁定商家钱包金额
     * @param orderChangeShopWalletAmountBO 金额相关信息
     * @return
     */
    void refundSupplierAmountByRefund(OrderChangeShopWalletAmountBO orderChangeShopWalletAmountBO);

    /**
     * 根据供应商id查询供应商钱包信息
     * @param supplierId 供应商id
     * @return 供应商钱包信息
     */
    SupplierWalletVO getBySupplierId(Long supplierId);

    /**
     * 获取所有供应商的钱包信息
     * @param supplierWalletLogSearchDTO
     * @return 钱包信息
     */
    SupplierWalletVO getAllSupplier(SupplierWalletLogSearchDTO supplierWalletLogSearchDTO);

    /**
     * 订单部分退款导致订单关闭 商家结算操作
     * @param orderChangeSupplierWalletAmountBO 金额相关信息
     */
    void settlementSupplierAmountByRefund(OrderChangeShopWalletAmountBO orderChangeSupplierWalletAmountBO);

    /**
     * 修改供应商钱包的待结算金额
     * @param message 分销产生的待结算金额
     */
    void updateByDistributionAmount(List<SupplierWalletBO> message);

    /**
     * 分页获取供应商钱包信息
     * @param pageDTO
     * @param supplierWalletLogSearchDTO
     * @return
     */
    PageVO<SupplierWalletVO> pageSupplierWalletByTime(PageDTO pageDTO, SupplierWalletLogSearchDTO supplierWalletLogSearchDTO);
}
