using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Nuuru.Server.Models { public class IpBan { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public Guid Id { get; set; } = Guid.NewGuid(); [Required] [MaxLength(45)] // IPv6 max length public string IpAddress { get; set; } = string.Empty; public string? Reason { get; set; } [Required] public DateTime StartTime { get; set; } [Required] public DateTime EndTime { get; set; } public bool Active { get; set; } = true; public bool AppealsDenied { get; set; } = false; public ICollection Appeals { get; set; } = new List(); public Guid? CreatedById { get; set; } public ApplicationUser? CreatedBy { get; set; } public bool IsActive() => Active && DateTime.UtcNow > StartTime && DateTime.UtcNow < EndTime; } }