#ifndef _area_business_person_attendance_hpp_
#define _area_business_person_attendance_hpp_

#include"area_business.h"
#include<rapidjson/document.h>
#include<rapidjson/prettywriter.h>
#include<rapidjson/stringbuffer.h>
#include<websocket/sio/sio_client.h>

struct area_business_person_attendance:area_business
{
    area_business_person_attendance();

    int area_business_type()
    {
        return 5;
    }

    void on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);

    //记录进入时间等信息,开始考勤
    void on_enter(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);

    void on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);

    //记录离开考勤区域信息,结束考勤
    void on_leave(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);

    //    ///升井或收到web的删除卡命令  site_ptr==nullptr表示收到web的删除卡命令
    //    /// 保存考勤记录，发升井json，清理卡
    //    static void up_mine(std::shared_ptr<card_location_base> card_ptr, bool is_web_delete);

    /**
     * @brief 手工升井函数
     */
    static void handle_up_mine(sio::message::ptr const& data);

private:
    ///升井json
    static void _to_json_card_up_one(std::shared_ptr<card_location_base> card_ptr,
                                     rapidjson::Value& out_datas, rapidjson::Document::AllocatorType& allocator);
};


#endif // AREA_BUSINESS_CAR_ATTENDANCE_H


