package com.crm.ucard.service;

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.wasabi.*;
import com.crm.rely.backend.core.entity.wasabi.*;
import com.crm.rely.backend.exception.ServiceException;
import com.crm.ucard.config.WasabiConfig;
import com.crm.ucard.model.ResultData;
import com.crm.ucard.model.TwoTuple;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface WasabiDocumentApiService {

    void verifySignature(TwoTuple<String, String> result, String publicKey) throws Exception;

    WasabiConfig getWasabiConfig() throws Exception;

    /**
     * 获取国家/地区列表
     */
    BaseResultDto<List<WasabiRegionDto>> getRegionList() throws Exception;

    /**
     * 获取城市列表
     */
    BaseResultDto<List<WasabiCityDto>> getCityList(WasabiCityEntity entity) throws Exception;

    /**
     * 获取城市列表v2
     */
    BaseResultDto<List<WasabiCityV2Dto>> getCityV2List(WasabiCityEntity entity) throws Exception;

    /**
     * 获取手机区号列表
     */
    BaseResultDto<List<WasabiMobileAreaCodeDto>> getMobileAreaCode() throws Exception;

    /**
     * 文件上传
     */
    String uploadFile(String path, String category) throws Exception;

    /**
     * 校验文件
     */
    void validatedFile(MultipartFile file) throws ServiceException;

    /**
     * 提交工单
     */
    BaseResultDto<WasabiWorkSubmitAndListDto> workSubmit(WasabiWorkSubmitEntity entity) throws Exception;

    /**
     * 获取工单列表
     */
    BaseResultDto<List<WasabiWorkSubmitAndListDto>> workList(WasabiWorkListEntity entity) throws Exception;

    /**
     * 获取账户资产信息列表
     */
    BaseResultDto<List<WasabiAccountInfoDto>> queryMerchantAccount() throws Exception;

    /**
     * 钱包充值
     */
    BaseResultDto<WasabiWalletDepositDto> walletDeposit(WasabiWalletDepositEntity entity) throws Exception;

    /**
     * 获取钱包充值记录列表
     */
    ResultWithPagerDto<WasabiWalletDepositTransactionDto> getWalletDepositTransactionList(WasabiWalletDepositTransactionEntity entity) throws Exception;

    /**
     * 获取支持的卡BIN列表
     */
    List<WasabiCardTypesDto> getCardTypeList() throws Exception;

    /**
     * 开卡
     */
    ResultData<List<WasabiOpenCardDto>> openCard(WasabiOpenCardEntity entity, WasabiConfig config) throws ServiceException;

    /**
     * 查询持卡人信息
     */
    List<WasabiHolderQueryDto> getHolderInfo(WasabiHolderQueryEntity entity, WasabiConfig config) throws ServiceException;

    /**
     * 激活卡
     */
    WasabiActiveCardDto activeCard(WasabiActiveCardEntity entity) throws Exception;

    /**
     * 获取卡信息
     */
    WasabiCardInfoDto getCardInfo(WasabiCardInfoEntity entity) throws Exception;

    /**
     * 获取卡敏感信息
     */
    WasabiCardSensitiveDto getCardSensitive(WasabiBalanceInfoEntity entity) throws Exception;

    /**
     * 获取卡余额
     */
    BaseResultDto<WasabiBalanceInfoDto> getBalanceInfo(WasabiBalanceInfoEntity entity) throws Exception;

    /**
     * 冻结卡-v2
     */
    WasabiFreezeAndUnfreezeV2Dto freezeV2(WasabiFreezeAndUnfreezeEntity entity) throws Exception;

    /**
     * 解冻卡-v2
     */
    WasabiFreezeAndUnfreezeV2Dto unfreezeV2(WasabiFreezeAndUnfreezeEntity entity) throws Exception;

    /**
     * 卡充值申请
     */
    ResultData<WasabiDepositDto> cardDeposit(WasabiBalanceEntity entity, WasabiConfig config) throws ServiceException;

    /**
     * 卡扣款
     */
    ResultData<WasabiDepositDto> withdraw(WasabiBalanceEntity entity, WasabiConfig config) throws Exception;

    /**
     * 销卡
     */
    WasabiDepositDto cardCancel(WasabiCancelEntity entity) throws Exception;

    /**
     * 更新实体卡PIN
     */
    WasabiUpdatePinDto updatePin(WasabiUpdatePinEntity entity) throws Exception;

    /**
     * 获取卡交易记录列表/查询充值记录
     */
    List<WasabiTransactionDto> getCardTransactionList(WasabiTransactionEntity entity) throws Exception;

    /**
     * 获取卡授权交易记录
     */
    BaseResultDto<WasabiAuthTransactionDto> getAuthTransactionList(WasabiAuthTransactionEntity entity) throws Exception;

    /**
     * 获取卡3ds交易记录
     */
    List<WasabiThird3dsTransactionDto> getThird3dsTransactionList(WasabiThird3dsTransactionEntity entity) throws Exception;

    /**
     * 查询职业信息列表
     */
    List<WasabiOccupationsDto> getHolderOccupations() throws Exception;

    /**
     * 创建持卡人
     */
    ResultData<WasabiUserDto> createHolderV2(WasabiUserEntity entity, WasabiConfig config) throws Exception;

    /**
     * 修改持卡人
     */
    ResultData<WasabiUserDto> updateHolderV2(WasabiUserEntity entity, WasabiConfig config) throws ServiceException;

    /**
     * 查询激活码
     */
    WasabiThird3dsTransactionDto getActivationCode(WasabiThird3dsTransactionEntity entity) throws Exception;

    /**
     * 全球速汇-查询支持的币种
     */
    BaseResultDto<List<WasabiAvailableCurrenciesDto>> getAvailableCurrencies() throws Exception;

    /**
     * 全球速汇-币种发送交易需要的字段
     */
    BaseResultDto<WasabiAvailableFieldParamsDto> getAvailableFieldParams(WasabiAvailableFieldParamsEntity entity) throws Exception;

    /**
     * 全球速汇-查询省份/州列表
     */
    BaseResultDto<List<WasabiStatesDto>> getStates() throws Exception;

    /**
     * 全球速汇-银行城市名单
     */
    BaseResultDto<List<WasabiMethodDto>> getAvailableBankCities(WasabiAvailableBankCitiesEntity entity) throws Exception;

    /**
     * 全球速汇-法币汇率
     */
    BaseResultDto<List<WasabiExchangeRateDto>> getExchangeRate() throws Exception;

    /**
     * 全球速汇-发送交易
     */
    WasabiTransactionTransferDto transactionTransfer(WasabiTransactionTransferEntity entity,
                                                     WasabiConfig config) throws Exception;

    /**
     * 全球速汇-交易记录
     */
    BaseResultDto<WasabiTransactionTransferDto> getTransactionList(WasabiTransactionListEntity entity) throws Exception;

    /**
     * 全球速汇-交易详情查询
     */
    BaseResultDto<WasabiTransactionDetailDto> getTransactionDetail(WasabiTransactionDetailEntity entity) throws Exception;

    /**
     * 全球速汇-提交合规性检查资料
     */
    BaseResultDto transactionSubmitRfi(WasabiTransactionSubmitRfiEntity entity) throws Exception;
}
