40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace FinlyticBackend.Entities;
|
|
|
|
[Table("users")]
|
|
public class UserEntity
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
[Required]
|
|
[MaxLength(150)]
|
|
public string Email { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
public string PasswordHash { get; set; } = string.Empty;
|
|
|
|
[MaxLength(100)]
|
|
public string FullName { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(30)]
|
|
public string Role { get; set; } = "User"; // "Admin" | "User"
|
|
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
public bool RequiresPasswordChange { get; set; } = false;
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime? LastLoginAt { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
public string ThemePreference { get; set; } = "dark_classic";
|
|
|
|
public List<UserDeviceTokenEntity> DeviceTokens { get; set; } = new();
|
|
}
|