using System;
using System.Collections.Generic;
using zero.Core.Attributes;
namespace zero.Core.Entities
{
public class User : ZeroEntity, IUser, IZeroDbConventions
{
///
public string AppId { get; set; }
///
public string CurrentAppId { get; set; }
///
public bool IsSuper { get; set; }
///
public string Email { get; set; }
///
public bool IsEmailConfirmed { get; set; }
///
public string PasswordHash { get; set; }
///
public string SecurityStamp { get; set; }
///
public string AvatarId { get; set; }
///
public string LanguageId { get; set; }
///
public List Roles { get; set; } = new List();
///
public List Claims { get; set; } = new List();
///
public string PasswordResetToken { get; set; }
///
public DateTimeOffset? PasswordResetTokenExpirationDate { get; set; }
///
public int AccessFailedCount { get; set; }
///
public bool LockoutEnabled { get; set; }
///
public DateTimeOffset? LockoutEnd { get; set; }
///
public bool TwoFactorEnabled { get; set; }
///
public string TwoFactorAuthenticatorKey { get; set; }
///
public List TwoFactorRecoveryCodes { get; set; } = new List();
}
[Collection("Users")]
public interface IUser : IZeroEntity, IAppAwareEntity, IZeroDbConventions
{
///
/// Currently selected app id for the backoffice
///
public string CurrentAppId { get; set; }
///
/// sudo.
/// The user who created the instance.
///
bool IsSuper { get; set; }
///
/// E-Mail address which is also used as the username
///
string Email { get; set; }
///
/// Whether the email address has been confirmed
///
public bool IsEmailConfirmed { get; set; }
///
/// The password hash
///
string PasswordHash { get; set; }
///
/// The security stamp
///
string SecurityStamp { get; set; }
///
/// Avatar image
///
string AvatarId { get; set; }
///
/// Backoffice display language
///
string LanguageId { get; set; }
///
/// The roles (aliases) of the user
///
List Roles { get; set; }
///
/// The user's claims, for use in claims-based authentication.
///
List Claims { get; set; }
///
/// A hash which is used to validate a password-change request
///
string PasswordResetToken { get; set; }
///
/// The date when the current password-reset hash expires
///
DateTimeOffset? PasswordResetTokenExpirationDate { get; set; }
///
/// Number of times sign in failed.
///
int AccessFailedCount { get; set; }
///
/// Whether the user is locked out.
///
bool LockoutEnabled { get; set; }
///
/// When the user lock out is over.
///
DateTimeOffset? LockoutEnd { get; set; }
///
/// Whether 2-factor authentication is enabled or not
///
bool TwoFactorEnabled { get; set; }
///
/// The two-factor authenticator key
///
string TwoFactorAuthenticatorKey { get; set; }
///
/// The list of two factor authentication recovery codes
///
List TwoFactorRecoveryCodes { get; set; }
}
}