using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using HelpDesk.Models.Enums; namespace HelpDesk.Models.Entities; [Table("users")] public class User { [Key] public Guid Id { get; set; } [Required] [MaxLength(100)] public string FirstName { get; set; } = string.Empty; [Required] [MaxLength(100)] public string LastName { get; set; } = string.Empty; [Required] [MaxLength(256)] public string Email { get; set; } = string.Empty; [Required] [MaxLength(500)] public string PasswordHash { get; set; } = string.Empty; [Required] [MaxLength(50)] public UserRole Role { get; set; } = UserRole.Customer; public bool IsActive { get; set; } = true; [MaxLength(50)] public string? PhoneNumber { get; set; } [MaxLength(500)] public string? AvatarUrl { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; // Navigation public ICollection RequestedTickets { get; set; } = new List(); public ICollection AssignedTickets { get; set; } = new List(); public ICollection Comments { get; set; } = new List(); public ICollection Articles { get; set; } = new List(); public ICollection ActivityLogs { get; set; } = new List(); }