package cn.iocoder.yudao.module.bpm.api.oa;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.api.oa.vo.refund.BpmOARefundDTO;
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 退款申请")
public interface BpmOARefundApi {

    String PREFIX = ApiConstants.PREFIX + "/oa/refund";

    @PostMapping(PREFIX + "/get")
    @Operation(summary = "获得指定的退款申请列表")
    CommonResult<Map<String,BpmOARefundDTO>> getListByOrderNo(@RequestBody List<String> orderNos);

    @GetMapping(PREFIX + "/update-status")
    @Operation(summary = "修改退款申请的退款状态 为已退款")
    @Parameter(name = "orderNo", description = "订单编号", required = true)
    @Parameter(name = "status", description = "状态", required = true)
    CommonResult<Boolean> updateStatus(@RequestParam("orderNo") String orderNo);
}
