package com.jkcredit.invoice.service.customer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jkcredit.invoice.model.entity.CustomerRecharge;
import com.jkcredit.invoice.model.entity.customer.Customer;
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
import com.jkcredit.invoice.util.RespR;

/**
 * 客户操作接口
 * @author mumuxigua
 */
public interface CustomerService extends IService<Customer> {
    /**
     * 查找所有客户
     *
     * @param page
     * @param customer
     * @return
     */
    IPage findAllCustomers(Page page, Customer customer);

    /**
     * 查找所有客户
     *
     * @param page
     * @param customer
     * @return
     */
    IPage findAllNomoneyCustomers(Page page, Customer customer);

    /**
     * 查找所有客户
     *
     * @param page
     * @param customer
     * @return
     */
    IPage findAllNomoneyCustomersByZero(Page page, Customer customer);

    /**
     * 查找所有客户
     *
     * @param customer
     * @return
     */
    Boolean addCustomers(Customer customer);

    /**
     * 修改用户状态
     *
     * @param customer
     * @return
     */
    Boolean updateCustomer(Customer customer);

    /**
     * 账号充值
     *
     * @param customerRecharge
     * @return
     */
    Boolean customRecharge(CustomerRecharge customerRecharge);

    /**
     * 协议上传
     *
     * @param customerRec
     * @return
     */
    RespR contractAdd(CustomerRec customerRec);
    /**
     * 承诺协议上传
     *
     * @param customerRec
     * @return
     */
    RespR promiseAdd(CustomerRec customerRec);
      /**
     * 协议下载
     *
     * @param id
     * @return
     */
    RespR contractDownload(String id);


    /**
     * 生成文档下载
     *
     * @param id
     * @return
     */
    RespR generateWordDownload(String id);

    /**
     * 用户备案
     *
     * @param customerRec
     * @return
     */
    RespR customeRec(CustomerRec customerRec);

    /**
     * 查询企业备案信息
     *
     * @param customerRec
     * @return
     */
    RespR customerRecQuery(CustomerRec customerRec);

    /**
     * 更新企业备案状态
     *
     * @param customerRec
     * @return
     */
    RespR updateCustomerRecStatus(CustomerRec customerRec);


    /**
     * 修改用户状态
     *
     * @param customer
     * @return
     */
    Customer getCustomerByAppKeyAndAppSecret(Customer customer);

    /**
     * 余额校验
     *
     * @param customerName
     * @return
     */
    boolean checkMoneyEnough(String customerName);


    /**
     * 协议上传失败 状态确认
     *
     * @param customerRec
     * @return
     */
    RespR contractStatusFail(CustomerRec customerRec);

    /**
     * 协议上传成功，审批中状态确认
     *
     * @param customerRec
     * @return
     */
    RespR contractStatusProcess(CustomerRec customerRec);

    /**
     * 备案成功状态确认
     *
     * @param customerRec
     * @return
     */
    RespR contractStatusSuccess(CustomerRec customerRec);


    /**
     * 修改备案邮箱
     *
     * @param customerRec
     * @return
     */
    RespR customerRecEditMail(CustomerRec customerRec);
}
