galaeth-draft/Galaeth.Core/Entities/User.cs
2024-11-17 09:31:01 +00:00

79 lines
1.8 KiB
C#

using Galaeth.Core.Attributes.EntityAnnotation;
using Galaeth.Core.Constants;
namespace Galaeth.Core.Entities;
/// <summary>
/// User entity.
/// </summary>
[TableMapping("users")]
public class User
{
/// <summary>
/// User id.
/// </summary>
[ColumnMapping("id")]
[PrimaryKey]
public Guid Id { get; set; }
/// <summary>
/// When the user was created.
/// </summary>
[ColumnMapping("createdAt")]
public DateTime CreatedAt { get; set; }
/// <summary>
/// When the user's entity was last updated.
/// </summary>
[ColumnMapping("updatedAt")]
public DateTime UpdatedAt { get; set; }
/// <summary>
/// The user's name.
/// </summary>
[ColumnMapping("username")]
public string Username { get; set; }
/// <summary>
/// The user's email address.
/// </summary>
[ColumnMapping("email")]
public string EmailAddress { get; set; }
/// <summary>
/// Authentication hash.
/// </summary>
[ColumnMapping("authHash")]
public string PasswordHash { get; set; }
/// <summary>
/// Authentication salt.
/// </summary>
[ColumnMapping("authSalt")]
public string PasswordSalt { get; set; }
/// <summary>
/// The ip address of the creator.
/// </summary>
[ColumnMapping("creatorIp")]
public string CreatorIp { get; set; }
/// <summary>
/// When the user last logged in.
/// </summary>
[ColumnMapping("lastLoggedIn")]
public DateTime LastLoggedIn { get; set; }
/// <summary>
/// The user account's role.
/// </summary>
[ColumnMapping("role")]
public UserRole Role { get; set; }
/// <summary>
/// State of the user's account.
/// </summary>
[ColumnMapping("state")]
public UserState State { get; set; }
}