package com.cf.imes.module.system.api.funds;


import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.api.funds.dto.InvoiceTitleInfoDTO;
import com.cf.imes.module.system.api.funds.dto.OrganAmountDTO;
import com.cf.imes.module.system.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.RequestParam;

import java.math.BigDecimal;

/**
 * @author 资金管理feign接口
 */
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰：fallbackFactory =
@Tag(name = "RPC 服务 - 资金管理")
public interface SystemFundsApi {


    String PREFIX = ApiConstants.PREFIX + "/funds";


    @GetMapping(PREFIX + "/amount/reduce")
    @Operation(summary = "减少组织可开票的金额")
    CommonResult<Boolean> reduceOrganAmount(@RequestParam("organId") Long organId,@RequestParam("invoiceAmount") BigDecimal invoiceAmount);


    @GetMapping(PREFIX + "/amount/add")
    @Operation(summary = "增加组织可开票的金额")
    CommonResult<Boolean> addOrganAmount(@RequestParam("organId") Long organId,@RequestParam("invoiceAmount") BigDecimal invoiceAmount);


    @GetMapping(PREFIX + "/amount/organ")
    @Operation(summary = "获取组织的资金信息")
    CommonResult<OrganAmountDTO> getOrganAmount(@RequestParam("organId") Long organId);


    @GetMapping(PREFIX + "/invoice/title")
    @Operation(summary = "获取发票的抬头信息")
    CommonResult<InvoiceTitleInfoDTO> getInvoiceTitle(@RequestParam("invoiceTitleId") Long invoiceTitleId);


}
