package jnpf.model.attendance.dto;

import jnpf.enums.attendance.ApplyTypeEnum;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 打卡dto
 *
 * @author yanwenfu
 * @create 2023-09-18
 */
@Getter
@Setter
@NoArgsConstructor
public class ClockInDto {

    /** 是否极速打卡(1: 是, 0: 否) */
    private Integer fast;
    /** 打卡种类(1: 普通打卡, 2: 外勤打卡) */
    @NotNull(message = "请选择打卡类型")
    private Integer clockInKind;
    /** 原打卡记录id(打卡类型为补卡时必传) */
    private String clockInId;
    /** 图片集合 */
    @Size(max =9, message = "最多上传9张图片")
    private List<String> picUrlList;
    /** 审批编码 */
    private String approvalCode;
    /** 审批类型[用于审批中的打卡] */
    private ApplyTypeEnum applyType;
    /** 打卡地址 */
    private String address;
    /** 经度 */
    private String lng;
    /** 维度 */
    private String lat;
    /** 设备类型 : 1地点打卡 2.考勤机 3.wifi */
    @NotNull(message = "设备类型不能为空")
    private Integer deviceType;
    /** 设备id */
    private String deviceId;
    /** 设备名称 */
    private String deviceName;
    /** 用户id(考勤机使用) */
    private String userId;
    /** 租户id(考勤机使用) */
    private String tenantId;

    /** 备注 */
    private String remark;

    public ClockInDto(Integer clockInKind, String address, Integer deviceType, String deviceId, String deviceName, String userId, String tenantId) {
        this.clockInKind = clockInKind;
        this.address = address;
        this.deviceType = deviceType;
        this.deviceId = deviceId;
        this.deviceName = deviceName;
        this.userId = userId;
        this.tenantId = tenantId;
    }

    public ClockInDto(Integer deviceType, Integer clockInKind, String approvalCode, ApplyTypeEnum applyType, String address, String lng, String lat, String remark) {
        this.deviceType = deviceType;
        this.clockInKind = clockInKind;
        this.approvalCode = approvalCode;
        this.applyType = applyType;
        this.address = address;
        this.lng = lng;
        this.lat = lat;
        this.remark = remark;
    }

    public ClockInDto(Integer clockInKind, String clockInId) {
        this.clockInKind = clockInKind;
        this.clockInId = clockInId;
    }
}
