SocialPub/PrivaPub/Models/User/RootUser.cs
2023-02-19 00:43:43 +01:00

49 lines
1.5 KiB
C#

using MongoDB.Entities;
using System.ComponentModel.DataAnnotations;
namespace PrivaPub.Models.User
{
public class RootUser : Entity
{
[StringLength(32)]
public string UserName { get; set; }
[EmailAddress]
public string Email { get; set; }
public bool IsEmailValidated { get; set; } = false;
public bool IsBanned { get; set; } = false;
public string HashedPassword { get; set; }
public List<string> Policies { get; set; } = new() { ClientModels.Policies.IsUser };
public List<ContactItem> Contacts { get; set; } = new();
public RootUserSettings Settings { get; set; } = new();
public string ResetPasswordToken { get; set; }
public DateTime? ResetPasswordTokenSentAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public DateTime? DeletedAt { get; set; }
}
public class ContactItem
{
public string Type { get; set; }
public string Contact { get; set; }
public string Note { get; set; }
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
}
public class RootUserSettings
{
public string LanguageCode { get; set; } = "en-GB";
public short IconsThemeIndexColour { get; set; } = 25;
public short LightThemeIndexColour { get; set; } = 25;
public short DarkThemeIndexColour { get; set; } = 215;
public bool PreferSystemTheming { get; set; } = true;
public bool ThemeIsDarkMode { get; set; } = false;
public bool ThemeIsDarkGray { get; set; } = false;
public bool ThemeIsLightGray { get; set; } = true;
}
}