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

import com.yuchen.saas.payment.api.entity.PmgBatParkPayRefund;
import com.yuchen.saas.payment.api.vo.*;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
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;

/**
 * @ClassName ParkPayRefundFeignService
 * @Description 支付退款远程接口
 * @Author 张逸飞
 * @Date 2022年11月19日 14:34:04
 */
@FeignClient(
        value = AppNameConstant.SAAS_PAYMENT,
        fallbackFactory = ParkPayRefundFeignServiceFallback.class
)
public interface ParkPayRefundFeignService {

    /**
     * 根据支付单号获取退款单信息
     * @param orderNumber 支付单号
     * @return
     */
    @GetMapping("/pay/getRefundByOrderNumber")
    PmgBatParkPayRefund getRefundByOrderNumber(@RequestParam String orderNumber);

    /**
     * 查询退款申请列表
     * @param dto
     * @return
     */
    @PostMapping("/pay/getRefundList")
    R<List<PmgBatParkPayRefundVo>> getRefundList(@RequestBody PmgBatParkPayRefundDto dto);
    /**
     * 查询退款申请导出列表
     * @param dto
     * @return
     */
    @PostMapping("/pay/getTempRefundListByExport")
    R<List<TempRefundExcelVO>> getTempRefundListByExport(@RequestBody PmgBatParkPayRefundDto dto);

    @PostMapping("/pay/getMonthlyRefundListByExport")
    R<List<MonthlyRefundExcelVO>> getMonthlyRefundListByExport(@RequestBody PmgBatParkPayRefundDto dto);

    @PostMapping("/pay/getStaggeredRefundListByExport")
    R<List<StaggeredRefundExcelVO>> getStaggeredRefundListByExport(@RequestBody PmgBatParkPayRefundDto dto);

    /**
     * 创建退款单
     * @return
     */
    @PostMapping("/payRefund/createRefund")
    R<PmgBatParkPayRefund> createRefund(@RequestBody CreateRefundVo refundVo);

    /**
     * 取消退款
     * @return
     */
    @PostMapping("/payRefund/cancelRefund")
    R cancelRefund(@RequestBody CancelRefundVo refundVo);

    @GetMapping("/payRefund/myRefundList")
    R<List<PmgBatParkPayRefund>> myRefundList();
}
