using System.ComponentModel.DataAnnotations;

namespace Database.Models
{
    public class User : BaseEntity
    {
        [Required]
        [MaxLength(100)]
        public string Username { get; set; } = string.Empty;
        
        [Required]
        public string PasswordHash { get; set; } = string.Empty;
        
        [Required]
        [MaxLength(50)]
        public string Role { get; set; } = "User"; // Admin, User, ReadOnly
        
        public DateTime? LastLogin { get; set; }
        
        public string? Email { get; set; }
        
        public string? FirstName { get; set; }
        
        public string? LastName { get; set; }
        
        public bool IsActive { get; set; } = true;
        
        public string FullName => $"{FirstName} {LastName}".Trim();
    }
}