dramaling-app/apps/backend/DramaLing.Core/Entities/User.cs

39 lines
1.7 KiB
C#

using Microsoft.AspNetCore.Identity;
namespace DramaLing.Core.Entities;
public class User : IdentityUser<Guid>
{
public string DisplayName { get; set; } = string.Empty;
public string? AvatarUrl { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public DateTime? LastLoginAt { get; set; }
public bool IsDeleted { get; set; } = false;
// Language Learning Properties
public string CurrentLanguage { get; set; } = "en"; // ISO 639-1 code
public string NativeLanguage { get; set; } = "zh"; // ISO 639-1 code
public string CurrentLevel { get; set; } = "A1"; // CEFR level
public int TotalExperience { get; set; } = 0;
public int Diamonds { get; set; } = 0;
public int LightningEnergy { get; set; } = 0;
public int LifePoints { get; set; } = 5;
public int MaxLifePoints { get; set; } = 5;
public DateTime? NextLifePointRecovery { get; set; }
// Subscription
public bool IsVipUser { get; set; } = false;
public DateTime? VipExpiresAt { get; set; }
// Learning Statistics
public int ConsecutiveDays { get; set; } = 0;
public DateTime? LastLearningDate { get; set; }
public int TotalDialoguesCompleted { get; set; } = 0;
public int TotalVocabularyMastered { get; set; } = 0;
// Navigation Properties
public virtual ICollection<UserProgress> UserProgresses { get; set; } = new List<UserProgress>();
public virtual ICollection<UserAchievement> UserAchievements { get; set; } = new List<UserAchievement>();
public virtual ICollection<VocabularyProgress> VocabularyProgresses { get; set; } = new List<VocabularyProgress>();
}