//
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
//
using Astral.Core.Attributes.EntityAnnotation;
using Astral.Core.Constants;
namespace Astral.Core.Entities;
///
/// Refresh token entity.
///
[TableMapping("refreshTokens")]
public class RefreshToken
{
///
/// Token identifier.
///
[PrimaryKey]
[ColumnMapping("token")]
public string Token { get; set; }
///
/// User id the token belongs to.
///
[ColumnMapping("userId")]
public Guid UserId { get; set; }
///
/// Ip address of the agent the token granted to.
///
[ColumnMapping("ipAddress")]
public string IpAddress { get; set; }
///
/// Session agent role.
///
[ColumnMapping("role")]
public UserRole Role { get; set; }
///
/// Session token scope.
///
[ColumnMapping("scope")]
public TokenScope Scope { get; set; }
///
/// When the token expires.
///
[ColumnMapping("expires")]
public DateTime Expires { get; set; }
///
/// When the token was created.
///
[ColumnMapping("createdAt")]
public DateTime CreatedAt { get; set; }
}