package com.sunxung.factoring.web.refundManagement;

import com.sunxung.factoring.component.annotation.OperationLog;
import com.sunxung.factoring.component.enums.OperationTypeEnum;
import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.entity.cashflowmanage.sop.BillingNonbusinessManageFactoringentry;
import com.sunxung.factoring.entity.salescontractmanagement.CSalesContract;
import com.sunxung.factoring.service.refundsManagement.IRefundManagementApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Yafan Wang
 * @Date 2024/3/14 15:53
 */
@RestController
@RequestMapping("api/refundManagement")
public class RefundManagementApiController {

    @Autowired
    private IRefundManagementApprovalService refundManagementApprovalService;

    @RequestMapping("/OAResult")
    @OperationLog(operationModule = "退款管理", operationType = OperationTypeEnum.INSERT, description = "sop回调")
    public ResponseJson doCreate(Long refundManagementId) {
        refundManagementApprovalService.handleApprovalProcess(refundManagementId);
        return new ResponseJson("操作成功！");
    }

    @RequestMapping("/handleCashFlow")
    @OperationLog(operationModule = "退款管理", operationType = OperationTypeEnum.INSERT, description = "sop回调")
    public ResponseJson doCreate(BillingNonbusinessManageFactoringentry nobusinessManage) {
        refundManagementApprovalService.handleCashFlow(nobusinessManage);
        return new ResponseJson("操作成功！");
    }

}
