package cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo;

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;

import static cn.iocoder.lyzsys.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 员工新增/修改 Request VO")
@Data
public class EmployeeSaveReqVO {

    @Schema(description = "员工 ID", example = "1")
    private Long id;

    @Schema(description = "员工姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @NotBlank(message = "员工姓名不能为空")
    @Size(max = 64, message = "员工姓名长度不能超过 64 个字符")
    private String employeeName;

    @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "男")
    @NotBlank(message = "性别不能为空")
    @Size(max = 2, message = "性别长度不能超过 2 个字符")
    private String gender;

    @Schema(description = "所属专业所 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "所属专业所不能为空")
    private Long officeId;

    @Schema(description = "注册类型及等级", example = "一级注册建筑师")
    @Size(max = 100, message = "注册类型及等级长度不能超过 100 个字符")
    private String registrationType;

    @Schema(description = "职称", example = "正高级")
    @Size(max = 50, message = "职称长度不能超过 50 个字符")
    private String jobTitle;

    @Schema(description = "注册章号", example = "A123456")
    @Size(max = 100, message = "注册章号长度不能超过 100 个字符")
    private String registrationSealNo;

    @Schema(description = "入职时间", example = "2026-01-01")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate entryDate;

    @Schema(description = "离职时间", example = "2026-12-31")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate leaveDate;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "在职")
    @NotBlank(message = "状态不能为空")
    @Size(max = 20, message = "状态长度不能超过 20 个字符")
    private String employeeStatus;

    @Schema(description = "备注")
    @Size(max = 255, message = "备注长度不能超过 255 个字符")
    private String remark;

    @Schema(description = "是否所长", example = "false")
    private Boolean officeLeaderFlag;

    @Schema(description = "排序号", example = "1")
    private Integer sortNo;

    @Schema(description = "是否启用", example = "true")
    private Boolean enabledFlag;

}
