package com.cm.central.control.service.customer;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.central.control.pojo.dtos.customer.CustomerDTO;
import com.cm.central.control.pojo.vos.customer.CustomerVO;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: ICustomerService
 * @Description: 客户管理
 * @Author: WenG
 * @Date: 2020-07-30 19:00
 * @Version: 1.0
 **/
public interface ICustomerService {

    /**
     * 新增客户管理
     *
     * @param customerVO
     * @return
     * @throws Exception
     */
    SuccessResult saveCustomer(CustomerVO customerVO) throws Exception;

    /**
     * 新增客户管理(APP)
     *
     * @param token
     * @param customerVO
     * @return
     * @throws Exception
     */
    SuccessResult saveCustomerByToken(String token, CustomerVO customerVO) throws Exception;

    /**
     * 新增客户管理
     *
     * @param customerVO
     * @return customerId
     * @throws Exception
     */
    String saveCustomerReturnId(CustomerVO customerVO) throws Exception;

    /**
     * 新增客户管理(APP)
     *
     * @param token
     * @param customerVO
     * @return customerId
     * @throws Exception
     */
    String saveCustomerByTokenReturnId(String token, CustomerVO customerVO) throws Exception;

    /**
     * 删除客户管理
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeCustomer(String ids) throws RemoveException;

    /**
     * 删除客户管理（物理删除）
     *
     * @param ids
     * @throws RemoveException
     */
    void deleteCustomer(String ids) throws RemoveException;

    /**
     * 删除客户管理(APP)
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeCustomerByToken(String token, String ids) throws RemoveException;

    /**
     * 修改客户管理
     *
     * @param customerId
     * @param customerVO
     * @return
     * @throws Exception
     */
    SuccessResult updateCustomer(String customerId, CustomerVO customerVO) throws Exception;

    /**
     * 修改客户管理(APP)
     *
     * @param token
     * @param customerId
     * @param customerVO
     * @return
     * @throws Exception
     */
    SuccessResult updateCustomerByToken(String token, String customerId, CustomerVO customerVO) throws Exception;

    /**
     * 客户管理详情(通过ID)
     *
     * @param customerId
     * @return
     * @throws SearchException
     */
    CustomerDTO getCustomerById(String customerId) throws SearchException;

    /**
     * 客户管理列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<CustomerDTO> listCustomer(Map<String, Object> params) throws SearchException;

    /**
     * 客户管理分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<CustomerDTO>> listPageCustomer(ListPage page) throws SearchException;

    /**
     * 客户管理统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer countNumberCustomer(Map<String, Object> params) throws SearchException;

    /**
     * 客户管理统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    SuccessResultData<Integer> countCustomer(Map<String, Object> params) throws SearchException;

}