package com.yuchen.saas.payment.api.feign;

import com.yuchen.saas.payment.api.dto.invoice.SaasInvoiceFaqQueryDTO;
import com.yuchen.saas.payment.api.dto.invoice.SaasInvoiceHeaderDTO;
import com.yuchen.saas.payment.api.dto.invoice.SaasInvoiceHeaderQueryDTO;
import com.yuchen.saas.payment.api.dto.invoice.SaasInvoiceInstructionQueryDTO;
import com.yuchen.saas.payment.api.vo.invoice.SaasInvoiceFaqVO;
import com.yuchen.saas.payment.api.vo.invoice.SaasInvoiceHeaderListVO;
import com.yuchen.saas.payment.api.vo.invoice.SaasInvoiceHeaderVO;
import com.yuchen.saas.payment.api.vo.invoice.SaasInvoiceInstructionVO;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(
        value = AppNameConstant.SAAS_PAYMENT,
        fallbackFactory = SaasInvoiceManageFeignFallback.class
)
public interface SaasInvoiceManageFeign {

    /**
     * 新增或编辑发票抬头
     * @param headerDTO 发票抬头DTO
     * @return TRUE/FALSE
     */
    @PostMapping("/invoice/saveOrUpdateHeader")
    R<Boolean> saveOrUpdateHeader(@RequestBody @Validated SaasInvoiceHeaderDTO headerDTO);
    /**
     * 刪除发票抬头
     * @param id 发票抬头ID
     * @return TRUE/FALSE
     */
    @DeleteMapping("/invoice/deleteHeader/{id}")
    R<Boolean> deleteHeader(@PathVariable("id") Long id);

    /**
     * 发票抬头详情
     * @param id 发票抬头ID
     * @return 发票抬头VO
     */
    @GetMapping("/invoice/getHeaderById/{id}")
    R<SaasInvoiceHeaderVO> getHeaderById(@PathVariable("id") Long id);

    /**
     * 查询发票抬头列表(分页)
     * @param queryDTO 发票抬头列表查询参数
     * @return 发票抬头列表VO
     */
    @PostMapping("/invoice/getHeaderPageList")
    R<NestPage<SaasInvoiceHeaderListVO>> getHeaderPageList(@RequestBody SaasInvoiceHeaderQueryDTO queryDTO);

    /**
     * 查询开票说明列表(分页)
     * @param queryDTO 开票说明列表查询参数
     * @return 开票说明列表VO
     */
    @PostMapping("/invoice/getInstructionPageList")
    R<NestPage<SaasInvoiceInstructionVO>> getInstructionPageList(@RequestBody SaasInvoiceInstructionQueryDTO queryDTO, @RequestHeader Map header);

    /**
     * 查询开票FAQ列表(分页)
     * @param queryDTO 开票FAQ列表查询参数
     * @return 开票FAQ列表VO
     */
    @PostMapping("/invoice/getFaqPageList")
    R<NestPage<SaasInvoiceFaqVO>> getFaqPageList(@RequestBody SaasInvoiceFaqQueryDTO queryDTO);
}
