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.*;
import com.crm.rely.backend.core.entity.base.BaseEntity;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.ucard.*;
import com.crm.rely.backend.core.entity.wasabi.*;
import com.crm.rely.backend.core.pojo.table.FinanceBalanceTable;
import com.crm.rely.backend.core.pojo.table.ucard.CardApplyTable;
import com.crm.rely.backend.core.pojo.table.ucard.UcardCardTable;
import com.crm.rely.backend.exception.ServiceException;

import java.util.List;

public interface UcardCardService {

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

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

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

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

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

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

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

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

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


    void updateCardLogisticsStatus(UcardCardTable ucardCardTable) throws ServiceException;

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


    void deductionCallback(FinanceBalanceTable entity) throws Exception;

    /**
     * 创建持卡人或开卡失败
     */
    void failure(CardApplyTable table) throws Exception;


    void refundCallback(FinanceBalanceTable balanceTable) throws Exception;

    void callbackCardApplyProgress(CardApplyTable table) throws Exception;

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

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

    /**
     * 获取卡余额
     */
    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 Exception;

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

    /**
     * 卡扣款
     */
    BaseResultDto cardWithdraw(WasabiWithdrawEntity entity) 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 Exception;

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

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

    void activateCallback(UcardCardTable cardTable) throws Exception;

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

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

    /**
     * 操作记录分页列表
     */
    ResultWithPagerDto<CardOperateDto> queryOperatePageList(CardOperatePageEntity 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 uploadCardPhotoManually(CardPhotoUploadManuallyEntity entity) throws ServiceException;

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

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

    /**
     * 获取卡片申请列表
     */
    ResultWithPagerDto<CardApplyDto> getCardApplyPageList(CardApplyPageEntity entity) throws ServiceException;

    /**
     * 充值记录分页查询
     */
    BaseReportResultDto<List<CardRechargeOrderDto>, CardRechargeOrderSumDto> queryRechargePageList(CardRechargePageEntity request) throws ServiceException;

    /**
     * 查询国家和城市
     */
    List<CardCountryDto> getCardCountryList(CardCountryEntity request);

    /**
     * 查询交易记录分页列表
     */
    ResultWithPagerDto<CardTransacOrderDto> getTransacOrderPageList(CardTransacOrderPageEntity request) throws ServiceException;

    /**
     * 获取卡片类型列表
     */
    ResultWithPagerDto<CardTypeDto> getCardTypePageList(CardTypePageEntity entity) throws Exception;

    /**
     * 商户用户分页列表
     */
    ResultWithPagerDto<MerchantUserDto> getMerchantUserPageList(MerchantUserPageEntity entity) throws ServiceException;

    /**
     * 获取卡片列表
     */
    ResultWithPagerDto<UcardCardDto> getCardPageList(CardPageEntity entity) throws ServiceException ;

    /**
     * 获取我的卡片列表
     */
    List<UcardCardDto> getCardList(CardPageEntity entity) throws ServiceException;

    /**
     * 获取卡片详情
     */
    UcardCardDto getCardSingle(SingleLongEntity entity) throws ServiceException;

    /**
     * 获取交易纪录详情
     */
    CardTransacOrderDto getTransactionSingle(SingleLongEntity entity) throws ServiceException;

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

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

}
