package com.red.circle.order.inner.endpoint.api;


import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.order.inner.model.cmd.SysPayCountryAddCmd;
import com.red.circle.order.inner.model.cmd.SysPayCountryChannelCmd;
import com.red.circle.order.inner.model.cmd.SysPayCountryChannelDetailsCmd;
import com.red.circle.order.inner.model.cmd.SysPayCountryQryCmd;
import com.red.circle.order.inner.model.dto.PayCountryDTO;
import com.red.circle.order.inner.model.dto.SysPayCountryChannelDTO;
import com.red.circle.order.inner.model.dto.SysPayCountryChannelDetailsDTO;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
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;

/**
 * 开通支付的国家.
 *
 * @author pengliang on 2023/11/3
 */
public interface PayCountryClientApi {

  String API_PREFIX = "/pay-country/client";

  @PostMapping("/mapCountryByIds")
  ResultResponse<Map<Long, PayCountryDTO>> mapCountryByIds(@RequestBody Set<Long> ids);

  @GetMapping("/switchShelf")
  ResultResponse<Void> switchShelf(@RequestParam("id") Long id,
      @RequestParam("shelf") Boolean shelf);

  @PostMapping("/delBatchAssociatedChannel")
  ResultResponse<Void> delBatchAssociatedChannel(@RequestBody SysPayCountryChannelCmd param);

  @PostMapping("/addAssociatedChannels")
  ResultResponse<Void> addAssociatedChannels(@RequestBody SysPayCountryChannelCmd param);

  @GetMapping("/listByPayCountryId")
  ResultResponse<List<SysPayCountryChannelDTO>> listByPayCountryId(
      @RequestParam("payCountryId") Long payCountryId);

  @PostMapping("/mapByCountryChannelId")
  ResultResponse<Map<Long, List<SysPayCountryChannelDetailsDTO>>> mapByCountryChannelId(
      @RequestBody Set<Long> countryChannelIds);

  @PostMapping("/delByCountryChannelId")
  ResultResponse<Void> delByCountryChannelId(@RequestBody SysPayCountryChannelCmd param);

  @GetMapping("/listSupportAmountUsd")
  ResultResponse<List<SysPayCountryChannelDetailsDTO>> listSupportAmountUsd(
      @RequestParam("payCountryId") Long payCountryId,
      @RequestParam("amountUsd") BigDecimal amountUsd);

  @PostMapping("/saveOrUpdateCountryChannelDetails")
  ResultResponse<Void> saveOrUpdateCountryChannelDetails(
      @RequestBody SysPayCountryChannelDetailsCmd cmd);

  @PostMapping("/pageOpenPayCountry")
  ResultResponse<PageResult<PayCountryDTO>> pageOpenPayCountry(
      @RequestBody SysPayCountryQryCmd query);

  @PostMapping("/addOpenPayCountry")
  ResultResponse<Void> addOpenPayCountry(@RequestBody List<SysPayCountryAddCmd> params);

  @PostMapping("/listOpenPayCountry")
  ResultResponse<List<PayCountryDTO>> listOpenPayCountry(@RequestBody Set<Long> ids);

  @PostMapping("/delOpenPayCountry")
  ResultResponse<Void> delOpenPayCountry(@RequestBody List<Long> ids);

  @GetMapping("/updateUsdExchangeRate")
  ResultResponse<Void> updateUsdExchangeRate(@RequestParam("id") Long id,
      @RequestParam("rate") BigDecimal rate);

  @GetMapping("/updateCountryCurrency")
  ResultResponse<Void> updateCountryCurrency(@RequestParam("id") Long id,
      @RequestParam("currency") String currency);

  @GetMapping("/updateSort")
  ResultResponse<Void> updateSort(@RequestParam("id") Long id, @RequestParam("sort") Integer sort);

  @GetMapping("/shelf")
  ResultResponse<Void> shelf(@RequestParam("id") Long id, @RequestParam("shelf") Boolean shelf);

  @GetMapping("/listPayCountryByRegionId")
  ResultResponse<List<PayCountryDTO>> listPayCountryByRegionId(
      @RequestParam("regionId") String regionId);
}
