package com.red.circle.console.app.service.app.sys.pay;

import com.red.circle.order.inner.endpoint.PayChannelClient;
import com.red.circle.order.inner.model.cmd.DelAssociatedChannelsCmd;
import com.red.circle.order.inner.model.cmd.SysPayChannelFactoryCmd;
import com.red.circle.order.inner.model.dto.PayCommodityPreviewDTO;
import com.red.circle.order.inner.model.dto.PayCountryAssociatedChannelsDTO;
import com.red.circle.order.inner.model.dto.SysPayChannelFactoryDTO;
import com.red.circle.order.inner.model.dto.SysPayFactoryAssociatedChannelsDTO;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 厂商渠道关联 服务实现类
 * </p>
 *
 * @author pengliang
 * @since 2021-11-29
 */
@Service
@RequiredArgsConstructor
public class SysPayChannelFactoryServiceImpl implements
    SysPayChannelFactoryService {

  private final PayChannelClient payChannelClient;


  @Override
  public void addAssociatedChannels(List<SysPayChannelFactoryCmd> params) {
    payChannelClient.addAssociatedChannels(params);
  }

  @Override
  public void updateAssociatedChannels(SysPayChannelFactoryCmd param) {
    payChannelClient.updateAssociatedChannels(param);
  }

  @Override
  public void delAssociatedChannels(DelAssociatedChannelsCmd param) {
    payChannelClient.delAssociatedChannels(param);
  }

  @Override
  public List<SysPayChannelFactoryDTO> listChannelFactory() {
    return payChannelClient.listChannelFactory().getBody();
  }

  @Override
  public List<PayCountryAssociatedChannelsDTO> listByPayCountry(Long payCountryId) {
    return payChannelClient.listByPayCountry(payCountryId).getBody();
  }

  @Override
  public PayCommodityPreviewDTO listSupportAmountUsd(Long payCountryId, BigDecimal amountUsd) {
    return payChannelClient.listSupportAmountUsd(payCountryId, amountUsd).getBody();
  }

  @Override
  public List<SysPayFactoryAssociatedChannelsDTO> listChannelByFactoryCode(String factoryCode) {
    return payChannelClient.listChannelByFactoryCode(factoryCode).getBody();
  }

  @Override
  public Set<String> listFactoryCodeByChannelCode(Set<String> channelCodes) {
    return payChannelClient.listFactoryCodeByChannelCode(channelCodes).getBody();
  }
}
