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.ucard.*;
import com.crm.rely.backend.core.dto.wasabi.*;
import com.crm.rely.backend.core.entity.base.*;
import com.crm.rely.backend.core.entity.custom.info.CustomInfoEntity;
import com.crm.rely.backend.core.entity.custom.info.InfoEntity;
import com.crm.rely.backend.core.entity.custom.kyc.WebsdkLinkAliEntity;
import com.crm.rely.backend.core.entity.ucard.*;
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 org.springframework.web.multipart.MultipartFile;

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

public interface WasabiCardService {

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

    /**
     * 更新国家/地区/手机区号列表
     */
    void cardUpdateCountry() throws ServiceException;

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

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

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

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

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

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

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

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

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

    /**
     * 获取并更新支持的卡BIN列表
     */
    void saveCardTypeList() throws ServiceException;

    /**
     * 用户获取卡片类型
     */
    List<CardTypeUserDto> getCardTypeList(CardTypeEntity entity) throws ServiceException;

    /**
     * 商户用户注册
     */
    BaseResultDto registerMerchantUser(CardMerchantUserEntity entity) throws ServiceException;

    /**
     * 更新商户用户信息
     */
    BaseResultDto updateMerchantUser(CardMerchantUserEntity request) throws ServiceException;

    /**
     * 更新邮寄地址
     */
    BaseResultDto updateUserMailingAddress(WasabiSaveUserMailingAddressEntity entity) throws ServiceException;

    /**
     * 查看用户详情
     */
    BaseResultDto merchantUserSingle(Long customId) throws ServiceException;

    /**
     * 手动审核KYC认证
     */
    BaseResultDto manualSubmitKyc(CardKycApproveEntity entity) throws ServiceException;

    /**
     * 开卡申请
     */
    BaseResultDto applyCard(CardApplyEntity entity) throws Exception;

    /**
     * 开卡审批
     */
    BaseResultDto cardApplyApprove(CardApplyApproveEntity entity) throws Exception;

    /**
     * 用户开卡申请详情
     */
    BaseResultDto cardApplyDetails(BaseEntity entity) throws ServiceException;

    /**
     * 查询开卡进度
     */
    BaseResultDto queryApplyProgress(CardApplyProgressEntity request) throws Exception;

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

    /**
     * 激活卡
     */
    BaseResultDto<WasabiActiveCardDto> activeCard(WasabiActiveCardEntity entity) throws ServiceException;

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

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

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

    /**
     * 调整余额
     */
    BaseResultDto updateBalance(WasabiUpdateBalanceEntity entity) throws ServiceException;

    /**
     * 冻结卡 v2
     */
    BaseResultDto cardFreeze(WasabiFreezeAndUnfreezeEntity entity) throws Exception;

    /**
     * 解冻卡 v2
     */
    BaseResultDto cardUnfreeze(WasabiFreezeAndUnfreezeEntity entity) throws Exception;

    /**
     * 卡充值申请
     */
    BaseResultDto cardDeposit(WasabiBalanceEntity entity) throws ServiceException;

    /**
     * 卡充值审核
     */
    BaseResultDto cardDepositApprove(WasabiDepositApproveEntity entity) throws Exception;

    /**
     * 卡扣款
     */
    BaseResultDto cardWithdraw(WasabiWithdrawEntity entity) throws Exception;

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

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

    /**
     * 用户钱包余额
     */
    BaseResultDto<WalletBalanceDto> walletBalance(WalletBalanceEntity entity) throws ServiceException;

    /**
     * 用户钱包流水
     */
    ResultWithPagerDto<CardWalletRecordDto> getCardWalletRecordPageList(CardWalletRecordPageEntity entity) throws ServiceException;

    /**
     * 查询充值订单
     */
    BaseResultDto queryDepositOrder(CardRechargeOrderQueryEntity entity) throws Exception;

    /**
     * 更新实体卡PIN
     */
    BaseResultDto<WasabiUpdatePinDto> updatePin(WasabiUpdatePinEntity entity) throws ServiceException;

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

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

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

    /**
     * 获取职业信息列表
     */
    BaseResultDto<List<WasabiOccupationsDto>> getOccupationList() throws ServiceException;

    /**
     * 更新职业信息列表
     */
    void updateOccupationList() throws ServiceException;

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

    /**
     * 卡交易通知
     */
    void cardTransactionNotify(WasabiTransactionDto dto) throws Exception;

    /**
     * 卡授权交易通知
     */
    void cardAuthTransactionNotify(WasabiAuthTransactionDto dto) throws ServiceException;

    /**
     * 卡授权交易冲正通知
     */
    void cardFeePatchNotify(WasabiFeePatchNotifyDto dto) throws ServiceException;

    /**
     * 卡3ds通知
     */
    void card3dsNotify(WasabiThird3dsTransactionDto dto) throws ServiceException;

    /**
     * 持卡人通知
     */
    void cardHolderNotify(WasabiHolderQueryDto dto) throws ServiceException;

    /**
     * 实体卡事件通知
     */
    void physicalCardNotify(WasabiPhysicalCardNotifyDto dto) throws ServiceException;

    /**
     * 速汇交易通知
     */
    void expressRemittanceTransactionNotify(WasabiTransactionTransferDto dto) throws ServiceException;

    /**
     * 刷新卡信息
     */
    BaseResultDto refreshCardInfo(CardInfoRefreshEntity entity) throws ServiceException;

    /**
     * 查询激活码
     */
    BaseResultDto<WasabiThird3dsTransactionDto> getActivationCode(WasabiThird3dsTransactionEntity entity) throws ServiceException;

    /**
     * 银行卡交易信息数据定时同步
     */
    void queryOrderInfo() throws ServiceException;

    /**
     * 激活中数据同步
     */
    void queryCardInfo() throws Exception;

    /**
     * 卡邮寄状态同步
     */
    void queryCardLogisticsStatus() throws Exception;

    /**
     * 获取身份认证链接
     */
    BaseResultDto getWebsdkLink(WebsdkLinkAliEntity entity, Long customId) throws ServiceException;

    /**
     * 新增权限
     */
    BaseResultDto addPermission(CardPermissionAddEntity entity) throws ServiceException;

    /**
     * 修改权限
     */
    BaseResultDto updatePermission(CardPermissionUpdateEntity entity) throws ServiceException;

    /**
     * 删除权限
     */
    BaseResultDto deletePermission(CardPermissionDeleteEntity entity) throws ServiceException;

    /**
     * 权限分页列表
     */
    ResultWithPagerDto<CardPermissionDto> queryPermissionPageList(CardPermissionPageEntity entity) throws ServiceException;

    /**
     * 权限验证
     */
    BaseResultDto permissionVerify(CustomInfoEntity entity) throws ServiceException;

    /**
     * 操作记录分页列表
     */
    ResultWithPagerDto<CardOperateDto> queryOperatePageList(CardOperatePageEntity entity) throws ServiceException;

    /**
     * kyc认证详情
     */
    BaseResultDto kycStatusSingle(SingleLongEntity entity) throws ServiceException;

    /**
     * 重新充值默认开卡金额
     */
    BaseResultDto rechargeDefaultAmount(CardRechargeDefaultAmountEntity entity) throws Exception;

    /**
     * 卡扣款分页列表
     */
    ResultWithPagerDto<CardWithdrawDto> queryCardWithdrawPage(CardWithdrawPageEntity entity) throws ServiceException;

    /**
     * 卡3ds分页列表
     */
    ResultWithPagerDto<Card3dsTransactionDto> queryCard3dsTransactionPage(Card3dsTransactionPageEntity entity) throws ServiceException;

    /**
     * 校验实体卡卡号是否使用过
     */
    BaseResultDto cardNumberVerify(CardNumberVerifyEntity entity) throws ServiceException;

    /**
     * 手动上传证件照
     */
    BaseResultDto uploadCardPhotoManually(CardPhotoUploadManuallyEntity entity) throws ServiceException;

    /**
     * 配置用户汇率
     */
    BaseResultDto cardUserRateConfig(CardUserRateConfigEntity entity) throws ServiceException;

    /**
     * 扫码上传文件
     */
    BaseResultDto scanUpload(CardWebSocketEntity entity) throws ServiceException;

    /**
     * 用户信息导出
     */
    BaseResultDto<List<MerchantUserDto>> merchantUserListExport(MerchantUserPageEntity entity) throws ServiceException;

    /**
     * kyc认证列表导出
     */
    BaseResultDto<List<CardKycStatusDto>> merchantKycListExport(CardKycStatusPageEntity entity) throws ServiceException;

    /**
     * 卡片申请列表导出
     */
    BaseResultDto<List<CardApplyDto>> cardApplyListExport(CardApplyPageEntity entity) throws ServiceException;

    /**
     * 卡片列表导出
     */
    BaseResultDto<List<UcardCardDto>> cardListExport(CardPageEntity entity) throws ServiceException;

    /**
     * 交易记录列表导出
     */
    BaseResultDto<List<CardTransacOrderDto>> cardTransacRecordExport(CardTransacOrderPageEntity request) throws ServiceException;

    /**
     * 充值记录导出
     */
    BaseResultDto<List<CardRechargeOrderDto>> cardRechargeListExport(CardRechargePageEntity entity) throws ServiceException;

    /**
     * 钱包余额记录列表导出
     */
    BaseResultDto<List<CardWalletRecordDto>> cardWalletRecordExport(CardWalletRecordPageEntity request) throws ServiceException;

    /**
     * 操作记录列表导出
     */
    BaseResultDto<List<CardOperateDto>> cardOperateRecordExport(CardOperatePageEntity entity) throws ServiceException;

    /**
     * 速汇订单列表导出
     */
    BaseResultDto<List<GlobalOrderDto>> globalOrderListExport(GlobalOrderPageEntity entity) throws ServiceException;

    /**
     * 3ds列表导出
     */
    BaseResultDto<List<Card3dsTransactionDto>> card3dsTransactionListExport(Card3dsTransactionPageEntity entity) throws ServiceException;

    /**
     * 卡扣款列表导出
     */
    BaseResultDto<List<CardWithdrawDto>> cardWithdrawListExport(CardWithdrawPageEntity entity) throws ServiceException;

    /**
     * 修改卡类型配置
     */
    BaseResultDto updateCardTypeConfig(CardTypeConfigUpdateEntity entity) throws ServiceException;

    /**
     * 证件类型配置列表
     */
    ResultWithPagerDto<CardIdTypeConfigDto> getCardIdTypeConfigList(CardIdTypeConfigPageEntity entity) throws ServiceException;

    /**
     * 批量新增证件类型配置
     */
    BaseResultDto batchAddCardIdTypeConfig(List<CardIdTypeConfigAddEntity> entitys) throws ServiceException;

    /**
     * 修改证件类型配置
     */
    BaseResultDto updateCardIdTypeConfig(CardIdTypeConfigUpdateEntity entity) throws ServiceException;

    /**
     * 删除证件类型配置
     */
    BaseResultDto deleteCardIdTypeConfig(BaseDeleteEntities entity) throws ServiceException;

    /**
     * 校验谷歌验证码查询cvv码
     */
    BaseResultDto cardQueryCvv(CardVerifyGoogleCodeEntity entity) throws ServiceException;

    /**
     * 校验谷歌验证码
     */
    void validateGoogleAuthenticatorCode(CardVerifyGoogleCodeEntity entity) throws ServiceException;

    /**
     * 根据卡号查询卡信息
     */
    BaseResultDto queryCardInfoByCardNumber(CardInfoQueryEntity entity) throws ServiceException;

    /**
     * 导入卡号
     */
    BaseResultDto cardNumberImport(List<CardNumberAddEntity> entityList) throws ServiceException;

    /**
     * 卡号列表
     */
    ResultWithPagerDto<CardNumberDto> queryCardNumberList(CardNumberPageEntity entity) throws ServiceException;

    /**
     * 卡号下拉列表
     */
    BaseResultDto<CardNumberDto> queryCardNumberDropdown(CardNumberPageEntity entity) throws ServiceException;

    /**
     * 修改卡号状态
     */
    BaseResultDto saveCardNumberStatus(CardNumberUpdateEntity entity) throws ServiceException;

    /**
     * 删除实体卡卡号
     */
    BaseResultDto deleteCardNumber(BaseDeleteEntities entity) throws ServiceException;

    /**
     * 查询CVV发送验证码
     */
    void queryCvvSendCode(CardQueryCvvSendEmailCodeEntity entity) throws ServiceException;

    /**
     * 验证邮箱验证码查询cvv
     */
    BaseResultDto queryCvvVerifyCode(CardQueryCvvVerifyEmailCodeEntity entity) throws ServiceException;

    /**
     * 添加宣传视频
     */
    BaseResultDto cardFileAdd(CardFileAddEntity entity) throws ServiceException;

    /**
     * 修改宣传视频
     */
    BaseResultDto cardFileUpdate(CardFileUpdateEntity entity) throws ServiceException;

    /**
     * 删除宣传视频
     */
    BaseResultDto cardFileDelete(BaseDeleteEntities entity) throws ServiceException;

    /**
     * 视频分页列表
     */
    ResultWithPagerDto<CardFileDto> cardFileSearchList(CardFilePageEntity entity) throws ServiceException;

    /**
     * 同步币种信息
     */
    BaseResultDto saveAvailableCurrencies() throws ServiceException;

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

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

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

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

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

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

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

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

    /**
     * 查询账户信息
     */
    BaseResultDto cardAccountDropdown(CardAccountDropdownEntity entity) throws ServiceException;

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

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

    /**
     * 查询速汇订单列表
     */
    ResultWithPagerDto<GlobalOrderDto> 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;

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

    /**
     * 查询认证成功用户列表
     */
    BaseResultDto<List<MerchantUserDto>> queryUcardUserList() throws ServiceException;

    /**
     * 加密货币交易分页列表导出
     */
    BaseResultDto<List<EncryptedWalletTransactionDto>> encryptedWalletTransactionListExport(EncryptedWalletTransactionPageEntity entity) throws ServiceException;

    /**
     * 区块链汇率配置列表
     */
    ResultWithPagerDto<CardBlockchainRateConfigDto> getCardBlockchainRateConfigPageList(CardBlockchainRateConfigPageEntity entity) throws ServiceException;

    /**
     * 新增区块链汇率配置
     */
    BaseResultDto addCardBlockchainRateConfig(CardBlockchainRateConfigAddEntity entity) throws ServiceException;

    /**
     * 修改区块链汇率配置
     */
    BaseResultDto updateCardBlockchainRateConfig(CardBlockchainRateConfigUpdateEntity entity) throws ServiceException;

    /**
     * 批量删除区块链汇率配置
     */
    BaseResultDto deleteCardBlockchainRateConfig(BaseDeleteEntities entity) throws ServiceException;

    String commonUpload(MultipartFile file, String middlePath) throws Exception;

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

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

    /**
     * 区块链配置列表
     */
    ResultWithPagerDto<CardBlockchainConfigDto> getCardBlockchainConfigPageList(CardBlockchainConfigPageEntity entity) throws ServiceException;

    /**
     * 区块链配置下拉列表
     */
    BaseResultDto getCardBlockchainConfigDropdown(CardBlockchainConfigDropdownEntity entity) throws ServiceException;

    /**
     * 区块链下拉列表
     */
    BaseResultDto<List<String>> getCardBlockchainDropdown() throws ServiceException;

    /**
     * 新增区块链配置
     */
    BaseResultDto addCardBlockchainConfig(CardBlockchainConfigAddEntity entity) throws ServiceException;

    /**
     * 修改区块链配置
     */
    BaseResultDto updateCardBlockchainConfig(CardBlockchainConfigUpdateEntity entity) throws ServiceException;

    /**
     * 删除区块链配置
     */
    BaseResultDto deleteCardBlockchainConfig(BaseDeleteEntities entity) throws ServiceException;

    /**
     * 加密货币交易分页列表
     */
    ResultWithPagerDto<EncryptedWalletTransactionDto> getEncryptedWalletTransactionPage(EncryptedWalletTransactionPageEntity entity) throws ServiceException;
}
