feat: add core persistence model
This commit is contained in:
20
Tiku.Domain/Identity/StudentProfile.cs
Normal file
20
Tiku.Domain/Identity/StudentProfile.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
|
||||
namespace Tiku.Domain.Identity;
|
||||
|
||||
public sealed class StudentProfile : AuditableTenantEntity
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public string? LegacyUserId { get; set; }
|
||||
public Guid? RegionId { get; set; }
|
||||
public Guid? SelectedSchoolId { get; set; }
|
||||
public Guid? SelectedMajorId { get; set; }
|
||||
public int QuestionsAnsweredToday { get; set; }
|
||||
public int MasteredWordsCount { get; set; }
|
||||
public DateOnly? LastCheckInDate { get; set; }
|
||||
public JsonElement Stats { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement Progress { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement ModuleSelections { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement RecentActivities { get; set; } = JsonDefaults.Array();
|
||||
}
|
||||
20
Tiku.Domain/Identity/User.cs
Normal file
20
Tiku.Domain/Identity/User.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
|
||||
namespace Tiku.Domain.Identity;
|
||||
|
||||
public sealed class User : AuditableEntity
|
||||
{
|
||||
public string? LegacyId { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? AvatarUrl { get; set; }
|
||||
public string PrimaryRole { get; set; } = "student";
|
||||
public int Score { get; set; }
|
||||
public DateTimeOffset? LastSeenAt { get; set; }
|
||||
public string? LegacyPasswordHash { get; set; }
|
||||
public bool PasswordMigrationRequired { get; set; }
|
||||
public JsonElement RawProfile { get; set; } = JsonDefaults.Object();
|
||||
}
|
||||
16
Tiku.Domain/Identity/UserIdentity.cs
Normal file
16
Tiku.Domain/Identity/UserIdentity.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
|
||||
namespace Tiku.Domain.Identity;
|
||||
|
||||
public sealed class UserIdentity : AuditableEntity
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public string Provider { get; set; } = string.Empty;
|
||||
public string ProviderSubject { get; set; } = string.Empty;
|
||||
public string? UnionId { get; set; }
|
||||
public string? OpenId { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public JsonElement SecretPayload { get; set; } = JsonDefaults.Object();
|
||||
}
|
||||
Reference in New Issue
Block a user