package com.jeesharp.business.modules.pay.api;

import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingFinishRequestDTO;
import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingReceiverAddRequestDTO;
import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingReceiverDeleteRequestDTO;
import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingReceiverResultDTO;
import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingRequestDTO;
import com.jeesharp.business.modules.pay.profitsharing.dto.PayProfitSharingResultDTO;

/**
 * 微信分账渠道跨模块 API，封装电商收付通分账请求与查询。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
public interface PayProfitSharingChannelApi {

    /**
     * 请求分账（POST /v3/ecommerce/profitsharing/orders）。
     */
    PayProfitSharingResultDTO requestOrders(PayProfitSharingRequestDTO request);

    /**
     * 查询分账结果。
     */
    PayProfitSharingResultDTO queryOrders(String platformTenantId, String subMchId, String transactionId, String outOrderNo);

    /**
     * 完结分账（POST /v3/ecommerce/profitsharing/finish-order），解冻剩余平台佣金。
     */
    PayProfitSharingResultDTO finishOrder(PayProfitSharingFinishRequestDTO request);

    /**
     * 确保二级商户自身已注册为微信分账接收方（分账前置）。
     */
    PayProfitSharingReceiverResultDTO ensureSubMerchantSelfReceiver(String platformTenantId, String subMchId);

    /**
     * 添加分账接收方（POST /v3/ecommerce/profitsharing/receivers/add）。
     */
    PayProfitSharingReceiverResultDTO addReceiver(PayProfitSharingReceiverAddRequestDTO request);

    /**
     * 删除分账接收方（POST /v3/ecommerce/profitsharing/receivers/delete）。
     */
    PayProfitSharingReceiverResultDTO deleteReceiver(PayProfitSharingReceiverDeleteRequestDTO request);

    /**
     * 查询分账接收方（GET /v3/ecommerce/profitsharing/receivers）。
     */
    PayProfitSharingReceiverResultDTO queryReceivers(String platformTenantId, String subMchId);
}
