package cn.iocoder.yudao.module.system.api.user.dto;

import cn.iocoder.yudao.framework.common.validation.IdCard;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Set;

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

@Schema(description = "RPC 服务 - Admin 用户创建 DTO")
@Data
public class UserSaveRespDTO {

    @Schema(description = "用户 ID", example = "1024")
    private Long id;

    @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @Size(max = 30, message = "用户昵称长度不能超过30个字符")
    private String nickname;

    @Schema(description = "部门ID", example = "我是一个用户")
    private Long deptId;

    @Schema(description = "职称编号数组", example = "1")
    private Set<Long> postIds;

    @Schema(description = "岗位编号数", example = "1")
    private Long positionId;

    @Schema(description = "手机号码", example = "15601691300")
    @Mobile
    private String mobile;

    @Schema(description = "用户性别，参见 SexEnum 枚举类", example = "1")
    private Integer sex;

    @Schema(description = "身份证号码")
    @IdCard
    private String idcard;

    @Schema(description = "年龄", example = "23")
    private Integer age;

    @Schema(description = "生日日期", example = "03-23")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate birthdayDay;

    @Schema(description = "入职日期", example = "03-23")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime entryDate;

    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
    private String password;

    @Schema(description = "是否为外勤人员", example = "1")
    private Integer fieldworkFlag;

    @Schema(description = "状态,参见 CommonStatusEnum 枚举", example = "1")
    private Integer status;
}
