package com.crm.manager.service.ucard;

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.entity.ucard.*;
import com.crm.rely.backend.exception.ServiceException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@FeignClient(name = "UCARD-SERVICE", path = "/ucard/manager")
public interface UcardFeignService {

    /**
     * 获取卡片类型列表
     */
    @PostMapping("/card/types/page")
    ResultWithPagerDto<CardTypeDto> getCardTypePageList(CardTypePageEntity entity) throws ServiceException;

    /**
     * 更新卡片类型列表
     */
    @PostMapping("/card/types")
    BaseResultDto getCardTypes() throws ServiceException;

    /**
     * 商户用户分页列表
     */
    @PostMapping("/merchant/user/page")
    ResultWithPagerDto<MerchantUserDto> getMerchantUserPageList(MerchantUserPageEntity entity) throws ServiceException;

    /**
     * 查询商户账户信息
     */
    @PostMapping("/merchant/account")
    BaseResultDto<List<MerchantAccountDto>> queryMerchantAccount() throws ServiceException;

    /**
     * 商户用户注册
     */
    @PostMapping("/merchant/user/register")
    BaseResultDto registerMerchantUser(MerchantUserEntity request) throws ServiceException;

    /**
     * 更新商户用户信息
     */
    @PostMapping("/merchant/user/update")
    BaseResultDto updateMerchantUser(MerchantUserEntity request) throws ServiceException;

    /**
     * 获取kyc认证分页列表
     */
    @PostMapping("/merchant/kyc/page")
    ResultWithPagerDto<CardKycStatusDto> getKycPageList(CardKycStatusPageEntity entity) throws ServiceException;

    /**
     * 上传KYC附件
     */
    @PostMapping("/merchant/kyc/upload")
    BaseResultDto uploadKycAttachment(KycAttachmentUploadEntity request) throws ServiceException;

    /**
     * 提交KYC认证"
     */
    @PostMapping("/merchant/kyc/submit")
    BaseResultDto submitKyc(KycEntity request) throws ServiceException;

    /**
     * 查询KYC认证状态
     */
    @PostMapping("/merchant/kyc/status")
    BaseResultDto<KycStatusDto> queryKycStatus(KycEntity entity) throws ServiceException;

    /**
     * 申请开卡
     */
    @PostMapping("/card/apply")
    BaseResultDto applyCard(CardApplyEntity request) throws ServiceException;

    /**
     * 查询开卡进度
     */
    @PostMapping("/card/apply/progress")
    BaseResultDto<CardApplyProgressDto> queryApplyProgress(CardApplyProgressEntity request) throws ServiceException;

    /**
     * 获取卡片申请列表
     */
    @PostMapping("/card/apply/page")
    ResultWithPagerDto<CardApplyDto> getCardApplyPageList(CardApplyPageEntity entity) throws ServiceException;

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

    /**
     * 银行卡激活
     */
    @PostMapping("/card/activate")
    BaseResultDto<CardActivateDto> activateCard(CardActivateEntity request) throws ServiceException;

    /**
     * 查询充值预估到账金额
     */
    @PostMapping("/card/recharge/estimate")
    BaseResultDto<CardRechargeEstimateDto> queryRechargeEstimate(CardRechargeEstimateEntity request) throws ServiceException;

    /**
     * 银行卡充值
     */
    @PostMapping("/card/recharge")
    BaseResultDto<CardRechargeDto> rechargeCard(CardRechargeEntity request) throws ServiceException;

    /**
     * 查询充值订单
     */
    @PostMapping("/card/recharge/order")
    BaseResultDto<CardRechargeOrderDto> queryRechargeOrder(CardRechargeOrderQueryEntity request) throws ServiceException;

    /**
     * 查询充值记录
     */
    @PostMapping("/card/recharge/records")
    BaseResultDto<CardRechargeOrderListDto> queryRechargeRecords(CardRechargeRecordQueryEntity request) throws ServiceException;

    /**
     * 充值记录分页查询
     */
    @PostMapping("/card/recharge/page")
    ResultWithPagerDto<CardRechargeOrderDto> queryRechargePageList(CardRechargePageEntity request) throws ServiceException;

    /**
     * 查询卡片余额
     */
    @PostMapping("/card/balance")
    BaseResultDto<List<CardBalanceDto>> queryCardBalance(CardBalanceEntity request) throws ServiceException;


    /**
     * 找回密码
     */
    @PostMapping("/card/password/reset")
    BaseResultDto resetPassword(CardOperateEntity request) throws ServiceException;

    /**
     * 查询交易记录分页列表
     */
    @PostMapping("/card/transac/page")
    ResultWithPagerDto<CardTransacOrderDto> getTransactionPageList(CardTransacOrderPageEntity request) throws ServiceException;

    /**
     * 查询交易记录
     */
    @PostMapping("/card/transac")
    BaseResultDto<CardTransacOrderListDto> queryTransactions(CardTransacQueryEntity request) throws ServiceException;

    /**
     * 冻结卡片
     */
    @PostMapping("/card/freeze")
    BaseResultDto<CardFreezeDto> freezeCard(CardOperateEntity request) throws ServiceException;

    /**
     * 解冻卡片
     */
    @PostMapping("/card/unfreeze")
    BaseResultDto<CardFreezeDto> unfreezeCard(CardOperateEntity request) throws ServiceException;

    /**
     * 查询速汇银行及相关配置
     */
    @PostMapping("/transfer/banks")
    BaseResultDto<List<GlobalTransferBankDto>> queryBankList() throws ServiceException;


    /**
     * 查询法币汇率
     */
    @PostMapping("/transfer/rate")
    BaseResultDto<GlobalExchangeRateDto> queryExchangeRate(GlobalExchangeRateEntity request) throws ServiceException;

    /**
     * 代付校验
     */
    @PostMapping("/transfer/validate")
    BaseResultDto validateTransfer(GlobalPaymentEntity request) throws ServiceException;

    /**
     * 代付付款人校验
     */
    @PostMapping("/transfer/validate/payer")
    BaseResultDto validatePayer(GlobalPayerEntity request) throws ServiceException;

    /**
     * 代付收款人校验
     */
    @PostMapping("/transfer/validate/payee")
    BaseResultDto validatePayee(GlobalPayeeEntity request) throws ServiceException;

    /**
     * 代付
     */
    @PostMapping("/transfer")
    BaseResultDto<GlobalPaymentDto> transfer(GlobalPaymentEntity request) throws ServiceException;

    /**
     * 用户代付订单列表
     */
    @PostMapping("/transfer/orders")
    BaseResultDto<GlobalPaymentOrderListDto> queryOrderList(GlobalTransferOrderEntity request) throws ServiceException;

    /**
     * 用户代付订单分页查询
     */
    @PostMapping("/transfer/page")
    ResultWithPagerDto<GlobalPaymentOrderDto> queryOrderPageList(GlobalPaymentPageEntity request) throws ServiceException;

    /**
     * 提交调单信息或文件
     */
    @PostMapping("/transfer/dispute")
    BaseResultDto submitDispute(GlobalSubmitDisputeEntity request) throws ServiceException;

    /**
     * 查询代付订单结果
     */
    @PostMapping("/transfer/order/result")
    BaseResultDto<GlobalOrderInfoDto> queryOrderResult(GlobalOrderQueryEntity request) throws ServiceException;

    /**
     * 上传文件
     */
    @PostMapping(value = "/upload/file", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    BaseResultDto<String> uploadFile(MultipartFile file) throws ServiceException;

    /**
     * 回调通知
     */
    @PostMapping("/callback/notify")
    BaseResultDto callbackNotify(UcardBaseRequest request) throws ServiceException;

    /**
     * 查询国家和城市
     */
    @PostMapping("/card/country")
    BaseResultDto getCardCountryList(CardCountryEntity request) throws ServiceException;

    /**
     * 更新国家/城市/手机区号
     */
    @PostMapping("/card/update/country")
    BaseResultDto cardUpdateCountry() throws ServiceException;
}
