package com.crm.pay.service;

import com.crm.pay.entity.FinanceDepositCallbackUpdateEntity;
import com.crm.pay.entity.FinanceDepositCallbackValidateUpdateEntity;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.exception.PayValidatedException;
import com.crm.rely.backend.core.exception.ServiceException;
import com.crm.rely.backend.model.dto.finance.deposit.FinanceDepositDto;
import com.crm.rely.backend.model.entity.finance.deposit.FinanceDepositAddEntity;
import com.crm.rely.backend.model.entity.finance.deposit.FinanceDepositApproveEntity;
import com.crm.rely.backend.model.entity.finance.deposit.FinanceDepositDeleteEntity;
import com.crm.rely.backend.model.entity.finance.deposit.FinanceDepositSearchListEntity;
import com.crm.rely.backend.model.pojo.table.FinanceDepositTable;
import com.crm.rely.backend.model.pojo.table.SysChannelBankTable;
import com.crm.rely.backend.model.pojo.table.SysRemittanceChannelTable;

import java.util.List;

/**
 * @description:
 * @author: houn
 * @create: 2020-05-05 20:16
 */
public interface FinanceDepositService {

    /**
     * 添加支付订单
     *
     * @param financeDepositAddEntity
     * @return
     * @throws ServiceException
     */
    FinanceDepositTable save(FinanceDepositAddEntity financeDepositAddEntity) throws ServiceException, PayValidatedException;

    boolean isIpWhitelist(String channelCode) throws ServiceException;

    /**
     * 添加支付订单
     *
     * @param balanceSaveEntity
     * @param sysRemittanceChannelTable
     * @return
     * @throws ServiceException
     * @throws PayValidatedException
     */
    FinanceDepositTable save(FinanceDepositAddEntity balanceSaveEntity, SysRemittanceChannelTable sysRemittanceChannelTable)
            throws ServiceException, PayValidatedException;

    void updateCallbackValidate(FinanceDepositCallbackValidateUpdateEntity financeDepositCallbackValidateUpdateEntity) throws ServiceException;

    FinanceDepositTable save(FinanceDepositAddEntity balanceSaveEntity, SysChannelBankTable sysChannelBankTable,
                             SysRemittanceChannelTable channel)
            throws ServiceException, PayValidatedException;

    void save(FinanceDepositTable financeDepositTable) throws ServiceException, PayValidatedException;

    FinanceDepositTable approve(FinanceDepositApproveEntity entity) throws ServiceException;

    void delete(FinanceDepositDeleteEntity entity) throws ServiceException;

    ResultWithPagerDto<FinanceDepositDto> searchPageList(FinanceDepositSearchListEntity entity) throws ServiceException;

    BaseResultDto<List<FinanceDepositDto>> searchList(FinanceDepositSearchListEntity entity) throws ServiceException;

    FinanceDepositDto searchSingle(Long id) throws ServiceException;

    void updateCallback(FinanceDepositCallbackUpdateEntity financeDepositCallbackUpdateEntity) throws ServiceException;

    SysChannelBankTable getChannelBank(FinanceDepositAddEntity balanceSaveEntity, SysRemittanceChannelTable channel)
            throws ServiceException;

    FinanceDepositTable getBySerial(String serial) throws ServiceException;

    FinanceDepositTable getByChannelSerial(String serial) throws ServiceException;

}
