package com.yaoai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("admin_users")
public class AdminUser {

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

    private String username;

    /** BCrypt; first boot is initialized by AdminInitializer. */
    @JsonIgnore
    private String passwordHash;

    private String displayName;

    private String email;

    /** SUPER_ADMIN / OPERATOR / FINANCE / READONLY */
    private String role;

    /** 1=ACTIVE 0=DISABLED */
    private Integer status;

    private Integer mustChangePassword;

    private LocalDateTime lastLoginAt;

    private String lastLoginIp;

    private Long createdBy;

    private LocalDateTime createdAt;

    private LocalDateTime updatedAt;
}
