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.receipt.*;
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
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.time.LocalDateTime;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 流程实例")
public interface BpmOAReceiptApi {

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

    @GetMapping(PREFIX + "/get-receipt-count")
    @Operation(summary = "获得当日回款统计 | 新增金额")
    CommonResult<ReceiptStatisticsDTO> getReceiptCount(@RequestParam("relation") String relation);

    @PostMapping(PREFIX + "/getList")
    @Operation(summary = "获得回款列表")
    CommonResult<List<BpmOAReceiptDTO>> getReceiptList(@RequestBody BpmOAReceiptVO respVO);

    @GetMapping(PREFIX + "/get-receipt-statistics")
    @Operation(summary = "获得指定用户的回款统计信息")
    CommonResult<List<ReceiptStatisticsDTO>> getContractStatistics(@RequestParam("userId") List<Long> userIds,
                                                                   @RequestParam(name = "createTime", required = false) LocalDateTime[] createTime);

    @PostMapping(PREFIX + "/getReceiptSettlement")
    @Operation(summary = "获取用户回款结算信息")
    CommonResult<List<ReceiptSettlementDTO>> getReceiptSettlement(@RequestBody ReceiptSettlementVO vo);
}
