using Microsoft.EntityFrameworkCore; using OnlyPrompt.Backend.Database.Core; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace OnlyPrompt.Backend.Database.Models { [Index(nameof(Email), IsUnique = true)] [Index(nameof(UserName), IsUnique = true)] public class UserModel : EntityBase { [MaxLength(100)] [Column(TypeName = "citext")] public required string UserName { get; set; } [Column(TypeName = "citext")] public required string Email { get; set; } public required string PasswordHash { get; set; } public required List Roles { get; set; } = new List(); [Required] public required virtual UserProfileModel Profile { get; set; } public virtual IList Prompts { get; set; } = new List(); public virtual IList Subscriptions { get; set; } = new List(); public virtual IList Subscribers { get; set; } = new List(); public virtual IList SubscriptionTiers { get; set; } = new List(); public bool IsLockoutEnabled { get; set; } = false; } }