using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace GestorFacturas.API.Models; public class RefreshToken { [Key] public int Id { get; set; } [Required] public string Token { get; set; } = string.Empty; public DateTime Expires { get; set; } public DateTime Created { get; set; } = DateTime.UtcNow; public DateTime? Revoked { get; set; } public bool IsPersistent { get; set; } public bool IsExpired => DateTime.UtcNow >= Expires; public bool IsActive => Revoked == null && !IsExpired; public int UsuarioId { get; set; } [ForeignKey("UsuarioId")] [JsonIgnore] public Usuario? Usuario { get; set; } }