package com.hotwj.platform.resourceManagement.personnelConfig.domain.bo;

import com.hotwj.platform.resourceManagement.personnelConfig.domain.HotPersonnelConfig;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.dromara.common.core.constant.RegexConstants;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

/**
 * 人员配置业务对象 hot_personnel_config
 *
 * @author shihongwei
 * @date 2026-01-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = HotPersonnelConfig.class, reverseConvertGenerate = false)
public class HotPersonnelConfigBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 单位ID
     */
    @NotNull(message = "单位ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long unitId;

    /**
     * 人员名称
     */
    @NotBlank(message = "人员名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String staffName;

    /**
     * 联系电话(默认为登录账号)
     */
    @NotBlank(message = "联系电话(默认为登录账号)不能为空", groups = {AddGroup.class, EditGroup.class})
    private String mobile;

    /**
     * 职位身份
     */
    private String positionName;

    /**
     * 权限类型: 1=超级管理员
     */
    @NotNull(message = "权限类型: 1=超级管理员不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long permissionType;

    /**
     * 登录账号
     */
    @NotBlank(message = "登录账号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String loginAccount;

    /**
     * 登录密码
     */
    @NotBlank(message = "登录密码不能为空", groups = {AddGroup.class, EditGroup.class})
    @Length(min = 8, max = 20, message = "{user.password.length.valid}", groups = {AddGroup.class, EditGroup.class})
    @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}", groups = {AddGroup.class, EditGroup.class})
    private String loginPassword;

    /**
     * 是否启用: 1=启用, 0=禁用
     */
    @NotNull(message = "是否启用: 1=启用, 0=禁用不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long isEnabled;

    /**
     * 0=正常, 1=已删除
     */
    private Long isDeleted;


}
