package com.reptileclient.jlifeapp.service;

import cn.hutool.core.date.DateTime;
import com.reptileclient.jlifeapp.entity.hm.HmBookTradeOrder;

import java.util.Map;

/**
 * @author fuxubing
 */
public interface HmBookTradeOrderService {


    /**
     * 新增盒马技师作业单
     *
     * @return
     */
    int addHmBookTradeList() throws InterruptedException;

    /**
     * 通过预约手机号一键同步盒马技师作业单数据
     *
     * @param phone
     * @return
     */
    int syncHmBookTradeOrderByPhone(String phone);

    /**
     * 通过服务者手机号 更新当前日期的服务单
     *
     * @param phone
     * @return
     */
    int syncHmBookTradeOrderByServantPhone(String phone);

    /**
     * 查询一条计师服务单
     *
     * @param bookTradeNo
     * @return
     */
    HmBookTradeOrder findByNo(Integer bookTradeNo);

    /**
     * 根据时间删除重复数据
     *
     * @param dateTime
     * @return
     */
    int deleteDistinctData(DateTime dateTime);

    /**
     * 查询最新一条
     *
     * @return
     */
    HmBookTradeOrder selectNewOne();

    /**
     * 更新盒马技师作业单
     *
     * @return
     */
    int updateHmBookTradeList(DateTime startTime,DateTime endTime) throws InterruptedException;


    /**
     * 我已提供服务
     *
     * @param bookTradeNo
     * @return
     */
    Map<String, Object> confirmBookTrade(Integer bookTradeNo);


    /**
     * 我已上门
     * @param bookTradeNo
     * @return
     */
    Map<String, Object> arrivedByMerchant(Integer bookTradeNo);

    int deleteHmBookTradeList(DateTime startTime,DateTime endTime) throws InterruptedException;

}
