package com.sundot.airport.attendance.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sundot.airport.common.annotation.Excel;
import com.sundot.airport.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 打卡记录对象 attendance_check_record
 *
 * @author wangchong
 * @date 2025-07-10
 */
@Data
public class AttendanceCheckRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 租户号
     */
    private String tenantId;

    /**
     * 乐观锁
     */
    private Long revision;

    /**
     * 主键
     */
    private Long id;

    /**
     * 打卡人ID
     */
    private Long userId;

    /**
     * 打卡类型
     */
    private String checkInType;

    /**
     * 打卡时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 3)
    private Date checkInTime;

    /**
     * 打卡位置
     */
    private String checkInPosition;

    /**
     * 打卡人名称
     */
    @Excel(name = "打卡人姓名", sort = 1)
    private String userName;

    /**
     * 备注
     */
    @Excel(name = "备注", sort = 4)
    private String remark;

    /**
     * 打卡类型名称
     */
    @Excel(name = "打卡类型名称", sort = 2)
    private String checkInTypeDesc;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("tenantId", getTenantId())
                .append("revision", getRevision())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("id", getId())
                .append("userId", getUserId())
                .append("checkInType", getCheckInType())
                .append("checkInTime", getCheckInTime())
                .append("userName", getUserName())
                .append("remark", getRemark())
                .append("checkInTypeDesc", getCheckInTypeDesc())
                .append("checkInDate", getCheckInDate())
                .toString();
    }

    /**
     * 打卡日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date checkInDate;


    /**
     * 打卡日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date checkInDateStart;


    /**
     * 打卡日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date checkInDateEnd;
    /**
     * 是否为梭班打卡
     */
    private Boolean shuttleShift;
    /**
     * 班次类型标识,SHUTTLE"表示梭班,后期有什么标识可以扩展
     */
    private String shiftType;
}
