package com.jwipc.finance.constant;

import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.converter.json.GsonEncoder;
import com.jwipc.api.dto.SapResposeBody;
import com.jwipc.api.interceptor.SapInterceptor;
import com.jwipc.finance.dto.*;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;

/**
 * @author shenyang.ou
 * @date 2024/3/21 13:49
 * @desc 对账相关接口
 */
public interface AccountStatementSapClient {
    @GsonEncoder
    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_MM_SRM_008", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "syncAccountStatement", name = "同步对账单", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    SapResposeBody syncAccountStatement(@JSONBody AccountStatementToSapDTO accountStatementToSapDTO);

    @GsonEncoder
    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_MM_SRM_021", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "syncPayment", name = "货款&费用匹配单过账", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    SapResposeBody syncPayment(@JSONBody PaymentToSapDTO paymentToSapDTO);

    @GsonEncoder
    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_MM_SRM_024", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "syncPayment02", name = "费用调整单过账凭证F-02", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    SapResposeBody syncCostAccountStatement(@JSONBody CostAccountStatementToSapDTO paymentToSapDTO);


    @GsonEncoder
    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_MM_SRM_012", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "getCopeWithUnclear", name = "统计应付未清金额", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    CopeWithUnclearResponseDTO getCopeWithUnclear(@JSONBody CopeWithUnclearSapDTO copeWithUnclearSapDTO);

    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_MM_SRM_019", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "getOrderDetailPaymentExpireDate", name = "对账管理，预付款查询订单行付款到期日", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    PurchaseOrderDetailResposeDTO getOrderDetailPaymentExpireDateByOrderNo(@JSONBody PurchaseOrderDetailSapDTO purchaseOrderDetailSapDTO);

    @GsonEncoder
    @Post(value = "#{sys.sap-host}/RESTAdapter/ERP/ZFM_FI_020", interceptor = SapInterceptor.class, dataType =
            "json")
    @ApiOperateLog(code = "getSapAmount", name = "对账查询余额及逾期金额信息", direction = ApiDirection.SRM_TO_OTHER,
            thirdSysType = ThirdSysType.SAP)
    AccountAmountResposeDTO getSapAmount(@JSONBody AccountAmountToSapDTO accountAmountToSapDTO);
}
