package com.yimeng.okr.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yimeng.okr.enums.UserRole;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("sys_user")
public class SysUser {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String username;
    private String passwordHash;
    private String realName;
    private String email;
    private String position;
    private Long departmentId;
    private Long superiorId;

    @TableField("role")
    private UserRole role;

    private String scopes;  // JSON array: ["dept:3","dept:5"]
    private String status;
    private LocalDateTime disabledAt;
    private LocalDateTime leftAt;

    @TableLogic
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
