package jnpf.model.attendance.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 考勤本记录DTO
 *
 * @author Generated
 * @create 2026-04-21
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "考勤本记录DTO")
public class AttendanceBookRecordDto {

    /**
     * 主键ID（更新时必填，新增时为空）
     */
    @Schema(description = "主键ID（更新时必填，新增时为空）")
    private String id;

    /**
     * 考勤本ID
     */
    @NotBlank(message = "考勤本ID不能为空")
    @Schema(description = "考勤本ID", required = true)
    private String bookId;

    /**
     * 员工ID
     */
    @NotBlank(message = "员工ID不能为空")
    @Schema(description = "员工ID", required = true)
    private String userId;

    /**
     * 考勤日期
     */
    @NotNull(message = "考勤日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "考勤日期", required = true, example = "2026-04-21")
    private Date day;

    /**
     * 时段类型（1:上班卡 2:下班卡）
     */
    @NotNull(message = "时段类型不能为空")
    @Schema(description = "时段类型（1:上班卡 2:下班卡）", required = true, allowableValues = {"1", "2"})
    private Integer periodType;

    /**
     * 考勤状态（1001:正常 1002:迟到 1003:早退 1004:缺卡 3005:请假 2006:出差 2007:外出 2008:外勤 1009:旷工 1010:公休）
     */
    @Schema(description = "考勤状态", required = true)
    private Integer attendanceStatus;

    /**
     * 请假类型（如：事假、病假、年假、婚假、产假等）
     */
    @Schema(description = "请假类型（如：事假、病假、年假、婚假、产假等）")
    private String leaveType;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
}
