51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
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<Ticket> RequestedTickets { get; set; } = new List<Ticket>();
|
|
public ICollection<Ticket> AssignedTickets { get; set; } = new List<Ticket>();
|
|
public ICollection<TicketComment> Comments { get; set; } = new List<TicketComment>();
|
|
public ICollection<KnowledgeBaseArticle> Articles { get; set; } = new List<KnowledgeBaseArticle>();
|
|
public ICollection<ActivityLog> ActivityLogs { get; set; } = new List<ActivityLog>();
|
|
}
|