package com.crm.ucard.service;

import com.crm.rely.backend.core.dto.base.BaseReportResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.ucard.*;
import com.crm.rely.backend.core.dto.wasabi.WasabiAvailableCurrenciesListDto;
import com.crm.rely.backend.core.dto.wasabi.WasabiFieldDto;
import com.crm.rely.backend.core.entity.base.BaseEntity;
import com.crm.rely.backend.core.entity.custom.info.InfoEntity;
import com.crm.rely.backend.core.entity.ucard.*;
import com.crm.rely.backend.core.entity.wasabi.WasabiTransactionSubmitRfiEntity;
import com.crm.rely.backend.core.pojo.table.ucard.CardGlobalCurrenciesTable;
import com.crm.rely.backend.core.pojo.table.ucard.CardGlobalOrderTable;
import com.crm.rely.backend.exception.ServiceException;

import java.math.BigDecimal;
import java.util.List;

public interface GlobalService {

    /**
     * 币种同步任务
     */
    BaseResultDto saveCurrencies() throws Exception;

    /**
     * 同步州表数据和银行城市信息
     */
    void saveGlobalStates(List<CardGlobalCurrenciesTable> currenciesTables) throws Exception;

    /**
     * 同步币种、币种字段、字段可选值
     */
    BaseResultDto saveAvailableCurrencies() throws Exception;

    /**
     * 获取所有币种字段列表
     */
    BaseResultDto getGlobalFieldParams() throws ServiceException;

    /**
     * 币种分页列表
     */
    ResultWithPagerDto<WasabiAvailableCurrenciesListDto> getCurrenciesPageList(GlobalCurrenciesPageListEntity entity) throws ServiceException;

    /**
     * 查询币种全局配置
     */
    BaseResultDto<WasabiAvailableCurrenciesListDto> getCurrenciesGlobalConfig() throws ServiceException;

    /**
     * 根据币种信息查询最新汇率
     */
    BigDecimal getExchangeRateByCurrency(String payoutCurrency, String transferType, String payoutMethod) throws Exception;

    /**
     * 查询支持币种列表
     */
    BaseResultDto<List<GlobalCurrenciesDropdownListDto>> getCurrenciesDropdown(GlobalCurrenciesDropdownEntity entity) throws ServiceException;

    /**
     * 币种字段和可选值列表
     */
    BaseResultDto<List<WasabiFieldDto>> getCurrenciesFieldList(GlobalCurrenciesFieldListEntity entity) throws ServiceException;

    /**
     * 查询汇率和手续费率
     */
    GlobalQueryExchangeRateDto queryExchangeRate(GlobalQueryExchangeRateEntity entity) throws Exception;

    /**
     * 币种配置更改
     */
    BaseResultDto globalCurrenciesConfig(GlobalCurrenciesConfigEntity entity) throws ServiceException;

    /**
     * 查询支持的城市列表
     */
    BaseResultDto<List<CardBankCitiesDto>> queryBankCities(CardBankCitiesEntity entity) throws ServiceException;

    /**
     * 创建交易订单
     */
    BaseResultDto globalCreateOrder(GlobalCreateOrderEntity entity) throws Exception;

    /**
     * 取消速汇交易订单
     */
    BaseResultDto globalCancelOrder(GlobalCancelOrderEntity entity) throws Exception;

    /**
     * 查询速汇订单列表
     */
    BaseReportResultDto<List<GlobalOrderDto>, GlobalOrderSumDto> globalOrderPageList(GlobalOrderPageEntity entity) throws ServiceException;

    /**
     * 速汇查询用户详情
     */
    BaseResultDto<MerchantUserDto> findGlobalUserDetails(InfoEntity entity) throws ServiceException;

    /**
     * 查询速汇订单详情
     */
    BaseResultDto<GlobalOrderDto> queryGlobalOrderDetails(BaseEntity entity) throws ServiceException;

    /**
     * 交易订单审批
     */
    BaseResultDto globalOrderApprove(GlobalOrderApproveEntity entity) throws Exception;

    /**
     * 速汇交易失败退款
     */
    void refundTransacOrder(CardGlobalOrderTable table) throws Exception;

    /**
     * 补充资料
     */
    BaseResultDto supplementaryData(WasabiTransactionSubmitRfiEntity entity) throws Exception;

    /**
     * 最近交易收款人列表
     */
    BaseResultDto<List<GlobalReceiverUserDto>> getGlobalReceiverUserList(GlobalReceiverUserEntity entity) throws ServiceException;

    /**
     * 删除最近交易收款人信息
     */
    BaseResultDto deleteGlobalReceiverUser(BaseEntity entity) throws ServiceException;

}
