42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace DramaLing.Api.Models.Entities;
|
|
|
|
public class User
|
|
{
|
|
public Guid Id { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(50)]
|
|
public string Username { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[EmailAddress]
|
|
[MaxLength(255)]
|
|
public string Email { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(255)]
|
|
public string PasswordHash { get; set; } = string.Empty;
|
|
|
|
[MaxLength(100)]
|
|
public string? DisplayName { get; set; }
|
|
|
|
public string? AvatarUrl { get; set; }
|
|
|
|
[MaxLength(20)]
|
|
public string SubscriptionType { get; set; } = "free";
|
|
|
|
public Dictionary<string, object> Preferences { get; set; } = new();
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Navigation Properties
|
|
public virtual ICollection<CardSet> CardSets { get; set; } = new List<CardSet>();
|
|
public virtual ICollection<Flashcard> Flashcards { get; set; } = new List<Flashcard>();
|
|
public virtual UserSettings? Settings { get; set; }
|
|
public virtual ICollection<StudySession> StudySessions { get; set; } = new List<StudySession>();
|
|
public virtual ICollection<ErrorReport> ErrorReports { get; set; } = new List<ErrorReport>();
|
|
public virtual ICollection<DailyStats> DailyStats { get; set; } = new List<DailyStats>();
|
|
} |