namespace Jiaowu.Api.Domain.Identity;

public enum AuthenticationClientType
{
    Web = 0,
    App = 1
}

public sealed class RefreshSession
{
    public Guid Id { get; set; } = Guid.NewGuid();
    public Guid UserId { get; set; }
    public ApplicationUser? User { get; set; }
    public required string TokenHash { get; set; }
    public AuthenticationClientType ClientType { get; set; }
    public required string SecurityStamp { get; set; }
    public DateTime ExpiresAt { get; set; }
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime LastRefreshedAt { get; set; } = DateTime.UtcNow;
    public DateTime? RevokedAt { get; set; }
    public Guid? ReplacedBySessionId { get; set; }
}
