package com.yc.ship.module.trade.api.contract;

import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.module.trade.api.contract.dto.ContractApplyReqDTO;
import com.yc.ship.module.trade.api.contract.dto.QueryContractRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.tags.Tag;

import javax.annotation.security.PermitAll;
import javax.validation.Valid;

/***
 *@return
 */
@Tag(name = "RPC 服务 - Contract 合同")
public interface ContractApi {

    @Operation(summary = "申请合同")
    CommonResult<?> applyContract(@Valid @RequestBody ContractApplyReqDTO reqDTO);


    @Operation(summary = "作废合同")
    @Parameters({
            @Parameter(name = "orderId", description = "订单号", example = "123123", required = true),
    })
    CommonResult<Boolean> cancelContractByOrder(Long orderId);

    @Operation(summary = "查询状态")
    @Parameters({
            @Parameter(name = "contractId", description = "合同id", example = "123123", required = true),
    })
    CommonResult<Integer> queryStatus(Long contractId);


    @Operation(summary = "获取合同的基础信息")
    @Parameters({
            @Parameter(name = "contractId", description = "合同id", example = "123123", required = true),
    })
    CommonResult<QueryContractRespDTO> queryContract(Long contractId);
}
