
package com.tmerclub.cloud.multishop.service;

import com.tmerclub.cloud.api.multishop.vo.ShopBankCardVO;
import com.tmerclub.cloud.api.multishop.vo.ShopDetailVO;
import com.tmerclub.cloud.multishop.dto.AllinpayShopBankCardDTO;
import com.tmerclub.cloud.multishop.dto.ShopBankCardDTO;
import com.tmerclub.cloud.multishop.model.ShopBankCard;
import com.tmerclub.cloud.multishop.vo.ShopCompanyVO;

import java.util.List;

/**
 * @Author lth
 * @Date 2021/4/25 17:02
 */
public interface ShopBankCardService {

    /**
     * 保存
     * @param shopBankCard
     */
    void save(ShopBankCard shopBankCard);

    /**
     * 批量新增结算银行账户
     * @param shopBankCardDTOList
     * @param shopId
     */
    void insertBatch(List<ShopBankCardDTO> shopBankCardDTOList, Long shopId);

    /**
     * 根据店铺id获取银行卡列表
     * @param shopId
     * @return
     */
    List<ShopBankCardVO> listByShopId(Long shopId);

    /**
     * 根据银行卡id删除银行卡信息
     * @param shopBankCardId
     * @param shopId
     */
    void deleteByShopBankCardId(Long shopBankCardId, Long shopId);

    /**
     * 批量新增结算银行账户并提交开店申请
     * @param shopBankCardDTOList
     * @param shopId
     */
    void insertBatchAndSubmitApply(List<ShopBankCardDTO> shopBankCardDTOList, Long shopId);

    /**
     * 将对公户信息和之前提交的工商信息一起交给通联去审核
     * @param allinpayShopBankCardDTO
     * @param shopId
     * @param shopCompany
     */
    void insertAndSetCompanyInfo(AllinpayShopBankCardDTO allinpayShopBankCardDTO, Long shopId,
                                 ShopCompanyVO shopCompany);

    /**
     * 通联设置企业信息
     * @param allinpayShopBankCardDTO
     * @param shopId
     * @param shopCompany
     * @param shopDetailVO
     */
    void allinpaySetCompanyInfo(AllinpayShopBankCardDTO allinpayShopBankCardDTO, Long shopId,
                                ShopCompanyVO shopCompany, ShopDetailVO shopDetailVO);

    /**
     * 更新通联店铺状态为成功
     * @param shopId
     */
    void updateShopAllinpayStatusToSuccess(Long shopId);

    /**
     * 更新店铺银行卡信息
     * @param shopBankCardDTO 银行卡信息
     * @param shopId 店铺id
     */
    void updateByShopId(ShopBankCardDTO shopBankCardDTO, Long shopId);

    /**
     * 设置银行卡为主账号
     * @param shopBankCardId
     * @param shopId
     */
    void setPrimaryByShopId(Long shopBankCardId, Long shopId);

    /**
     * 设置银行卡不为主账号
     * @param shopBankCardId
     * @param shopId
     */
    void setNotPrimaryByShopId(Long shopBankCardId, Long shopId);

    /**
     * 保存单个银行卡信息
     * @param shopBankCardDTO
     * @param shopId
     */
    void insertByShopId(ShopBankCardDTO shopBankCardDTO, Long shopId);

    /**
     * 根据银行卡id获取银行卡信息
     * @param shopBankCardId
     * @return
     */
    ShopBankCardVO getByShopBankCardId(Long shopBankCardId);

    /**
     * 根据银行卡id与店铺id获取银行卡信息
     * @param shopBankCardId
     * @param shopId
     * @return
     */
    ShopBankCardVO getByShopBankCardIdAndShopId(Long shopBankCardId, Long shopId);

    /**
     * 根据店铺id删除银行卡信息
     * @param shopId
     */
    void deleteByShopId(Long shopId);

    /**
     * 刷新银行卡
     * @param shopId
     */
    void refresh(Long shopId);
}
