package com.jwipc.finance.controller;

import com.jwipc.api.dto.ApiResult;
import com.jwipc.finance.dto.InvoicedApplyPostApiDTO;
import com.jwipc.finance.dto.PaymentPostApiDTO;
import com.jwipc.finance.logic.InvoicedApplyPostApiLogic;
import com.jwipc.finance.logic.PaymentPostApiLogic;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shenyang.ou
 * @date 2024/3/27 9:39
 * @desc
 */
@RestController
@RequestMapping( "/sap/api/payment/post")
@RequiredArgsConstructor
public class PaymentPostApiController {
    private final PaymentPostApiLogic paymentPostApiLogic;

    /**
     * MIRO凭证过账状态反写
     * @param param 参数
     */
    @PostMapping("/sync")
    @ApiOperateLog(code = "paymentPostStatusSync",name = "费用匹配&货款匹配凭证过账状态反写", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.SAP)
    public ApiResult sync(@RequestBody PaymentPostApiDTO param){
        return paymentPostApiLogic.sync(param);
    }
}
