package com.jwipc.finance.controller;

import com.jwipc.api.dto.ApiResult;
import com.jwipc.finance.dto.CompanyAccountApiDTO;
import com.jwipc.finance.dto.PaymentPostApiDTO;
import com.jwipc.finance.logic.CompanyAccountApiLogic;
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.validation.annotation.Validated;
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;

import javax.validation.Valid;

/**
 * @author shenyang.ou
 * @date 2024/3/27 9:39
 * @desc
 */
@RestController
@RequestMapping( "/sap/api/company/account")
@RequiredArgsConstructor
@Validated
public class CompanyAccountApiController {
    private final CompanyAccountApiLogic companyAccountApiLogic;

    /**
     * 公司级销售对账创建
     * @param param 参数
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperateLog(code = "saveOrUpdate",name = "跨公司销售对账创建", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.SAP)
    public ApiResult saveOrUpdate(@Valid @RequestBody CompanyAccountApiDTO param){
        return companyAccountApiLogic.saveOrUpdate(param);
    }
}
