2026-02-02 04:45:56 -06:00
|
|
|
namespace FiscalOS.Core.Identity;
|
2026-02-01 06:13:08 -06:00
|
|
|
|
2026-02-02 04:45:56 -06:00
|
|
|
public sealed class User : Entity
|
2026-02-01 06:13:08 -06:00
|
|
|
{
|
2026-02-01 08:07:23 -06:00
|
|
|
public string Username { get; init; } = string.Empty;
|
2026-02-02 04:45:56 -06:00
|
|
|
public string HashedPassword { get; init; } = string.Empty;
|
2026-02-01 08:07:23 -06:00
|
|
|
|
|
|
|
|
public ICollection<RefreshToken> RefreshTokens { get; init; } = [];
|
2026-02-02 13:17:43 -06:00
|
|
|
|
|
|
|
|
private User()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static User New()
|
|
|
|
|
{
|
|
|
|
|
return new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static User From(string username, string hashedPassword)
|
|
|
|
|
{
|
|
|
|
|
return new()
|
|
|
|
|
{
|
|
|
|
|
Username = username,
|
|
|
|
|
HashedPassword = hashedPassword,
|
|
|
|
|
};
|
|
|
|
|
}
|
2026-02-01 06:13:08 -06:00
|
|
|
}
|