diff --git a/README.md b/README.md index a87731c6..774f4839 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Legacy minimum-enrollment/preparation fields remain in stored policy revisions f - Migration `20261201135156_RepairCohortInvitationRevision` repairs a database where the invitation migration is recorded as applied but `StudyCohortMentorInvitations.CohortRevisionAtInvite` is absent. It adds the required integer column only when the invitation table is empty, verifies its type and nullability, and leaves correct databases unchanged. A populated incomplete table requires manual review because the original invite-time revision cannot be reconstructed safely. The read-only preflight checks this column when the original migration is marked applied. Rehearse and obtain the normal shared database approval before applying the repair; the migration is never applied at startup. - The operator will review each Stage through the UI after deployment. Full automated end-to-end acceptance is not a prerequisite for this handoff. Migration rehearsal already succeeded on a clean isolated database (25 migrations, including idempotent replay) and a restored local-data clone (76 to 77 history rows); existing class, enrollment, schedule and attendance fingerprints were preserved. The clone's 22 unresolved historical sessions retained null lifecycle status and actual timestamps. Server identity/history and backup/restore still require preflight before an approved server migration. +## ZIP tài liệu chuẩn bị theo cấp độ + +- Admin quản lý ZIP dùng chung cho từng cấp JLPT N5–N2 qua `GET /api/admin/level-preparation-zips` và `GET/PUT /api/admin/level-preparation-zips/{level}` (`PUT` nhận multipart `file`). Tệp nằm trong bucket Supabase private ở `level-preparation/{level}/materials.zip`; API danh sách chỉ trả trạng thái có ZIP, không công khai URL. +- Khi tạo lớp, Backend kiểm tra ZIP của level đã tồn tại và trả `409 COHORT_PREPARATION_ZIP_REQUIRED` nếu thiếu. Form tạo lớp không tải ZIP lên. `GET /api/study-courses/cohorts/{cohortId}/preparation-zip` giữ kiểm tra quyền cũ rồi ký URL ngắn hạn của ZIP theo level. Thay ZIP cấp độ áp dụng ngay cho mọi lớp cùng cấp; ZIP riêng của lớp cũ chỉ được dùng khi cấp độ chưa có ZIP chung. +- Không thay đổi entity, schema hay migration cho luồng này. + ## Admin AI configuration - `GET /api/admin/ai-configuration` returns the active models, provider endpoints, timeouts, token limits and per-user quotas. It reports whether each provider key is set, but never returns a key. diff --git a/RikiPath.Application/Handlers/GrammarImportHandler.cs b/RikiPath.Application/Handlers/GrammarImportHandler.cs index ae154b1b..47bb3968 100644 --- a/RikiPath.Application/Handlers/GrammarImportHandler.cs +++ b/RikiPath.Application/Handlers/GrammarImportHandler.cs @@ -82,7 +82,10 @@ private static ImportRowDiffResponse BuildRowDiff( // ---- Validate ---- if (string.IsNullOrWhiteSpace(title)) diff.Errors.Add("Thiếu cột Title."); if (string.IsNullOrWhiteSpace(structure)) diff.Errors.Add("Thiếu cột Structure."); - ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + if (!string.IsNullOrWhiteSpace(levelCode)) + ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + else if (string.IsNullOrWhiteSpace(lessonTitle)) + diff.Errors.Add("Cần Certificate Level Code hoặc Lesson Title để liên kết ngữ pháp."); // ---- Kiểm tra "đã có chưa" ngoài dữ liệu của chính dòng ---- if (!string.IsNullOrWhiteSpace(title)) @@ -110,8 +113,8 @@ private static ImportRowDiffResponse BuildRowDiff( UsageNotes = usageNotes, ExampleSentence = exampleSentence, ExampleSentenceMeaning = exampleSentenceMeaning, - CertificateLevelCode = levelCode!, - CertificateLevelId = levelsByCode[levelCode!], + CertificateLevelCode = levelCode ?? string.Empty, + CertificateLevelId = string.IsNullOrWhiteSpace(levelCode) ? 0 : levelsByCode[levelCode], LessonTitle = lessonTitle, }; @@ -156,4 +159,4 @@ private static ImportRowDiffResponse BuildRowDiff( return diff; } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Handlers/KanjiImportHandler.cs b/RikiPath.Application/Handlers/KanjiImportHandler.cs index ba17f11c..7ee3a326 100644 --- a/RikiPath.Application/Handlers/KanjiImportHandler.cs +++ b/RikiPath.Application/Handlers/KanjiImportHandler.cs @@ -92,7 +92,10 @@ private static ImportRowDiffResponse BuildRowDiff( if (!isValidStrokeCount) diff.Errors.Add("Stroke Count phải là số nguyên dương."); - ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + if (!string.IsNullOrWhiteSpace(levelCode)) + ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + else if (string.IsNullOrWhiteSpace(lessonTitle)) + diff.Errors.Add("Cần Certificate Level Code hoặc Lesson Title để liên kết hán tự."); if (!string.IsNullOrWhiteSpace(character)) { @@ -122,8 +125,8 @@ private static ImportRowDiffResponse BuildRowDiff( OnYomi = onYomi, KunYomi = kunYomi, StrokeCount = strokeCount, - CertificateLevelCode = levelCode!, - CertificateLevelId = levelsByCode[levelCode!], + CertificateLevelCode = levelCode ?? string.Empty, + CertificateLevelId = string.IsNullOrWhiteSpace(levelCode) ? 0 : levelsByCode[levelCode], LessonTitle = lessonTitle, }; @@ -171,4 +174,4 @@ private static ImportRowDiffResponse BuildRowDiff( return diff; } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Handlers/LessonImportHandler.cs b/RikiPath.Application/Handlers/LessonImportHandler.cs index 018fe222..377a4a45 100644 --- a/RikiPath.Application/Handlers/LessonImportHandler.cs +++ b/RikiPath.Application/Handlers/LessonImportHandler.cs @@ -51,7 +51,7 @@ public async Task BuildDiffAsync(IReadOnlyList ro private static ImportRowDiffResponse BuildRowDiff( ExcelRow row, - ILookup<(string Title, int CertificateLevelId), Lesson> existingByKey, + ILookup<(string Title, int? CertificateLevelId), Lesson> existingByKey, Dictionary levelsByCode, HashSet ambiguousLevelCodes, Dictionary skillsByName, @@ -66,6 +66,7 @@ private static ImportRowDiffResponse BuildRowDiff( var skillName = row.Get("Language Skill Name"); var sortOrderRaw = row.Get("Sort Order"); var topicTitle = ImportHandlerSupport.Clean(row.Get("Topic Title") ?? row.Get("Chapter Title")); + var topicDescription = ImportHandlerSupport.Clean(row.Get("Topic Description")); var stageCode = ImportHandlerSupport.Clean(row.Get("Stage Code")); var stageObjectives = ImportHandlerSupport.Clean(row.Get("Stage Objectives")); var stageSortRaw = ImportHandlerSupport.Clean(row.Get("Stage Sort Order")); @@ -74,8 +75,8 @@ private static ImportRowDiffResponse BuildRowDiff( var prerequisiteTitle = ImportHandlerSupport.Clean(row.Get("Prerequisite Lesson Title")); var sourceProvenance = ImportHandlerSupport.Clean(row.Get("Source Provenance")); - var hasKey = !string.IsNullOrWhiteSpace(title) && !string.IsNullOrWhiteSpace(levelCode); - var rowKey = hasKey ? $"{title} / {levelCode}" : title ?? $"(dòng {row.RowNumber})"; + var hasKey = !string.IsNullOrWhiteSpace(title); + var rowKey = hasKey ? $"{title} / {(string.IsNullOrWhiteSpace(levelCode) ? "Không cấp độ" : levelCode)}" : $"(dòng {row.RowNumber})"; var diff = new ImportRowDiffResponse { @@ -99,11 +100,12 @@ private static ImportRowDiffResponse BuildRowDiff( if (string.IsNullOrWhiteSpace(title)) diff.Errors.Add("Thiếu cột LessonTitle."); var audioUrl = ImportHandlerSupport.CheckUrl(audio, "AudioUrl", "", diff.Errors); - ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + if (!string.IsNullOrWhiteSpace(levelCode)) + ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); Domain.Entities.LanguageSkill? skill = null; if (string.IsNullOrWhiteSpace(skillName)) - diff.Errors.Add("Thiếu cột Language Skill Name."); + skill = null; else if (ambiguousSkillNames.Contains(skillName)) diff.Errors.Add($"Language Skill '{skillName}' bị trùng tên trong hệ thống, không xác định được kỹ năng."); else if (!skillsByName.TryGetValue(skillName, out skill)) @@ -148,7 +150,7 @@ private static ImportRowDiffResponse BuildRowDiff( return diff; } - var levelId = levelsByCode[levelCode!]; + int? levelId = string.IsNullOrWhiteSpace(levelCode) ? null : levelsByCode[levelCode]; var matches = existingByKey[(title!, levelId)]; if (matches.Skip(1).Any()) { @@ -171,14 +173,15 @@ private static ImportRowDiffResponse BuildRowDiff( LearningObjectives = learningObjectives ?? existing?.LearningObjectives, PrerequisiteLessonTitle = prerequisiteTitle, SourceProvenance = sourceProvenance ?? existing?.SourceProvenance, - CertificateLevelCode = levelCode!, + CertificateLevelCode = levelCode ?? string.Empty, CertificateLevelId = levelId, - LanguageSkillId = skill!.Id, + LanguageSkillId = skill?.Id, TopicId = existing?.TopicId, TopicTitle = topicTitle ?? existing?.Topic?.Title, - StageCode = stageCode ?? existing?.Topic?.StageCode, - StageSortOrder = stageSortOrder ?? existing?.Topic?.SortOrder, - StageObjectives = stageObjectives ?? existing?.Topic?.LearningObjectives, + TopicDescription = topicDescription, + StageCode = stageCode, + StageSortOrder = stageSortOrder, + StageObjectives = stageObjectives, }; if (existing is null) @@ -196,7 +199,7 @@ private static ImportRowDiffResponse BuildRowDiff( ImportHandlerSupport.CompareField(changed, "description", existing.Description, payload.Description); if (audioUrl is not null) ImportHandlerSupport.CompareField(changed, "audioUrl", existing.AudioUrl, audioUrl); - ImportHandlerSupport.CompareField(changed, "languageSkillName", existing.LanguageSkill?.Name, skill.Name); + ImportHandlerSupport.CompareField(changed, "languageSkillName", existing.LanguageSkill?.Name, skill?.Name); ImportHandlerSupport.CompareField(changed, "sortOrder", existing.SortOrder.ToString(), payload.SortOrder.ToString()); if (topicTitle is not null) ImportHandlerSupport.CompareField(changed, "topicTitle", existing.Topic?.Title, topicTitle); diff --git a/RikiPath.Application/Handlers/MockTestImportHandler.cs b/RikiPath.Application/Handlers/MockTestImportHandler.cs index e5fab247..10a6957f 100644 --- a/RikiPath.Application/Handlers/MockTestImportHandler.cs +++ b/RikiPath.Application/Handlers/MockTestImportHandler.cs @@ -24,10 +24,12 @@ public async Task BuildDiffAsync(IReadOnlyList ro var existingTests = await unitOfWork.MockTests.Query() .Include(t => t.CertificateLevel) .Include(t => t.Sections).ThenInclude(s => s.Questions).ThenInclude(q => q.Options) - .Where(t => !t.IsDeleted && titles.Contains(t.Title)) + .Where(t => !t.IsDeleted && !t.IsArchivedVersion && titles.Contains(t.Title) + && (t.ExamKind == ExamKind.FullMockTest || t.ExamKind == ExamKind.Placement)) .ToListAsync(cancellationToken); var (existingByKey, ambiguousKeys) = ImportHandlerSupport.IndexByKey( - existingTests, t => NaturalKey(t.Title, t.CertificateLevelId)); + existingTests, t => NaturalKey(t.Title, t.CertificateLevelId, + t.ExamKind == ExamKind.Placement)); var (levelsByCode, ambiguousLevelCodes) = await ImportHandlerSupport.LoadLevelsAsync(unitOfWork, cancellationToken); @@ -47,7 +49,7 @@ public async Task BuildDiffAsync(IReadOnlyList ro certSectionsByCode, ambiguousSectionCodes, certSections.ToDictionary(s => s.Id, s => s.Code), certSections, openRowKeys); - // Gộp theo tên đề + mã cấp độ; cùng tên ở N5 và N4 là hai đề khác nhau. + // Gộp theo tên, cấp độ và loại đề; placement không trộn với mock test cùng tên. var groups = new List>(); var byExam = new Dictionary>(StringComparer.Ordinal); foreach (var row in rows) @@ -55,7 +57,8 @@ public async Task BuildDiffAsync(IReadOnlyList ro var title = ImportHandlerSupport.Clean(row.Get("MockTestTitle")); if (title is null) { groups.Add([row]); continue; } var levelCode = ImportHandlerSupport.Clean(row.Get("CertificateLevelCode"))?.ToUpperInvariant(); - var examKey = $"{title}\u001f{levelCode}"; + var placement = ImportHandlerSupport.Clean(row.Get("IsPlacementAssessment"))?.ToLowerInvariant(); + var examKey = $"{title}\u001f{levelCode}\u001f{placement}"; if (!byExam.TryGetValue(examKey, out var list)) { byExam[examKey] = list = []; groups.Add(list); } list.Add(row); } @@ -72,7 +75,8 @@ public async Task BuildDiffAsync(IReadOnlyList ro return result; } - private static string NaturalKey(string title, int certificateLevelId) => $"{title}|{certificateLevelId}"; + private static string NaturalKey(string title, int certificateLevelId, bool placement) => + $"{title}|{certificateLevelId}|{(placement ? "placement" : "mock")}"; private sealed record DiffContext( Dictionary ExistingByKey, @@ -129,7 +133,9 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo else if (!int.TryParse(timeRaw, out timeLimit) || timeLimit <= 0) errors.Add($"{P(first)}TimeLimitMinutes phải là số nguyên dương."); - var rowKey = title is not null && levelCode is not null ? $"{title} / {levelCode}" : title ?? $"(dòng {first.RowNumber})"; + var rowKey = title is not null && levelCode is not null + ? $"{title} / {levelCode}" + (isPlacement ? " / Placement" : string.Empty) + : title ?? $"(dòng {first.RowNumber})"; if (title is not null && levelCode is not null && ctx.OpenRowKeys.Contains(rowKey)) errors.Add($"{P(first)}Đề thi '{title}' ({levelCode}) đang có bản nháp chờ Quản trị viên duyệt, chưa thể nhập lại."); @@ -328,7 +334,8 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo }); } - var coverageError = ImportHandlerSupport.ValidateMockTestCoverage(levelCode, sectionPayloads, ctx.SkillNameById); + var coverageError = isPlacement ? null : + ImportHandlerSupport.ValidateMockTestCoverage(levelCode, sectionPayloads, ctx.SkillNameById); if (coverageError is not null) errors.Add(P(first) + coverageError); foreach (var section in sectionPayloads) foreach (var question in section.Questions) @@ -346,7 +353,7 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo } var levelId = ctx.LevelsByCode[levelCode!]; - var key = NaturalKey(title!, levelId); + var key = NaturalKey(title!, levelId, isPlacement); if (ctx.AmbiguousKeys.Contains(key)) { diff.Errors.Add($"Có nhiều đề thi '{title}' ({levelCode}) trùng nhau trong hệ thống, cần dọn dữ liệu trước khi import."); diff --git a/RikiPath.Application/Handlers/PracticeExerciseImportHandler.cs b/RikiPath.Application/Handlers/PracticeExerciseImportHandler.cs index 9b54e02f..642b7a26 100644 --- a/RikiPath.Application/Handlers/PracticeExerciseImportHandler.cs +++ b/RikiPath.Application/Handlers/PracticeExerciseImportHandler.cs @@ -32,6 +32,8 @@ public async Task BuildDiffAsync( var existingExercises = await unitOfWork.PracticeExercises.Query() .Include(e => e.Questions).ThenInclude(q => q.Options) + .Include(e => e.Questions).ThenInclude(q => q.ContentPassage) + .Include(e => e.Passages) .Where(e => !e.IsDeleted && titles.Contains(e.Title)) .ToListAsync(cancellationToken); @@ -123,11 +125,13 @@ private async Task>> LoadLessonCandidatesAsyn CancellationToken cancellationToken) { var dbLessons = await unitOfWork.Lessons.Query() - .Where(l => !l.IsDeleted && !l.CertificateLevel.IsDeleted - && l.CertificateLevel.CertificateType.IsActive && !l.CertificateLevel.CertificateType.IsDeleted) - .Select(l => new { l.Id, l.Title, l.CertificateLevelId, Code = l.CertificateLevel.Code }) + .Where(l => !l.IsDeleted && (l.CertificateLevelId == null || + !l.CertificateLevel!.IsDeleted && l.CertificateLevel.CertificateType.IsActive && + !l.CertificateLevel.CertificateType.IsDeleted)) + .Select(l => new { l.Id, l.Title, l.CertificateLevelId, + Code = l.CertificateLevel == null ? string.Empty : l.CertificateLevel.Code }) .ToListAsync(cancellationToken); - var candidates = dbLessons.Select(l => new LessonRef(l.Id, l.Title, l.CertificateLevelId, l.Code)).ToList(); + var candidates = dbLessons.Select(l => new LessonRef(l.Id, l.Title, l.CertificateLevelId ?? 0, l.Code)).ToList(); var authorId = claims?.GetUserClaim().Id; var pendingPayloads = await unitOfWork.ContentApprovalRequests.Query() @@ -143,17 +147,19 @@ private async Task>> LoadLessonCandidatesAsyn LessonImportPayloadResponse? p; try { p = JsonSerializer.Deserialize(json); } catch (JsonException) { continue; } - if (p is null || string.IsNullOrWhiteSpace(p.Title) || p.CertificateLevelId <= 0) continue; - if (candidates.Any(c => c.Title == p.Title && c.CertificateLevelId == p.CertificateLevelId)) continue; - candidates.Add(new LessonRef(null, p.Title, p.CertificateLevelId, p.CertificateLevelCode)); + if (p is null || string.IsNullOrWhiteSpace(p.Title)) continue; + var levelId = p.CertificateLevelId ?? 0; + if (candidates.Any(c => c.Title == p.Title && c.CertificateLevelId == levelId)) continue; + candidates.Add(new LessonRef(null, p.Title, levelId, p.CertificateLevelCode)); } foreach (var lesson in workbookLessons) { - if (string.IsNullOrWhiteSpace(lesson.Title) || lesson.CertificateLevelId <= 0) continue; + if (string.IsNullOrWhiteSpace(lesson.Title)) continue; + var levelId = lesson.CertificateLevelId ?? 0; if (candidates.Any(candidate => candidate.Title == lesson.Title - && candidate.CertificateLevelId == lesson.CertificateLevelId)) continue; - candidates.Add(new LessonRef(null, lesson.Title, lesson.CertificateLevelId, lesson.CertificateLevelCode)); + && candidate.CertificateLevelId == levelId)) continue; + candidates.Add(new LessonRef(null, lesson.Title, levelId, lesson.CertificateLevelCode)); } return candidates.GroupBy(c => c.Title).ToDictionary(g => g.Key, g => g.ToList(), StringComparer.Ordinal); @@ -164,24 +170,24 @@ private async Task>> LoadTopicCandidatesAsync( CancellationToken cancellationToken) { var dbTopics = await unitOfWork.Topics.Query() - .Include(t => t.CertificateLevel) + .Include(t => t.Lessons).ThenInclude(l => l.CertificateLevel) .Where(t => !t.IsDeleted) .ToListAsync(cancellationToken); var candidates = dbTopics - .Select(t => new TopicRef( - t.Id, - t.Title, - t.CertificateLevelId ?? 0, - t.CertificateLevel?.Code ?? string.Empty)) + .SelectMany(t => t.Lessons.Where(l => !l.IsDeleted && l.CertificateLevelId.HasValue && !l.CertificateLevel!.IsDeleted) + .Select(l => new TopicRef(t.Id, t.Title, l.CertificateLevelId!.Value, l.CertificateLevel!.Code)) + .Distinct() + .DefaultIfEmpty(new TopicRef(t.Id, t.Title, 0, string.Empty))) + .Distinct() .ToList(); foreach (var lesson in workbookLessons) { - if (string.IsNullOrWhiteSpace(lesson.TopicTitle) || lesson.CertificateLevelId <= 0) continue; + if (string.IsNullOrWhiteSpace(lesson.TopicTitle) || lesson.CertificateLevelId is not int levelId || levelId <= 0) continue; var tt = lesson.TopicTitle.Trim(); - if (candidates.Any(c => c.Title == tt && c.CertificateLevelId == lesson.CertificateLevelId)) continue; - candidates.Add(new TopicRef(null, tt, lesson.CertificateLevelId, lesson.CertificateLevelCode)); + if (candidates.Any(c => c.Title == tt && c.CertificateLevelId == levelId)) continue; + candidates.Add(new TopicRef(null, tt, levelId, lesson.CertificateLevelCode)); } return candidates.GroupBy(t => t.Title).ToDictionary(g => g.Key, g => g.ToList(), StringComparer.OrdinalIgnoreCase); @@ -290,8 +296,10 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo else errors.Add($"{P(first)}Exercise Sort Order phải là số nguyên không âm."); } - double passingScore = 70; - if (passRaw is not null) + double passingScore = 0; + if (passRaw is null) + errors.Add($"{P(first)}Thiếu cột Passing Score Percent."); + else { if (double.TryParse(passRaw, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsedPass) && parsedPass is >= 1 and <= 100) passingScore = parsedPass; @@ -323,6 +331,7 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo }; var questions = new List(); + var passages = new Dictionary(StringComparer.OrdinalIgnoreCase); var seenSortOrders = new Dictionary(); foreach (var row in group) @@ -345,11 +354,51 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo var options = ImportHandlerSupport.ParseOptions(row, OptionHeaders, "Correct Option Number", rp, errors, includeImages: true); + var pointsRaw = ImportHandlerSupport.Clean(row.Get("Question Points")); + var points = 0d; + if (pointsRaw is null || !double.TryParse(pointsRaw, NumberStyles.Float, CultureInfo.InvariantCulture, out points) + || !double.IsFinite(points) || points <= 0) + errors.Add($"{rp}Question Points phải là số lớn hơn 0."); + + var passageCode = ImportHandlerSupport.Clean(row.Get("Passage Code")); + if (passageCode is not null) + { + var passageTitle = ImportHandlerSupport.Clean(row.Get("Passage Title")); + if (passageTitle is not null) + { + var passage = new PracticePassagePayloadResponse + { + PassageCode = passageCode, + Title = passageTitle, + PassageText = ImportHandlerSupport.Clean(row.Get("Passage Text")), + AudioUrl = ImportHandlerSupport.CheckUrl(row.Get("Passage AudioUrl"), "Passage AudioUrl", rp, errors), + AudioTranscript = ImportHandlerSupport.Clean(row.Get("Passage AudioTranscript")), + ImageUrl = ImportHandlerSupport.CheckUrl(row.Get("Passage ImageUrl"), "Passage ImageUrl", rp, errors), + SortOrder = passages.Count + 1, + }; + if (passages.TryGetValue(passageCode, out var existingPassage)) + { + if (existingPassage.Title != passage.Title + || (passage.PassageText is not null && existingPassage.PassageText is not null && existingPassage.PassageText != passage.PassageText) + || (passage.AudioUrl is not null && existingPassage.AudioUrl is not null && existingPassage.AudioUrl != passage.AudioUrl) + || (passage.ImageUrl is not null && existingPassage.ImageUrl is not null && existingPassage.ImageUrl != passage.ImageUrl)) + errors.Add($"{rp}Passage Code '{passageCode}' có nội dung không nhất quán."); + existingPassage.PassageText ??= passage.PassageText; + existingPassage.AudioUrl ??= passage.AudioUrl; + existingPassage.AudioTranscript ??= passage.AudioTranscript; + existingPassage.ImageUrl ??= passage.ImageUrl; + } + else passages.Add(passageCode, passage); + } + } + if (errors.Count > before || (text is null && imageUrl is null) || options is null) continue; questions.Add(new PracticeQuestionPayloadResponse { SortOrder = qSort, + Points = points, + PassageCode = passageCode, QuestionText = text ?? string.Empty, ImageUrl = imageUrl, Explanation = ImportHandlerSupport.Clean(row.Get("Explanation")), @@ -357,6 +406,11 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo }); } + foreach (var question in questions.Where(q => q.PassageCode is not null && !passages.ContainsKey(q.PassageCode))) + errors.Add($"Không tìm thấy Passage Title/nội dung cho mã '{question.PassageCode}'."); + foreach (var passage in passages.Values.Where(p => string.IsNullOrWhiteSpace(p.PassageText) && p.AudioUrl is null && p.ImageUrl is null)) + errors.Add($"Passage '{passage.PassageCode}' cần nội dung, âm thanh hoặc hình ảnh."); + if (errors.Count > 0) { diff.Errors.AddRange(errors); @@ -391,6 +445,7 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo LanguageSkillId = skill!.Id, LanguageSkillName = skill.Name, Questions = questions.OrderBy(q => q.SortOrder).ToList(), + Passages = passages.Values.ToList(), }; if (existing is null) @@ -415,16 +470,23 @@ private static ImportRowDiffResponse BuildGroupDiff(List group, DiffCo foreach (var q in (existing.Questions ?? []).Where(q => !q.IsDeleted)) { var opts = (q.Options ?? []).Where(o => !o.IsDeleted).OrderBy(o => o.SortOrder).Select(o => (o.OptionText + "\u001e" + o.ImageUrl, o.IsCorrect)); - oldQuestions[q.SortOrder] = ImportHandlerSupport.QuestionSignature("", q.QuestionText, q.Explanation, null, q.ImageUrl, opts); + oldQuestions[q.SortOrder] = ImportHandlerSupport.QuestionSignature("", q.QuestionText, q.Explanation, null, q.ImageUrl, opts) + + $"|{q.Points}|{q.ContentPassage?.PassageCode}"; } var newQuestions = payload.Questions.ToDictionary( q => q.SortOrder, q => ImportHandlerSupport.QuestionSignature("", q.QuestionText, q.Explanation, null, q.ImageUrl, - q.Options.Select(o => (o.OptionText + "\u001e" + o.ImageUrl, o.IsCorrect)))); + q.Options.Select(o => (o.OptionText + "\u001e" + o.ImageUrl, o.IsCorrect))) + + $"|{q.Points}|{q.PassageCode}"); var questionSummary = ImportHandlerSupport.QuestionDiffSummary(oldQuestions, newQuestions); if (questionSummary is not null) changed["questions"] = questionSummary; + var oldPassages = (existing.Passages ?? []).Where(p => !p.IsDeleted).OrderBy(p => p.SortOrder) + .Select(p => $"{p.PassageCode}|{p.Title}|{p.PassageText}|{p.AudioUrl}|{p.AudioTranscript}|{p.ImageUrl}"); + var newPassages = payload.Passages.OrderBy(p => p.SortOrder) + .Select(p => $"{p.PassageCode}|{p.Title}|{p.PassageText}|{p.AudioUrl}|{p.AudioTranscript}|{p.ImageUrl}"); + if (!oldPassages.SequenceEqual(newPassages)) changed["passages"] = "Nội dung đoạn đọc/nghe thay đổi"; if (changed.Count == 0) { diff --git a/RikiPath.Application/Handlers/VocabularyImportHandler.cs b/RikiPath.Application/Handlers/VocabularyImportHandler.cs index e73e12f7..fb8e1088 100644 --- a/RikiPath.Application/Handlers/VocabularyImportHandler.cs +++ b/RikiPath.Application/Handlers/VocabularyImportHandler.cs @@ -93,7 +93,10 @@ private static ImportRowDiffResponse BuildRowDiff( if (string.IsNullOrWhiteSpace(word)) diff.Errors.Add("Thiếu cột Word."); if (string.IsNullOrWhiteSpace(reading)) diff.Errors.Add("Thiếu cột Reading."); if (string.IsNullOrWhiteSpace(meaning)) diff.Errors.Add("Thiếu cột Meaning."); - ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + if (!string.IsNullOrWhiteSpace(levelCode)) + ImportHandlerSupport.CheckLevel(levelCode, levelsByCode, ambiguousLevelCodes, diff.Errors); + else if (string.IsNullOrWhiteSpace(lessonTitle)) + diff.Errors.Add("Cần Certificate Level Code hoặc Lesson Title để liên kết từ vựng."); // ---- Kiểm tra "đã có chưa" ngoài dữ liệu của chính dòng ---- if (hasKey) @@ -122,8 +125,8 @@ private static ImportRowDiffResponse BuildRowDiff( ExampleSentence = exampleSentence, ExampleSentenceMeaning = exampleSentenceMeaning, AudioUrl = audioUrl, - CertificateLevelCode = levelCode!, - CertificateLevelId = levelsByCode[levelCode!], + CertificateLevelCode = levelCode ?? string.Empty, + CertificateLevelId = string.IsNullOrWhiteSpace(levelCode) ? 0 : levelsByCode[levelCode], LessonTitle = lessonTitle, }; @@ -171,4 +174,4 @@ private static ImportRowDiffResponse BuildRowDiff( return diff; } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Helpers/ZipExcelWorkbookNormalizer.cs b/RikiPath.Application/Helpers/ZipExcelWorkbookNormalizer.cs new file mode 100644 index 00000000..991e2bb3 --- /dev/null +++ b/RikiPath.Application/Helpers/ZipExcelWorkbookNormalizer.cs @@ -0,0 +1,326 @@ +using ClosedXML.Excel; +using RikiPath.Application.Handlers; +using RikiPath.Application.Helpers; + +namespace RikiPath.Application.Helpers; + +/// Adapts the supplied Excel templates to the existing import handlers. +public static class ZipExcelWorkbookNormalizer +{ + private const int MaxDataRows = 100_000; + + public static bool NeedsNormalization(XLWorkbook workbook) + { + var names = workbook.Worksheets.Select(sheet => ExcelSheetReader.Normalize(sheet.Name)) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + if (names.Contains("placementtest") || names.Contains("mocktestsection") || + names.Contains("placementsection") || names.Contains("practicepassage") || + names.Contains("practicequestion")) return true; + if (names.Contains("mocktest") && workbook.Worksheets.Any(sheet => + ExcelSheetReader.Normalize(sheet.Name) == "mocktest" && + !sheet.FirstRowUsed()?.CellsUsed().Any(cell => + ExcelSheetReader.Normalize(cell.GetString()) == "questiontext") == true)) return true; + return workbook.Worksheets.Any(sheet => + ExcelSheetReader.Normalize(sheet.Name) == "lesson" && + sheet.FirstRowUsed()?.CellsUsed().Any(cell => + ExcelSheetReader.Normalize(cell.GetString()) == "title") == true); + } + + public static XLWorkbook Combine(IReadOnlyList<(string Name, XLWorkbook Book)> sources, + IEnumerable handlers, double? passingScorePercent, double? questionPoints, + bool requireContent = true) + { + var known = handlers.Select(handler => ExcelSheetReader.Normalize(handler.SheetName)) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + var sheets = new Dictionary>>(StringComparer.OrdinalIgnoreCase); + var recognizedTargets = new HashSet(StringComparer.OrdinalIgnoreCase); + var total = 0; + + void Add(string sheet, Dictionary fields) + { + if (++total > MaxDataRows) throw new InvalidDataException("ZIP vượt quá 100.000 dòng nội dung."); + if (!sheets.TryGetValue(sheet, out var rows)) sheets[sheet] = rows = []; + rows.Add(fields); + } + + foreach (var source in sources) + { + var sourceSheets = source.Book.Worksheets + .ToDictionary(sheet => ExcelSheetReader.Normalize(sheet.Name), StringComparer.OrdinalIgnoreCase); + if (sourceSheets.Count == 0) + throw new InvalidDataException($"Excel {source.Name} không có trang tính."); + var recognized = false; + var topicDescriptions = Read(sourceSheets, "topic") + .Where(row => Get(row, "title") is not null) + .GroupBy(row => Get(row, "title")!, StringComparer.OrdinalIgnoreCase) + .ToDictionary(group => group.Key, group => Get(group.First(), "description"), + StringComparer.OrdinalIgnoreCase); + if (topicDescriptions.Count > 0) + { + var lessonTopics = Read(sourceSheets, "lesson") + .Select(row => Get(row, "topictitle")) + .Where(title => title is not null) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + var orphan = topicDescriptions.Keys.FirstOrDefault(title => !lessonTopics.Contains(title)); + if (orphan is not null) + throw new InvalidDataException($"Topic '{orphan}' trong {source.Name} chưa có Lesson tham chiếu."); + } + + foreach (var sheet in source.Book.Worksheets) + { + var name = ExcelSheetReader.Normalize(sheet.Name); + var rows = ExcelSheetReader.ReadRows(sheet); + if (name == "topic") { recognized = true; continue; } + if (name is "practicemanifest" or "practicepassage" or "practicequestion" or + "mocktestsection" or "mockpassage" or "mockquestion" or + "placementtest" or "placementsection" or "placementpassage" or "placementquestion") + { + recognized = true; + if (name is "practicepassage" or "practicequestion") recognizedTargets.Add("Practice Exercise"); + if (name.StartsWith("placement", StringComparison.Ordinal)) recognizedTargets.Add("Placement Test"); + if (name.StartsWith("mock", StringComparison.Ordinal)) recognizedTargets.Add("Mock Test"); + continue; + } + if (name == "mocktest" && rows.All(row => !row.Has("QuestionText"))) + { + recognized = true; + recognizedTargets.Add("Mock Test"); + continue; + } + var target = name == "practiceexercise" ? "Practice Exercise" + : known.Contains(name) ? sheet.Name : null; + if (target is null) + { + if (rows.Count > 0) + throw new InvalidDataException($"Excel {source.Name} có sheet '{sheet.Name}' chưa được hỗ trợ."); + continue; + } + recognized = true; + recognizedTargets.Add(target); + if (name == "practiceexercise" && sourceSheets.TryGetValue("practicequestion", out var questionSheet) + && ExcelSheetReader.ReadRows(questionSheet).Count > 0) + continue; // The separate PracticeQuestion sheet is authoritative in this format. + foreach (var row in rows) + { + var fields = Copy(row); + if (name == "lesson") + { + Alias(fields, "title", "lessontitle"); + Alias(fields, "languageskillcode", "languageskillname"); + if (fields.TryGetValue("topictitle", out var topicTitle) && + topicDescriptions.TryGetValue(topicTitle, out var description) && description is not null) + fields["topicdescription"] = description; + } + if (name == "practiceexercise") + { + if ((!fields.TryGetValue("passingscorepercent", out var pass) || string.IsNullOrWhiteSpace(pass)) + && passingScorePercent.HasValue) + fields["passingscorepercent"] = passingScorePercent.Value.ToString(System.Globalization.CultureInfo.InvariantCulture); + if ((!fields.TryGetValue("questionpoints", out var points) || string.IsNullOrWhiteSpace(points)) + && questionPoints.HasValue) + fields["questionpoints"] = questionPoints.Value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + Add(target, fields); + } + } + if (sourceSheets.ContainsKey("practicequestion")) + AppendPractice(sourceSheets, Add, passingScorePercent, questionPoints); + if (sourceSheets.ContainsKey("placementtest")) AppendMock(sourceSheets, Add, placement: true); + if (sourceSheets.TryGetValue("mocktest", out var mockSheet) && + ExcelSheetReader.ReadRows(mockSheet).All(row => !row.Has("QuestionText"))) + AppendMock(sourceSheets, Add, placement: false); + if (!recognized) + throw new InvalidDataException($"Excel {source.Name} không có sheet nội dung được hỗ trợ."); + } + + var output = new XLWorkbook(); + if (!requireContent) + foreach (var target in recognizedTargets) + sheets.TryAdd(target, []); + foreach (var (sheetName, rows) in sheets) + { + var sheet = output.Worksheets.Add(sheetName); + if (rows.Count == 0) { sheet.Cell(1, 1).Value = "Preview"; continue; } + var columns = rows.SelectMany(row => row.Keys).Distinct(StringComparer.OrdinalIgnoreCase).ToList(); + for (var column = 0; column < columns.Count; column++) sheet.Cell(1, column + 1).Value = columns[column]; + for (var row = 0; row < rows.Count; row++) + for (var column = 0; column < columns.Count; column++) + if (rows[row].TryGetValue(columns[column], out var value)) + sheet.Cell(row + 2, column + 1).Value = value; + } + if (requireContent && total == 0 || !output.Worksheets.Any()) + { + output.Dispose(); + throw new InvalidDataException("Excel chỉ có các mẫu trống; hãy nhập ít nhất một dòng nội dung."); + } + return output; + } + + private static void AppendPractice(IReadOnlyDictionary sheets, + Action> add, double? passingScorePercent, double? questionPoints) + { + var questions = Read(sheets, "practicequestion"); + if (questions.Count == 0) return; + var exerciseGroups = Read(sheets, "practiceexercise") + .Where(row => Get(row, "exercisetitle") is not null) + .GroupBy(row => Get(row, "exercisetitle")!, StringComparer.OrdinalIgnoreCase) + .ToList(); + var duplicate = exerciseGroups.FirstOrDefault(group => group + .Select(row => Get(row, "lessontitle") ?? Get(row, "topictitle") ?? Get(row, "certificatelevelcode")) + .Distinct(StringComparer.OrdinalIgnoreCase).Skip(1).Any()); + if (duplicate is not null) + throw new InvalidDataException($"PracticeQuestion không thể phân biệt các bài tập cùng tên '{duplicate.Key}' gắn với nhiều Lesson; hãy dùng Exercise Title riêng."); + var exercises = exerciseGroups + .ToDictionary(group => group.Key, group => group.First(), StringComparer.OrdinalIgnoreCase); + var passages = Read(sheets, "practicepassage"); + foreach (var question in questions) + { + var title = Get(question, "exercisetitle") + ?? throw new InvalidDataException($"PracticeQuestion dòng {question.RowNumber} thiếu Exercise Title."); + if (!exercises.TryGetValue(title, out var exercise)) + throw new InvalidDataException($"PracticeQuestion dòng {question.RowNumber}: không tìm thấy bài tập '{title}'."); + var fields = Copy(exercise); + fields.Remove("questiontext"); + foreach (var (key, value) in question.Fields) fields[key] = value; + Alias(fields, "points", "questionpoints"); + Alias(fields, "correctoptions", "correctoptionnumber"); + Alias(fields, "sortorder", "questionsortorder"); + if ((!fields.TryGetValue("passingscorepercent", out var pass) || string.IsNullOrWhiteSpace(pass)) + && passingScorePercent.HasValue) + fields["passingscorepercent"] = passingScorePercent.Value.ToString(System.Globalization.CultureInfo.InvariantCulture); + if ((!fields.TryGetValue("questionpoints", out var points) || string.IsNullOrWhiteSpace(points)) + && questionPoints.HasValue) + fields["questionpoints"] = questionPoints.Value.ToString(System.Globalization.CultureInfo.InvariantCulture); + for (var i = 1; i <= 4; i++) + Alias(fields, $"option{i}text", $"option{i}"); + var passageTitle = Get(question, "passagetitle"); + if (passageTitle is not null) + { + var passage = passages.SingleOrDefault(row => + string.Equals(Get(row, "exercisetitle"), title, StringComparison.OrdinalIgnoreCase) && + string.Equals(Get(row, "title"), passageTitle, StringComparison.OrdinalIgnoreCase)); + if (passage is null) + throw new InvalidDataException($"PracticeQuestion dòng {question.RowNumber}: không tìm thấy đoạn '{passageTitle}'."); + fields["passagecode"] = passageTitle; + fields["passagetitle"] = passageTitle; + foreach (var key in new[] { "passagetext", "instructions", "audiourl", "audiotranscript", "imageurl" }) + if (passage.Fields.TryGetValue(key, out var value)) + fields[key is "audiourl" or "audiotranscript" or "imageurl" ? "passage" + key : key] = value; + } + add("Practice Exercise", fields); + } + } + + private static void AppendMock(IReadOnlyDictionary sheets, + Action> add, bool placement) + { + var target = placement ? "Placement Test" : "Mock Test"; + var passageTarget = placement ? "Placement Passage" : "Mock Passage"; + var questionTarget = placement ? "PlacementQuestion" : "MockQuestion"; + var tests = Read(sheets, placement ? "placementtest" : "mocktest"); + var sections = Read(sheets, placement ? "placementsection" : "mocktestsection"); + var questions = Read(sheets, placement ? "placementquestion" : "mockquestion"); + var passages = Read(sheets, placement ? "placementpassage" : "mockpassage"); + var questionOrder = new Dictionary(StringComparer.OrdinalIgnoreCase); + var sectionTests = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var section in sections) + { + var sectionCode = Get(section, "sectioncode"); + var title = Get(section, placement ? "placementtitle" : "mocktesttitle"); + if (sectionCode is null || title is null) continue; + var test = tests.SingleOrDefault(row => string.Equals(Get(row, + placement ? "title" : "mocktesttitle"), title, StringComparison.OrdinalIgnoreCase)); + if (test is null) throw new InvalidDataException($"Phần thi '{sectionCode}' tham chiếu đề '{title}' không tồn tại."); + if (!sectionTests.TryAdd(sectionCode, test)) + throw new InvalidDataException($"Section Code '{sectionCode}' bị lặp trong file; hãy dùng mã riêng cho mỗi đề."); + } + + var passageOrder = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var passage in passages) + { + var sectionCode = Get(passage, "sectioncode") + ?? throw new InvalidDataException($"Passage dòng {passage.RowNumber} thiếu Section Code."); + if (!sectionTests.TryGetValue(sectionCode, out var test)) + throw new InvalidDataException($"Passage dòng {passage.RowNumber}: không tìm thấy phần thi '{sectionCode}'."); + var title = Get(test, placement ? "title" : "mocktesttitle")!; + var next = passageOrder.GetValueOrDefault(sectionCode) + 1; + passageOrder[sectionCode] = next; + var fields = Copy(passage); + fields["mocktesttitle"] = title; + fields["certificatelevelcode"] = Get(test, "certificatelevelcode") ?? string.Empty; + fields["sortorder"] = next.ToString(); + add(passageTarget, fields); + } + + foreach (var question in questions) + { + var sectionCode = Get(question, "sectioncode") + ?? throw new InvalidDataException($"{(placement ? "Placement" : "Mock")} Question dòng {question.RowNumber} thiếu Section Code."); + var section = sections.SingleOrDefault(row => + string.Equals(Get(row, "sectioncode"), sectionCode, StringComparison.OrdinalIgnoreCase)); + if (section is null) + throw new InvalidDataException($"Không tìm thấy phần thi '{sectionCode}' cho câu hỏi dòng {question.RowNumber}."); + var title = Get(section, placement ? "placementtitle" : "mocktesttitle"); + var test = tests.SingleOrDefault(row => string.Equals(Get(row, + placement ? "title" : "mocktesttitle"), title, StringComparison.OrdinalIgnoreCase)); + if (test is null || title is null) + throw new InvalidDataException($"Không tìm thấy đề thi '{title}' cho phần '{sectionCode}'."); + var nextOrder = questionOrder.GetValueOrDefault(title) + 1; + questionOrder[title] = nextOrder; + var fields = Copy(question); + fields["mocktesttitle"] = title; + fields["mocktestdescription"] = Get(test, placement ? "description" : "mocktestdescription") ?? string.Empty; + fields["timelimitminutes"] = Get(test, placement ? "timelimitminutes" : "timelimitminutes") ?? string.Empty; + fields["certificatelevelcode"] = Get(test, "certificatelevelcode") ?? string.Empty; + fields["isplacementassessment"] = placement ? "true" : "false"; + fields["questionsortorder"] = nextOrder.ToString(); + fields["sectioncode"] = sectionCode; + fields["sectiontitle"] = Get(section, "title") ?? string.Empty; + fields["languageskillname"] = Get(section, "languageskillcode") ?? string.Empty; + Alias(fields, "audiotranscript", "audiotext"); + Alias(fields, "sortorder", "groupsortorder"); + for (var option = 1; option <= 4; option++) + Alias(fields, $"explanationoption{option}", $"option{option}explanation"); + var passageCode = Get(question, "passagecode"); + if (passageCode is not null) + { + var passage = passages.SingleOrDefault(row => + string.Equals(Get(row, "sectioncode"), sectionCode, StringComparison.OrdinalIgnoreCase) && + string.Equals(Get(row, "passagecode"), passageCode, StringComparison.OrdinalIgnoreCase)); + if (passage is null) + throw new InvalidDataException($"Không tìm thấy PassageCode '{passageCode}' của phần '{sectionCode}'."); + fields["passage"] = Get(passage, "passagetext") ?? string.Empty; + } + add(target, fields); + var detail = new Dictionary(fields, StringComparer.OrdinalIgnoreCase); + detail["audiotranscript"] = Get(question, "audiotranscript") ?? string.Empty; + add(questionTarget, detail); + } + // A test with metadata but no questions still appears in preview as a validation error. + foreach (var test in tests.Where(row => Get(row, placement ? "title" : "mocktesttitle") is { } title && + !questionOrder.ContainsKey(title))) + { + var fields = Copy(test); + if (placement) + { + Alias(fields, "title", "mocktesttitle"); + Alias(fields, "description", "mocktestdescription"); + fields["isplacementassessment"] = "true"; + } + add(target, fields); + } + } + + private static List Read(IReadOnlyDictionary sheets, string name) => + sheets.TryGetValue(name, out var sheet) ? ExcelSheetReader.ReadRows(sheet) : []; + + private static Dictionary Copy(ExcelRow row) => + new(row.Fields, StringComparer.OrdinalIgnoreCase); + + private static string? Get(ExcelRow row, string key) => row.Get(key); + + private static void Alias(Dictionary fields, string source, string target) + { + if (!fields.ContainsKey(target) && fields.TryGetValue(source, out var value)) fields[target] = value; + } +} diff --git a/RikiPath.Application/IClients/IAzurePronunciationAssessmentClient.cs b/RikiPath.Application/IClients/IAzurePronunciationAssessmentClient.cs new file mode 100644 index 00000000..a4d8a4d1 --- /dev/null +++ b/RikiPath.Application/IClients/IAzurePronunciationAssessmentClient.cs @@ -0,0 +1,14 @@ +namespace RikiPath.Application.IClients; + +public sealed record PronunciationWordResult( + string Text, double? AccuracyScore, string? ErrorType, long? Offset, long? Duration); + +public sealed record PronunciationAssessmentResult( + string ReferenceText, string Transcript, double AccuracyScore, double FluencyScore, + double? CompletenessScore, double PronunciationScore, double? ProsodyScore, + IReadOnlyList Words); + +public interface IAzurePronunciationAssessmentClient +{ + Task AssessAsync(Stream audio, string referenceText, CancellationToken cancellationToken); +} diff --git a/RikiPath.Application/IClients/ISpeakingAudioFeedbackClient.cs b/RikiPath.Application/IClients/ISpeakingAudioFeedbackClient.cs new file mode 100644 index 00000000..20e36488 --- /dev/null +++ b/RikiPath.Application/IClients/ISpeakingAudioFeedbackClient.cs @@ -0,0 +1,9 @@ +namespace RikiPath.Application.IClients; + +public sealed record SpeakingAudioFeedback(string PronunciationAdvice, string IntonationAdvice); + +public interface ISpeakingAudioFeedbackClient +{ + Task AnalyzeAsync(int userId, Stream audio, string referenceText, + string transcript, PronunciationAssessmentResult assessment, CancellationToken cancellationToken); +} diff --git a/RikiPath.Application/IRepositories/ILessonRepository.cs b/RikiPath.Application/IRepositories/ILessonRepository.cs index b6a3fcc3..72921420 100644 --- a/RikiPath.Application/IRepositories/ILessonRepository.cs +++ b/RikiPath.Application/IRepositories/ILessonRepository.cs @@ -21,6 +21,10 @@ Task> GetAssessmentRoadmapLessonsAsync( Task> GetLearnerVisibleByIdsAsync( IReadOnlyCollection lessonIds, CancellationToken cancellationToken = default); + Task<(int Total, IReadOnlyList Items)> SearchLearnerTopicsAsync( + string query, int page, int pageSize, CancellationToken cancellationToken = default); + Task<(int Total, IReadOnlyList Items)> GetLearnerVisibleByTopicAsync( + int topicId, int userId, int page, int pageSize, CancellationToken cancellationToken = default); Task<(int Total, int Completed)> GetCompletionStatsAsync(int userId); Task> GetByCertificateLevelAsync(int certificateLevelId, CancellationToken cancellationToken = default); Task<(int Total, Lesson? Lesson)> GetByCertificateLevelPositionAsync( @@ -47,4 +51,6 @@ public sealed record AssessmentRoadmapLesson( int? PrerequisiteLessonId = null, string? LearningObjectives = null, string? LanguageSkillCode = null); + + public sealed record LearnerTopicSummary(int Id, string Title, string? Description, int LessonCount); } diff --git a/RikiPath.Application/IServices/ICohortPreparationZipService.cs b/RikiPath.Application/IServices/ICohortPreparationZipService.cs index e11d70cf..9b94e0df 100644 --- a/RikiPath.Application/IServices/ICohortPreparationZipService.cs +++ b/RikiPath.Application/IServices/ICohortPreparationZipService.cs @@ -5,6 +5,12 @@ namespace RikiPath.Application.IServices; public interface ICohortPreparationZipService { + Task>> ListLevelsAsync( + CancellationToken ct = default); + Task> UploadLevelAsync(string level, Stream content, + CancellationToken ct = default); + Task> GetLevelAsync(string level, + CancellationToken ct = default); Task> UploadAsync(int cohortId, Stream content, CancellationToken ct = default); Task> GetAsync(int cohortId, CancellationToken ct = default); diff --git a/RikiPath.Application/IServices/ILessonProgressService.cs b/RikiPath.Application/IServices/ILessonProgressService.cs index 6c185af7..2e9409f0 100644 --- a/RikiPath.Application/IServices/ILessonProgressService.cs +++ b/RikiPath.Application/IServices/ILessonProgressService.cs @@ -11,6 +11,12 @@ Task> GetLearningDiscoveryAsync( int certificateLevelId, CancellationToken cancellationToken); + Task> SearchTopicsAsync( + string? query, int page, CancellationToken cancellationToken); + + Task> GetTopicLessonsAsync( + int topicId, int page, CancellationToken cancellationToken); + Task> GetLessonDetailAsync(int lessonId, CancellationToken cancellationToken); Task> RecordInteractionAsync(int lessonId, CancellationToken cancellationToken); diff --git a/RikiPath.Application/IServices/ISpeechToTextService.cs b/RikiPath.Application/IServices/ISpeechToTextService.cs index 405d25b4..09dbe5a0 100644 --- a/RikiPath.Application/IServices/ISpeechToTextService.cs +++ b/RikiPath.Application/IServices/ISpeechToTextService.cs @@ -9,6 +9,7 @@ public interface ISpeechToTextService Task ConvertAudioToTextAsync(IFormFile audioFile, CancellationToken cancellationToken = default); async Task ConvertAndSaveAudioAsync(IFormFile audioFile, CancellationToken cancellationToken = default) => new(await ConvertAudioToTextAsync(audioFile, cancellationToken), null); + Task SaveAudioAsync(IFormFile audioFile, CancellationToken cancellationToken = default); Task> GetTokenAsync(CancellationToken cancellationToken); Task> CreateStreamingSessionAsync(CancellationToken cancellationToken); } diff --git a/RikiPath.Application/Requests/AdminMentor/CreateMentorRequest.cs b/RikiPath.Application/Requests/AdminMentor/CreateMentorRequest.cs index d15855a4..adfe649b 100644 --- a/RikiPath.Application/Requests/AdminMentor/CreateMentorRequest.cs +++ b/RikiPath.Application/Requests/AdminMentor/CreateMentorRequest.cs @@ -5,7 +5,6 @@ namespace RikiPath.Application.Requests.AdminMentor public class CreateMentorRequest { public string Email { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; [MaxLength(200)] public string? FullName { get; set; } public string? PhoneNumber { get; set; } diff --git a/RikiPath.Application/Requests/Content/AuthorContentRequest.cs b/RikiPath.Application/Requests/Content/AuthorContentRequest.cs index b1f14c66..676b97d6 100644 --- a/RikiPath.Application/Requests/Content/AuthorContentRequest.cs +++ b/RikiPath.Application/Requests/Content/AuthorContentRequest.cs @@ -8,7 +8,7 @@ public class AuthorContentRequest public string? VideoUrl { get; set; } public int? DurationSeconds { get; set; } public int? SortOrder { get; set; } - public int CertificateLevelId { get; set; } + public int? CertificateLevelId { get; set; } public int? LanguageSkillId { get; set; } public string? Character { get; set; } diff --git a/RikiPath.Application/Requests/Practice/SubmitPracticeRequest.cs b/RikiPath.Application/Requests/Practice/SubmitPracticeRequest.cs index a8be5421..3ef0c129 100644 --- a/RikiPath.Application/Requests/Practice/SubmitPracticeRequest.cs +++ b/RikiPath.Application/Requests/Practice/SubmitPracticeRequest.cs @@ -1,4 +1,6 @@ using RikiPath.Domain.Enums; +using System.Text.Json.Serialization; +using RikiPath.Application.IClients; namespace RikiPath.Application.Requests.Practice { @@ -24,5 +26,12 @@ public sealed class SubmitPracticeRequest /// Tùy chọn: đề bài/chủ đề học viên đã viết, giúp AI chấm đúng ngữ cảnh hơn /// (vd: "Hãy viết về kỳ nghỉ hè của bạn"). Không có cũng chấm được, chỉ là kém ngữ cảnh hơn. public string? Topic { get; set; } + + // Set only by the trusted Speech endpoint after a server-to-server Azure assessment. + [JsonIgnore] + public PronunciationAssessmentResult? PronunciationAssessment { get; set; } + + [JsonIgnore] + public SpeakingAudioFeedback? SpeakingAudioFeedback { get; set; } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Responses/Content/AuthorContentDetailsResponse.cs b/RikiPath.Application/Responses/Content/AuthorContentDetailsResponse.cs index 71815d9a..f440b230 100644 --- a/RikiPath.Application/Responses/Content/AuthorContentDetailsResponse.cs +++ b/RikiPath.Application/Responses/Content/AuthorContentDetailsResponse.cs @@ -12,7 +12,7 @@ public class AuthorContentDetailsResponse public string? VideoUrl { get; set; } public int? DurationSeconds { get; set; } public int? SortOrder { get; set; } - public int CertificateLevelId { get; set; } + public int? CertificateLevelId { get; set; } public int? LanguageSkillId { get; set; } public string? Character { get; set; } public RikiPath.Domain.Enums.KanaCharacterType? KanaType { get; set; } @@ -39,6 +39,8 @@ public class AuthorContentDetailsResponse public string? ReviewedByName { get; set; } public List? MockSections { get; set; } public List? PracticeQuestions { get; set; } + public double? PassingScorePercent { get; set; } + public List? PracticePassages { get; set; } } public class AuthorMockSectionDetails @@ -68,6 +70,8 @@ public class AuthorPracticeQuestionDetails public string QuestionText { get; set; } = string.Empty; public string? Explanation { get; set; } public int SortOrder { get; set; } + public double Points { get; set; } + public string? PassageCode { get; set; } public List Options { get; set; } = []; } diff --git a/RikiPath.Application/Responses/Content/ImportPreviewResponse.cs b/RikiPath.Application/Responses/Content/ImportPreviewResponse.cs index 3d6c2538..3029af0f 100644 --- a/RikiPath.Application/Responses/Content/ImportPreviewResponse.cs +++ b/RikiPath.Application/Responses/Content/ImportPreviewResponse.cs @@ -10,5 +10,10 @@ public class ImportPreviewResponse /// Mỗi sheet tìm thấy trong file trả về 1 phần tử. Sheet không có trong file (single upload, hoặc bulk thiếu sheet) thì không xuất hiện ở đây. public List Sheets { get; set; } = new(); + + /// Các sheet gốc đã đọc, kể cả sheet chỉ có tiêu đề cột. + public List SourceSheets { get; set; } = new(); } + + public sealed record ImportSourceSheetResponse(string SheetName, int DataRows); } diff --git a/RikiPath.Application/Responses/Content/LessonImportPayloadResponse.cs b/RikiPath.Application/Responses/Content/LessonImportPayloadResponse.cs index 3e197f1e..d733369d 100644 --- a/RikiPath.Application/Responses/Content/LessonImportPayloadResponse.cs +++ b/RikiPath.Application/Responses/Content/LessonImportPayloadResponse.cs @@ -14,10 +14,11 @@ public class LessonImportPayloadResponse public string? SourceProvenance { get; set; } public string CertificateLevelCode { get; set; } = string.Empty; - public int CertificateLevelId { get; set; } - public int LanguageSkillId { get; set; } + public int? CertificateLevelId { get; set; } + public int? LanguageSkillId { get; set; } public int? TopicId { get; set; } public string? TopicTitle { get; set; } + public string? TopicDescription { get; set; } public string? StageCode { get; set; } public int? StageSortOrder { get; set; } public string? StageObjectives { get; set; } diff --git a/RikiPath.Application/Responses/Content/PracticeExerciseImportPayloadResponse.cs b/RikiPath.Application/Responses/Content/PracticeExerciseImportPayloadResponse.cs index aedac15b..925611e2 100644 --- a/RikiPath.Application/Responses/Content/PracticeExerciseImportPayloadResponse.cs +++ b/RikiPath.Application/Responses/Content/PracticeExerciseImportPayloadResponse.cs @@ -7,7 +7,7 @@ public class PracticeExerciseImportPayloadResponse public string? Description { get; set; } public int SortOrder { get; set; } public string Scope { get; set; } = "LessonQuickCheck"; - public double PassingScorePercent { get; set; } = 70; + public double PassingScorePercent { get; set; } public string LessonTitle { get; set; } = string.Empty; @@ -24,6 +24,7 @@ public class PracticeExerciseImportPayloadResponse public int LanguageSkillId { get; set; } public string LanguageSkillName { get; set; } = string.Empty; public List Questions { get; set; } = []; + public List Passages { get; set; } = []; } } diff --git a/RikiPath.Application/Responses/Content/PracticePassagePayloadResponse.cs b/RikiPath.Application/Responses/Content/PracticePassagePayloadResponse.cs new file mode 100644 index 00000000..9ee73e3f --- /dev/null +++ b/RikiPath.Application/Responses/Content/PracticePassagePayloadResponse.cs @@ -0,0 +1,13 @@ +namespace RikiPath.Application.Responses.Content; + +public sealed class PracticePassagePayloadResponse +{ + public string PassageCode { get; set; } = string.Empty; + public string Title { get; set; } = string.Empty; + public string? PassageText { get; set; } + public string? Instructions { get; set; } + public string? AudioUrl { get; set; } + public string? AudioTranscript { get; set; } + public string? ImageUrl { get; set; } + public int SortOrder { get; set; } +} diff --git a/RikiPath.Application/Responses/Content/PracticeQuestionPayloadResponse.cs b/RikiPath.Application/Responses/Content/PracticeQuestionPayloadResponse.cs index fe01732b..9525c723 100644 --- a/RikiPath.Application/Responses/Content/PracticeQuestionPayloadResponse.cs +++ b/RikiPath.Application/Responses/Content/PracticeQuestionPayloadResponse.cs @@ -4,6 +4,8 @@ public class PracticeQuestionPayloadResponse { public string? ImageUrl { get; set; } public int SortOrder { get; set; } + public double Points { get; set; } = 1.0; + public string? PassageCode { get; set; } public string QuestionText { get; set; } = string.Empty; public string? Explanation { get; set; } public List Options { get; set; } = []; diff --git a/RikiPath.Application/Responses/Lessons/LearnerTopicResponses.cs b/RikiPath.Application/Responses/Lessons/LearnerTopicResponses.cs new file mode 100644 index 00000000..5722b488 --- /dev/null +++ b/RikiPath.Application/Responses/Lessons/LearnerTopicResponses.cs @@ -0,0 +1,28 @@ +namespace RikiPath.Application.Responses.Lessons; + +public sealed class LearnerTopicSearchResponse +{ + public int Total { get; init; } + public int Page { get; init; } + public int PageSize { get; init; } + public IReadOnlyList Items { get; init; } = []; +} + +public sealed class LearnerTopicItemResponse +{ + public int Id { get; init; } + public string Title { get; init; } = string.Empty; + public string? Description { get; init; } + public int LessonCount { get; init; } +} + +public sealed class LearnerTopicLessonsResponse +{ + public int TopicId { get; init; } + public string Title { get; init; } = string.Empty; + public string? Description { get; init; } + public int Total { get; init; } + public int Page { get; init; } + public int PageSize { get; init; } + public IReadOnlyList Lessons { get; init; } = []; +} diff --git a/RikiPath.Application/Responses/Lessons/LearningDiscoveryResponse.cs b/RikiPath.Application/Responses/Lessons/LearningDiscoveryResponse.cs index 0535e892..05d09eeb 100644 --- a/RikiPath.Application/Responses/Lessons/LearningDiscoveryResponse.cs +++ b/RikiPath.Application/Responses/Lessons/LearningDiscoveryResponse.cs @@ -19,7 +19,7 @@ public sealed class LearningLessonSummaryResponse public string Title { get; init; } = string.Empty; public string? Description { get; init; } public int SortOrder { get; init; } - public int LanguageSkillId { get; init; } + public int? LanguageSkillId { get; init; } public string LanguageSkillName { get; init; } = string.Empty; public int ProgressPercent { get; init; } public int ResumePositionSeconds { get; init; } diff --git a/RikiPath.Application/Responses/Lessons/LessonDetailResponse.cs b/RikiPath.Application/Responses/Lessons/LessonDetailResponse.cs index 5c7752c6..abc16105 100644 --- a/RikiPath.Application/Responses/Lessons/LessonDetailResponse.cs +++ b/RikiPath.Application/Responses/Lessons/LessonDetailResponse.cs @@ -5,9 +5,9 @@ public class LessonDetailResponse public string? ImageUrl { get; set; } public int LessonId { get; set; } public int CourseId { get; set; } - public int CertificateLevelId { get; set; } + public int? CertificateLevelId { get; set; } public string LevelCode { get; set; } = string.Empty; - public int LanguageSkillId { get; set; } + public int? LanguageSkillId { get; set; } public string LanguageSkillName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public string Content { get; set; } = string.Empty; diff --git a/RikiPath.Application/Responses/Practice/PracticeSubmissionResponse.cs b/RikiPath.Application/Responses/Practice/PracticeSubmissionResponse.cs index ccee5418..aa91eed3 100644 --- a/RikiPath.Application/Responses/Practice/PracticeSubmissionResponse.cs +++ b/RikiPath.Application/Responses/Practice/PracticeSubmissionResponse.cs @@ -1,4 +1,5 @@ using RikiPath.Domain.Enums; +using RikiPath.Application.IClients; namespace RikiPath.Application.Responses.Practice { @@ -31,6 +32,8 @@ public sealed class GradingResultResponse public List Improvements { get; set; } = new(); public List Corrections { get; set; } = new(); public DateTime GradedAt { get; set; } + public PronunciationAssessmentResult? Pronunciation { get; set; } + public SpeakingAudioFeedback? SpeakingAudioFeedback { get; set; } } public sealed class SubmitPracticeResponse @@ -69,4 +72,4 @@ public sealed class PracticeSubmissionSummaryResponse public bool IsGraded { get; set; } public double? OverallScore { get; set; } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Responses/PracticeExercises/PracticeExerciseResponses.cs b/RikiPath.Application/Responses/PracticeExercises/PracticeExerciseResponses.cs index 212a20b3..bb09733a 100644 --- a/RikiPath.Application/Responses/PracticeExercises/PracticeExerciseResponses.cs +++ b/RikiPath.Application/Responses/PracticeExercises/PracticeExerciseResponses.cs @@ -5,7 +5,7 @@ public class PracticeExerciseSummaryResponse public string? ImageUrl { get; set; } public int Id { get; set; } public int PracticeExerciseId => Id; - public double MinimumPassingScorePercent { get; set; } = 70; + public double MinimumPassingScorePercent { get; set; } public bool Passed { get; set; } public int LessonId { get; set; } public int? TopicId { get; set; } @@ -31,7 +31,8 @@ public class PracticeExerciseAttemptResponse public int LessonId { get; set; } public int? TopicId { get; set; } public int? CertificateLevelId { get; set; } - public double PassingScorePercent { get; set; } = 70; + public double PassingScorePercent { get; set; } + public List Passages { get; set; } = new(); public List Questions { get; set; } = new(); } @@ -41,9 +42,22 @@ public class PracticeExerciseQuestionResponse public int QuestionId { get; set; } public string QuestionText { get; set; } = string.Empty; public int SortOrder { get; set; } + public double Points { get; set; } + public string? PassageCode { get; set; } public List Options { get; set; } = new(); } +public class PracticePassageResponse +{ + public string PassageCode { get; set; } = string.Empty; + public string Title { get; set; } = string.Empty; + public string? PassageText { get; set; } + public string? Instructions { get; set; } + public string? AudioUrl { get; set; } + public string? ImageUrl { get; set; } + public int SortOrder { get; set; } +} + public class PracticeExerciseOptionResponse { public string? ImageUrl { get; set; } @@ -56,6 +70,8 @@ public class PracticeQuestionReviewResponse { public int QuestionId { get; set; } public int SortOrder { get; set; } + public double Points { get; set; } + public double EarnedPoints { get; set; } public string QuestionText { get; set; } = string.Empty; public int? SelectedOptionId { get; set; } public string? SelectedOptionText { get; set; } diff --git a/RikiPath.Application/Responses/SharedBanks/BankCardResponses.cs b/RikiPath.Application/Responses/SharedBanks/BankCardResponses.cs index acb97b2c..61b4d095 100644 --- a/RikiPath.Application/Responses/SharedBanks/BankCardResponses.cs +++ b/RikiPath.Application/Responses/SharedBanks/BankCardResponses.cs @@ -81,9 +81,9 @@ public class LessonCardResponse public string? Description { get; set; } public int SortOrder { get; set; } public int EstimatedMinutes { get; set; } - public int CertificateLevelId { get; set; } + public int? CertificateLevelId { get; set; } public string JlptLevelName { get; set; } = string.Empty; - public int LanguageSkillId { get; set; } + public int? LanguageSkillId { get; set; } public string SkillName { get; set; } = string.Empty; public string? TopicTitle { get; set; } public string? LearningObjectives { get; set; } diff --git a/RikiPath.Application/Responses/StudyCourses/LevelPreparationZipResponse.cs b/RikiPath.Application/Responses/StudyCourses/LevelPreparationZipResponse.cs new file mode 100644 index 00000000..a34c0edf --- /dev/null +++ b/RikiPath.Application/Responses/StudyCourses/LevelPreparationZipResponse.cs @@ -0,0 +1,6 @@ +namespace RikiPath.Application.Responses.StudyCourses; + +public sealed record LevelPreparationZipStatusResponse(string Level, bool HasZip); + +public sealed record LevelPreparationZipDownloadResponse( + string Level, string FileName, string DownloadUrl, DateTime ExpiresAtUtc); diff --git a/RikiPath.Application/Services/AdminLearningContentService.cs b/RikiPath.Application/Services/AdminLearningContentService.cs new file mode 100644 index 00000000..c32637e2 --- /dev/null +++ b/RikiPath.Application/Services/AdminLearningContentService.cs @@ -0,0 +1,199 @@ +using System.Net; +using Microsoft.EntityFrameworkCore; +using RikiPath.Application.Responses; +using RikiPath.Domain.Enums; + +namespace RikiPath.Application.Services; + +public sealed class AdminLearningContentService(IUnitOfWork uow) +{ + public sealed record CatalogItem( + string EntityType, int EntityId, string Title, string? Subtitle, + string? Level, ContentStatus? Status, DateTime? UpdatedAtUtc, + int ChildCount) + { + public ContentApprovalStatus? ReviewStatus { get; init; } + public bool IsManagedWorkflow { get; init; } + } + + public sealed record CatalogPage(List Items, int Total, int Page, int PageSize); + + public async Task> ListAsync( + string entityType, string? search, int? certificateLevelId, + ContentStatus? status, int page, int pageSize, CancellationToken ct) + { + var type = entityType.Trim(); + if (type is not ("Lesson" or "Vocabulary" or "Kanji" or "Grammar" or "PracticeExercise" or "MockTest")) + return ApiResponse.Fail("Loại nội dung không hợp lệ."); + if (page < 1 || pageSize is < 1 or > 100) + return ApiResponse.Fail("Trang hoặc số mục mỗi trang không hợp lệ."); + if (certificateLevelId is <= 0) + return ApiResponse.Fail("Cấp độ không hợp lệ."); + if (status is not null && type is ("PracticeExercise" or "MockTest")) + return ApiResponse.Fail("Loại nội dung này không hỗ trợ lọc trạng thái xuất bản."); + + var term = search?.Trim().ToLowerInvariant(); + if (term?.Length > 200) return ApiResponse.Fail("Từ khóa tìm kiếm quá dài."); + var offset = (long)(page - 1) * pageSize; + if (offset > int.MaxValue) return ApiResponse.Fail("Số trang quá lớn."); + + IQueryable query = type switch + { + "Lesson" => uow.Lessons.Query().AsNoTracking() + .Where(x => !x.IsDeleted && (certificateLevelId == null || x.CertificateLevelId == certificateLevelId) + && (status == null || x.Status == status) + && (term == null || x.Title.ToLower().Contains(term) || (x.Description != null && x.Description.ToLower().Contains(term)))) + .Select(x => new CatalogItem(type, x.Id, x.Title, x.Description, x.CertificateLevel == null ? null : x.CertificateLevel.Code, + x.Status, x.ModifiedDate ?? x.CreatedDate, + (x.LessonVocabularies == null ? 0 : x.LessonVocabularies.Count) + + (x.LessonKanjis == null ? 0 : x.LessonKanjis.Count) + + (x.LessonGrammars == null ? 0 : x.LessonGrammars.Count))), + "Vocabulary" => uow.Vocabularies.Query().AsNoTracking() + .Where(x => !x.IsDeleted && (certificateLevelId == null || x.ContentLevelMappings!.Any(m => !m.IsDeleted && m.CertificateLevelId == certificateLevelId)) + && (status == null || x.Status == status) + && (term == null || x.Word.ToLower().Contains(term) || x.Reading.ToLower().Contains(term) || x.Meaning.ToLower().Contains(term))) + .Select(x => new CatalogItem(type, x.Id, x.Word, x.Reading + " · " + x.Meaning, + x.ContentLevelMappings!.Where(m => !m.IsDeleted).OrderBy(m => m.Id).Select(m => m.CertificateLevel.Code).FirstOrDefault(), + x.Status, x.ModifiedDate ?? x.CreatedDate, x.LessonVocabularies == null ? 0 : x.LessonVocabularies.Count)), + "Kanji" => uow.Kanjis.Query().AsNoTracking() + .Where(x => !x.IsDeleted && (certificateLevelId == null || x.ContentLevelMappings!.Any(m => !m.IsDeleted && m.CertificateLevelId == certificateLevelId)) + && (status == null || x.Status == status) + && (term == null || x.Character.ToLower().Contains(term) || x.Meaning.ToLower().Contains(term))) + .Select(x => new CatalogItem(type, x.Id, x.Character, x.Meaning, + x.ContentLevelMappings!.Where(m => !m.IsDeleted).OrderBy(m => m.Id).Select(m => m.CertificateLevel.Code).FirstOrDefault(), + x.Status, x.ModifiedDate ?? x.CreatedDate, x.LessonKanjis == null ? 0 : x.LessonKanjis.Count)), + "Grammar" => uow.GrammarPatterns.Query().AsNoTracking() + .Where(x => !x.IsDeleted && (certificateLevelId == null || x.ContentLevelMappings!.Any(m => !m.IsDeleted && m.CertificateLevelId == certificateLevelId)) + && (status == null || x.Status == status) + && (term == null || x.Title.ToLower().Contains(term) || x.Structure.ToLower().Contains(term))) + .Select(x => new CatalogItem(type, x.Id, x.Title, x.Structure, + x.ContentLevelMappings!.Where(m => !m.IsDeleted).OrderBy(m => m.Id).Select(m => m.CertificateLevel.Code).FirstOrDefault(), + x.Status, x.ModifiedDate ?? x.CreatedDate, x.LessonGrammars == null ? 0 : x.LessonGrammars.Count)), + "PracticeExercise" => uow.PracticeExercises.Query().AsNoTracking() + .Where(x => !x.IsDeleted && (certificateLevelId == null || x.CertificateLevelId == certificateLevelId + || x.Lesson != null && x.Lesson.CertificateLevelId == certificateLevelId) + && (term == null || x.Title.ToLower().Contains(term) || (x.Description != null && x.Description.ToLower().Contains(term)))) + .Select(x => new CatalogItem(type, x.Id, x.Title, x.Description, + x.CertificateLevel != null ? x.CertificateLevel.Code : x.Lesson == null ? null : x.Lesson.CertificateLevel.Code, + null, x.ModifiedDate ?? x.CreatedDate, x.Questions == null ? 0 : x.Questions.Count)), + _ => uow.MockTests.Query().AsNoTracking() + .Where(x => !x.IsDeleted && !x.IsArchivedVersion && (certificateLevelId == null || x.CertificateLevelId == certificateLevelId) + && (term == null || x.Title.ToLower().Contains(term) || (x.Description != null && x.Description.ToLower().Contains(term)))) + .Select(x => new CatalogItem(type, x.Id, x.Title, x.Description, x.CertificateLevel.Code, + null, x.ModifiedDate ?? x.CreatedDate, x.Sections == null ? 0 : x.Sections.Count) + { IsManagedWorkflow = x.IsManagedWorkflow }), + }; + + var total = await query.CountAsync(ct); + var items = await query.OrderByDescending(x => x.UpdatedAtUtc).ThenByDescending(x => x.EntityId) + .Skip((int)offset).Take(pageSize).ToListAsync(ct); + if (items.Count > 0 && type is ("MockTest" or "PracticeExercise")) + { + var ids = items.Select(x => x.EntityId).ToArray(); + var reviews = await uow.ContentApprovalRequests.Query().AsNoTracking() + .Where(x => !x.IsDeleted && x.TargetEntityId.HasValue && ids.Contains(x.TargetEntityId.Value) + && (type == "MockTest" + ? x.EntityType == ImportEntityType.MockTest || x.EntityType == ImportEntityType.PracticeSet + : x.EntityType == ImportEntityType.PracticeExercise)) + .OrderByDescending(x => x.Id) + .Select(x => new { x.TargetEntityId, x.Status }).ToListAsync(ct); + var latest = reviews.GroupBy(x => x.TargetEntityId!.Value) + .ToDictionary(group => group.Key, group => group.First().Status); + items = items.Select(item => item with + { + ReviewStatus = latest.TryGetValue(item.EntityId, out var reviewStatus) ? reviewStatus : null + }).ToList(); + } + return ApiResponse.Success(new CatalogPage(items, total, page, pageSize)); + } + + public async Task> GetDetailAsync(string entityType, int id, CancellationToken ct) + { + if (id < 1) return ApiResponse.Fail("Mã nội dung không hợp lệ."); + object? detail = entityType switch + { + "Lesson" => await uow.Lessons.Query().AsNoTracking().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Title, x.Description, x.ImageUrl, x.AudioUrl, x.SortOrder, x.EstimatedMinutes, + x.LearningObjectives, x.SourceProvenance, x.CertificateLevelId, + CertificateLevelCode = x.CertificateLevel == null ? null : x.CertificateLevel.Code, x.LanguageSkillId, + x.TopicId, TopicTitle = x.Topic == null ? null : x.Topic.Title, + PrerequisiteLessonTitle = x.PrerequisiteLesson == null ? null : x.PrerequisiteLesson.Title, + x.Status, x.Version, + Vocabularies = x.LessonVocabularies!.Select(v => new { v.VocabularyId, v.Vocabulary.Word }).ToList(), + Kanjis = x.LessonKanjis!.Select(k => new { k.KanjiId, k.Kanji.Character }).ToList(), + Grammars = x.LessonGrammars!.Select(g => new { g.GrammarPatternId, g.GrammarPattern.Title }).ToList(), + }).FirstOrDefaultAsync(ct), + "Vocabulary" => await uow.Vocabularies.Query().AsNoTracking().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Word, x.Reading, x.Meaning, x.ExampleSentence, x.ExampleSentenceMeaning, + x.ImageUrl, x.AudioUrl, x.Status, x.Version, + Levels = x.ContentLevelMappings!.Where(m => !m.IsDeleted).Select(m => new { m.CertificateLevelId, m.CertificateLevel.Code }).ToList(), + Lessons = x.LessonVocabularies!.Select(l => new { l.LessonId, l.Lesson.Title }).ToList(), + }).FirstOrDefaultAsync(ct), + "Kanji" => await uow.Kanjis.Query().AsNoTracking().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Character, x.Meaning, x.SinoVietnamese, x.OnYomi, x.KunYomi, + x.StrokeCount, x.StrokeOrderImageUrl, x.ImageUrl, x.AudioUrl, x.Status, x.Version, + Levels = x.ContentLevelMappings!.Where(m => !m.IsDeleted).Select(m => new { m.CertificateLevelId, m.CertificateLevel.Code }).ToList(), + Lessons = x.LessonKanjis!.Select(l => new { l.LessonId, l.Lesson.Title }).ToList(), + }).FirstOrDefaultAsync(ct), + "Grammar" => await uow.GrammarPatterns.Query().AsNoTracking().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Title, x.Structure, x.UsageNotes, x.ExampleSentence, x.ExampleSentenceMeaning, + x.ImageUrl, x.Status, x.Version, + Levels = x.ContentLevelMappings!.Where(m => !m.IsDeleted).Select(m => new { m.CertificateLevelId, m.CertificateLevel.Code }).ToList(), + Lessons = x.LessonGrammars!.Select(l => new { l.LessonId, l.Lesson.Title }).ToList(), + }).FirstOrDefaultAsync(ct), + "PracticeExercise" => await uow.PracticeExercises.Query().AsNoTracking().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Title, x.Description, x.ImageUrl, x.Scope, x.SortOrder, x.PassingScorePercent, + CertificateLevelId = x.CertificateLevelId ?? (x.Lesson == null ? null : x.Lesson.CertificateLevelId), + CertificateLevelCode = x.CertificateLevel != null ? x.CertificateLevel.Code : x.Lesson == null ? null : x.Lesson.CertificateLevel.Code, + x.LanguageSkillId, x.LessonId, LessonTitle = x.Lesson == null ? null : x.Lesson.Title, + x.TopicId, TopicTitle = x.Topic == null ? null : x.Topic.Title, + Passages = x.Passages!.Where(p => !p.IsDeleted).OrderBy(p => p.SortOrder) + .Select(p => new { p.Id, p.PassageCode, p.Title, p.PassageText, p.Instructions, + p.AudioUrl, p.AudioTranscript, p.ImageUrl, p.SortOrder }).ToList(), + Questions = x.Questions!.Where(q => !q.IsDeleted).OrderBy(q => q.SortOrder) + .Select(q => new { q.Id, q.QuestionText, q.Explanation, q.ImageUrl, q.SortOrder, + q.Points, PassageCode = q.ContentPassage == null ? null : q.ContentPassage.PassageCode, + Options = q.Options!.Where(o => !o.IsDeleted).OrderBy(o => o.SortOrder) + .Select(o => new { o.Id, o.OptionText, o.ImageUrl, o.IsCorrect, o.SortOrder }).ToList() }).ToList(), + }).FirstOrDefaultAsync(ct), + "MockTest" => await uow.MockTests.Query().AsNoTracking().AsSplitQuery().Where(x => !x.IsDeleted && x.Id == id) + .Select(x => new + { + x.Id, x.Title, x.Description, x.TimeLimitMinutes, x.ExamKind, x.Version, + IsPlacementAssessment = x.ExamKind == ExamKind.Placement, + x.IsManagedWorkflow, x.CertificateLevelId, CertificateLevelCode = x.CertificateLevel.Code, + Sections = x.Sections!.Where(s => !s.IsDeleted).OrderBy(s => s.SortOrder) + .Select(s => new { s.Id, s.Title, s.SortOrder, s.LanguageSkillId, s.CertificateSectionId, + LanguageSkillName = s.LanguageSkill.Name, + CertificateSectionCode = s.CertificateSection.Code, s.DurationMinutes, s.Instructions, + QuestionCount = s.Questions!.Count(q => !q.IsDeleted), + PassageCount = s.Passages!.Count(p => !p.IsDeleted), + Passages = s.Passages!.Where(p => !p.IsDeleted && !p.IsArchivedVersion).OrderBy(p => p.SortOrder) + .Select(p => new { p.Id, p.PassageCode, p.Title, p.PassageText, p.Instructions, + p.ListeningSection, p.AudioUrl, p.AudioTranscript, p.ImageUrl, p.SortOrder, p.SourceReference }).ToList(), + Questions = s.Questions!.Where(q => !q.IsDeleted && !q.IsArchivedVersion).OrderBy(q => q.SortOrder) + .Select(q => new { q.Id, q.QuestionText, q.QuestionType, q.InteractionDataJson, + q.AnswerKeyJson, q.AudioUrl, q.AudioTranscript, q.ImageUrl, q.Explanation, + q.SortOrder, q.GroupSortOrder, PassageCode = q.Passage == null ? null : q.Passage.PassageCode, + Options = q.Options!.Where(o => !o.IsDeleted).OrderBy(o => o.SortOrder) + .Select(o => new { o.Id, o.OptionText, o.ImageUrl, o.Explanation, o.IsCorrect, o.SortOrder }).ToList(), + }).ToList(), + }).ToList(), + }).FirstOrDefaultAsync(ct), + _ => null, + }; + return detail is null + ? ApiResponse.NotFound("Không tìm thấy nội dung.") + : ApiResponse.Success(detail); + } +} diff --git a/RikiPath.Application/Services/AdminMentorService.cs b/RikiPath.Application/Services/AdminMentorService.cs index 0005893d..9821352d 100644 --- a/RikiPath.Application/Services/AdminMentorService.cs +++ b/RikiPath.Application/Services/AdminMentorService.cs @@ -23,6 +23,8 @@ public class AdminMentorService( ILogger? logger = null, ISidebarCounterNotifier? sidebarNotifier = null) : IAdminMentorService { + private const string DefaultMentorPassword = "12345678"; + public async Task> CreateMentorAsync( CreateMentorRequest request, CancellationToken cancellationToken) { @@ -31,9 +33,6 @@ public async Task> CreateMentorAsync( if (string.IsNullOrWhiteSpace(request.Email)) return ApiResponse.Fail("Email không được để trống.", HttpStatusCode.BadRequest); - if (string.IsNullOrWhiteSpace(request.Password) || request.Password.Length < 6) - return ApiResponse.Fail("Mật khẩu phải có ít nhất 6 ký tự.", HttpStatusCode.BadRequest); - var normalizedEmail = request.Email.Trim().ToLowerInvariant(); var actor = claimService.GetUserClaim(); @@ -42,7 +41,7 @@ public async Task> CreateMentorAsync( if (existing) return ApiResponse.Fail("Email này đã được sử dụng.", HttpStatusCode.Conflict); - CreatePasswordHash(request.Password, out var hash, out var salt); + CreatePasswordHash(DefaultMentorPassword, out var hash, out var salt); var (firstName, lastName) = UserNameHelper.SplitFullName(request.FullName); var now = DateTime.UtcNow; diff --git a/RikiPath.Application/Services/CohortPreparationZipService.cs b/RikiPath.Application/Services/CohortPreparationZipService.cs index ea74f0f9..318cb632 100644 --- a/RikiPath.Application/Services/CohortPreparationZipService.cs +++ b/RikiPath.Application/Services/CohortPreparationZipService.cs @@ -5,6 +5,7 @@ using RikiPath.Application.Responses; using RikiPath.Application.Responses.StudyCourses; using RikiPath.Domain.Enums; +using RikiPath.Domain.MentorScheduling; namespace RikiPath.Application.Services; @@ -15,6 +16,60 @@ public sealed class CohortPreparationZipService(IUnitOfWork uow, IClaimService c private const long MaxExpandedBytes = 250L * 1024 * 1024; private const int MaxEntries = 500; + public async Task>> ListLevelsAsync( + CancellationToken ct = default) + { + if (claims.GetUserClaim().Role != Role.Admin) + return ApiResponse>.Forbidden(); + var levels = await uow.CertificateLevels.Query().AsNoTracking() + .Where(x => !x.IsDeleted && !x.CertificateType.IsDeleted && x.CertificateType.IsActive + && x.CertificateType.Name.ToUpper() == "JLPT") + .Select(x => x.Code.ToUpper()).ToListAsync(ct); + var result = new List(); + foreach (var level in levels.Where(MentorSlotPolicy.IsSupportedClassLevel).Distinct().OrderBy(MentorSlotPolicy.GetJlptRank)) + result.Add(new(level, await storage.LevelPreparationZipExistsAsync(level, ct))); + return ApiResponse>.Success(result); + } + + public async Task> UploadLevelAsync(string level, Stream content, + CancellationToken ct = default) + { + if (claims.GetUserClaim().Role != Role.Admin) + return ApiResponse.Forbidden(); + var normalized = level.Trim().ToUpperInvariant(); + if (!await LevelExistsAsync(normalized, ct)) + return ApiResponse.NotFound("Không tìm thấy cấp độ lớp hợp lệ."); + if (!ValidZip(content)) + return ApiResponse.Fail( + "ZIP không hợp lệ, rỗng hoặc vượt giới hạn 25 MB / 500 tệp / 250 MB sau giải nén.", + HttpStatusCode.BadRequest); + content.Position = 0; + await storage.UploadLevelPreparationZipAsync(normalized, content, ct); + return ApiResponse.Success(new(normalized, true)); + } + + public async Task> GetLevelAsync(string level, + CancellationToken ct = default) + { + if (claims.GetUserClaim().Role != Role.Admin) + return ApiResponse.Forbidden(); + var normalized = level.Trim().ToUpperInvariant(); + if (!await LevelExistsAsync(normalized, ct)) + return ApiResponse.NotFound("Không tìm thấy cấp độ lớp hợp lệ."); + var downloadUrl = await storage.GetLevelPreparationZipDownloadUrlAsync(normalized, ct); + if (downloadUrl is null) + return ApiResponse.NotFound("Cấp độ này chưa có ZIP tài liệu chuẩn bị."); + return ApiResponse.Success(new( + normalized, $"Tai-lieu-chuan-bi-{normalized}.zip", downloadUrl, DateTime.UtcNow.AddSeconds(60))); + } + + private Task LevelExistsAsync(string level, CancellationToken ct) + => MentorSlotPolicy.IsSupportedClassLevel(level) + ? uow.CertificateLevels.Query().AnyAsync(x => x.Code.ToUpper() == level && !x.IsDeleted + && !x.CertificateType.IsDeleted && x.CertificateType.IsActive + && x.CertificateType.Name.ToUpper() == "JLPT", ct) + : Task.FromResult(false); + public async Task> UploadAsync(int cohortId, Stream content, CancellationToken ct = default) { @@ -41,7 +96,7 @@ public async Task> GetAsync(int cohort { var actor = claims.GetUserClaim(); var cohort = await uow.StudyCohorts.Query().AsNoTracking() - .Where(c => c.Id == cohortId).Select(c => new { c.MentorId }).FirstOrDefaultAsync(ct); + .Where(c => c.Id == cohortId).Select(c => new { c.MentorId, c.Level }).FirstOrDefaultAsync(ct); if (cohort is null) return ApiResponse.NotFound("Không tìm thấy lớp học."); var authorized = actor.Role switch { @@ -55,7 +110,10 @@ public async Task> GetAsync(int cohort _ => false }; if (!authorized) return ApiResponse.Forbidden("Bạn không có quyền tải tài liệu lớp."); - var downloadUrl = await storage.GetCohortPreparationZipDownloadUrlAsync(cohortId, ct); + var downloadUrl = MentorSlotPolicy.IsSupportedClassLevel(cohort.Level) + ? await storage.GetLevelPreparationZipDownloadUrlAsync(cohort.Level, ct) + : null; + downloadUrl ??= await storage.GetCohortPreparationZipDownloadUrlAsync(cohortId, ct); if (downloadUrl is null) return ApiResponse.NotFound("Lớp chưa có ZIP tài liệu chuẩn bị."); return ApiResponse.Success(new( diff --git a/RikiPath.Application/Services/CohortSessionLearningMaterialsService.cs b/RikiPath.Application/Services/CohortSessionLearningMaterialsService.cs index 1047e996..a0bf1524 100644 --- a/RikiPath.Application/Services/CohortSessionLearningMaterialsService.cs +++ b/RikiPath.Application/Services/CohortSessionLearningMaterialsService.cs @@ -37,7 +37,7 @@ public async Task HasPreparedAsync(int cohortId, int sessionId, Cancellati if (level is null) return false; var count = await uow.Lessons.Query().AsNoTracking().CountAsync(l => ids.Contains(l.Id) && l.CertificateLevelId == level.Id && !l.IsDeleted && l.Status == ContentStatus.Published - && !l.LanguageSkill.IsDeleted, ct); + && (l.LanguageSkillId == null || !l.LanguageSkill!.IsDeleted), ct); return count == ids.Length; } @@ -91,7 +91,7 @@ await uow.ExecuteInTransactionAsync(async token => } var allowed = await uow.Lessons.Query().AsNoTracking().Where(l => lessonIds.Contains(l.Id) && l.CertificateLevelId == level.Id && !l.IsDeleted - && l.Status == ContentStatus.Published && !l.LanguageSkill.IsDeleted) + && l.Status == ContentStatus.Published && (l.LanguageSkillId == null || !l.LanguageSkill!.IsDeleted)) .Select(l => l.Id).ToListAsync(token); if (allowed.Count != lessonIds.Count) { @@ -176,11 +176,11 @@ public async Task> GetAsync( l.CertificateLevelId == level.Id && !l.IsDeleted && l.Status == ContentStatus.Published && !l.CertificateLevel.IsDeleted && !l.CertificateLevel.CertificateType.IsDeleted && l.CertificateLevel.CertificateType.IsActive && l.CertificateLevel.CertificateType.Name == "JLPT" - && !l.LanguageSkill.IsDeleted); + && (l.LanguageSkillId == null || !l.LanguageSkill!.IsDeleted)); var suggested = actor.Role == Role.Mentor ? await visible.OrderBy(l => l.SortOrder).ThenBy(l => l.Id) .Select(l => new CohortLessonSuggestionResponse(l.Id, l.Title, l.Description, l.SortOrder, - l.EstimatedMinutes, l.LanguageSkill.Name, + l.EstimatedMinutes, l.LanguageSkill == null ? string.Empty : l.LanguageSkill.Name, l.Topic != null && !l.Topic.IsDeleted ? l.Topic.Title : null, l.LessonKanjis!.Count(k => !k.Kanji.IsDeleted && k.Kanji.Status == ContentStatus.Published), l.LessonVocabularies!.Count(v => !v.Vocabulary.IsDeleted && v.Vocabulary.Status == ContentStatus.Published), diff --git a/RikiPath.Application/Services/ContentApprovalService.cs b/RikiPath.Application/Services/ContentApprovalService.cs index 02e12c63..31c89516 100644 --- a/RikiPath.Application/Services/ContentApprovalService.cs +++ b/RikiPath.Application/Services/ContentApprovalService.cs @@ -1,4 +1,6 @@ using System.Data.Common; +using System.Security.Cryptography; +using System.Text; using System.Text.Json; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; @@ -109,7 +111,9 @@ public async Task>> GetPend if (requests.Count == 0) return ApiResponse>.Success(new() { - Page = page, PageSize = pageSize, TotalCount = total, + Page = page, + PageSize = pageSize, + TotalCount = total, }); var builderDict = diffBuilders.ToDictionary(b => b.EntityType); @@ -158,7 +162,9 @@ public async Task>> GetPend .ToDictionary(pair => pair.Id, pair => pair.index); return ApiResponse>.Success(new() { - Page = page, PageSize = pageSize, TotalCount = total, + Page = page, + PageSize = pageSize, + TotalCount = total, Items = responseList.OrderBy(item => requestOrder[item.RequestId]).ToList(), }); } @@ -308,6 +314,7 @@ private async Task AttachLessonRelatedContentAsync( if (string.IsNullOrWhiteSpace(title)) continue; if (string.IsNullOrWhiteSpace(code) && doc.RootElement.TryGetProperty("CertificateLevelId", out var relatedLevelNode) + && relatedLevelNode.ValueKind == JsonValueKind.Number && relatedLevelNode.TryGetInt32(out var relatedLevelId)) code = lessons.Values.FirstOrDefault(x => x.CertificateLevelId == relatedLevelId && x.Title == title)?.CertificateLevelCode; if (string.IsNullOrWhiteSpace(code)) continue; @@ -375,7 +382,9 @@ private async Task AttachLessonRelatedContentAsync( dbLessonIds.Contains(exercise.LessonId.Value)) .Select(exercise => new { - exercise.LessonId, exercise.Title, exercise.Description, + exercise.LessonId, + exercise.Title, + exercise.Description, QuestionCount = exercise.Questions!.Count(question => !question.IsDeleted) }) .ToListAsync(cancellationToken); @@ -561,7 +570,7 @@ await unitOfWork.ExecuteInTransactionAsync(async token => if (doc.RootElement.TryGetProperty("LessonTitle", out var titleNode) && titleNode.GetString() == payload.Title && doc.RootElement.TryGetProperty("CertificateLevelId", out var levelNode) - && levelNode.GetInt32() == payload.CertificateLevelId) + && LevelMatches(levelNode, payload.CertificateLevelId)) group.Add(candidate); } catch (JsonException) { } @@ -829,13 +838,13 @@ private static string DescribeDatabaseFailure(DbUpdateException exception) => IsMissingPassagePublishStatus(exception) ? "Database vẫn bắt buộc ContentPassages.PublishStatus nhưng model hiện tại không ghi cột này. Cần đồng bộ schema database." : GetSqlState(exception) switch - { - "23503" => "Không thể lưu đề thi vì cấp độ, kỹ năng hoặc dữ liệu tham chiếu không hợp lệ.", - "23505" => "Không thể lưu vì dữ liệu đề thi trùng với bản ghi đã có.", - "23502" => "Không thể lưu đề thi vì thiếu dữ liệu bắt buộc.", - "22001" => "Không thể lưu đề thi vì một trường văn bản vượt quá độ dài cho phép.", - _ => "Database từ chối lưu nội dung. Vui lòng liên hệ quản trị viên với mã yêu cầu duyệt." - }; + { + "23503" => "Không thể lưu đề thi vì cấp độ, kỹ năng hoặc dữ liệu tham chiếu không hợp lệ.", + "23505" => "Không thể lưu vì dữ liệu đề thi trùng với bản ghi đã có.", + "23502" => "Không thể lưu đề thi vì thiếu dữ liệu bắt buộc.", + "22001" => "Không thể lưu đề thi vì một trường văn bản vượt quá độ dài cho phép.", + _ => "Database từ chối lưu nội dung. Vui lòng liên hệ quản trị viên với mã yêu cầu duyệt." + }; public async Task>> GetMyApprovalsAsync(CancellationToken cancellationToken) { @@ -1161,8 +1170,9 @@ await unitOfWork.ContentLevelMappings.AddAsync(new ContentLevelMapping } } - private async Task FindLessonAsync(string title, int levelId, CancellationToken cancellationToken) => - await unitOfWork.Lessons.FirstOrDefaultAsync(l => !l.IsDeleted && l.Title == title && l.CertificateLevelId == levelId, cancellationToken); + private async Task FindLessonAsync(string title, int? levelId, CancellationToken cancellationToken) => + await unitOfWork.Lessons.FirstOrDefaultAsync(l => !l.IsDeleted && l.Title == title && + l.CertificateLevelId == (levelId > 0 ? levelId : null), cancellationToken); private static LessonImportPayloadResponse ReadLessonPayload(ContentApprovalRequest request) => JsonSerializer.Deserialize(request.PayloadJson, JsonOptions) @@ -1266,7 +1276,7 @@ private async Task ApplyLessonApprovalAsync(ContentApprovalRequest req, LessonIm if (prereq is not null && prereq.Id != lesson.Id) lesson.PrerequisiteLessonId = prereq.Id; } - lesson.CertificateLevelId = p.CertificateLevelId; + lesson.CertificateLevelId = p.CertificateLevelId is > 0 ? p.CertificateLevelId : null; lesson.LanguageSkillId = p.LanguageSkillId; lesson.Status = ContentStatus.Published; lesson.UnpublishedAtUtc = null; @@ -1296,31 +1306,20 @@ private async Task ApplyLessonApprovalAsync(ContentApprovalRequest req, LessonIm if (string.IsNullOrEmpty(title)) return null; var candidates = await topics - .Where(x => x.CertificateLevelId == payload.CertificateLevelId || x.CertificateLevelId == null) - .OrderByDescending(x => x.CertificateLevelId == payload.CertificateLevelId) + .Where(x => x.Lessons.Any(l => !l.IsDeleted && l.CertificateLevelId == payload.CertificateLevelId) + || !x.Lessons.Any(l => !l.IsDeleted)) + .OrderByDescending(x => x.Lessons.Any(l => !l.IsDeleted && l.CertificateLevelId == payload.CertificateLevelId)) .ThenBy(x => x.Id) .ToListAsync(ct); var match = candidates.Find(x => string.Equals(x.Title.Trim().Normalize(), title, StringComparison.OrdinalIgnoreCase)); if (match is not null) - { - if (!match.CertificateLevelId.HasValue) match.CertificateLevelId = payload.CertificateLevelId; - if (!string.IsNullOrWhiteSpace(payload.StageCode)) match.StageCode = payload.StageCode; - if (!string.IsNullOrWhiteSpace(payload.StageObjectives)) match.LearningObjectives = payload.StageObjectives; - if (payload.StageSortOrder.HasValue) match.SortOrder = payload.StageSortOrder.Value; - unitOfWork.Topics.Update(match); return match; - } - var nextSort = payload.StageSortOrder - ?? ((candidates.Where(x => x.CertificateLevelId == payload.CertificateLevelId).Select(x => x.SortOrder).DefaultIfEmpty(0).Max()) + 1); return await unitOfWork.Topics.AddAsync(new Topic { Title = title, - CertificateLevelId = payload.CertificateLevelId, - StageCode = payload.StageCode, - LearningObjectives = payload.StageObjectives, - SortOrder = nextSort, + Description = payload.TopicDescription }, ct); } @@ -1329,7 +1328,30 @@ private async Task ApplyPracticeExerciseApprovalAsync(ContentApprovalRequest req var p = JsonSerializer.Deserialize(req.PayloadJson, JsonOptions) ?? throw new InvalidOperationException("Payload Practice Exercise rỗng."); var scope = PracticeExerciseScopes.Normalize(p.Scope); - var passingScore = p.PassingScorePercent > 0 ? p.PassingScorePercent : 70; + if (!double.IsFinite(p.PassingScorePercent) || p.PassingScorePercent is <= 0 or > 100) + throw new InvalidOperationException("Điểm đạt phải từ 1 đến 100%."); + var passingScore = p.PassingScorePercent; + + var passagesByCode = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var passage in p.Passages ?? []) + { + var code = passage.PassageCode?.Trim(); + if (string.IsNullOrWhiteSpace(code) || string.IsNullOrWhiteSpace(passage.Title) + || !passagesByCode.TryAdd(code, new ContentPassage + { + PassageCode = code, + Title = passage.Title.Trim(), + PassageText = passage.PassageText?.Trim(), + Instructions = passage.Instructions?.Trim(), + AudioUrl = passage.AudioUrl?.Trim(), + AudioTranscript = passage.AudioTranscript?.Trim(), + ImageUrl = passage.ImageUrl?.Trim(), + SortOrder = passage.SortOrder, + ContentFingerprint = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes( + $"{code}|{passage.Title}|{passage.PassageText}|{passage.AudioUrl}|{passage.ImageUrl}"))).ToLowerInvariant(), + })) + throw new InvalidOperationException("Mã đoạn đọc/nghe bị thiếu hoặc trùng."); + } Lesson? lesson = null; int? resolvedTopicId = p.TopicId; @@ -1340,7 +1362,7 @@ private async Task ApplyPracticeExerciseApprovalAsync(ContentApprovalRequest req lesson = await FindLessonAsync(p.LessonTitle, p.CertificateLevelId, cancellationToken) ?? throw new InvalidOperationException($"Không tìm thấy Lesson '{p.LessonTitle}' ({p.CertificateLevelId}) để lưu Practice Exercise."); resolvedTopicId = lesson.TopicId; - resolvedLevelId = lesson.CertificateLevelId; + resolvedLevelId = lesson.CertificateLevelId ?? 0; } else if (scope == PracticeExerciseScopes.GroupQuiz) { @@ -1348,14 +1370,14 @@ private async Task ApplyPracticeExerciseApprovalAsync(ContentApprovalRequest req { var normalizedTopic = ManualContentService.NormalizeTopicTitle(p.TopicTitle); var topicRow = await unitOfWork.Topics.Query() - .Where(t => !t.IsDeleted && (t.CertificateLevelId == resolvedLevelId || resolvedLevelId == 0 || t.CertificateLevelId == null)) - .OrderByDescending(t => t.CertificateLevelId == resolvedLevelId) + .Where(t => !t.IsDeleted && (t.Lessons.Any(l => !l.IsDeleted && l.CertificateLevelId == resolvedLevelId) + || !t.Lessons.Any(l => !l.IsDeleted))) + .OrderByDescending(t => t.Lessons.Any(l => !l.IsDeleted && l.CertificateLevelId == resolvedLevelId)) .ToListAsync(cancellationToken); var matchedTopic = topicRow.FirstOrDefault(t => string.Equals(t.Title.Trim().Normalize(), normalizedTopic, StringComparison.OrdinalIgnoreCase)); if (matchedTopic is null) throw new InvalidOperationException($"Không tìm thấy Topic/Chặng '{p.TopicTitle}' để lưu GroupQuiz."); resolvedTopicId = matchedTopic.Id; - resolvedLevelId = matchedTopic.CertificateLevelId ?? resolvedLevelId; } if (!resolvedTopicId.HasValue) throw new InvalidOperationException("GroupQuiz yêu cầu TopicId hoặc TopicTitle."); @@ -1365,9 +1387,14 @@ private async Task ApplyPracticeExerciseApprovalAsync(ContentApprovalRequest req throw new InvalidOperationException("StageAssessment yêu cầu CertificateLevelId."); } - static List MapQuestions(IEnumerable questions) => questions + List MapQuestions(IEnumerable questions) => questions .OrderBy(q => q.SortOrder).Select(q => new PracticeQuestion { + Points = double.IsFinite(q.Points) && q.Points > 0 ? q.Points + : throw new InvalidOperationException("Điểm từng câu phải lớn hơn 0."), + ContentPassage = string.IsNullOrWhiteSpace(q.PassageCode) ? null + : passagesByCode.GetValueOrDefault(q.PassageCode.Trim()) + ?? throw new InvalidOperationException("Câu hỏi liên kết đoạn đọc/nghe không tồn tại."), QuestionText = q.QuestionText, ImageUrl = q.ImageUrl, Explanation = q.Explanation, @@ -1395,6 +1422,7 @@ await unitOfWork.PracticeExercises.AddAsync(new PracticeExercise TopicId = resolvedTopicId, CertificateLevelId = resolvedLevelId > 0 ? resolvedLevelId : null, LanguageSkillId = p.LanguageSkillId, + Passages = passagesByCode.Values.ToList(), Questions = MapQuestions(p.Questions) }, cancellationToken); return; @@ -1412,6 +1440,8 @@ await unitOfWork.PracticeExercises.AddAsync(new PracticeExercise exercise.TopicId = resolvedTopicId; exercise.CertificateLevelId = resolvedLevelId > 0 ? resolvedLevelId : null; exercise.LanguageSkillId = p.LanguageSkillId; + foreach (var passage in exercise.Passages ?? []) passage.IsDeleted = true; + exercise.Passages = (exercise.Passages ?? []).Concat(passagesByCode.Values).ToList(); foreach (var question in (exercise.Questions ?? []).Where(q => !q.IsDeleted)) { question.IsDeleted = true; @@ -1440,7 +1470,7 @@ private async Task LinkPendingLessonContentAsync(Lesson lesson, ContentApprovalR { using var doc = JsonDocument.Parse(related.PayloadJson); if (!doc.RootElement.TryGetProperty("LessonTitle", out var titleNode) || titleNode.GetString() != lessonPayload.Title) continue; - if (!doc.RootElement.TryGetProperty("CertificateLevelId", out var levelNode) || levelNode.GetInt32() != lessonPayload.CertificateLevelId) continue; + if (!doc.RootElement.TryGetProperty("CertificateLevelId", out var levelNode) || !LevelMatches(levelNode, lessonPayload.CertificateLevelId)) continue; matching.Add(related); } catch (JsonException) { throw new InvalidOperationException($"Không đọc được nội dung liên quan #{related.Id}."); } @@ -1505,7 +1535,12 @@ private static void MarkRelatedApproved(ContentApprovalRequest request) request.ReviewedAt = DateTime.UtcNow; } - private async Task LinkKanjiToLessonAsync(Kanji kanji, string lessonTitle, int levelId, CancellationToken cancellationToken) + private static bool LevelMatches(JsonElement node, int? expected) => + node.ValueKind == JsonValueKind.Null ? expected is null or 0 : + node.ValueKind == JsonValueKind.Number && node.TryGetInt32(out var id) && + (expected is null or 0 ? id == 0 : id == expected); + + private async Task LinkKanjiToLessonAsync(Kanji kanji, string lessonTitle, int? levelId, CancellationToken cancellationToken) { var lesson = await FindLessonAsync(lessonTitle, levelId, cancellationToken); if (lesson is null) return; @@ -1533,7 +1568,7 @@ private async Task LinkKanjiToLessonAsync(Kanji kanji, string lessonTitle, int l } - private async Task LinkGrammarToLessonAsync(GrammarPattern grammar, string lessonTitle, int levelId, CancellationToken cancellationToken) + private async Task LinkGrammarToLessonAsync(GrammarPattern grammar, string lessonTitle, int? levelId, CancellationToken cancellationToken) { var lesson = await FindLessonAsync(lessonTitle, levelId, cancellationToken); if (lesson is null) return; @@ -1550,7 +1585,7 @@ private async Task LinkGrammarToLessonAsync(GrammarPattern grammar, string lesso } } - private async Task LinkVocabularyToLessonAsync(Vocabulary vocabulary, string lessonTitle, int levelId, CancellationToken cancellationToken) + private async Task LinkVocabularyToLessonAsync(Vocabulary vocabulary, string lessonTitle, int? levelId, CancellationToken cancellationToken) { var lesson = await FindLessonAsync(lessonTitle, levelId, cancellationToken); if (lesson is null) return; @@ -1660,7 +1695,7 @@ private async Task ApplyMockTestApprovalAsync(ContentApprovalRequest req, Cancel } var validationError = ExcelContentImportService.ValidateMockTestPayload(req.PayloadJson!, skillNames, new Dictionary { [p.CertificateLevelId] = level.Code }, - requireFullCoverage: req.EntityType == ImportEntityType.MockTest); + requireFullCoverage: req.EntityType == ImportEntityType.MockTest && !p.IsPlacementAssessment); if (validationError is not null) throw new InvalidOperationException(validationError); } diff --git a/RikiPath.Application/Services/ContentAuthorService.cs b/RikiPath.Application/Services/ContentAuthorService.cs index acaaf9c3..af3c202f 100644 --- a/RikiPath.Application/Services/ContentAuthorService.cs +++ b/RikiPath.Application/Services/ContentAuthorService.cs @@ -169,7 +169,8 @@ public async Task> CheckWithAiAsync(Content private async Task SaveStagedAsync(ContentEntityType type, int? id, AuthorContentRequest r, CancellationToken ct) { var importType = ContentStagingMap.ToImportType(type); - var level = await RequireLevelAsync(Required(r.CertificateLevelId, nameof(r.CertificateLevelId)), ct); + var level = type == ContentEntityType.Lesson && r.CertificateLevelId is null + ? null : await RequireLevelAsync(Required(r.CertificateLevelId, nameof(r.CertificateLevelId)), ct); var userId = claimService.GetUserClaim().Id; string rowKey; @@ -178,10 +179,13 @@ private async Task SaveStagedAsync(ContentEntityTyp { case ContentEntityType.Lesson: { - var languageSkillId = Required(r.LanguageSkillId, nameof(r.LanguageSkillId)); - var skill = await unitOfWork.LanguageSkills.GetByIdAsync(languageSkillId, ct); - if (skill is null || skill.IsDeleted) - throw new InvalidOperationException($"LanguageSkillId {languageSkillId} không tồn tại hoặc đã bị xóa."); + var languageSkillId = r.LanguageSkillId; + if (languageSkillId is int skillId) + { + var skill = await unitOfWork.LanguageSkills.GetByIdAsync(skillId, ct); + if (skill is null || skill.IsDeleted) + throw new InvalidOperationException($"LanguageSkillId {skillId} không tồn tại hoặc đã bị xóa."); + } var title = Required(r.Title, nameof(r.Title)); rowKey = title; payload = new LessonImportPayloadResponse @@ -189,8 +193,8 @@ private async Task SaveStagedAsync(ContentEntityTyp Title = title, Description = r.Description, SortOrder = r.SortOrder ?? 0, - CertificateLevelId = level.Id, - CertificateLevelCode = level.Code, + CertificateLevelId = level?.Id, + CertificateLevelCode = level?.Code ?? string.Empty, LanguageSkillId = languageSkillId, }; break; @@ -390,8 +394,14 @@ private static async Task DeleteAsync(T? entity, Action update) wher LessonId = e.LessonId, LanguageSkillId = e.LanguageSkillId, SortOrder = e.SortOrder, + PassingScorePercent = e.PassingScorePercent, + PracticePassages = e.Passages?.Where(p => !p.IsDeleted).OrderBy(p => p.SortOrder).Select(p => new PracticePassagePayloadResponse + { PassageCode = p.PassageCode, Title = p.Title, PassageText = p.PassageText, Instructions = p.Instructions, + AudioUrl = p.AudioUrl, AudioTranscript = p.AudioTranscript, ImageUrl = p.ImageUrl, SortOrder = p.SortOrder }).ToList(), PracticeQuestions = e.Questions?.Where(q => !q.IsDeleted).OrderBy(q => q.SortOrder).Select(q => new AuthorPracticeQuestionDetails - { Id = q.Id, QuestionText = q.QuestionText, Explanation = q.Explanation, SortOrder = q.SortOrder, Options = q.Options?.Where(o => !o.IsDeleted).OrderBy(o => o.SortOrder).Select(ToOption).ToList() ?? [] }).ToList() + { Id = q.Id, QuestionText = q.QuestionText, Explanation = q.Explanation, SortOrder = q.SortOrder, + Points = q.Points, PassageCode = q.ContentPassage?.PassageCode, + Options = q.Options?.Where(o => !o.IsDeleted).OrderBy(o => o.SortOrder).Select(ToOption).ToList() ?? [] }).ToList() }; private static AuthorOptionDetails ToOption(MockQuestionOption o) => new() { Id = o.Id, OptionText = o.OptionText, ImageUrl = o.ImageUrl, Explanation = o.Explanation, IsCorrect = o.IsCorrect, SortOrder = o.SortOrder }; diff --git a/RikiPath.Application/Services/ContentAuthoringService.cs b/RikiPath.Application/Services/ContentAuthoringService.cs index 8c11f121..029d53ba 100644 --- a/RikiPath.Application/Services/ContentAuthoringService.cs +++ b/RikiPath.Application/Services/ContentAuthoringService.cs @@ -1406,7 +1406,9 @@ public async Task> SuggestPracticeE return ApiResponse.NotFound("Không tìm thấy bài học."); var skillId = request.LanguageSkillId ?? lesson.LanguageSkillId; - var skill = await unitOfWork.LanguageSkills.GetByIdAsync(skillId, cancellationToken); + if (skillId is null) + return ApiResponse.Fail("Hãy chọn kỹ năng cho bài luyện tập."); + var skill = await unitOfWork.LanguageSkills.GetByIdAsync(skillId.Value, cancellationToken); if (skill is null || skill.IsDeleted) return ApiResponse.NotFound("Không tìm thấy kỹ năng."); @@ -1490,13 +1492,15 @@ public async Task> ConfirmPracticeExe var skill = await unitOfWork.LanguageSkills.GetByIdAsync(request.LanguageSkillId, cancellationToken); if (skill is null || skill.IsDeleted) return ApiResponse.NotFound("Không tìm thấy kỹ năng."); + if (lesson.CertificateLevelId is not int levelId) + return ApiResponse.Fail("Bài luyện tập theo cấp độ cần bài học có cấp độ JLPT."); var canonicalPractice = ContentAuthoring.AuthoringPayloadConverter.ToPracticeExerciseImportPayload( request.Title, request.Description, lesson.Title, lesson.Id, - lesson.CertificateLevelId, + levelId, skill, request.Questions); diff --git a/RikiPath.Application/Services/ContentManagementService.cs b/RikiPath.Application/Services/ContentManagementService.cs index 6a65cb15..4509a388 100644 --- a/RikiPath.Application/Services/ContentManagementService.cs +++ b/RikiPath.Application/Services/ContentManagementService.cs @@ -54,10 +54,13 @@ public async Task> BulkImportAsync( case ContentEntityType.Lesson: { currentLesson = null; - var languageSkillId = GetRequiredInt(row, "LanguageSkillId"); - var skill = await unitOfWork.LanguageSkills.GetByIdAsync(languageSkillId, cancellationToken); - if (skill is null || skill.IsDeleted) - throw new InvalidOperationException($"LanguageSkillId {languageSkillId} không tồn tại hoặc đã bị xóa."); + var languageSkillId = GetOptionalInt(row, "LanguageSkillId"); + if (languageSkillId is int skillId) + { + var skill = await unitOfWork.LanguageSkills.GetByIdAsync(skillId, cancellationToken); + if (skill is null || skill.IsDeleted) + throw new InvalidOperationException($"LanguageSkillId {skillId} không tồn tại hoặc đã bị xóa."); + } var title = GetRequired(row, "Title"); var description = GetOptional(row, "Description"); @@ -292,6 +295,10 @@ await unitOfWork.LessonGrammars.AddAsync( var skill = await unitOfWork.LanguageSkills.GetByIdAsync(languageSkillId, cancellationToken); if (skill is null || skill.IsDeleted) throw new InvalidOperationException($"LanguageSkillId {languageSkillId} không tồn tại hoặc đã bị xóa."); + var passingScoreRaw = GetRequired(row, "PassingScorePercent"); + if (!double.TryParse(passingScoreRaw, NumberStyles.Float, CultureInfo.InvariantCulture, out var passingScore) + || !double.IsFinite(passingScore) || passingScore is <= 0 or > 100) + throw new InvalidOperationException("PassingScorePercent phải từ 1 đến 100."); await unitOfWork.PracticeExercises.AddAsync(new PracticeExercise { @@ -299,6 +306,7 @@ await unitOfWork.PracticeExercises.AddAsync(new PracticeExercise Description = GetOptional(row, "Description"), Lesson = lesson, LanguageSkillId = languageSkillId, + PassingScorePercent = passingScore, SortOrder = GetOptionalInt(row, "SortOrder") ?? row.RowNumber, }, cancellationToken); break; diff --git a/RikiPath.Application/Services/ContentPlanningService.cs b/RikiPath.Application/Services/ContentPlanningService.cs index 6c66103f..0a39afcb 100644 --- a/RikiPath.Application/Services/ContentPlanningService.cs +++ b/RikiPath.Application/Services/ContentPlanningService.cs @@ -176,12 +176,12 @@ private async Task LoadCatalogAsync(CancellationToken cancellationToken .Select(s => new CatalogSection(s.Id, s.Name, s.CertificateLevelId)).ToList(); var lessons = (await unitOfWork.Lessons.Query() - .Where(l => !l.IsDeleted) + .Where(l => !l.IsDeleted && l.CertificateLevelId.HasValue && l.LanguageSkillId.HasValue) .OrderByDescending(l => l.Id) .Take(MaxCatalogLessons) .Select(l => new { l.Id, l.Title, l.CertificateLevelId, l.LanguageSkillId }) .ToListAsync(cancellationToken)) - .Select(l => new CatalogLesson(l.Id, l.Title, l.CertificateLevelId, l.LanguageSkillId)).ToList(); + .Select(l => new CatalogLesson(l.Id, l.Title, l.CertificateLevelId!.Value, l.LanguageSkillId!.Value)).ToList(); return new Catalog(levels, skills, sections, lessons); } @@ -1172,4 +1172,4 @@ private async Task> RunAiWithRetryAsync( return new AiRunResult(null, lastError, null); } } -} \ No newline at end of file +} diff --git a/RikiPath.Application/Services/ExcelContentImportService.cs b/RikiPath.Application/Services/ExcelContentImportService.cs index bf6eb50c..2674d151 100644 --- a/RikiPath.Application/Services/ExcelContentImportService.cs +++ b/RikiPath.Application/Services/ExcelContentImportService.cs @@ -61,14 +61,21 @@ public async Task> PreviewAsync( if (fileStream is null || fileStream.Length == 0) return ApiResponse.Fail("File rỗng hoặc không đọc được."); - using var workbook = new XLWorkbook(fileStream); - var allHandlers = handlers.ToList(); + using var sourceWorkbook = new XLWorkbook(fileStream); + using var normalizedWorkbook = ZipExcelWorkbookNormalizer.NeedsNormalization(sourceWorkbook) + ? ZipExcelWorkbookNormalizer.Combine([(fileName, sourceWorkbook)], allHandlers, + passingScorePercent: null, questionPoints: null, requireContent: false) + : null; + var workbook = normalizedWorkbook ?? sourceWorkbook; var targetHandlers = (onlyType is null ? allHandlers : allHandlers.Where(h => h.EntityType == onlyType.Value)).ToList(); var response = new ImportPreviewResponse { PreviewId = Guid.NewGuid(), FileName = fileName }; + response.SourceSheets = sourceWorkbook.Worksheets + .Select(sheet => new ImportSourceSheetResponse(sheet.Name, ExcelSheetReader.ReadRows(sheet).Count)) + .ToList(); var media = new WorkbookMediaPreparation(); // Resolve Lesson rows first, even when only Practice Exercise was requested. @@ -97,6 +104,12 @@ public async Task> PreviewAsync( catch (JsonException) { /* the Lesson preview already reports invalid rows */ } } } + else if (targetHandlers.Contains(lessonHandler)) + lessonPreview = new SheetImportResponse + { + EntityType = ImportEntityType.Lesson, + SheetName = lessonHandler.SheetName, + }; } } @@ -108,20 +121,33 @@ public async Task> PreviewAsync( cancellationToken.ThrowIfCancellationRequested(); if (ReferenceEquals(handler, lessonHandler)) continue; - var sheet = ExcelSheetReader.FindSheet(workbook, handler.SheetName); - if (sheet is null) continue; // Single upload chỉ 1 sheet; Bulk upload cho phép thiếu sheet - - var rows = ToExcelRows(ExcelSheetReader.ReadRows(sheet)); - if (rows.Count == 0) continue; - - await media.PrepareAsync(rows, cancellationToken); + var names = handler.EntityType == ImportEntityType.MockTest + ? new[] { handler.SheetName, "Placement Test" } + : [handler.SheetName]; + foreach (var name in names) + { + var sheet = ExcelSheetReader.FindSheet(workbook, name); + if (sheet is null) continue; + var rows = ToExcelRows(ExcelSheetReader.ReadRows(sheet)); + if (rows.Count == 0) + { + response.Sheets.Add(new SheetImportResponse + { + EntityType = handler.EntityType, + SheetName = name, + }); + continue; + } - var sheetResult = handler is IWorkbookLessonAwareImportHandler lessonAwareHandler - ? await lessonAwareHandler.BuildDiffAsync(rows, workbookLessons, cancellationToken) - : await handler.BuildDiffAsync(rows, cancellationToken); - if (handler.EntityType == ImportEntityType.MockTest) - MockTestWorkbookRelations.Enrich(workbook, sheetResult); - response.Sheets.Add(sheetResult); + await media.PrepareAsync(rows, cancellationToken); + var sheetResult = handler is IWorkbookLessonAwareImportHandler lessonAwareHandler + ? await lessonAwareHandler.BuildDiffAsync(rows, workbookLessons, cancellationToken) + : await handler.BuildDiffAsync(rows, cancellationToken); + sheetResult.SheetName = name; + if (handler.EntityType == ImportEntityType.MockTest) + MockTestWorkbookRelations.Enrich(workbook, sheetResult, name == "Placement Test"); + response.Sheets.Add(sheetResult); + } } if (response.Sheets.Count == 0) @@ -242,7 +268,12 @@ private async Task> SaveDraftsAsync(ConfirmIm if (row.RowKey.Length > 500 || !Enum.IsDefined(row.EntityType)) return ApiResponse.Fail($"Dòng {row.SourceRowNumber}: thông tin học liệu không hợp lệ."); var info = ManualContentService.ReadListInfo(row.PayloadJson); - if (info?.CertificateLevelId is not int levelId || !levelCodes.TryGetValue(levelId, out _)) + var levelId = info?.CertificateLevelId ?? 0; + var allowsNoLevel = row.EntityType == ImportEntityType.Lesson || + row.EntityType is ImportEntityType.Kanji or ImportEntityType.Vocabulary or ImportEntityType.Grammar + && !string.IsNullOrWhiteSpace(info?.LessonTitle) || + row.EntityType == ImportEntityType.PracticeExercise && !string.IsNullOrWhiteSpace(info?.LessonTitle); + if (levelId > 0 ? !levelCodes.ContainsKey(levelId) : !allowsNoLevel) return ApiResponse.Fail($"Dòng {row.SourceRowNumber}: hãy chọn cấp độ hợp lệ."); if (!seen.Add((row.EntityType, row.RowKey, row.EntityType == ImportEntityType.PracticeExercise ? levelId : null))) continue; if (row.EntityType == ImportEntityType.MockTest) @@ -390,7 +421,7 @@ await audioTranscriptions.QueuePayloadsAsync( return $"Phần '{section.Title}', câu số {question.SortOrder}: {formatError}"; } } - return requireFullCoverage + return requireFullCoverage && !payload.IsPlacementAssessment ? ImportHandlerSupport.ValidateMockTestCoverage(levelCode, payload.Sections, skillNames) : null; } diff --git a/RikiPath.Application/Services/HomeworkService.cs b/RikiPath.Application/Services/HomeworkService.cs index d15ab246..4536c594 100644 --- a/RikiPath.Application/Services/HomeworkService.cs +++ b/RikiPath.Application/Services/HomeworkService.cs @@ -87,7 +87,7 @@ public async Task> GetCatalogAsync(string? level, stri .ThenBy(lesson => lesson.SortOrder).ThenBy(lesson => lesson.Id) .Skip((Math.Clamp(page, 1, 10000) - 1) * pageSize).Take(pageSize) .Select(lesson => new HomeworkLesson(lesson.Id, lesson.Title, lesson.CertificateLevel.Code, - lesson.LanguageSkill.Name)).ToListAsync(ct); + lesson.LanguageSkill == null ? string.Empty : lesson.LanguageSkill.Name)).ToListAsync(ct); var lessonIds = items.Select(lesson => lesson.Id).ToArray(); var exercises = await UsableExercises().Where(exercise => exercise.LessonId.HasValue && lessonIds.Contains(exercise.LessonId.Value)) .OrderBy(exercise => exercise.SortOrder).ThenBy(exercise => exercise.Id) @@ -401,8 +401,8 @@ public async Task> GetAssignmentsAsync(int? learnerId, Cancel item.DueAt, item.Status, item.HomeworkAssignmentLessons.OrderBy(link => link.Lesson.SortOrder).ThenBy(link => link.LessonId) - .Select(link => new HomeworkLesson(link.LessonId, link.Lesson.Title, link.Lesson.CertificateLevel.Code, - link.Lesson.LanguageSkill.Name)).ToList(), + .Select(link => new HomeworkLesson(link.LessonId, link.Lesson.Title, link.Lesson.CertificateLevel?.Code ?? string.Empty, + link.Lesson.LanguageSkill?.Name ?? string.Empty)).ToList(), item.Exercises.OrderBy(link => link.PracticeExercise.SortOrder).ThenBy(link => link.PracticeExerciseId) .Select(link => new HomeworkExercise(link.PracticeExerciseId, link.PracticeExercise.Title, link.PracticeExercise.Description, questionCounts.GetValueOrDefault(link.PracticeExerciseId), @@ -736,7 +736,7 @@ private IQueryable AssignmentsFor(ClaimDTO user, int? learne : item.LearnerId == user.Id)); private IQueryable VisibleLessons() => unit.Lessons.Query().Where(lesson => !lesson.IsDeleted && - !lesson.LanguageSkill.IsDeleted && !lesson.CertificateLevel.IsDeleted && + (lesson.LanguageSkillId == null || !lesson.LanguageSkill!.IsDeleted) && !lesson.CertificateLevel.IsDeleted && SupportedLevels.Contains(lesson.CertificateLevel.Code) && lesson.CertificateLevel.CertificateType.Name == "JLPT" && lesson.CertificateLevel.CertificateType.IsActive && !lesson.CertificateLevel.CertificateType.IsDeleted); diff --git a/RikiPath.Application/Services/LearningMomentService.cs b/RikiPath.Application/Services/LearningMomentService.cs index f5983291..94523095 100644 --- a/RikiPath.Application/Services/LearningMomentService.cs +++ b/RikiPath.Application/Services/LearningMomentService.cs @@ -393,7 +393,7 @@ private async Task> BuildCandidatesAsync(int userId, DateT && a.SubmittedAt != null && a.ScorePercent.HasValue && (a.PracticeExercise.Scope == PracticeExerciseScopes.GroupQuiz || a.PracticeExercise.Scope == PracticeExerciseScopes.StageAssessment) - && a.ScorePercent >= (a.PracticeExercise.PassingScorePercent > 0 ? a.PracticeExercise.PassingScorePercent : LessonPracticeProgress.PassingScore)) + && a.ScorePercent >= a.PracticeExercise.PassingScorePercent) .OrderByDescending(a => a.SubmittedAt) .Select(a => new { diff --git a/RikiPath.Application/Services/LearningPathService.cs b/RikiPath.Application/Services/LearningPathService.cs index aa637dac..55b3a82f 100644 --- a/RikiPath.Application/Services/LearningPathService.cs +++ b/RikiPath.Application/Services/LearningPathService.cs @@ -34,7 +34,6 @@ public partial class LearningPathService( private const int MaxNotebookWords = 50; private const int MaxLessonProgressItems = 30; private const int MaxCatalogLessons = 60; // Giữ prompt vừa giới hạn token, vẫn trải đều kỹ năng và cấp độ. - private const double MinimumPracticePassPercent = LessonPracticeProgress.PassingScore; private const double CompletedPercent = 100; private static readonly ConcurrentDictionary UserGenerateLocks = new(); private static readonly JsonSerializerOptions StoredPathJsonOptions = @@ -686,7 +685,7 @@ private async Task> UpdateActiveDayAsync( !await LessonPracticeProgress.AllClearedAsync(unitOfWork, userId, daySchedule.LessonIds.Distinct().ToArray(), cancellationToken)) return ApiResponse.Fail( - $"Hãy đạt Practice Exercise của từng lesson trong ngày này với điểm tối thiểu {MinimumPracticePassPercent:0}% để mở ngày tiếp theo.", + "Hãy đạt điểm yêu cầu do tác giả hoặc quản trị viên đặt cho bài luyện tập của từng lesson trong ngày này để mở ngày tiếp theo.", HttpStatusCode.Conflict, errorCode: "LEARNING_PATH_PRACTICE_PASS_REQUIRED"); daySchedule.IsCompleted = true; @@ -1053,8 +1052,8 @@ private static string BuildFeasibilityText( levelLessons = await unitOfWork.Lessons.GetByCertificateLevelAsync(level.Id); loadedLevels[level.Id] = levelLessons; } - var matchingLessons = levelLessons.Where(lesson => - skillGroupById.GetValueOrDefault(lesson.LanguageSkillId) == assessment.Group); + var matchingLessons = levelLessons.Where(lesson => lesson.LanguageSkillId is int skillId && + skillGroupById.GetValueOrDefault(skillId) == assessment.Group); catalog.AddRange(matchingLessons.Select(lesson => new CatalogLesson( lesson.Id, lesson.Title, level.Code, diff --git a/RikiPath.Application/Services/LessonPracticeProgress.cs b/RikiPath.Application/Services/LessonPracticeProgress.cs index e626f1c5..62c38d5a 100644 --- a/RikiPath.Application/Services/LessonPracticeProgress.cs +++ b/RikiPath.Application/Services/LessonPracticeProgress.cs @@ -6,8 +6,6 @@ namespace RikiPath.Application.Services; internal static class LessonPracticeProgress { - public const double PassingScore = 70; - public static IQueryable ReadyExercises(IUnitOfWork unit) => unit.PracticeExercises.Query().Where(exercise => !exercise.IsDeleted && exercise.Questions!.Any(question => !question.IsDeleted) && @@ -37,8 +35,7 @@ public static async Task> PassedAsync(IUnitOfWork unit, int userId, exercise => exercise.Id, (attempt, exercise) => new { attempt, exercise }) .Where(row => !row.attempt.IsDeleted && !row.exercise.IsDeleted && row.attempt.UserId == userId && row.attempt.HomeworkAssignmentId == null && row.attempt.IsCompleted && - // Same rule as the roadmap: the Quick Check's own passing score; PassingScore only when unset. - row.attempt.ScorePercent >= (row.exercise.PassingScorePercent > 0 ? row.exercise.PassingScorePercent : PassingScore) && + row.attempt.ScorePercent >= row.exercise.PassingScorePercent && lessonIds.Contains(row.exercise.LessonId!.Value)) .Select(row => row.exercise.LessonId!.Value).Distinct().ToListAsync(ct)).ToHashSet(); } diff --git a/RikiPath.Application/Services/LessonProgressService.cs b/RikiPath.Application/Services/LessonProgressService.cs index b65f7fda..14424d61 100644 --- a/RikiPath.Application/Services/LessonProgressService.cs +++ b/RikiPath.Application/Services/LessonProgressService.cs @@ -21,6 +21,82 @@ public class LessonProgressService( IReviewService? reviewService = null) : ILessonProgressService { private const int AutoCompleteThresholdPercent = 95; + private const int TopicPageSize = 20; + + public async Task> SearchTopicsAsync( + string? query, int page, CancellationToken cancellationToken) + { + if (page < 1 || query?.Length > 100) + return ApiResponse.Fail( + "Trang hoặc từ khóa tìm kiếm không hợp lệ.", HttpStatusCode.BadRequest); + + try + { + var (total, items) = await unitOfWork.Lessons.SearchLearnerTopicsAsync( + query?.Trim() ?? string.Empty, page, TopicPageSize, cancellationToken); + return ApiResponse.Success(new LearnerTopicSearchResponse + { + Total = total, + Page = page, + PageSize = TopicPageSize, + Items = items.Select(item => new LearnerTopicItemResponse + { + Id = item.Id, + Title = item.Title, + Description = item.Description, + LessonCount = item.LessonCount, + }).ToList(), + }); + } + catch (OperationCanceledException) { throw; } + catch (Exception exception) + { + logger?.LogError(exception, "Failed to search learner topics."); + return ApiResponse.Fail( + "Không thể tìm chủ đề học.", HttpStatusCode.InternalServerError); + } + } + + public async Task> GetTopicLessonsAsync( + int topicId, int page, CancellationToken cancellationToken) + { + if (topicId <= 0 || page < 1) + return ApiResponse.Fail( + "Chủ đề hoặc trang không hợp lệ.", HttpStatusCode.BadRequest); + + try + { + var topic = await unitOfWork.Topics.FirstOrDefaultAsync( + item => item.Id == topicId && !item.IsDeleted, cancellationToken); + if (topic is null) + return ApiResponse.NotFound("Không tìm thấy chủ đề học."); + + var userId = claimService.GetUserClaim().Id; + var (total, lessons) = await unitOfWork.Lessons.GetLearnerVisibleByTopicAsync( + topicId, userId, page, TopicPageSize, cancellationToken); + if (total == 0) + return ApiResponse.NotFound("Chủ đề chưa có bài học khả dụng."); + + return ApiResponse.Success(new LearnerTopicLessonsResponse + { + TopicId = topic.Id, + Title = topic.Title, + Description = topic.Description, + Total = total, + Page = page, + PageSize = TopicPageSize, + Lessons = lessons.Select(lesson => + MapToResponse(lesson, lesson.LessonProgresses?.FirstOrDefault())).ToList(), + }); + } + catch (OperationCanceledException) { throw; } + catch (Exception exception) + { + logger?.LogError(exception, "Failed to load learner topic {TopicId}.", topicId); + return ApiResponse.Fail( + "Không thể tải bài học theo chủ đề.", HttpStatusCode.InternalServerError); + } + } public async Task> GetLearningDiscoveryAsync( int certificateLevelId, @@ -629,7 +705,7 @@ private static LearningLessonSummaryResponse MapToSummary(Lesson lesson, bool ha HasAudio = !string.IsNullOrWhiteSpace(lesson.AudioUrl), SortOrder = lesson.SortOrder, LanguageSkillId = lesson.LanguageSkillId, - LanguageSkillName = lesson.LanguageSkill.Name, + LanguageSkillName = lesson.LanguageSkill?.Name ?? string.Empty, ProgressPercent = progress?.ProgressPercent ?? 0, ResumePositionSeconds = progress?.LastPositionSeconds ?? 0, IsCompleted = progress?.IsCompleted ?? false, @@ -643,9 +719,9 @@ private static LessonDetailResponse MapToResponse( { LessonId = lesson.Id, CertificateLevelId = lesson.CertificateLevelId, - LevelCode = lesson.CertificateLevel.Code, + LevelCode = lesson.CertificateLevel?.Code ?? string.Empty, LanguageSkillId = lesson.LanguageSkillId, - LanguageSkillName = lesson.LanguageSkill.Name, + LanguageSkillName = lesson.LanguageSkill?.Name ?? string.Empty, Title = lesson.Title, Content = lesson.Description ?? string.Empty, AudioUrl = lesson.AudioUrl, diff --git a/RikiPath.Application/Services/ManualContentService.cs b/RikiPath.Application/Services/ManualContentService.cs index 49b87516..f940c84a 100644 --- a/RikiPath.Application/Services/ManualContentService.cs +++ b/RikiPath.Application/Services/ManualContentService.cs @@ -266,7 +266,7 @@ async Task PopulateEntitiesAsync() foreach (var e in entities) { - var key = $"{e.Title.Trim()} / {e.LevelCode.Trim()}"; + var key = $"{e.Title.Trim()} / {e.LevelCode?.Trim() ?? "Không cấp độ"}"; var isMine = ownedEntityIds.Contains(e.Id) || legacyApprovedKeys.Contains(key); proposalByEntityId.TryGetValue(e.Id, out var proposal); var dto = new UnifiedAuthorContentItem @@ -277,7 +277,7 @@ async Task PopulateEntitiesAsync() Status = "Approved", IsMine = isMine, CertificateLevelId = e.CertificateLevelId, - JlptLevelName = e.LevelCode, + JlptLevelName = e.LevelCode ?? string.Empty, LanguageSkillId = e.LanguageSkillId, SkillName = e.SkillName, Title = e.Title, @@ -292,7 +292,7 @@ async Task PopulateEntitiesAsync() UpdatedAt = e.UpdatedAt, }; AttachProposal(dto, proposal); - rows.Add((dto, [e.CertificateLevelId])); + rows.Add((dto, e.CertificateLevelId is int levelId ? [levelId] : Array.Empty())); } } } @@ -494,7 +494,7 @@ private static UnifiedAuthorContentItem BuildRequestRow( item.CertificateLevelId = p.CertificateLevelId; item.JlptLevelName = ResolveLevelCode(p.CertificateLevelId, p.CertificateLevelCode, levels); item.LanguageSkillId = p.LanguageSkillId; - item.SkillName = skills.GetValueOrDefault(p.LanguageSkillId); + item.SkillName = p.LanguageSkillId is int skillId ? skills.GetValueOrDefault(skillId) : null; item.Title = p.Title; item.Description = p.Description; item.AudioUrl = p.AudioUrl; @@ -513,9 +513,9 @@ private static UnifiedAuthorContentItem BuildRequestRow( return item; } - private static string ResolveLevelCode(int levelId, string? fallback, IReadOnlyDictionary levels) + private static string ResolveLevelCode(int? levelId, string? fallback, IReadOnlyDictionary levels) { - if (levelId > 0 && levels.TryGetValue(levelId, out var code)) return code; + if (levelId is > 0 && levels.TryGetValue(levelId.Value, out var code)) return code; return fallback ?? string.Empty; } @@ -731,6 +731,8 @@ private async Task> SaveDraftAsync(ImportEntityType type, int? ImportEntityType.Kanji => await uow.Kanjis.Query().AnyAsync(x => !x.IsDeleted && x.Id == requestedTargetEntityId.Value, ct), ImportEntityType.Grammar => await uow.GrammarPatterns.Query().AnyAsync(x => !x.IsDeleted && x.Id == requestedTargetEntityId.Value, ct), ImportEntityType.Lesson => await uow.Lessons.Query().AnyAsync(x => !x.IsDeleted && x.Id == requestedTargetEntityId.Value, ct), + ImportEntityType.PracticeExercise => await uow.PracticeExercises.Query().AnyAsync(x => !x.IsDeleted && x.Id == requestedTargetEntityId.Value, ct), + ImportEntityType.MockTest => await uow.MockTests.Query().AnyAsync(x => !x.IsDeleted && x.Id == requestedTargetEntityId.Value && !x.IsArchivedVersion, ct), _ => false, }; if (!targetExists) @@ -1007,11 +1009,12 @@ private async Task ValidatePracticeExerciseLinksAsync( var scope = Domain.Enums.PracticeExerciseScopes.Normalize(exercise.Scope); if (scope == Domain.Enums.PracticeExerciseScopes.LessonQuickCheck) { - var lessonKnown = batchLessonKeys?.Contains((exercise.LessonTitle, exercise.CertificateLevelId)) == true; + int? lessonLevelId = exercise.CertificateLevelId > 0 ? exercise.CertificateLevelId : null; + var lessonKnown = batchLessonKeys?.Contains((exercise.LessonTitle, lessonLevelId)) == true; if (!lessonKnown) { lessonKnown = await uow.Lessons.Query().AnyAsync(lesson => !lesson.IsDeleted && - lesson.Title == exercise.LessonTitle && lesson.CertificateLevelId == exercise.CertificateLevelId, ct); + lesson.Title == exercise.LessonTitle && lesson.CertificateLevelId == lessonLevelId, ct); } if (!lessonKnown) { @@ -1023,7 +1026,7 @@ private async Task ValidatePracticeExerciseLinksAsync( .ToListAsync(ct); lessonKnown = pendingPayloads .Select(ReadListInfo) - .Any(info => info?.Title == exercise.LessonTitle && info?.CertificateLevelId == exercise.CertificateLevelId); + .Any(info => info?.Title == exercise.LessonTitle && info?.CertificateLevelId == lessonLevelId); } if (!lessonKnown) throw new ArgumentException($"Hãy gửi bài học '{exercise.LessonTitle}' trước hoặc cùng bài luyện tập."); @@ -1035,7 +1038,8 @@ private async Task ValidatePracticeExerciseLinksAsync( batchTopicKeys?.Contains((tt, (int?)exercise.CertificateLevelId)) == true; var topicExistsInDb = !topicExistsInBatch && !string.IsNullOrWhiteSpace(tt) && await uow.Topics.Query().AnyAsync(t => !t.IsDeleted && t.Title == tt - && (!t.CertificateLevelId.HasValue || t.CertificateLevelId == exercise.CertificateLevelId), ct); + && (!t.Lessons.Any(l => !l.IsDeleted) + || t.Lessons.Any(l => !l.IsDeleted && l.CertificateLevelId == exercise.CertificateLevelId)), ct); var topicIdExists = !topicExistsInBatch && !topicExistsInDb && exercise.TopicId.HasValue && await uow.Topics.Query().AnyAsync(t => !t.IsDeleted && t.Id == exercise.TopicId.Value, ct); if (!topicExistsInBatch && !topicExistsInDb && !topicIdExists) @@ -1064,7 +1068,11 @@ private static void ValidateStoredImportPayload(ContentApprovalRequest item) throw new ArgumentException("Payload bản nháp không hợp lệ."); var info = ReadListInfo(item.PayloadJson); - if (info?.CertificateLevelId is not > 0) + var allowsNoLevel = item.EntityType == ImportEntityType.Lesson || + item.EntityType is ImportEntityType.Kanji or ImportEntityType.Vocabulary or ImportEntityType.Grammar + && !string.IsNullOrWhiteSpace(info?.LessonTitle) || + item.EntityType == ImportEntityType.PracticeExercise && !string.IsNullOrWhiteSpace(info?.LessonTitle); + if (!allowsNoLevel && info?.CertificateLevelId is not > 0) throw new ArgumentException("Payload bản nháp thiếu cấp độ JLPT."); if (item.EntityType == ImportEntityType.MockTest) @@ -1105,8 +1113,12 @@ private static void ValidateStoredImportPayload(ContentApprovalRequest item) var level = importLevels is null ? await uow.CertificateLevels.Query().SingleOrDefaultAsync(x => x.Id == levelId && !x.IsDeleted && x.CertificateType.IsActive && !x.CertificateType.IsDeleted, ct) - : importLevels.GetValueOrDefault(levelId); - if (level is null) throw new ArgumentException("Hãy chọn cấp độ hợp lệ."); + : levelId is int id ? importLevels.GetValueOrDefault(id) : null; + var linkedContent = type is ImportEntityType.Kanji or ImportEntityType.Vocabulary or ImportEntityType.Grammar + && !string.IsNullOrWhiteSpace(Read(input).LessonTitle) || + type == ImportEntityType.PracticeExercise && !string.IsNullOrWhiteSpace(Read(input).LessonTitle); + if (levelId is > 0 && level is null || type != ImportEntityType.Lesson && !linkedContent && level is null) + throw new ArgumentException("Hãy chọn cấp độ hợp lệ."); switch (type) { @@ -1116,14 +1128,15 @@ private static void ValidateStoredImportPayload(ContentApprovalRequest item) lesson.Title = Required(lesson.Title, "Tên bài học"); if (lesson.AudioUrl is not null) lesson.AudioUrl = MediaUrl(lesson.AudioUrl, "URL âm thanh") ?? string.Empty; - lesson.CertificateLevelCode = level.Code; - await RequireSkillAsync(lesson.LanguageSkillId, ct); + lesson.CertificateLevelCode = level?.Code ?? string.Empty; + if (lesson.LanguageSkillId is int lessonSkillId) + await RequireSkillAsync(lessonSkillId, ct); lesson.TopicTitle = lesson.TopicId is int topicId ? await uow.Topics.Query().Where(x => x.Id == topicId && !x.IsDeleted) .Select(x => x.Title).SingleOrDefaultAsync(ct) ?? throw new ArgumentException("Chủ đề đã chọn không còn tồn tại.") : NormalizeTopicTitle(lesson.TopicTitle); - return (lesson, $"{lesson.Title} / {level.Code}"); + return (lesson, $"{lesson.Title} / {level?.Code ?? "Không cấp độ"}"); case ImportEntityType.Vocabulary: var vocabulary = Read(input); if (vocabulary.ImageUrl is not null) vocabulary.ImageUrl = MediaUrl(vocabulary.ImageUrl, "URL ảnh") ?? string.Empty; @@ -1131,7 +1144,7 @@ private static void ValidateStoredImportPayload(ContentApprovalRequest item) vocabulary.Reading = Required(vocabulary.Reading, "Cách đọc"); vocabulary.Meaning = Required(vocabulary.Meaning, "Nghĩa"); vocabulary.AudioUrl = MediaUrl(vocabulary.AudioUrl, "URL âm thanh"); - vocabulary.CertificateLevelCode = level.Code; + vocabulary.CertificateLevelCode = level?.Code ?? string.Empty; return (vocabulary, $"{vocabulary.Word} / {vocabulary.Reading}"); case ImportEntityType.Kanji: var kanji = Read(input); @@ -1141,25 +1154,26 @@ private static void ValidateStoredImportPayload(ContentApprovalRequest item) if (kanji.StrokeCount <= 0) throw new ArgumentException("Số nét phải lớn hơn 0."); kanji.AudioUrl = MediaUrl(kanji.AudioUrl, "URL âm thanh"); kanji.StrokeOrderImageUrl = MediaUrl(kanji.StrokeOrderImageUrl, "URL ảnh thứ tự nét"); - kanji.CertificateLevelCode = level.Code; + kanji.CertificateLevelCode = level?.Code ?? string.Empty; return (kanji, kanji.Character); case ImportEntityType.Grammar: var grammar = Read(input); if (grammar.ImageUrl is not null) grammar.ImageUrl = MediaUrl(grammar.ImageUrl, "URL ảnh") ?? string.Empty; grammar.Title = Required(grammar.Title, "Tên mẫu ngữ pháp"); grammar.Structure = Required(grammar.Structure, "Cấu trúc"); - grammar.CertificateLevelCode = level.Code; + grammar.CertificateLevelCode = level?.Code ?? string.Empty; return (grammar, grammar.Title); case ImportEntityType.MockTest: var test = Read(input); await ValidateMockTestAsync(test, level, ct); - return (test, $"{test.Title} / {level.Code}"); + return (test, $"{test.Title} / {level.Code}" + + (test.IsPlacementAssessment ? " / Placement" : string.Empty)); case ImportEntityType.PracticeExercise: var exercise = Read(input); await ValidateExerciseAsync(exercise, ct); var exTarget = !string.IsNullOrEmpty(exercise.LessonTitle) ? exercise.LessonTitle - : (!string.IsNullOrEmpty(exercise.TopicTitle) ? exercise.TopicTitle : level.Code); + : (!string.IsNullOrEmpty(exercise.TopicTitle) ? exercise.TopicTitle : level?.Code ?? string.Empty); return (exercise, $"{exercise.Title} / {exTarget}"); default: throw new ArgumentException("Loại nội dung không được hỗ trợ."); @@ -1224,7 +1238,7 @@ private async Task ValidateMockTestAsync(MockTestImportPayloadResponse test, Cer } } var error = ExcelContentImportService.ValidateMockTestPayload(JsonSerializer.Serialize(test), skills, - new Dictionary { [level.Id] = level.Code }); + new Dictionary { [level.Id] = level.Code }, requireFullCoverage: !test.IsPlacementAssessment); if (error is not null) throw new ArgumentException(error); } @@ -1232,14 +1246,14 @@ private async Task ValidateExerciseAsync(PracticeExerciseImportPayloadResponse e { exercise.Title = Required(exercise.Title, "Tên bài luyện tập"); exercise.Scope = Domain.Enums.PracticeExerciseScopes.Normalize(exercise.Scope); - if (exercise.PassingScorePercent <= 0 || exercise.PassingScorePercent > 100) - exercise.PassingScorePercent = 70; + if (!double.IsFinite(exercise.PassingScorePercent) || exercise.PassingScorePercent <= 0 || exercise.PassingScorePercent > 100) + throw new ArgumentException("Điểm đạt phải từ 1 đến 100%."); if (exercise.ImageUrl is not null) exercise.ImageUrl = MediaUrl(exercise.ImageUrl, "URL ảnh bài tập") ?? string.Empty; exercise.LanguageSkillName = await RequireSkillAsync(exercise.LanguageSkillId, ct); if (exercise.LessonId.HasValue) { exercise.LessonTitle = await uow.Lessons.Query().Where(x => x.Id == exercise.LessonId - && !x.IsDeleted && x.CertificateLevelId == exercise.CertificateLevelId) + && !x.IsDeleted && x.CertificateLevelId == (exercise.CertificateLevelId > 0 ? exercise.CertificateLevelId : null)) .Select(x => x.Title).SingleOrDefaultAsync(ct) ?? throw new ArgumentException("Bài học không thuộc cấp độ đã chọn."); } @@ -1254,11 +1268,34 @@ private async Task ValidateExerciseAsync(PracticeExerciseImportPayloadResponse e ?? throw new ArgumentException("Chặng/Chủ đề không tồn tại.") : Required(exercise.TopicTitle, "Chủ đề / Chặng học"); } + var passageCodes = new HashSet(StringComparer.OrdinalIgnoreCase); + exercise.Passages ??= []; + for (var i = 0; i < exercise.Passages.Count; i++) + { + var passage = exercise.Passages[i]; + passage.PassageCode = Required(passage.PassageCode, $"Mã đoạn đọc/nghe {i + 1}"); + passage.Title = Required(passage.Title, $"Tiêu đề đoạn đọc/nghe {i + 1}"); + if (!passageCodes.Add(passage.PassageCode)) + throw new ArgumentException("Mã đoạn đọc/nghe không được trùng trong bài luyện tập."); + passage.AudioUrl = MediaUrl(passage.AudioUrl, $"URL âm thanh đoạn {i + 1}"); + passage.ImageUrl = MediaUrl(passage.ImageUrl, $"URL ảnh đoạn {i + 1}"); + if (string.IsNullOrWhiteSpace(passage.PassageText) && passage.AudioUrl is null && passage.ImageUrl is null) + throw new ArgumentException($"Đoạn đọc/nghe {i + 1} cần nội dung, âm thanh hoặc hình ảnh."); + passage.SortOrder = i + 1; + } if (exercise.Questions is not { Count: > 0 }) throw new ArgumentException("Hãy thêm câu hỏi."); for (var i = 0; i < exercise.Questions.Count; i++) { var question = exercise.Questions[i] ?? throw new ArgumentException("Câu hỏi không hợp lệ."); question.SortOrder = i + 1; + if (!double.IsFinite(question.Points) || question.Points <= 0) + throw new ArgumentException($"Điểm câu {question.SortOrder} phải lớn hơn 0."); + if (!string.IsNullOrWhiteSpace(question.PassageCode)) + { + question.PassageCode = question.PassageCode.Trim(); + if (!passageCodes.Contains(question.PassageCode)) + throw new ArgumentException($"Câu {question.SortOrder} liên kết đoạn đọc/nghe không tồn tại."); + } question.ImageUrl = MediaUrl(question.ImageUrl, $"URL ảnh câu {question.SortOrder}"); question.QuestionText = question.ImageUrl is null ? Required(question.QuestionText, $"Nội dung câu {question.SortOrder}") : question.QuestionText?.Trim() ?? string.Empty; SetOptionOrder(question.Options, allowImage: true); @@ -1323,9 +1360,13 @@ await uow.LanguageSkills.Query().Where(x => !x.IsDeleted && x.Id == id).Select(x ids = type switch { ImportEntityType.Lesson => uow.Lessons.Query().Where(x => !x.IsDeleted - && x.Title == fields.Title && x.CertificateLevelId == fields.CertificateLevelId).Select(x => x.Id), + && x.Title == fields.Title && (fields.CertificateLevelId <= 0 + ? x.CertificateLevelId == null : x.CertificateLevelId == fields.CertificateLevelId)).Select(x => x.Id), ImportEntityType.MockTest => uow.MockTests.Query().Where(x => !x.IsDeleted - && x.Title == fields.Title && x.CertificateLevelId == fields.CertificateLevelId).Select(x => x.Id), + && !x.IsArchivedVersion && x.Title == fields.Title + && x.CertificateLevelId == fields.CertificateLevelId + && x.ExamKind == (fields.IsPlacementAssessment + ? ExamKind.Placement : ExamKind.FullMockTest)).Select(x => x.Id), ImportEntityType.Kanji => uow.Kanjis.Query().Where(x => !x.IsDeleted && x.Character == fields.Character).Select(x => x.Id), ImportEntityType.Vocabulary => uow.Vocabularies.Query().Where(x => !x.IsDeleted && x.Word == fields.Word && x.Reading == fields.Reading).Select(x => x.Id), @@ -1368,9 +1409,11 @@ private static string Required(string? value, string label) => string.IsNullOrWhiteSpace(value) ? throw new ArgumentException($"{label} không được để trống.") : value.Trim(); private sealed record ManualIdentity(string? Title, string? Character, string? Word, string? Reading, - string? LessonTitle, int CertificateLevelId, string? Scope = null, string? TopicTitle = null); + string? LessonTitle, int CertificateLevelId, string? Scope = null, string? TopicTitle = null, + bool IsPlacementAssessment = false); - internal sealed record ManualListInfo(int? CertificateLevelId, string? TopicTitle, string? Title); + internal sealed record ManualListInfo(int? CertificateLevelId, string? TopicTitle, string? Title, + string? LessonTitle = null); } public sealed record ManualContentItem(int Id, ImportEntityType EntityType, string RowKey, ContentApprovalStatus Status, diff --git a/RikiPath.Application/Services/MockTestWorkbookRelations.cs b/RikiPath.Application/Services/MockTestWorkbookRelations.cs index 3a046f7e..26b50fe3 100644 --- a/RikiPath.Application/Services/MockTestWorkbookRelations.cs +++ b/RikiPath.Application/Services/MockTestWorkbookRelations.cs @@ -32,11 +32,11 @@ private static List Read(XLWorkbook book, string name) return sheet is null ? [] : ExcelSheetReader.ReadRows(sheet); } - public static void Enrich(XLWorkbook book, SheetImportResponse result) + public static void Enrich(XLWorkbook book, SheetImportResponse result, bool placement = false) { - var passages = Read(book, "Mock Passage"); - var questions = Read(book, "MockQuestion"); - var options = Read(book, "MockQuestionOption"); + var passages = Read(book, placement ? "Placement Passage" : "Mock Passage"); + var questions = Read(book, placement ? "PlacementQuestion" : "MockQuestion"); + var options = placement ? [] : Read(book, "MockQuestionOption"); if (passages.Count == 0 && questions.Count == 0 && options.Count == 0) return; var ambiguousTitles = result.Rows.Select(row => row.ParsedFields.GetValueOrDefault("mockTestTitle")) .Where(title => !string.IsNullOrWhiteSpace(title)) diff --git a/RikiPath.Application/Services/PracticeQuizService.cs b/RikiPath.Application/Services/PracticeQuizService.cs index cd11f910..c82cc639 100644 --- a/RikiPath.Application/Services/PracticeQuizService.cs +++ b/RikiPath.Application/Services/PracticeQuizService.cs @@ -17,7 +17,19 @@ public class PracticeQuizService( ILearningPathService learningPathService, IStandardRoadmapService? standardRoadmapService = null) : IPracticeQuizService { - public const double MinimumPassingScorePercent = LessonPracticeProgress.PassingScore; + + private static List MapPassages(PracticeExercise exercise) => + (exercise.Passages ?? []).Where(p => !p.IsDeleted).OrderBy(p => p.SortOrder) + .Select(p => new PracticePassageResponse + { + PassageCode = p.PassageCode, + Title = p.Title, + PassageText = p.PassageText, + Instructions = p.Instructions, + AudioUrl = p.AudioUrl, + ImageUrl = p.ImageUrl, + SortOrder = p.SortOrder, + }).ToList(); public Task>> GetLessonExercisesAsync( int lessonId, CancellationToken cancellationToken) @@ -46,11 +58,11 @@ public async Task>> G .Select(e => new PracticeExerciseSummaryResponse { Id = e.Id, - MinimumPassingScorePercent = e.PassingScorePercent > 0 ? e.PassingScorePercent : MinimumPassingScorePercent, + MinimumPassingScorePercent = e.PassingScorePercent, Passed = unitOfWork.PracticeExerciseAttempts.Query().Any(a => !a.IsDeleted && a.UserId == userId && a.HomeworkAssignmentId == null && a.IsCompleted && a.PracticeExerciseId == e.Id && - a.ScorePercent >= (e.PassingScorePercent > 0 ? e.PassingScorePercent : MinimumPassingScorePercent)), + a.ScorePercent >= e.PassingScorePercent), LessonId = e.LessonId ?? 0, TopicId = e.TopicId, CertificateLevelId = e.CertificateLevelId, @@ -117,7 +129,7 @@ public async Task> StartCheckpointA await unitOfWork.PracticeExerciseAttempts.AddAsync(attempt, cancellationToken); await unitOfWork.SaveChangesAsync(cancellationToken); - var passingScore = exercise.PassingScorePercent > 0 ? exercise.PassingScorePercent : MinimumPassingScorePercent; + var passingScore = exercise.PassingScorePercent; return ApiResponse.Success(new PracticeExerciseAttemptResponse { AttemptId = attempt.Id, @@ -129,12 +141,15 @@ public async Task> StartCheckpointA TopicId = exercise.TopicId, CertificateLevelId = exercise.CertificateLevelId, PassingScorePercent = passingScore, + Passages = MapPassages(exercise), Questions = questions.Select(question => new PracticeExerciseQuestionResponse { QuestionId = question.Id, QuestionText = question.QuestionText, ImageUrl = question.ImageUrl, SortOrder = question.SortOrder, + Points = question.Points, + PassageCode = question.ContentPassage?.PassageCode, Options = (question.Options ?? []).Where(option => !option.IsDeleted) .OrderBy(option => option.SortOrder) .Select(option => new PracticeExerciseOptionResponse @@ -192,12 +207,12 @@ private async Task>> .Select(exercise => new PracticeExerciseSummaryResponse { Id = exercise.Id, - MinimumPassingScorePercent = exercise.PassingScorePercent > 0 ? exercise.PassingScorePercent : MinimumPassingScorePercent, + MinimumPassingScorePercent = exercise.PassingScorePercent, Passed = unitOfWork.PracticeExerciseAttempts.Query().Any(attempt => !attempt.IsDeleted && attempt.UserId == userId && attempt.HomeworkAssignmentId == null && attempt.IsCompleted && attempt.PracticeExerciseId == exercise.Id && - attempt.ScorePercent >= (exercise.PassingScorePercent > 0 ? exercise.PassingScorePercent : MinimumPassingScorePercent)), + attempt.ScorePercent >= exercise.PassingScorePercent), LessonId = exercise.LessonId ?? 0, TopicId = exercise.TopicId, CertificateLevelId = exercise.CertificateLevelId, @@ -275,10 +290,12 @@ private async Task> StartAsync( } else if (!assignmentId.HasValue && fromCatalog && lesson is not null) { - if (skill is not null && (skill is not ("Reading" or "Listening") || lesson.LanguageSkill.Name != skill)) + if (lesson.CertificateLevelId is not int catalogLevelId) + return ApiResponse.Fail("Bài học này không thuộc danh mục JLPT.", HttpStatusCode.Conflict); + if (skill is not null && (skill is not ("Reading" or "Listening") || lesson.LanguageSkill?.Name != skill)) return ApiResponse.Fail("Kỹ năng ôn luyện không hợp lệ."); var catalog = await unitOfWork.Lessons.GetLearnerVisibleByLevelAsync( - lesson.CertificateLevelId, userId, cancellationToken); + catalogLevelId, userId, cancellationToken); var preceding = catalog.Where(item => skill is null || item.LanguageSkill.Name == skill) .TakeWhile(item => item.Id != lesson.Id).Select(item => item.Id).ToArray(); if (!await LessonPracticeProgress.AllClearedAsync(unitOfWork, userId, preceding, cancellationToken)) @@ -330,7 +347,7 @@ private async Task> StartAsync( await unitOfWork.SaveChangesAsync(cancellationToken); } - var passingScore = exercise.PassingScorePercent > 0 ? exercise.PassingScorePercent : MinimumPassingScorePercent; + var passingScore = exercise.PassingScorePercent; return ApiResponse.Success(new PracticeExerciseAttemptResponse { AttemptId = attempt.Id, @@ -342,12 +359,15 @@ private async Task> StartAsync( TopicId = exercise.TopicId, CertificateLevelId = exercise.CertificateLevelId, PassingScorePercent = passingScore, + Passages = MapPassages(exercise), Questions = questions.Select(question => new PracticeExerciseQuestionResponse { QuestionId = question.Id, QuestionText = question.QuestionText, ImageUrl = question.ImageUrl, SortOrder = question.SortOrder, + Points = question.Points, + PassageCode = question.ContentPassage?.PassageCode, Options = (question.Options ?? []).Where(option => !option.IsDeleted) .OrderBy(option => option.SortOrder) .Select(option => new PracticeExerciseOptionResponse @@ -460,6 +480,7 @@ private async Task> SubmitAsy var answerMap = suppliedAnswers.ToDictionary(answer => answer.QuestionId); var correctCount = 0; + var earnedPoints = 0d; var persistedAnswers = new List(questions.Count); var questionResults = new List(questions.Count); @@ -473,7 +494,11 @@ private async Task> SubmitAsy : null; var correctOpt = visibleOptions.FirstOrDefault(o => o.IsCorrect); var isCorrect = selectedOpt is not null && selectedOpt.IsCorrect; - if (isCorrect) correctCount++; + if (isCorrect) + { + correctCount++; + earnedPoints += question.Points; + } persistedAnswers.Add(new LearnerPracticeAnswer { @@ -487,6 +512,8 @@ private async Task> SubmitAsy { QuestionId = question.Id, SortOrder = question.SortOrder, + Points = question.Points, + EarnedPoints = isCorrect ? question.Points : 0, QuestionText = question.QuestionText, SelectedOptionId = selectedOptionId, SelectedOptionText = selectedOpt?.OptionText, @@ -497,7 +524,10 @@ private async Task> SubmitAsy }); } - var scorePercent = Math.Round(correctCount * 100d / questions.Count, 2); + var totalPoints = questions.Sum(question => question.Points); + if (totalPoints <= 0 || questions.Any(question => !double.IsFinite(question.Points) || question.Points <= 0)) + return ApiResponse.Fail("Điểm câu hỏi không hợp lệ.", HttpStatusCode.Conflict); + var scorePercent = Math.Round(earnedPoints * 100d / totalPoints, 2); attempt.ScorePercent = scorePercent; attempt.SubmittedAt = DateTime.UtcNow; attempt.IsCompleted = true; @@ -505,7 +535,7 @@ private async Task> SubmitAsy await unitOfWork.LearnerPracticeAnswers.AddRangeAsync(persistedAnswers, cancellationToken); await unitOfWork.SaveChangesAsync(cancellationToken); - var passingScore = exercise.PassingScorePercent > 0 ? exercise.PassingScorePercent : MinimumPassingScorePercent; + var passingScore = exercise.PassingScorePercent; var passed = scorePercent >= passingScore; var unlockedNextDay = false; if (passed && !assignmentId.HasValue && !fromAssessmentRoadmap && !isCheckpoint && exercise.LessonId is int completedLessonId) diff --git a/RikiPath.Application/Services/PracticeSubmissionService.cs b/RikiPath.Application/Services/PracticeSubmissionService.cs index 1582a2a4..bd7677fd 100644 --- a/RikiPath.Application/Services/PracticeSubmissionService.cs +++ b/RikiPath.Application/Services/PracticeSubmissionService.cs @@ -46,13 +46,17 @@ public class PracticeSubmissionService( """; private const string SpeakingGradingSystemPrompt = """ - Bạn chấm kỹ năng nói tiếng Nhật theo tiêu chí luyện nói của RikiPath, dựa trên bản chép lời. + Bạn chấm kỹ năng nói tiếng Nhật theo tiêu chí luyện nói của RikiPath, dựa trên bản chép lời + và kết quả đo phát âm Azure khi được cung cấp. Mã cấp độ chỉ dùng để điều chỉnh kỳ vọng về kỹ năng nói. Không quy đổi điểm sang điểm thi JLPT hoặc suy luận khả năng đỗ. Đối chiếu câu mẫu hoặc đề bài nếu được cung cấp. Chấm mỗi tiêu chí từ 0-10: Mức độ đáp ứng đề, Ngữ pháp, Từ vựng, Tính mạch lạc, Cách diễn đạt. overallScore là trung bình điểm 5 tiêu chí nhân 10, trong khoảng 0-100. - Chỉ đánh giá nội dung thể hiện trong văn bản. Không suy đoán phát âm, ngữ điệu hoặc tốc độ nói. + Điểm phát âm/độ trôi chảy chỉ được nhận xét theo số đo Azure. Nếu có từ điểm thấp, + chỉ ra từ đó, đưa cách đọc bằng kana và hướng dẫn chia nhịp, luyện đọc lại bằng tiếng Việt. + Không tự suy đoán lỗi âm vị, cao độ + hay ngữ điệu khi Azure không cung cấp dữ liệu; ProsodyScore không có cho ja-JP. Viết phản hồi tiếng Việt và trả một JSON object đúng cấu trúc: { "overallScore": number, "criteria": [ { "name": string, "score": number, "comment": string } ], "strengths": string[], "improvements": string[], @@ -108,7 +112,27 @@ public async Task> SubmitAsync( } var (grading, gradingNote) = await GradeAsync( - userId, submission.Type, submission.TextContent!, level.Code, request.Topic, cancellationToken); + userId, submission.Type, submission.TextContent!, level.Code, request.Topic, + request.PronunciationAssessment, cancellationToken); + + if (request.PronunciationAssessment is { } assessment) + { + grading ??= new GradingResultResponse + { + OverallScore = assessment.PronunciationScore, + Criteria = + [ + new() { Name = "Phát âm", Score = assessment.AccuracyScore / 10, Comment = "Điểm đo bởi Azure Speech." }, + new() { Name = "Độ trôi chảy", Score = assessment.FluencyScore / 10, Comment = "Điểm đo bởi Azure Speech." }, + ], + Improvements = ["Nghe lại bản thu và luyện đọc các từ có điểm phát âm thấp."], + GradedAt = DateTime.UtcNow, + }; + grading.Pronunciation = assessment; + } + + if (grading is not null) + grading.SpeakingAudioFeedback = request.SpeakingAudioFeedback; if (grading is not null) { @@ -239,9 +263,17 @@ public async Task> RegradeAsync( return ApiResponse.Fail( $"Loại bài {submission.Type} chưa hỗ trợ chấm tự động.", HttpStatusCode.BadRequest); + var previousGrading = DeserializeGrading(submission.GradingResult); + var savedAssessment = previousGrading?.Pronunciation; var (grading, gradingNote) = await GradeAsync( userId, submission.Type, submission.TextContent!, submission.CertificateLevel?.Code ?? string.Empty, - topic: null, cancellationToken); + topic: savedAssessment?.ReferenceText, savedAssessment, cancellationToken); + + if (grading is not null) + { + grading.Pronunciation = savedAssessment; + grading.SpeakingAudioFeedback = previousGrading?.SpeakingAudioFeedback; + } if (grading is not null) { @@ -289,11 +321,22 @@ await unitOfWork.GradingResults.AddAsync(new GradingResult // ===================================================================== private async Task<(GradingResultResponse? Grading, string? Note)> GradeAsync( int userId, SubmissionType type, string essayText, string certificateLevelCode, string? topic, - CancellationToken cancellationToken) + PronunciationAssessmentResult? assessment, CancellationToken cancellationToken) { var systemPrompt = type == SubmissionType.Speaking ? SpeakingGradingSystemPrompt : EssayGradingSystemPrompt; var userPrompt = BuildGradingUserPrompt(essayText, certificateLevelCode, topic); + if (type == SubmissionType.Speaking && assessment is not null) + userPrompt += "\n[KẾT QUẢ ĐO TỪ AZURE SPEECH; chỉ nhận xét theo dữ liệu này]\n" + + JsonSerializer.Serialize(new + { + assessment.AccuracyScore, + assessment.FluencyScore, + assessment.CompletenessScore, + assessment.PronunciationScore, + weakWords = assessment.Words.Where(w => w.AccuracyScore < 75 || w.ErrorType is not (null or "None")) + .Take(20).Select(w => new { w.Text, w.AccuracyScore, w.ErrorType }), + }); string? lastError = null; for (var attempt = 1; attempt <= MaxAiAttempts; attempt++) diff --git a/RikiPath.Application/Services/SpeechToTextService.cs b/RikiPath.Application/Services/SpeechToTextService.cs index 1b51dc5a..48fda7f6 100644 --- a/RikiPath.Application/Services/SpeechToTextService.cs +++ b/RikiPath.Application/Services/SpeechToTextService.cs @@ -21,11 +21,20 @@ public async Task ConvertAudioToTextAsync(IFormFile audioFile, Cancellat public async Task ConvertAndSaveAudioAsync( IFormFile audioFile, CancellationToken cancellationToken = default) + { + if (speechClient is null) + throw new InvalidOperationException("Dịch vụ nhận dạng audio AWS chưa được cấu hình."); + var audioUrl = await SaveAudioAsync(audioFile, cancellationToken); + var result = await speechClient.TranscribeFromUrlAsync(audioUrl, cancellationToken); + return new(result.TranscribedText, audioUrl); + } + + public async Task SaveAudioAsync(IFormFile audioFile, CancellationToken cancellationToken = default) { if (audioFile.Length == 0 || audioFile.Length > 25 * 1024 * 1024) throw new ArgumentException("File audio phải có dữ liệu và không vượt quá 25MB."); - if (fileStorage is null || claims is null || speechClient is null) - throw new InvalidOperationException("Dịch vụ lưu và nhận dạng audio AWS chưa được cấu hình."); + if (fileStorage is null || claims is null) + throw new InvalidOperationException("Dịch vụ lưu audio chưa được cấu hình."); string? contentType; await using (var input = audioFile.OpenReadStream()) { @@ -37,8 +46,7 @@ public async Task ConvertAndSaveAudioAsync( await using var stream = audioFile.OpenReadStream(); var uploaded = await fileStorage.UploadPrivateVerificationAsync( stream, contentType, claims.GetUserClaim().Id, cancellationToken); - var result = await speechClient.TranscribeFromUrlAsync(uploaded.Url, cancellationToken); - return new(result.TranscribedText, uploaded.Url); + return uploaded.Url; } diff --git a/RikiPath.Application/Services/SrsCardTemplateService.cs b/RikiPath.Application/Services/SrsCardTemplateService.cs index 99e647b5..769c18e1 100644 --- a/RikiPath.Application/Services/SrsCardTemplateService.cs +++ b/RikiPath.Application/Services/SrsCardTemplateService.cs @@ -525,7 +525,9 @@ private async Task> ResolveAndValidateTempla var lesson = await unitOfWork.Lessons.GetByIdAsync(request.LessonId.Value, cancellationToken); if (lesson is null || lesson.IsDeleted) return ApiResponse.NotFound("Không tìm thấy bài học liên kết."); - var level = await unitOfWork.CertificateLevels.GetByIdAsync(lesson.CertificateLevelId, cancellationToken); + var level = lesson.CertificateLevelId is int levelId + ? await unitOfWork.CertificateLevels.GetByIdAsync(levelId, cancellationToken) + : null; jlptLevel ??= SrsSchedulingHelper.NormalizeSupportedJlptLevel(level?.Code); } diff --git a/RikiPath.Application/Services/StandardRoadmapService.cs b/RikiPath.Application/Services/StandardRoadmapService.cs index 31a473f7..ca2af0ed 100644 --- a/RikiPath.Application/Services/StandardRoadmapService.cs +++ b/RikiPath.Application/Services/StandardRoadmapService.cs @@ -352,7 +352,7 @@ public async Task> GetAssessmentRoadmapAsyn var progress = lesson.Progress; var hasQc = quickCheckByLesson.TryGetValue(lesson.Id, out var qc); var qcPassing = hasQc && qc is not null - ? (qc.PassingScorePercent > 0 ? qc.PassingScorePercent : LessonPracticeProgress.PassingScore) + ? qc.PassingScorePercent : (double?)null; var stat = hasQc && qc is not null && statsByExercise.TryGetValue(qc.Id, out var s) ? s : null; var qcPassed = hasQc && qcPassing.HasValue && stat is { HasAnyScore: true } && stat.BestScore >= qcPassing.Value; @@ -425,7 +425,7 @@ public async Task> GetAssessmentRoadmapAsyn .GroupBy(x => new { x.Dto.LevelCode, x.Raw.TopicId, x.IsBridge }) .OrderBy(g => g.Key.IsBridge ? 0 : 1) .ThenBy(g => JlptCurriculum.Rank(g.Key.LevelCode)) - .ThenBy(g => g.First().Raw.TopicSortOrder ?? int.MaxValue) + .ThenBy(g => g.Min(x => x.Raw.SortOrder)) .ThenBy(g => g.Key.TopicId ?? int.MaxValue) .ToList(); @@ -449,7 +449,7 @@ public async Task> GetAssessmentRoadmapAsyn if (gq is not null) { statsByExercise.TryGetValue(gq.Id, out var gStat); - var gqPassing = gq.PassingScorePercent > 0 ? gq.PassingScorePercent : LessonPracticeProgress.PassingScore; + var gqPassing = gq.PassingScorePercent; var isPassed = gStat is { HasAnyScore: true } && gStat.BestScore >= gqPassing; var unlocked = allCleared || allStudied; groupQuiz = new RoadmapCheckpointResponse @@ -520,7 +520,7 @@ public async Task> GetAssessmentRoadmapAsyn var levelLessons = levelStages.SelectMany(s => s.Lessons).ToList(); var levelReady = levelLessons.Count > 0 && levelLessons.All(l => l.IsCompleted || l.IsStudied); statsByExercise.TryGetValue(sa.Id, out var sStat); - var saPassing = sa.PassingScorePercent > 0 ? sa.PassingScorePercent : LessonPracticeProgress.PassingScore; + var saPassing = sa.PassingScorePercent; var saPassed = sStat is { HasAnyScore: true } && sStat.BestScore >= saPassing; anchorStage.StageAssessment = new RoadmapCheckpointResponse diff --git a/RikiPath.Application/Services/StudyCohortMentorInvitationService.cs b/RikiPath.Application/Services/StudyCohortMentorInvitationService.cs index 5455d8f0..dd2e5d6b 100644 --- a/RikiPath.Application/Services/StudyCohortMentorInvitationService.cs +++ b/RikiPath.Application/Services/StudyCohortMentorInvitationService.cs @@ -155,6 +155,10 @@ public Task> CreateAdminCohortAsync(CreateAdminCohortRequest } var (level, sessions, policy) = await ValidateAdminCohortScheduleAsync(r.Level, r.Capacity, r.Price, r.CourseDurationWeeks, r.Sessions, ct); + Rule(preparationStorage is not null && await preparationStorage.LevelPreparationZipExistsAsync(level, ct), + "COHORT_PREPARATION_ZIP_REQUIRED", + "Cấp độ này chưa có ZIP tài liệu chuẩn bị. Hãy tải ZIP theo cấp độ trước khi tạo lớp.", + HttpStatusCode.Conflict); var defaultCutoff = sessions[0].StartsAtUtc; Rule(!r.EnrollmentClosesAtUtc.HasValue || (r.EnrollmentClosesAtUtc.Value.Kind == DateTimeKind.Utc && r.EnrollmentClosesAtUtc.Value > DateTime.UtcNow diff --git a/RikiPath.Application/Services/StudyCourseService.cs b/RikiPath.Application/Services/StudyCourseService.cs index c369b12a..b3b642d7 100644 --- a/RikiPath.Application/Services/StudyCourseService.cs +++ b/RikiPath.Application/Services/StudyCourseService.cs @@ -25,7 +25,8 @@ public sealed partial class StudyCourseService(IUnitOfWork uow, IClaimService cl IEmailTemplateService? emailTemplates = null, ILogger? logger = null, ICohortEnrollmentDeadlineService? enrollmentDeadlines = null, - ISidebarCounterNotifier? sidebarNotifier = null) : IStudyCourseService + ISidebarCounterNotifier? sidebarNotifier = null, + SupabaseFileStorageService? preparationStorage = null) : IStudyCourseService { private ClaimDTO Actor => claims.GetUserClaim(); private Task NotifyAdminsCounterAsync(string reason, CancellationToken ct) diff --git a/RikiPath.Application/Services/SupabaseFileStorageService.cs b/RikiPath.Application/Services/SupabaseFileStorageService.cs index 2a8a3607..b570168a 100644 --- a/RikiPath.Application/Services/SupabaseFileStorageService.cs +++ b/RikiPath.Application/Services/SupabaseFileStorageService.cs @@ -316,13 +316,42 @@ private async Task SignObjectAsync(string bucket, string objectPath, Can private static string CohortPreparationPath(int cohortId) => $"cohort-preparation/{cohortId}/materials.zip"; + private static string LevelPreparationPath(string level) + { + if (!RikiPath.Domain.MentorScheduling.MentorSlotPolicy.IsSupportedClassLevel(level)) + throw new ArgumentException("Cấp độ lớp không hợp lệ.", nameof(level)); + return $"level-preparation/{level.Trim().ToUpperInvariant()}/materials.zip"; + } + + public Task UploadLevelPreparationZipAsync(string level, Stream contentStream, + CancellationToken cancellationToken) + => UploadPrivatePreparationZipAsync(LevelPreparationPath(level), contentStream, cancellationToken); + + public Task LevelPreparationZipExistsAsync(string level, CancellationToken cancellationToken) + => PrivatePreparationZipExistsAsync(LevelPreparationPath(level), cancellationToken); + + public async Task GetLevelPreparationZipDownloadUrlAsync(string level, + CancellationToken cancellationToken) + { + var objectPath = LevelPreparationPath(level); + if (!await PrivatePreparationZipExistsAsync(objectPath, cancellationToken)) return null; + var bucket = await RequirePrivateVerificationBucketAsync(cancellationToken); + return await SignObjectAsync(bucket, objectPath, cancellationToken); + } + public async Task UploadCohortPreparationZipAsync(int cohortId, Stream contentStream, CancellationToken cancellationToken) { - EnsureConfigured(); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(cohortId); + return await UploadPrivatePreparationZipAsync(CohortPreparationPath(cohortId), contentStream, + cancellationToken); + } + + private async Task UploadPrivatePreparationZipAsync(string objectPath, Stream contentStream, + CancellationToken cancellationToken) + { + EnsureConfigured(); var bucket = await RequirePrivateVerificationBucketAsync(cancellationToken); - var objectPath = CohortPreparationPath(cohortId); using var content = new StreamContent(contentStream); content.Headers.ContentType = new MediaTypeHeaderValue("application/zip"); using var request = new HttpRequestMessage(HttpMethod.Post, @@ -337,17 +366,25 @@ public async Task UploadCohortPreparationZipAsync(int cohortId, Stream c public async Task GetCohortPreparationZipDownloadUrlAsync(int cohortId, CancellationToken cancellationToken) { - EnsureConfigured(); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(cohortId); - var bucket = await RequirePrivateVerificationBucketAsync(cancellationToken); var objectPath = CohortPreparationPath(cohortId); + if (!await PrivatePreparationZipExistsAsync(objectPath, cancellationToken)) return null; + var bucket = await RequirePrivateVerificationBucketAsync(cancellationToken); + return await SignObjectAsync(bucket, objectPath, cancellationToken); + } + + private async Task PrivatePreparationZipExistsAsync(string objectPath, + CancellationToken cancellationToken) + { + EnsureConfigured(); + var bucket = await RequirePrivateVerificationBucketAsync(cancellationToken); using var info = new HttpRequestMessage(HttpMethod.Head, $"/storage/v1/object/info/{Uri.EscapeDataString(bucket)}/{objectPath}"); using var response = await httpClient.SendAsync(info, cancellationToken); - if (response.StatusCode == System.Net.HttpStatusCode.NotFound) return null; + if (response.StatusCode == System.Net.HttpStatusCode.NotFound) return false; if (!response.IsSuccessStatusCode) throw new InvalidOperationException($"Không thể kiểm tra ZIP tài liệu lớp trên Supabase (HTTP {(int)response.StatusCode})."); - return await SignObjectAsync(bucket, objectPath, cancellationToken); + return true; } public async Task SignCohortPreparationZipAsync(int cohortId, CancellationToken cancellationToken) diff --git a/RikiPath.Domain/Entities/ContentPassage.cs b/RikiPath.Domain/Entities/ContentPassage.cs index 809ceea3..1f35268d 100644 --- a/RikiPath.Domain/Entities/ContentPassage.cs +++ b/RikiPath.Domain/Entities/ContentPassage.cs @@ -31,10 +31,14 @@ public class ContentPassage : Base public int? MockTestSectionId { get; set; } public MockTestSection? MockTestSection { get; set; } + public int? PracticeExerciseId { get; set; } + public PracticeExercise? PracticeExercise { get; set; } + public int Version { get; set; } = 1; public int? ParentPassageId { get; set; } public bool IsArchivedVersion { get; set; } public List? Questions { get; set; } + public List? PracticeQuestions { get; set; } } } diff --git a/RikiPath.Domain/Entities/Lesson.cs b/RikiPath.Domain/Entities/Lesson.cs index 571b9728..4b6da700 100644 --- a/RikiPath.Domain/Entities/Lesson.cs +++ b/RikiPath.Domain/Entities/Lesson.cs @@ -19,10 +19,10 @@ public class Lesson : Base public string? SourceProvenance { get; set; } public List HomeworkAssignmentLessons { get; set; } = new(); - public int CertificateLevelId { get; set; } - public CertificateLevel CertificateLevel { get; set; } - public int LanguageSkillId { get; set; } - public LanguageSkill LanguageSkill { get; set; } + public int? CertificateLevelId { get; set; } + public CertificateLevel? CertificateLevel { get; set; } + public int? LanguageSkillId { get; set; } + public LanguageSkill? LanguageSkill { get; set; } public ContentStatus Status { get; set; } = ContentStatus.Published; public int Version { get; set; } = 1; diff --git a/RikiPath.Domain/Entities/MockTestSection.cs b/RikiPath.Domain/Entities/MockTestSection.cs index 98d55c57..be6aa4e7 100644 --- a/RikiPath.Domain/Entities/MockTestSection.cs +++ b/RikiPath.Domain/Entities/MockTestSection.cs @@ -16,6 +16,8 @@ public class MockTestSection : Base public int CertificateSectionId { get; set; } public CertificateSection CertificateSection { get; set; } = null!; public int? DurationMinutes { get; set; } + public double MaxScore { get; set; } = 60; + public double? PassingScore { get; set; } public string? Instructions { get; set; } public string? SectionPolicyJson { get; set; } public List? Passages { get; set; } diff --git a/RikiPath.Domain/Entities/PracticeExercise.cs b/RikiPath.Domain/Entities/PracticeExercise.cs index 2d044c45..f1428ec7 100644 --- a/RikiPath.Domain/Entities/PracticeExercise.cs +++ b/RikiPath.Domain/Entities/PracticeExercise.cs @@ -19,7 +19,8 @@ public class PracticeExercise : Base public int LanguageSkillId { get; set; } public LanguageSkill LanguageSkill { get; set; } = null!; public int SortOrder { get; set; } - public double PassingScorePercent { get; set; } = 70; + public double PassingScorePercent { get; set; } + public List? Passages { get; set; } public List? Questions { get; set; } public List? Attempts { get; set; } } diff --git a/RikiPath.Domain/Entities/PracticeQuestion.cs b/RikiPath.Domain/Entities/PracticeQuestion.cs index b9a3ad48..321d6967 100644 --- a/RikiPath.Domain/Entities/PracticeQuestion.cs +++ b/RikiPath.Domain/Entities/PracticeQuestion.cs @@ -8,8 +8,11 @@ public class PracticeQuestion : Base public string QuestionText { get; set; } = string.Empty; public string? Explanation { get; set; } public int SortOrder { get; set; } + public double Points { get; set; } = 1.0; public int PracticeExerciseId { get; set; } public PracticeExercise PracticeExercise { get; set; } = null!; + public int? ContentPassageId { get; set; } + public ContentPassage? ContentPassage { get; set; } public List? Options { get; set; } public List? Answers { get; set; } } diff --git a/RikiPath.Domain/Entities/Topic.cs b/RikiPath.Domain/Entities/Topic.cs index b84b8b38..d4d4bb34 100644 --- a/RikiPath.Domain/Entities/Topic.cs +++ b/RikiPath.Domain/Entities/Topic.cs @@ -5,10 +5,5 @@ public class Topic : Base public int Id { get; set; } public string Title { get; set; } = string.Empty; public string? Description { get; set; } - public int SortOrder { get; set; } - public int? CertificateLevelId { get; set; } - public CertificateLevel? CertificateLevel { get; set; } - public string? StageCode { get; set; } - public string? LearningObjectives { get; set; } public List Lessons { get; set; } = new(); } diff --git a/RikiPath.Domain/OpenAiSettings.cs b/RikiPath.Domain/OpenAiSettings.cs index 704b5342..de714af9 100644 --- a/RikiPath.Domain/OpenAiSettings.cs +++ b/RikiPath.Domain/OpenAiSettings.cs @@ -10,6 +10,7 @@ public class OpenAiSettings public string ContentModel { get; set; } = "gpt-4.1-mini"; public string ReviewModel { get; set; } = "gpt-4.1-mini"; public string GradingModel { get; set; } = "gpt-4.1"; + public string SpeakingAudioModel { get; set; } = "gpt-audio-1.5"; public string OcrModel { get; set; } = "gpt-4.1-mini"; public string TranscriptionModel { get; set; } = "gpt-4o-mini-transcribe"; public int TimeoutSeconds { get; set; } = 180; diff --git a/RikiPath.Infrastructure/Clients/AzurePronunciationAssessmentClient.cs b/RikiPath.Infrastructure/Clients/AzurePronunciationAssessmentClient.cs new file mode 100644 index 00000000..5594448a --- /dev/null +++ b/RikiPath.Infrastructure/Clients/AzurePronunciationAssessmentClient.cs @@ -0,0 +1,104 @@ +using System.Buffers.Binary; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using RikiPath.Application.IClients; +using RikiPath.Domain; + +namespace RikiPath.Infrastructure.Clients; + +/// Azure scripted pronunciation assessment for a short Japanese PCM WAV recording. +public sealed class AzurePronunciationAssessmentClient(IHttpClientFactory clients, AppSettings appSettings) + : IAzurePronunciationAssessmentClient +{ + private const int MaxAudioBytes = 44 + 30 * 16_000 * 2; + + public async Task AssessAsync( + Stream audio, string referenceText, CancellationToken cancellationToken) + { + var settings = appSettings.AzureSpeechSettings; + var region = settings?.Region?.Trim(); + var key = settings?.SubscriptionKey?.Trim(); + if (string.IsNullOrWhiteSpace(region) || string.IsNullOrWhiteSpace(key) + || region.Any(c => !char.IsAsciiLetterLower(c) && !char.IsAsciiDigit(c))) + throw new InvalidOperationException("Azure Speech region/key chưa được cấu hình hợp lệ."); + if (string.IsNullOrWhiteSpace(referenceText) || referenceText.Length > 500) + throw new ArgumentException("Câu mẫu phải có từ 1 đến 500 ký tự.", nameof(referenceText)); + + using var buffer = new MemoryStream(); + await audio.CopyToAsync(buffer, cancellationToken); + var wav = buffer.ToArray(); + if (wav.Length is < 45 or > MaxAudioBytes || + !wav.AsSpan(0, 4).SequenceEqual("RIFF"u8) || + !wav.AsSpan(8, 4).SequenceEqual("WAVE"u8) || + !wav.AsSpan(12, 4).SequenceEqual("fmt "u8) || + BinaryPrimitives.ReadUInt16LittleEndian(wav.AsSpan(20, 2)) != 1 || + BinaryPrimitives.ReadUInt16LittleEndian(wav.AsSpan(22, 2)) != 1 || + BinaryPrimitives.ReadUInt32LittleEndian(wav.AsSpan(24, 4)) != 16_000 || + BinaryPrimitives.ReadUInt16LittleEndian(wav.AsSpan(34, 2)) != 16 || + !wav.AsSpan(36, 4).SequenceEqual("data"u8) || + BinaryPrimitives.ReadUInt32LittleEndian(wav.AsSpan(40, 4)) != wav.Length - 44) + throw new ArgumentException("Bản ghi phải là WAV PCM mono 16 kHz, tối đa 30 giây.", nameof(audio)); + + var endpoint = $"https://{region}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=ja-JP&format=detailed"; + var assessment = JsonSerializer.Serialize(new + { + ReferenceText = referenceText.Trim(), + GradingSystem = "HundredMark", + Granularity = "Word", + Dimension = "Comprehensive", + EnableMiscue = "True", + }); + using var request = new HttpRequestMessage(HttpMethod.Post, endpoint); + request.Headers.Add("Ocp-Apim-Subscription-Key", key); + request.Headers.Add("Pronunciation-Assessment", Convert.ToBase64String(Encoding.UTF8.GetBytes(assessment))); + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + request.Content = new ByteArrayContent(wav); + request.Content.Headers.TryAddWithoutValidation("Content-Type", "audio/wav; codecs=audio/pcm; samplerate=16000"); + using var response = await clients.CreateClient().SendAsync(request, cancellationToken); + if (!response.IsSuccessStatusCode) + throw new HttpRequestException("Azure Speech không thể chấm bản ghi.", null, response.StatusCode); + + await using var body = await response.Content.ReadAsStreamAsync(cancellationToken); + using var json = await JsonDocument.ParseAsync(body, cancellationToken: cancellationToken); + var root = json.RootElement; + if (!string.Equals(ReadString(root, "RecognitionStatus"), "Success", StringComparison.Ordinal) + || !root.TryGetProperty("NBest", out var best) || best.ValueKind != JsonValueKind.Array + || best.GetArrayLength() == 0) + throw new InvalidDataException("Azure Speech không nhận dạng được câu đọc."); + var first = best[0]; + var scores = first.TryGetProperty("PronunciationAssessment", out var nested) + && nested.ValueKind == JsonValueKind.Object ? nested : first; + var accuracy = ReadScore(scores, "AccuracyScore"); + var fluency = ReadScore(scores, "FluencyScore"); + var pronunciation = ReadScore(scores, "PronScore"); + if (accuracy is null || fluency is null || pronunciation is null) + throw new InvalidDataException("Azure Speech không trả đủ điểm phát âm tiếng Nhật."); + var words = new List(); + if (first.TryGetProperty("Words", out var wordArray) && wordArray.ValueKind == JsonValueKind.Array) + { + foreach (var word in wordArray.EnumerateArray().Take(100)) + { + var wordScores = word.TryGetProperty("PronunciationAssessment", out var wordNested) + && wordNested.ValueKind == JsonValueKind.Object ? wordNested : word; + words.Add(new PronunciationWordResult( + ReadString(word, "Word") ?? string.Empty, + ReadScore(wordScores, "AccuracyScore"), ReadString(wordScores, "ErrorType"), + ReadInt64(word, "Offset"), ReadInt64(word, "Duration"))); + } + } + return new PronunciationAssessmentResult(referenceText.Trim(), + ReadString(root, "DisplayText") ?? ReadString(first, "Display") ?? string.Empty, + accuracy.Value, fluency.Value, ReadScore(scores, "CompletenessScore"), + pronunciation.Value, null, words); + } + + private static string? ReadString(JsonElement element, string name) + => element.TryGetProperty(name, out var value) && value.ValueKind == JsonValueKind.String ? value.GetString() : null; + private static double? ReadScore(JsonElement element, string name) + => element.TryGetProperty(name, out var value) && value.ValueKind == JsonValueKind.Number + && value.TryGetDouble(out var score) && score is >= 0 and <= 100 ? score : null; + private static long? ReadInt64(JsonElement element, string name) + => element.TryGetProperty(name, out var value) && value.ValueKind == JsonValueKind.Number + && value.TryGetInt64(out var result) ? result : null; +} diff --git a/RikiPath.Infrastructure/Clients/OpenAiSpeakingAudioFeedbackClient.cs b/RikiPath.Infrastructure/Clients/OpenAiSpeakingAudioFeedbackClient.cs new file mode 100644 index 00000000..6c37bea2 --- /dev/null +++ b/RikiPath.Infrastructure/Clients/OpenAiSpeakingAudioFeedbackClient.cs @@ -0,0 +1,95 @@ +using System.Net.Http.Json; +using System.Text.Json; +using RikiPath.Application.Exceptions; +using RikiPath.Application.IClients; +using RikiPath.Application.IServices; + +namespace RikiPath.Infrastructure.Clients; + +/// Qualitative coaching from the actual recording; Azure remains the source of measured scores. +public sealed class OpenAiSpeakingAudioFeedbackClient(OpenAiClient client, IAiUsageQuotaService quota) + : ISpeakingAudioFeedbackClient +{ + private const string Instructions = """ + Bạn là giáo viên phát âm tiếng Nhật. Hãy NGHE bản ghi, đối chiếu câu mẫu, bản chép lời + và điểm đo Azure. Chỉ nhận xét những gì thật sự nghe được. Viết tiếng Việt, ngắn và cụ thể. + pronunciationAdvice: chỉ ra tối đa hai chỗ cần luyện âm hoặc nhịp đọc, kèm cách luyện lại. + intonationAdvice: nhận xét định tính về nhịp, chỗ ngắt và đường giọng nghe được; hướng dẫn + đọc lại. Không đưa điểm ngữ điệu, không khẳng định pitch accent đúng/sai nếu không chắc. + Nếu âm thanh không đủ rõ để nhận xét, nói rõ điều đó. Điểm Azure là nguồn đo phát âm, + không biến nhận xét của bạn thành điểm đo. Chỉ trả JSON object với hai chuỗi + pronunciationAdvice và intonationAdvice, không Markdown. + """; + + public async Task AnalyzeAsync(int userId, Stream audio, string referenceText, + string transcript, PronunciationAssessmentResult assessment, CancellationToken cancellationToken) + { + await quota.EnsureWithinQuotaAsync(userId, AiFeature.Grading, cancellationToken); + using var buffer = new MemoryStream(); + await audio.CopyToAsync(buffer, cancellationToken); + if (buffer.Length is < 45 or > 1_000_000) + throw new ArgumentException("Bản ghi WAV phải dài tối đa 30 giây.", nameof(audio)); + + var context = JsonSerializer.Serialize(new + { + ReferenceText = referenceText, + Transcript = transcript, + assessment.AccuracyScore, + assessment.FluencyScore, + WeakWords = assessment.Words.Where(w => w.AccuracyScore < 75 || w.ErrorType is not (null or "None")) + .Take(12).Select(w => new { w.Text, w.AccuracyScore, w.ErrorType }) + }); + var payload = new + { + model = client.Settings.SpeakingAudioModel, + modalities = new[] { "text" }, + messages = new object[] + { + new { role = "system", content = Instructions }, + new + { + role = "user", + content = new object[] + { + new { type = "text", text = context }, + new { type = "input_audio", input_audio = new { data = Convert.ToBase64String(buffer.ToArray()), format = "wav" } } + } + } + }, + max_completion_tokens = 600, + store = false + }; + using var request = client.CreateRequest("chat/completions", JsonContent.Create(payload)); + var raw = await client.SendAsync(request, cancellationToken); + try + { + using var response = JsonDocument.Parse(raw); + var root = response.RootElement; + var content = root.GetProperty("choices")[0].GetProperty("message").GetProperty("content").GetString(); + if (string.IsNullOrWhiteSpace(content)) + throw new JsonException("OpenAI audio returned empty text."); + var answer = content.Trim(); + if (answer.StartsWith("```", StringComparison.Ordinal)) + { + var start = answer.IndexOf('\n'); + var end = answer.LastIndexOf("```", StringComparison.Ordinal); + if (start >= 0 && end > start) answer = answer[(start + 1)..end].Trim(); + } + using var document = JsonDocument.Parse(answer); + var feedback = document.RootElement; + var pronunciation = feedback.GetProperty("pronunciationAdvice").GetString()?.Trim(); + var intonation = feedback.GetProperty("intonationAdvice").GetString()?.Trim(); + if (string.IsNullOrWhiteSpace(pronunciation) || string.IsNullOrWhiteSpace(intonation) + || pronunciation.Length > 1000 || intonation.Length > 1000) + throw new JsonException("OpenAI audio feedback was incomplete."); + var tokens = root.TryGetProperty("usage", out var usage) + && usage.TryGetProperty("total_tokens", out var total) ? total.GetInt32() : 0; + await quota.RecordUsageAsync(userId, AiFeature.Grading, tokens, cancellationToken); + return new SpeakingAudioFeedback(pronunciation, intonation); + } + catch (Exception ex) when (ex is JsonException or KeyNotFoundException or InvalidOperationException or IndexOutOfRangeException) + { + throw new AiServiceException("AI không trả về nhận xét âm thanh hợp lệ.", ex); + } + } +} diff --git a/RikiPath.Infrastructure/Configuration/ContentPassageConfig.cs b/RikiPath.Infrastructure/Configuration/ContentPassageConfig.cs index 422342f5..ce3f5deb 100644 --- a/RikiPath.Infrastructure/Configuration/ContentPassageConfig.cs +++ b/RikiPath.Infrastructure/Configuration/ContentPassageConfig.cs @@ -18,16 +18,18 @@ public void Configure(EntityTypeBuilder builder) builder.Property(x => x.SourceReference).HasMaxLength(300); builder.Property(x => x.AiProvenanceJson).HasColumnType("jsonb"); builder.Property(x => x.ContentFingerprint).IsRequired().HasMaxLength(64); - // ContentPassage chỉ có hai quan hệ: - // MockTestSection (1) -> ContentPassage (N), - // ContentPassage (1) -> MockQuestion (N). builder.HasOne(x => x.MockTestSection) .WithMany(x => x.Passages) .HasForeignKey(x => x.MockTestSectionId) .OnDelete(DeleteBehavior.SetNull); + builder.HasOne(x => x.PracticeExercise) + .WithMany(x => x.Passages) + .HasForeignKey(x => x.PracticeExerciseId) + .OnDelete(DeleteBehavior.Cascade); builder.HasIndex(x => x.PassageIdentity); builder.HasIndex(x => x.ContentFingerprint); builder.HasIndex(x => x.MockTestSectionId); + builder.HasIndex(x => x.PracticeExerciseId); } } diff --git a/RikiPath.Infrastructure/Configuration/LessonConfig.cs b/RikiPath.Infrastructure/Configuration/LessonConfig.cs index e2de4fa1..045b1602 100644 --- a/RikiPath.Infrastructure/Configuration/LessonConfig.cs +++ b/RikiPath.Infrastructure/Configuration/LessonConfig.cs @@ -10,7 +10,9 @@ public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.Id); builder.Property(x => x.CertificateLevelId).HasColumnName("CertificationLevelId"); + builder.Property(x => x.CertificateLevelId).IsRequired(false); builder.Property(x => x.LanguageSkillId).HasColumnName("SkillId"); + builder.Property(x => x.LanguageSkillId).IsRequired(false); builder.Property(x => x.Title).IsRequired().HasMaxLength(300); builder.HasOne(x => x.CertificateLevel) diff --git a/RikiPath.Infrastructure/Configuration/PracticeExerciseConfig.cs b/RikiPath.Infrastructure/Configuration/PracticeExerciseConfig.cs index 6fdf17ab..1cc7d580 100644 --- a/RikiPath.Infrastructure/Configuration/PracticeExerciseConfig.cs +++ b/RikiPath.Infrastructure/Configuration/PracticeExerciseConfig.cs @@ -17,8 +17,7 @@ public void Configure(EntityTypeBuilder builder) .HasDefaultValue(PracticeExerciseScopes.LessonQuickCheck) .HasSentinel(""); builder.Property(x => x.PassingScorePercent) - .HasDefaultValue(70d) - .HasSentinel(-1d); + .IsRequired(); builder.Property(x => x.LessonId).IsRequired(false); builder.HasOne(x => x.Lesson).WithMany().HasForeignKey(x => x.LessonId).OnDelete(DeleteBehavior.Cascade); builder.HasOne(x => x.Topic).WithMany().HasForeignKey(x => x.TopicId).OnDelete(DeleteBehavior.SetNull); diff --git a/RikiPath.Infrastructure/Configuration/PracticeQuestionConfig.cs b/RikiPath.Infrastructure/Configuration/PracticeQuestionConfig.cs index 6882dd70..79e7c479 100644 --- a/RikiPath.Infrastructure/Configuration/PracticeQuestionConfig.cs +++ b/RikiPath.Infrastructure/Configuration/PracticeQuestionConfig.cs @@ -10,6 +10,10 @@ public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.Id); builder.Property(x => x.QuestionText).IsRequired(); + builder.Property(x => x.Points).HasDefaultValue(1d); builder.HasOne(x => x.PracticeExercise).WithMany(x => x.Questions).HasForeignKey(x => x.PracticeExerciseId).OnDelete(DeleteBehavior.Cascade); + builder.HasOne(x => x.ContentPassage).WithMany(x => x.PracticeQuestions) + .HasForeignKey(x => x.ContentPassageId).OnDelete(DeleteBehavior.SetNull); + builder.HasIndex(x => x.ContentPassageId); } } diff --git a/RikiPath.Infrastructure/Configuration/TopicConfig.cs b/RikiPath.Infrastructure/Configuration/TopicConfig.cs index 3d21c9d8..83993fd7 100644 --- a/RikiPath.Infrastructure/Configuration/TopicConfig.cs +++ b/RikiPath.Infrastructure/Configuration/TopicConfig.cs @@ -10,11 +10,9 @@ public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.Id); builder.Property(x => x.Title).IsRequired().HasMaxLength(300); - builder.Property(x => x.StageCode).HasMaxLength(60); - builder.Property(x => x.LearningObjectives).HasMaxLength(1000); - builder.HasOne(x => x.CertificateLevel).WithMany() - .HasForeignKey(x => x.CertificateLevelId).OnDelete(DeleteBehavior.Restrict); - builder.HasIndex(x => new { x.CertificateLevelId, x.SortOrder }); + // The existing database still requires this column. Keep it as an EF shadow + // property so newly created topics can be inserted without restoring it to Topic. + builder.Property("SortOrder").ValueGeneratedNever(); builder.HasMany(x => x.Lessons).WithOne(x => x.Topic) .HasForeignKey(x => x.TopicId).OnDelete(DeleteBehavior.Restrict); } diff --git a/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.Designer.cs b/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.Designer.cs deleted file mode 100644 index 544572b4..00000000 --- a/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.Designer.cs +++ /dev/null @@ -1,14067 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261129090000_PersistClassSessionLifecycle")] - partial class PersistClassSessionLifecycle - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'Resolved', 'Rejected')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioDurationSeconds") - .HasColumnType("integer"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Topic") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageIdentity"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("QuestionBankItemId") - .HasColumnType("integer"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionBankItemId"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.QuestionBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioDurationSeconds") - .HasColumnType("integer"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(60) - .HasColumnType("character varying(60)") - .HasDefaultValue("VocabMeaning"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("AuthorUserId"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("QuestionBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany() - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.QuestionBankItem", "QuestionBankItem") - .WithMany() - .HasForeignKey("QuestionBankItemId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - - b.Navigation("QuestionBankItem"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.QuestionBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.cs b/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.cs deleted file mode 100644 index 52df1c43..00000000 --- a/RikiPath.Infrastructure/Migrations/20261129090000_PersistClassSessionLifecycle.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations; - -// Prepared source only. Rehearse on an isolated clone before applying. -public partial class PersistClassSessionLifecycle : Migration -{ - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn("Status", "StudyCohortSessions", type: "character varying(20)", maxLength: 20, nullable: true); - migrationBuilder.AddColumn("ActualStartedAtUtc", "StudyCohortSessions", type: "timestamp with time zone", nullable: true); - migrationBuilder.AddColumn("ActualEndedAtUtc", "StudyCohortSessions", type: "timestamp with time zone", nullable: true); - // Preserve ambiguous historical sessions as NULL. Attendance proves delivery, never actual timestamps. - migrationBuilder.Sql(""" - UPDATE "StudyCohortSessions" s SET "Status" = 'Completed' - WHERE EXISTS ( - SELECT 1 FROM "StudyCourseSessions" cs JOIN "StudyCourses" c ON c."Id" = cs."CourseId" - WHERE cs."AvailabilityId" = s."AvailabilityId" AND c."CohortId" = s."CohortId" - AND c."PaymentStatus" IN ('Paid', 'PartiallyRefunded') - AND c."Status" IN ('Ready', 'Active', 'Completed') - ) AND NOT EXISTS ( - SELECT 1 FROM "StudyCourses" c WHERE c."CohortId" = s."CohortId" - AND c."PaymentStatus" IN ('Paid', 'PartiallyRefunded') - AND c."Status" IN ('Ready', 'Active', 'Completed') - AND NOT EXISTS (SELECT 1 FROM "StudyCourseSessions" cs - WHERE cs."CourseId" = c."Id" AND cs."AvailabilityId" = s."AvailabilityId" - AND cs."Status" IN ('Present', 'Absent', 'ExcusedAbsent', 'Completed')) - ); - UPDATE "StudyCohortSessions" s SET "Status" = 'Cancelled' - FROM "StudyCohorts" c WHERE c."Id" = s."CohortId" AND c."Status" = 'Cancelled' AND s."Status" IS NULL; - """); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - // Rollback discards newly collected lifecycle data; export it before any approved rollback. - migrationBuilder.DropColumn("Status", "StudyCohortSessions"); - migrationBuilder.DropColumn("ActualStartedAtUtc", "StudyCohortSessions"); - migrationBuilder.DropColumn("ActualEndedAtUtc", "StudyCohortSessions"); - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.Designer.cs b/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.Designer.cs deleted file mode 100644 index c225bc6d..00000000 --- a/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.Designer.cs +++ /dev/null @@ -1,14117 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261129110000_AddLearningFeedbackAndComplaintWorkflow")] - partial class AddLearningFeedbackAndComplaintWorkflow - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CourseSessionId").HasColumnType("integer"); - b.Property("Title").HasMaxLength(200).HasColumnType("character varying(200)"); - b.Property("MentorDisclosure").HasMaxLength(2000).HasColumnType("character varying(2000)"); - b.Property("MentorAccessGrantedAtUtc").HasColumnType("timestamp with time zone"); - b.Property("MentorEvidenceAllowed").HasColumnType("boolean"); - - b.HasKey("Id"); - b.HasIndex("CourseSessionId"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl").HasMaxLength(500).HasColumnType("character varying(500)"); - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.Property("Id").ValueGeneratedOnAdd().HasColumnType("integer"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CourseId").HasColumnType("integer"); - b.Property("CourseSessionId").HasColumnType("integer"); - b.Property("LearnerId").HasColumnType("integer"); - b.Property("MentorId").HasColumnType("integer"); - b.Property("RespondedById").HasColumnType("integer"); - b.Property("IdempotencyKey").HasColumnType("uuid"); - b.Property("Revision").IsConcurrencyToken().HasColumnType("integer"); - b.Property("Topic").IsRequired().HasMaxLength(30).HasColumnType("character varying(30)"); - b.Property("Message").IsRequired().HasMaxLength(2000).HasColumnType("character varying(2000)"); - b.Property("Response").HasMaxLength(2000).HasColumnType("character varying(2000)"); - b.Property("EvidenceUrl").HasMaxLength(500).HasColumnType("character varying(500)"); - b.Property("CreatedAtUtc").HasColumnType("timestamp with time zone"); - b.Property("RespondedAtUtc").HasColumnType("timestamp with time zone"); - b.HasKey("Id"); - b.HasIndex("CourseId"); b.HasIndex("CourseSessionId"); - b.HasIndex("MentorId"); b.HasIndex("RespondedById"); - b.HasIndex("LearnerId", "IdempotencyKey").IsUnique(); - b.ToTable("CohortLearningFeedback", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioDurationSeconds") - .HasColumnType("integer"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Topic") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageIdentity"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("QuestionBankItemId") - .HasColumnType("integer"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionBankItemId"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.QuestionBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioDurationSeconds") - .HasColumnType("integer"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("AuthorUserId") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(60) - .HasColumnType("character varying(60)") - .HasDefaultValue("VocabMeaning"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("AuthorUserId"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("QuestionBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany().HasForeignKey("CourseSessionId").OnDelete(DeleteBehavior.Restrict); - b.Navigation("CourseSession"); - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course").WithMany() - .HasForeignKey("CourseId").OnDelete(DeleteBehavior.Restrict).IsRequired(); - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession").WithMany() - .HasForeignKey("CourseSessionId").OnDelete(DeleteBehavior.Restrict); - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner").WithMany() - .HasForeignKey("LearnerId").OnDelete(DeleteBehavior.Restrict).IsRequired(); - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor").WithMany() - .HasForeignKey("MentorId").OnDelete(DeleteBehavior.Restrict).IsRequired(); - b.HasOne("RikiPath.Domain.Entities.UserAccount", null).WithMany() - .HasForeignKey("RespondedById").OnDelete(DeleteBehavior.Restrict); - b.Navigation("Course"); b.Navigation("CourseSession"); b.Navigation("Learner"); b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany() - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.QuestionBankItem", "QuestionBankItem") - .WithMany() - .HasForeignKey("QuestionBankItemId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - - b.Navigation("QuestionBankItem"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.QuestionBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.cs b/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.cs deleted file mode 100644 index e1be2b01..00000000 --- a/RikiPath.Infrastructure/Migrations/20261129110000_AddLearningFeedbackAndComplaintWorkflow.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations; - -// Source preparation only. Requires build, drift check and isolated clean/baseline rehearsal before delivery. -public partial class AddLearningFeedbackAndComplaintWorkflow : Migration -{ - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn("Title", "CohortComplaints", type: "character varying(200)", maxLength: 200, nullable: true); - migrationBuilder.AddColumn("CourseSessionId", "CohortComplaints", type: "integer", nullable: true); - migrationBuilder.AddColumn("MentorDisclosure", "CohortComplaints", type: "character varying(2000)", maxLength: 2000, nullable: true); - migrationBuilder.AddColumn("MentorAccessGrantedAtUtc", "CohortComplaints", type: "timestamp with time zone", nullable: true); - migrationBuilder.AddColumn("MentorEvidenceAllowed", "CohortComplaints", type: "boolean", nullable: false, defaultValue: false); - migrationBuilder.AddColumn("EvidenceUrl", "CohortComplaintEvents", type: "character varying(500)", maxLength: 500, nullable: true); - migrationBuilder.DropCheckConstraint("CK_CohortComplaint_Status", "CohortComplaints"); - migrationBuilder.AddCheckConstraint("CK_CohortComplaint_Status", "CohortComplaints", - "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - migrationBuilder.CreateIndex("IX_CohortComplaints_CourseSessionId", "CohortComplaints", "CourseSessionId"); - migrationBuilder.AddForeignKey("FK_CohortComplaints_StudyCourseSessions_CourseSessionId", "CohortComplaints", "CourseSessionId", - "StudyCourseSessions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); - - migrationBuilder.CreateTable("CohortLearningFeedback", columns: table => new - { - Id = table.Column(type: "integer", nullable: false).Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CourseId = table.Column(type: "integer", nullable: false), - CourseSessionId = table.Column(type: "integer", nullable: true), - LearnerId = table.Column(type: "integer", nullable: false), - MentorId = table.Column(type: "integer", nullable: false), - RespondedById = table.Column(type: "integer", nullable: true), - Topic = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), - Message = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - EvidenceUrl = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - Response = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - RespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), - IdempotencyKey = table.Column(type: "uuid", nullable: false), - Revision = table.Column(type: "integer", nullable: false), - }, constraints: table => - { - table.PrimaryKey("PK_CohortLearningFeedback", x => x.Id); - table.ForeignKey("FK_CohortLearningFeedback_StudyCourses_CourseId", x => x.CourseId, "StudyCourses", "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_CohortLearningFeedback_StudyCourseSessions_CourseSessionId", x => x.CourseSessionId, "StudyCourseSessions", "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_CohortLearningFeedback_Users_LearnerId", x => x.LearnerId, "Users", "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_CohortLearningFeedback_Users_MentorId", x => x.MentorId, "Users", "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_CohortLearningFeedback_Users_RespondedById", x => x.RespondedById, "Users", "Id", onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateIndex("IX_CohortLearningFeedback_CourseId", "CohortLearningFeedback", "CourseId"); - migrationBuilder.CreateIndex("IX_CohortLearningFeedback_CourseSessionId", "CohortLearningFeedback", "CourseSessionId"); - migrationBuilder.CreateIndex("IX_CohortLearningFeedback_MentorId", "CohortLearningFeedback", "MentorId"); - migrationBuilder.CreateIndex("IX_CohortLearningFeedback_RespondedById", "CohortLearningFeedback", "RespondedById"); - migrationBuilder.CreateIndex("IX_CohortLearningFeedback_LearnerId_IdempotencyKey", "CohortLearningFeedback", new[] { "LearnerId", "IdempotencyKey" }, unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - // Refuse destructive rollback once this workflow has been used. Export and design a reviewed data-preserving rollback. - migrationBuilder.Sql(""" - DO $$ BEGIN - IF EXISTS (SELECT 1 FROM "CohortLearningFeedback") - OR EXISTS (SELECT 1 FROM "CohortComplaints" WHERE "Status" IN ('NeedsInformation', 'Withdrawn') - OR "Title" IS NOT NULL OR "CourseSessionId" IS NOT NULL OR "MentorDisclosure" IS NOT NULL - OR "MentorAccessGrantedAtUtc" IS NOT NULL OR "MentorEvidenceAllowed") - OR EXISTS (SELECT 1 FROM "CohortComplaintEvents" WHERE "EvidenceUrl" IS NOT NULL) - THEN RAISE EXCEPTION 'Workflow data exists; automatic rollback is refused to protect history.'; END IF; - END $$; - """); - migrationBuilder.DropTable("CohortLearningFeedback"); - migrationBuilder.DropForeignKey("FK_CohortComplaints_StudyCourseSessions_CourseSessionId", "CohortComplaints"); - migrationBuilder.DropIndex("IX_CohortComplaints_CourseSessionId", "CohortComplaints"); - migrationBuilder.DropCheckConstraint("CK_CohortComplaint_Status", "CohortComplaints"); - migrationBuilder.AddCheckConstraint("CK_CohortComplaint_Status", "CohortComplaints", "\"Status\" IN ('Open', 'UnderReview', 'Resolved', 'Rejected')"); - foreach (var column in new[] { "Title", "CourseSessionId", "MentorDisclosure", "MentorAccessGrantedAtUtc", "MentorEvidenceAllowed" }) - migrationBuilder.DropColumn(column, "CohortComplaints"); - migrationBuilder.DropColumn("EvidenceUrl", "CohortComplaintEvents"); - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.Designer.cs b/RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.Designer.cs deleted file mode 100644 index 38f00022..00000000 --- a/RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.Designer.cs +++ /dev/null @@ -1,13883 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261130043054_InitialCreate")] - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'Resolved', 'Rejected')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LatestBatchId") - .HasColumnType("uuid"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NaturalKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("OwnerUserId") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntityType", "TargetEntityId"); - - b.HasIndex("OwnerUserId", "EntityType", "NaturalKey") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("ContentBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("MockTestSectionId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageIdentity"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Owner") - .WithMany() - .HasForeignKey("OwnerUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Passages") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Passages"); - - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.Designer.cs b/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.Designer.cs deleted file mode 100644 index ff593514..00000000 --- a/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.Designer.cs +++ /dev/null @@ -1,14239 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261130120000_AddHomeworkFiles")] - partial class AddHomeworkFiles - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorAccessGrantedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorDisclosure") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorEvidenceAllowed") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Title") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RespondedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("MentorId"); - - b.HasIndex("RespondedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.ToTable("CohortLearningFeedback", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LatestBatchId") - .HasColumnType("uuid"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NaturalKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("OwnerUserId") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntityType", "TargetEntityId"); - - b.HasIndex("OwnerUserId", "EntityType", "NaturalKey") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("ContentBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("MockTestSectionId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageIdentity"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkAssignmentId"); - - b.ToTable("HomeworkAssignmentAttachments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkSubmissionId"); - - b.ToTable("HomeworkSubmissionFiles"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceQuestionId") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("SourceQuestionId"); - - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("RespondedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Owner") - .WithMany() - .HasForeignKey("OwnerUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Passages") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Attachments") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithMany("Files") - .HasForeignKey("HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Attachments"); - - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("Files"); - - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Passages"); - - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.cs b/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.cs deleted file mode 100644 index 415ccf23..00000000 --- a/RikiPath.Infrastructure/Migrations/20261130120000_AddHomeworkFiles.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - /// Additive only: Mentor homework attachments (đề bài / đáp án) and multi-file learner submissions. - /// Existing assignments and submissions (including legacy single-file PrivateScanReference) are untouched. - /// - public partial class AddHomeworkFiles : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "HomeworkAssignmentAttachments", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - HomeworkAssignmentId = table.Column(type: "integer", nullable: false), - FileKey = table.Column(type: "uuid", nullable: false), - Kind = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - StorageReference = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - FileName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - ContentType = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - SizeBytes = table.Column(type: "bigint", nullable: false), - SortOrder = table.Column(type: "integer", nullable: false), - CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), - ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), - CreatedBy = table.Column(type: "uuid", nullable: true), - ModifiedBy = table.Column(type: "uuid", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HomeworkAssignmentAttachments", x => x.Id); - table.ForeignKey( - name: "FK_HomeworkAssignmentAttachments_HomeworkAssignments_HomeworkAssignmentId", - column: x => x.HomeworkAssignmentId, - principalTable: "HomeworkAssignments", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "HomeworkSubmissionFiles", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - HomeworkSubmissionId = table.Column(type: "integer", nullable: false), - FileKey = table.Column(type: "uuid", nullable: false), - StorageReference = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - FileName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - ContentType = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - SizeBytes = table.Column(type: "bigint", nullable: false), - SortOrder = table.Column(type: "integer", nullable: false), - CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), - ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), - CreatedBy = table.Column(type: "uuid", nullable: true), - ModifiedBy = table.Column(type: "uuid", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HomeworkSubmissionFiles", x => x.Id); - table.ForeignKey( - name: "FK_HomeworkSubmissionFiles_HomeworkSubmissions_HomeworkSubmissionId", - column: x => x.HomeworkSubmissionId, - principalTable: "HomeworkSubmissions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_HomeworkAssignmentAttachments_FileKey", - table: "HomeworkAssignmentAttachments", - column: "FileKey"); - - migrationBuilder.CreateIndex( - name: "IX_HomeworkAssignmentAttachments_HomeworkAssignmentId", - table: "HomeworkAssignmentAttachments", - column: "HomeworkAssignmentId"); - - migrationBuilder.CreateIndex( - name: "IX_HomeworkSubmissionFiles_FileKey", - table: "HomeworkSubmissionFiles", - column: "FileKey"); - - migrationBuilder.CreateIndex( - name: "IX_HomeworkSubmissionFiles_HomeworkSubmissionId", - table: "HomeworkSubmissionFiles", - column: "HomeworkSubmissionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - // Rolling back drops uploaded-file metadata; export it first (stored objects remain in the private bucket). - migrationBuilder.DropTable( - name: "HomeworkAssignmentAttachments"); - - migrationBuilder.DropTable( - name: "HomeworkSubmissionFiles"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.cs b/RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.cs deleted file mode 100644 index bc52dfc9..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class AddClassQuizzes : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ClassQuizzes", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CohortId = table.Column(type: "integer", nullable: false), - MentorId = table.Column(type: "integer", nullable: false), - CertificateLevelId = table.Column(type: "integer", nullable: false), - Title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - TimeLimitMinutes = table.Column(type: "integer", nullable: false), - DueAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - SkillCodes = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - QuestionCount = table.Column(type: "integer", nullable: false), - QuestionSnapshotJson = table.Column(type: "text", nullable: false), - StructureKey = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - PublishedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - IsDeleted = table.Column(type: "boolean", nullable: false), - Revision = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ClassQuizzes", x => x.Id); - table.CheckConstraint("CK_ClassQuiz_QuestionCount", "\"QuestionCount\" BETWEEN 1 AND 200"); - table.CheckConstraint("CK_ClassQuiz_Status", "\"Status\" IN ('Published','Cancelled')"); - table.CheckConstraint("CK_ClassQuiz_TimeLimit", "\"TimeLimitMinutes\" BETWEEN 1 AND 240"); - table.ForeignKey( - name: "FK_ClassQuizzes_CertificateLevels_CertificateLevelId", - column: x => x.CertificateLevelId, - principalTable: "CertificateLevels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ClassQuizzes_StudyCohorts_CohortId", - column: x => x.CohortId, - principalTable: "StudyCohorts", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ClassQuizzes_Users_MentorId", - column: x => x.MentorId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ClassQuizAssignments", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - QuizId = table.Column(type: "integer", nullable: false), - LearnerId = table.Column(type: "integer", nullable: false), - EnrollmentId = table.Column(type: "integer", nullable: false), - AttemptId = table.Column(type: "integer", nullable: true), - AssignedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - CompletedAtUtc = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ClassQuizAssignments", x => x.Id); - table.ForeignKey( - name: "FK_ClassQuizAssignments_ClassQuizzes_QuizId", - column: x => x.QuizId, - principalTable: "ClassQuizzes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ClassQuizAssignments_MockTestAttempts_AttemptId", - column: x => x.AttemptId, - principalTable: "MockTestAttempts", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ClassQuizAssignments_StudyCourses_EnrollmentId", - column: x => x.EnrollmentId, - principalTable: "StudyCourses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ClassQuizAssignments_Users_LearnerId", - column: x => x.LearnerId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizAssignments_AttemptId", - table: "ClassQuizAssignments", - column: "AttemptId", - unique: true, - filter: "\"AttemptId\" IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizAssignments_EnrollmentId", - table: "ClassQuizAssignments", - column: "EnrollmentId"); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizAssignments_LearnerId_EnrollmentId", - table: "ClassQuizAssignments", - columns: new[] { "LearnerId", "EnrollmentId" }); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizAssignments_QuizId_LearnerId", - table: "ClassQuizAssignments", - columns: new[] { "QuizId", "LearnerId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizzes_CertificateLevelId", - table: "ClassQuizzes", - column: "CertificateLevelId"); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizzes_CohortId_IsDeleted_DueAtUtc", - table: "ClassQuizzes", - columns: new[] { "CohortId", "IsDeleted", "DueAtUtc" }); - - migrationBuilder.CreateIndex( - name: "IX_ClassQuizzes_MentorId", - table: "ClassQuizzes", - column: "MentorId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ClassQuizAssignments"); - - migrationBuilder.DropTable( - name: "ClassQuizzes"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.Designer.cs b/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.Designer.cs deleted file mode 100644 index 5b3092e1..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.Designer.cs +++ /dev/null @@ -1,14341 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261201081546_AddAdminCohortMentorInvitations")] - partial class AddAdminCohortMentorInvitations - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorAccessGrantedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorDisclosure") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorEvidenceAllowed") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Title") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RespondedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("MentorId"); - - b.HasIndex("RespondedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.ToTable("CohortLearningFeedback", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LatestBatchId") - .HasColumnType("uuid"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NaturalKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("OwnerUserId") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntityType", "TargetEntityId"); - - b.HasIndex("OwnerUserId", "EntityType", "NaturalKey") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("ContentBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("MockTestSectionId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageIdentity"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkAssignmentId"); - - b.ToTable("HomeworkAssignmentAttachments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkSubmissionId"); - - b.ToTable("HomeworkSubmissionFiles"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceQuestionId") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("SourceQuestionId"); - - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssignedByAdminId") - .HasColumnType("integer"); - - b.Property("AssignmentReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionAtInvite") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeclineReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FromSessionNumber") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedByAdminId"); - - b.HasIndex("CohortId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId", "Status"); - - b.ToTable("StudyCohortMentorInvitations", null, t => - { - t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); - - t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("RespondedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Owner") - .WithMany() - .HasForeignKey("OwnerUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Passages") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Attachments") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithMany("Files") - .HasForeignKey("HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") - .WithMany() - .HasForeignKey("AssignedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("AssignedByAdmin"); - - b.Navigation("Cohort"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Attachments"); - - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("Files"); - - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Passages"); - - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.cs b/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.cs deleted file mode 100644 index 25dc46e3..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201081546_AddAdminCohortMentorInvitations.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class AddAdminCohortMentorInvitations : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "StudyCohortMentorInvitations", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CohortId = table.Column(type: "integer", nullable: false), - MentorId = table.Column(type: "integer", nullable: false), - AssignedByAdminId = table.Column(type: "integer", nullable: true), - Status = table.Column(type: "character varying(24)", maxLength: 24, nullable: false), - DeclineReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - ChangeReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - AssignmentReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - FromSessionNumber = table.Column(type: "integer", nullable: true), - CohortRevisionAtInvite = table.Column(type: "integer", nullable: false), - IdempotencyKey = table.Column(type: "uuid", nullable: false), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - RespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), - Revision = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_StudyCohortMentorInvitations", x => x.Id); - table.CheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); - table.CheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); - table.ForeignKey( - name: "FK_StudyCohortMentorInvitations_StudyCohorts_CohortId", - column: x => x.CohortId, - principalTable: "StudyCohorts", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StudyCohortMentorInvitations_Users_AssignedByAdminId", - column: x => x.AssignedByAdminId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StudyCohortMentorInvitations_Users_MentorId", - column: x => x.MentorId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_StudyCohortMentorInvitations_AssignedByAdminId", - table: "StudyCohortMentorInvitations", - column: "AssignedByAdminId"); - - migrationBuilder.CreateIndex( - name: "IX_StudyCohortMentorInvitations_CohortId", - table: "StudyCohortMentorInvitations", - column: "CohortId", - unique: true, - filter: "\"Status\" = 'Pending'"); - - migrationBuilder.CreateIndex( - name: "IX_StudyCohortMentorInvitations_IdempotencyKey", - table: "StudyCohortMentorInvitations", - column: "IdempotencyKey", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_StudyCohortMentorInvitations_MentorId_Status", - table: "StudyCohortMentorInvitations", - columns: new[] { "MentorId", "Status" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql("DO $$ BEGIN IF EXISTS (SELECT 1 FROM \"StudyCohortMentorInvitations\") THEN RAISE EXCEPTION 'Export mentor invitation history before rollback'; END IF; END $$;"); - migrationBuilder.DropTable( - name: "StudyCohortMentorInvitations"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.cs b/RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.cs deleted file mode 100644 index baa93785..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class AddRetakeSupportPolicyThresholds : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "RemediationAttendanceThresholdPercent", - table: "MentorGroupPolicies", - type: "numeric(5,2)", - precision: 5, - scale: 2, - nullable: false, - defaultValue: 90m); - - migrationBuilder.AddColumn( - name: "RetakeSupportEnabled", - table: "MentorGroupPolicies", - type: "boolean", - nullable: false, - defaultValue: true); - - migrationBuilder.UpdateData( - table: "MentorGroupPolicies", - keyColumn: "Id", - keyValue: 1, - columns: new[] { "RemediationAttendanceThresholdPercent", "RetakeSupportEnabled" }, - values: new object[] { 90m, true }); - - migrationBuilder.AddCheckConstraint( - name: "CK_MentorGroupPolicy_RemediationAttendance", - table: "MentorGroupPolicies", - sql: "\"RemediationAttendanceThresholdPercent\" > 0 AND \"RemediationAttendanceThresholdPercent\" <= 100"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropCheckConstraint( - name: "CK_MentorGroupPolicy_RemediationAttendance", - table: "MentorGroupPolicies"); - - migrationBuilder.DropColumn( - name: "RemediationAttendanceThresholdPercent", - table: "MentorGroupPolicies"); - - migrationBuilder.DropColumn( - name: "RetakeSupportEnabled", - table: "MentorGroupPolicies"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.cs b/RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.cs deleted file mode 100644 index 8833a0f2..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class AddMentorKpiPolicyAndTimesheetAdjustments : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MentorKpiPolicies", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Version = table.Column(type: "integer", nullable: false), - EffectiveFromMonth = table.Column(type: "date", nullable: false), - MinimumPresencePercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), - TeachingCompletionTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), - HomeworkMinimumCount = table.Column(type: "integer", nullable: false), - HomeworkPerSessionCount = table.Column(type: "integer", nullable: false), - GradingCompletionTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), - ResponseSlaHours = table.Column(type: "integer", nullable: false), - OnTimeResponseTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), - AverageRatingTarget = table.Column(type: "numeric(3,2)", precision: 3, scale: 2, nullable: false), - PositiveReviewTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), - Note = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - CreatedByAdminId = table.Column(type: "integer", nullable: true), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - IsDeleted = table.Column(type: "boolean", nullable: false), - DeletedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), - DeletedByAdminId = table.Column(type: "integer", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_MentorKpiPolicies", x => x.Id); - table.CheckConstraint("CK_MentorKpiPolicy_Homework", "\"HomeworkMinimumCount\" >= 0 AND \"HomeworkPerSessionCount\" > 0"); - table.CheckConstraint("CK_MentorKpiPolicy_Month", "EXTRACT(DAY FROM \"EffectiveFromMonth\") = 1"); - table.CheckConstraint("CK_MentorKpiPolicy_Percents", "\"MinimumPresencePercent\" > 0 AND \"MinimumPresencePercent\" <= 100 AND \"TeachingCompletionTargetPercent\" > 0 AND \"TeachingCompletionTargetPercent\" <= 100 AND \"GradingCompletionTargetPercent\" > 0 AND \"GradingCompletionTargetPercent\" <= 100 AND \"OnTimeResponseTargetPercent\" > 0 AND \"OnTimeResponseTargetPercent\" <= 100 AND \"PositiveReviewTargetPercent\" > 0 AND \"PositiveReviewTargetPercent\" <= 100"); - table.CheckConstraint("CK_MentorKpiPolicy_Rating", "\"AverageRatingTarget\" >= 1 AND \"AverageRatingTarget\" <= 5"); - table.CheckConstraint("CK_MentorKpiPolicy_Sla", "\"ResponseSlaHours\" > 0"); - table.ForeignKey( - name: "FK_MentorKpiPolicies_Users_CreatedByAdminId", - column: x => x.CreatedByAdminId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "MentorTimesheetAdjustments", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CohortSessionId = table.Column(type: "integer", nullable: false), - MentorId = table.Column(type: "integer", nullable: false), - PreviousStatus = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), - NewStatus = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), - PreviousConfirmedMinutes = table.Column(type: "integer", nullable: false), - NewConfirmedMinutes = table.Column(type: "integer", nullable: false), - Reason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: false), - Evidence = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - AdminId = table.Column(type: "integer", nullable: false), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MentorTimesheetAdjustments", x => x.Id); - table.CheckConstraint("CK_MentorTimesheetAdjustment_Minutes", "\"NewConfirmedMinutes\" >= 0 AND \"PreviousConfirmedMinutes\" >= 0"); - table.CheckConstraint("CK_MentorTimesheetAdjustment_Status", "\"NewStatus\" IN ('Taught', 'Absent')"); - table.ForeignKey( - name: "FK_MentorTimesheetAdjustments_StudyCohortSessions_CohortSessio~", - column: x => x.CohortSessionId, - principalTable: "StudyCohortSessions", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.InsertData( - table: "MentorKpiPolicies", - columns: new[] { "Id", "AverageRatingTarget", "CreatedAtUtc", "CreatedByAdminId", "DeletedAtUtc", "DeletedByAdminId", "EffectiveFromMonth", "GradingCompletionTargetPercent", "HomeworkMinimumCount", "HomeworkPerSessionCount", "IsDeleted", "MinimumPresencePercent", "Note", "OnTimeResponseTargetPercent", "PositiveReviewTargetPercent", "ResponseSlaHours", "TeachingCompletionTargetPercent", "Version" }, - values: new object[] { 1, 4m, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, null, null, new DateOnly(2026, 1, 1), 90m, 1, 2, false, 80m, "Phiên bản khởi tạo", 90m, 80m, 24, 90m, 1 }); - - migrationBuilder.CreateIndex( - name: "IX_MentorKpiPolicies_CreatedByAdminId", - table: "MentorKpiPolicies", - column: "CreatedByAdminId"); - - migrationBuilder.CreateIndex( - name: "IX_MentorKpiPolicies_EffectiveFromMonth", - table: "MentorKpiPolicies", - column: "EffectiveFromMonth", - unique: true, - filter: "\"IsDeleted\" = FALSE"); - - migrationBuilder.CreateIndex( - name: "IX_MentorKpiPolicies_Version", - table: "MentorKpiPolicies", - column: "Version", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_MentorTimesheetAdjustments_CohortSessionId_CreatedAtUtc", - table: "MentorTimesheetAdjustments", - columns: new[] { "CohortSessionId", "CreatedAtUtc" }); - - migrationBuilder.CreateIndex( - name: "IX_MentorTimesheetAdjustments_MentorId", - table: "MentorTimesheetAdjustments", - column: "MentorId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MentorKpiPolicies"); - - migrationBuilder.DropTable( - name: "MentorTimesheetAdjustments"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.Designer.cs b/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.Designer.cs deleted file mode 100644 index d8a66e99..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.Designer.cs +++ /dev/null @@ -1,14332 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261201132000_MakeCohortsPlanless")] - partial class MakeCohortsPlanless - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorAccessGrantedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorDisclosure") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorEvidenceAllowed") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Title") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RespondedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("MentorId"); - - b.HasIndex("RespondedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.ToTable("CohortLearningFeedback", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LatestBatchId") - .HasColumnType("uuid"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NaturalKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("OwnerUserId") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntityType", "TargetEntityId"); - - b.HasIndex("OwnerUserId", "EntityType", "NaturalKey") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("ContentBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("MockTestSectionId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageIdentity"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkAssignmentId"); - - b.ToTable("HomeworkAssignmentAttachments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkSubmissionId"); - - b.ToTable("HomeworkSubmissionFiles"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceQuestionId") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("SourceQuestionId"); - - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("Level") - .IsRequired() - .HasMaxLength(12) - .HasColumnType("character varying(12)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssignedByAdminId") - .HasColumnType("integer"); - - b.Property("AssignmentReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionAtInvite") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeclineReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FromSessionNumber") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedByAdminId"); - - b.HasIndex("CohortId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId", "Status"); - - b.ToTable("StudyCohortMentorInvitations", null, t => - { - t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); - - t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("RespondedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Owner") - .WithMany() - .HasForeignKey("OwnerUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Passages") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Attachments") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithMany("Files") - .HasForeignKey("HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") - .WithMany() - .HasForeignKey("AssignedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("AssignedByAdmin"); - - b.Navigation("Cohort"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Attachments"); - - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("Files"); - - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Passages"); - - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.cs b/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.cs deleted file mode 100644 index 2b15ded5..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201132000_MakeCohortsPlanless.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class MakeCohortsPlanless : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Level", - table: "StudyCohorts", - type: "character varying(12)", - maxLength: 12, - nullable: true); - - // Retain legacy class identity and tuition before removing the plan relationship. - migrationBuilder.Sql(""" - UPDATE "StudyCohorts" AS c - SET "Level" = upper(btrim(l."Code")), - "TotalTuitionSnapshot" = COALESCE(c."TotalTuitionSnapshot", p."Price"), - "CourseDurationWeeks" = CASE - WHEN c."CourseDurationWeeks" > 1 THEN c."CourseDurationWeeks" - WHEN p."SessionsPerWeek" > 0 AND p."TotalSessions" > 0 - THEN GREATEST(1, CEIL(p."TotalSessions"::numeric / p."SessionsPerWeek")::integer) - ELSE 1 END - FROM "StudyCoursePlans" AS p - JOIN "CertificateLevels" AS l ON l."Id" = p."CertificateLevelId" - WHERE c."PlanId" = p."Id"; - """); - - migrationBuilder.Sql(""" - DO $$ BEGIN - IF EXISTS (SELECT 1 FROM "StudyCohorts" WHERE "Level" IS NULL OR length(btrim("Level")) = 0) THEN - RAISE EXCEPTION 'Legacy cohort level backfill failed; PlanId was preserved'; - END IF; - END $$; - """); - - migrationBuilder.AlterColumn( - name: "Level", - table: "StudyCohorts", - type: "character varying(12)", - maxLength: 12, - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(12)", - oldMaxLength: 12, - oldNullable: true); - - migrationBuilder.DropForeignKey( - name: "FK_StudyCohorts_StudyCoursePlans_PlanId", - table: "StudyCohorts"); - - migrationBuilder.DropIndex( - name: "IX_StudyCohorts_PlanId", - table: "StudyCohorts"); - - migrationBuilder.DropColumn( - name: "PlanId", - table: "StudyCohorts"); - - migrationBuilder.AlterColumn( - name: "PlanId", - table: "StudyCourses", - type: "integer", - nullable: true, - oldClrType: typeof(int), - oldType: "integer"); - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql("DO $$ BEGIN RAISE EXCEPTION 'Planless classes cannot be converted back to plan-linked classes; use a reviewed forward migration'; END $$;"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.Designer.cs b/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.Designer.cs deleted file mode 100644 index 8abe0c0f..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.Designer.cs +++ /dev/null @@ -1,14332 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using RikiPath.Infrastructure; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20261201135156_RepairCohortInvitationRevision")] - partial class RepairCohortInvitationRevision - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.Property("FeaturesId") - .HasColumnType("integer"); - - b.Property("SubscriptionPlansId") - .HasColumnType("integer"); - - b.HasKey("FeaturesId", "SubscriptionPlansId"); - - b.HasIndex("SubscriptionPlansId"); - - b.ToTable("FeatureSubscriptionPlan"); - - b.HasData( - new - { - FeaturesId = 1, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 1 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 2 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 3 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 4 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 5 - }, - new - { - FeaturesId = 1, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 2, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 3, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 4, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 5, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 6 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 7 - }, - new - { - FeaturesId = 13, - SubscriptionPlansId = 8101 - }, - new - { - FeaturesId = 14, - SubscriptionPlansId = 8102 - }, - new - { - FeaturesId = 6, - SubscriptionPlansId = 8103 - }, - new - { - FeaturesId = 12, - SubscriptionPlansId = 8104 - }, - new - { - FeaturesId = 7, - SubscriptionPlansId = 8105 - }, - new - { - FeaturesId = 8, - SubscriptionPlansId = 8105 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AdminAuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("AfterJson") - .HasColumnType("text"); - - b.Property("BeforeJson") - .HasColumnType("text"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityId") - .HasColumnType("integer"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedAtUtc"); - - b.HasIndex("EntityType", "EntityId"); - - b.ToTable("AdminAuditLogs", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Quantity") - .HasColumnType("integer"); - - b.Property("TotalAmount") - .HasColumnType("decimal(18,2)"); - - b.Property("UnitPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "PaymentStatus"); - - b.ToTable("AiCreditTopUps"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateTypeId") - .HasColumnType("integer") - .HasColumnName("CertificationId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateTypeId", "Code") - .IsUnique(); - - b.ToTable("CertificateLevels", null, t => - { - t.HasCheckConstraint("CK_CertificateLevels_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CertificateTypeId = 1, - Code = "N5", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N5", - IsDeleted = false, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateTypeId = 1, - Code = "N4", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N4", - IsDeleted = false, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateTypeId = 1, - Code = "N3", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N3", - IsDeleted = false, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateTypeId = 1, - Code = "N2", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N2", - IsDeleted = false, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 5, - CertificateTypeId = 1, - Code = "N1", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "JLPT N1", - IsDeleted = false, - Revision = 1, - SortOrder = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxScore") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PassingScore") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "Code") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("CertificateSections"); - - b.HasData( - new - { - Id = 1, - CertificateLevelId = 1, - Code = "N5_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5285), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 1 - }, - new - { - Id = 2, - CertificateLevelId = 1, - Code = "N5_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5292), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 2 - }, - new - { - Id = 3, - CertificateLevelId = 1, - Code = "N5_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5294), - Description = "Phần thi nghe hiểu tình huống giao tiếp hàng ngày cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 4 - }, - new - { - Id = 16, - CertificateLevelId = 1, - Code = "N5_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5308), - Description = "Phần thi đọc hiểu văn bản, thông báo và đoạn hội thoại ngắn cấp độ N5", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 3 - }, - new - { - Id = 4, - CertificateLevelId = 2, - Code = "N4_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5295), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 5, - CertificateLevelId = 2, - Code = "N4_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5296), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 6, - CertificateLevelId = 2, - Code = "N4_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5297), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 7, - CertificateLevelId = 2, - Code = "N4_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5298), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N4", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 8, - CertificateLevelId = 3, - Code = "N3_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5300), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 9, - CertificateLevelId = 3, - Code = "N3_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5301), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 10, - CertificateLevelId = 3, - Code = "N3_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5302), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 11, - CertificateLevelId = 3, - Code = "N3_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5303), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N3", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 12, - CertificateLevelId = 4, - Code = "N2_VOCAB", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5304), - Description = "Phần thi kiểm tra chữ Hán, cách đọc và từ vựng cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Từ vựng)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 13, - CertificateLevelId = 4, - Code = "N2_GRAMMAR", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5305), - Description = "Phần thi kiểm tra cấu trúc ngữ pháp và sắp xếp câu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Kiến thức ngôn ngữ (Ngữ pháp)", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 14, - CertificateLevelId = 4, - Code = "N2_READING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5306), - Description = "Phần thi đọc hiểu văn bản, thông báo và biểu mẫu cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Đọc hiểu", - PassingScore = 0, - SortOrder = 0 - }, - new - { - Id = 15, - CertificateLevelId = 4, - Code = "N2_LISTENING", - CreatedDate = new DateTime(2026, 10, 31, 11, 13, 24, 991, DateTimeKind.Utc).AddTicks(5307), - Description = "Phần thi nghe hiểu hội thoại và tình huống thực tế cấp độ N2", - IsDeleted = false, - MaxScore = 0, - Name = "Nghe hiểu", - PassingScore = 0, - SortOrder = 0 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("CertificateTypes", null, t => - { - t.HasCheckConstraint("CK_CertificateTypes_SortOrder", "\"SortOrder\" >= 1"); - }); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese-Language Proficiency Test", - IsActive = true, - IsDeleted = false, - Name = "JLPT", - Revision = 1, - SortOrder = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecidedById") - .HasColumnType("integer"); - - b.Property("Decision") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorAccessGrantedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorDisclosure") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorEvidenceAllowed") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorResponse") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RefundReviewRequested") - .HasColumnType("boolean"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Title") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("DecidedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.HasIndex("MentorId", "Status", "CreatedAtUtc"); - - b.ToTable("CohortComplaints", null, t => - { - t.HasCheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - - t.HasCheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - - t.HasCheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - - t.HasCheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ComplaintId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("ComplaintId", "Id"); - - b.ToTable("CohortComplaintEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ConsumedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ConsumedByCourseId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntitlementReference") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("GrantedById") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("RevocationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RevokedById") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("StudyCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntitlementReference") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("PlanId"); - - b.HasIndex("StudyCohortId", "LearnerId") - .IsUnique() - .HasFilter("\"Status\" = 'Active' AND \"IsDeleted\" = false"); - - b.ToTable("CohortEnrollmentEntitlements", null, t => - { - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_NoCredit", "\"SourceType\" NOT IN ('ConsultationCredit', 'Credit1on1', 'OneOnOneCredit')"); - - t.HasCheckConstraint("CK_CohortEnrollmentEntitlement_Status", "\"Status\" IN ('Active', 'Consumed', 'Revoked', 'Expired')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RespondedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("MentorId"); - - b.HasIndex("RespondedById"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.ToTable("CohortLearningFeedback", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Comment") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHidden") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CohortId"); - - b.HasIndex("LearnerId"); - - b.HasIndex("CourseId", "MentorId") - .IsUnique(); - - b.HasIndex("MentorId", "IsHidden", "CreatedAtUtc"); - - b.ToTable("CohortMentorReviews", null, t => - { - t.HasCheckConstraint("CK_CohortMentorReview_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("RequestedByRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("ShiftWeeks") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("CohortId") - .IsUnique() - .HasDatabaseName("IX_CohortScheduleRequests_PendingCohort") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("CohortId", "Id"); - - b.HasIndex("RequestedById", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortScheduleRequests", null, t => - { - t.HasCheckConstraint("CK_CohortScheduleRequest_Decision", "(\"Status\" NOT IN ('Approved', 'Rejected') OR (\"ReviewedById\" IS NOT NULL AND \"ReviewedAtUtc\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0))"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Kind", "\"Kind\" IN ('ShiftWeeks', 'CancelEmptyCohort')"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Reason", "length(btrim(\"Reason\")) BETWEEN 10 AND 1000"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_ShiftWeeks", "(\"Kind\" = 'ShiftWeeks' AND \"ShiftWeeks\" BETWEEN 1 AND 8) OR (\"Kind\" = 'CancelEmptyCohort' AND \"ShiftWeeks\" IS NULL)"); - - t.HasCheckConstraint("CK_CohortScheduleRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortScheduleRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("DestinationCourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RequestedTargetCohortId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceCohortId") - .HasColumnType("integer"); - - b.Property("SourceCourseId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TargetCohortId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DestinationCourseId") - .IsUnique() - .HasFilter("\"DestinationCourseId\" IS NOT NULL"); - - b.HasIndex("PolicyId"); - - b.HasIndex("RequestedTargetCohortId"); - - b.HasIndex("ReviewedById"); - - b.HasIndex("SourceCohortId"); - - b.HasIndex("SourceCourseId") - .IsUnique() - .HasDatabaseName("IX_CohortTransferRequests_PendingSource") - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("TargetCohortId"); - - b.HasIndex("LearnerId", "IdempotencyKey") - .IsUnique(); - - b.HasIndex("Status", "CreatedAtUtc"); - - b.ToTable("CohortTransferRequests", null, t => - { - t.HasCheckConstraint("CK_CohortTransferRequest_Decision", "(\"Status\" <> 'Approved' OR (\"TargetCohortId\" IS NOT NULL AND \"DestinationCourseId\" IS NOT NULL AND \"ReviewedById\" IS NOT NULL)) AND (\"Status\" <> 'Rejected' OR (\"DecisionNote\" IS NOT NULL AND length(btrim(\"DecisionNote\")) > 0 AND \"ReviewedById\" IS NOT NULL))"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Status", "\"Status\" IN ('Pending', 'Approved', 'Rejected', 'Withdrawn')"); - - t.HasCheckConstraint("CK_CohortTransferRequest_Target", "\"TargetCohortId\" IS NULL OR \"TargetCohortId\" <> \"SourceCohortId\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("AtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RequestId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RequestId", "Id"); - - b.ToTable("CohortTransferRequestEvents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAiReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentId") - .HasColumnType("integer"); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ErrorCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IssuesJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RequestedByUserId") - .HasColumnType("integer"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Verdict") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("WarningCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentType", "ContentId", "ReviewedAt"); - - b.ToTable("ContentAiReviews"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BatchId") - .HasColumnType("uuid"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DiffSummaryJson") - .HasColumnType("text"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReviewHistoryJson") - .HasColumnType("jsonb"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByName") - .HasColumnType("text"); - - b.Property("RightsConfirmed") - .HasColumnType("boolean"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RowKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SourceFileName") - .IsRequired() - .HasMaxLength(260) - .HasColumnType("character varying(260)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceRowNumber") - .HasColumnType("integer"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("ImportExcel"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.Property("ValidationSummaryJson") - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("BatchId"); - - b.HasIndex("SubmittedByUserId"); - - b.HasIndex("EntityType", "Status"); - - b.HasIndex("SubmittedByUserId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.ToTable("ContentApprovalRequests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AttemptCount") - .HasColumnType("integer"); - - b.Property("AudioUrl") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("AudioUrlHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Confidence") - .HasColumnType("double precision"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedByUserId") - .HasColumnType("integer"); - - b.Property("ErrorCode") - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("ErrorMessage") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("LanguageCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LeaseExpiresAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeaseId") - .HasColumnType("uuid"); - - b.Property("NextAttemptAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RawTranscriptJson") - .HasColumnType("jsonb"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Transcript") - .HasColumnType("text"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("AudioUrlHash") - .IsUnique(); - - b.HasIndex("CreatedByUserId"); - - b.HasIndex("Status", "NextAttemptAtUtc", "LeaseExpiresAtUtc"); - - b.ToTable("ContentAudioTranscriptions", null, t => - { - t.HasCheckConstraint("CK_ContentAudioTranscription_Attempts", "\"AttemptCount\" >= 0"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Language", "\"LanguageCode\" = 'ja-JP'"); - - t.HasCheckConstraint("CK_ContentAudioTranscription_Status", "\"Status\" IN ('Pending', 'Processing', 'Completed', 'Failed')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EntityType") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LatestBatchId") - .HasColumnType("uuid"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NaturalKey") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("OwnerUserId") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TargetEntityId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("EntityType", "TargetEntityId"); - - b.HasIndex("OwnerUserId", "EntityType", "NaturalKey") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.ToTable("ContentBankItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("CertificateLevelId", "GrammarPatternId") - .IsUnique() - .HasFilter("\"GrammarPatternId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "KanjiId") - .IsUnique() - .HasFilter("\"KanjiId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.HasIndex("CertificateLevelId", "VocabularyId") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL AND \"IsDeleted\" = false"); - - b.ToTable("ContentLevelMappings", t => - { - t.HasCheckConstraint("CK_ContentLevelMappings_ExactlyOneContent", "(CASE WHEN \"KanjiId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"VocabularyId\" IS NOT NULL THEN 1 ELSE 0 END) + (CASE WHEN \"GrammarPatternId\" IS NOT NULL THEN 1 ELSE 0 END) = 1"); - }); - - b.HasData( - new - { - Id = 920001, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910001 - }, - new - { - Id = 920002, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910002 - }, - new - { - Id = 920003, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910003 - }, - new - { - Id = 920004, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910004 - }, - new - { - Id = 920005, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910005 - }, - new - { - Id = 920006, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910006 - }, - new - { - Id = 920007, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910007 - }, - new - { - Id = 920008, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910008 - }, - new - { - Id = 920009, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910009 - }, - new - { - Id = 920010, - CertificateLevelId = 1, - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KanjiId = 910010 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ListeningSection") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("MockTestSectionId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentPassageId") - .HasColumnType("integer"); - - b.Property("PassageCode") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("PassageIdentity") - .HasColumnType("uuid"); - - b.Property("PassageText") - .HasColumnType("text"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("PassageIdentity"); - - b.ToTable("ContentPassages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("At") - .HasColumnType("timestamp without time zone"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("Detail") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("CourseAuditEntries", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("EligibilitySnapshot") - .HasColumnType("text"); - - b.Property("EvidenceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlan") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorSupportPlanAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorSupportPlanById") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ResultPublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("CourseId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseRetakeRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Kind") - .IsRequired() - .HasColumnType("text"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequestedById") - .HasColumnType("integer"); - - b.Property("Response") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SessionId") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CourseId", "SessionId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.ToTable("CourseScheduleRequests", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsUsed") - .HasColumnType("boolean"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VerificationCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("EmailVerifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccessMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("FREE"); - - b.Property("Category") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("general"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditFeatureKey") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsCoreFree") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("RoutePrefixesJson") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = 1, - AccessMode = "PLAN_REQUIRED", - Category = "self_study", - Code = "LESSONS_CONTENT", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập kho bài học JLPT đầy đủ theo cấp độ kèm nghe hiểu, đọc hiểu và lưu tiến độ.", - IsCoreFree = false, - IsDeleted = false, - Name = "Thư viện bài học JLPT", - RoutePrefixesJson = "[\"/lessons\",\"/lesson-player\",\"/riki/listening\",\"/riki/reading\"]", - SortOrder = 10 - }, - new - { - Id = 2, - AccessMode = "FREE", - Category = "core_tools", - Code = "JAPANESE_LIBRARY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tra cứu ngữ pháp, luyện viết Hiragana, Katakana và Kanji theo thứ tự nét miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Thư viện Kana, Kanji & Ngữ pháp", - RoutePrefixesJson = "[\"/grammar\",\"/kanji-writing\",\"/vocabulary-detail\"]", - SortOrder = 3 - }, - new - { - Id = 3, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PRACTICE_EXERCISES", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài luyện tập củng cố kỹ năng và bộ đề theo cấp độ JLPT.", - IsCoreFree = false, - IsDeleted = false, - Name = "Bài luyện tập theo kỹ năng", - RoutePrefixesJson = "[\"/lesson-practice\",\"/practice-sets\"]", - SortOrder = 20 - }, - new - { - Id = 4, - AccessMode = "FREE", - Category = "practice_exam", - Code = "MOCK_TESTS", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Luyện đề thi thử JLPT mô phỏng đầy đủ 4 kỹ năng và theo dõi kết quả.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đề thi thử JLPT", - RoutePrefixesJson = "[\"/mock-test\",\"/mock-tests\",\"/exam-result\"]", - SortOrder = 21 - }, - new - { - Id = 5, - AccessMode = "FREE", - Category = "self_study", - Code = "STANDARD_ROADMAP", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Xem lộ trình học JLPT tiêu chuẩn theo mục tiêu, kết quả đánh giá năng lực và tiến độ học.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình tiêu chuẩn & Tiến độ học", - RoutePrefixesJson = "[\"/roadmap\"]", - SortOrder = 11 - }, - new - { - Id = 6, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_MOCK_EXPLANATION", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "mock_test_explanation", - Description = "Nhận phân tích chi tiết đáp án đề thi thử từ trợ lý AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Giải thích câu hỏi bằng AI", - SortOrder = 33 - }, - new - { - Id = 7, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_1ON1_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói cũ bao gồm 12 buổi ôn luyện trực tiếp 1-1 với Mentor (đã thay bằng lớp học nhóm).", - IsCoreFree = false, - IsDeleted = false, - Name = "12 buổi meeting 1-1 với Mentor", - SortOrder = 90 - }, - new - { - Id = 8, - AccessMode = "DISABLED", - Category = "mentor_legacy", - Code = "MENTOR_ROOM_LEGACY", - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Cấu hình lịch 1-1 cũ (lớp học nhóm dùng cơ chế ghi danh khóa học riêng).", - IsCoreFree = false, - IsDeleted = false, - Name = "Đặt lịch và phòng học trực tuyến", - SortOrder = 91 - }, - new - { - Id = 9, - AccessMode = "FREE", - Category = "core_tools", - Code = "PERSONAL_NOTEBOOK", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Tạo thư mục, tệp ghi chú, trang bài học, highlight và mục đã lưu cá nhân miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Sổ tay cá nhân & Mini Notebook", - RoutePrefixesJson = "[\"/kanji-notebook\"]", - SortOrder = 1 - }, - new - { - Id = 10, - AccessMode = "FREE", - Category = "core_tools", - Code = "SRS_STUDY", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Ôn thẻ đến hạn, 4 chế độ ôn tự do, quản lý thẻ cá nhân và thư viện thẻ mẫu miễn phí.", - IsCoreFree = true, - IsDeleted = false, - Name = "Ôn tập SRS & Thư viện thẻ mẫu", - RoutePrefixesJson = "[\"/daily-srs\"]", - SortOrder = 2 - }, - new - { - Id = 11, - AccessMode = "FREE", - Category = "practice_exam", - Code = "PLACEMENT_TEST", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Làm bài đánh giá trình độ JLPT đầu vào để xác định cấp độ học phù hợp.", - IsCoreFree = false, - IsDeleted = false, - Name = "Đánh giá năng lực đầu vào", - RoutePrefixesJson = "[\"/placement\"]", - SortOrder = 19 - }, - new - { - Id = 12, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_LEARNING_PATH", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "learning_path", - Description = "Tạo kế hoạch học tập chi tiết theo ngày bằng AI dựa trên điểm đánh giá và ngày thi.", - IsCoreFree = false, - IsDeleted = false, - Name = "Lộ trình học cá nhân hóa bằng AI", - SortOrder = 30 - }, - new - { - Id = 13, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_SPEAKING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "speaking", - Description = "Thu âm tiếng Nhật và nhận điểm phát âm, ngữ điệu cùng nhận xét chi tiết từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện nói & Chấm phát âm AI", - RoutePrefixesJson = "[\"/riki/speaking\",\"/speech\"]", - SortOrder = 31 - }, - new - { - Id = 14, - AccessMode = "CREDIT_REQUIRED", - Category = "ai_services", - Code = "AI_WRITING", - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - CreditFeatureKey = "writing", - Description = "Viết câu và bài luận tiếng Nhật, nhận sửa lỗi ngữ pháp và chấm điểm từ AI.", - IsCoreFree = false, - IsDeleted = false, - Name = "Luyện viết & Chấm bài luận AI", - RoutePrefixesJson = "[\"/riki/essay\",\"/sentence-studio\"]", - SortOrder = 32 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FeedbackJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("GradedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OverallScore") - .HasColumnType("double precision"); - - b.Property("PracticeSubmissionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkSubmissionId") - .IsUnique(); - - b.HasIndex("PracticeSubmissionId") - .IsUnique(); - - b.ToTable("GradingResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentenceMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Structure") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("Title"); - - b.HasIndex("UserAccountId"); - - b.ToTable("GrammarPatterns"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiDraftFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("AiDraftGeneratedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("AiDraftScore") - .HasColumnType("double precision"); - - b.Property("AiDraftUnavailableReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("AssignmentScope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Booking1on1"); - - b.Property("AuthoredDefinitionJson") - .HasColumnType("text"); - - b.Property("CohortAssignmentGroupKey") - .HasColumnType("uuid"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Instructions") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorFeedback") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScore") - .HasColumnType("double precision"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("PublishedByMentorId") - .HasColumnType("integer"); - - b.Property("PublishedFeedbackAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("StudyCourseId") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("MentorId"); - - b.HasIndex("StudyCourseId"); - - b.HasIndex("CohortId", "LearnerId"); - - b.HasIndex("LearnerId", "DueAt"); - - b.ToTable("HomeworkAssignments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkAssignmentId"); - - b.ToTable("HomeworkAssignmentAttachments"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "PracticeExerciseId"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("HomeworkAssignmentExercises", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.HasKey("HomeworkAssignmentId", "LessonId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkAssignmentLessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileUrl") - .HasColumnType("text"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastRevisedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrivateAudioReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PrivateScanReference") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("RevisionCount") - .HasColumnType("integer"); - - b.Property("ScanStorageUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedOptionsJson") - .HasColumnType("text"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("HomeworkAssignmentId") - .IsUnique(); - - b.HasIndex("LearnerId"); - - b.HasIndex("LessonId"); - - b.ToTable("HomeworkSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FileKey") - .HasColumnType("uuid"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("HomeworkSubmissionId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SizeBytes") - .HasColumnType("bigint"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StorageReference") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("FileKey"); - - b.HasIndex("HomeworkSubmissionId"); - - b.ToTable("HomeworkSubmissionFiles"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptExamSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExamDate") - .HasColumnType("date"); - - b.Property("ImportedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Location") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ReviewNote") - .HasColumnType("text"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedById") - .HasColumnType("integer"); - - b.Property("SourceKey") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceKey") - .IsUnique(); - - b.ToTable("JlptExamSchedules", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("Coefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("CertificateLevelId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("JlptLevelPayCoefficients", t => - { - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Positive", "\"Coefficient\" > 0"); - - t.HasCheckConstraint("CK_JlptLevelPayCoefficient_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Romaji") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("Character", "Type") - .IsUnique(); - - b.ToTable("KanaCharacters"); - - b.HasData( - new - { - Id = 1, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "あ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1757), - IsDeleted = false, - Romaji = "a", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 2, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "い", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1766), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 3, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "う", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1768), - IsDeleted = false, - Romaji = "u", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 4, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "え", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1770), - IsDeleted = false, - Romaji = "e", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 5, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "お", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1771), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 6, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "か", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1774), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 7, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "き", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1775), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 8, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "く", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1776), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 9, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "け", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1830), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 10, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "こ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1832), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 11, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "さ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1833), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 12, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "し", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1834), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 13, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "す", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1835), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 14, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "せ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1836), - IsDeleted = false, - Romaji = "se", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 15, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "そ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1837), - IsDeleted = false, - Romaji = "so", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 16, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "た", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 17, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "ち", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1838), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 18, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "つ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1840), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 19, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "て", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1841), - IsDeleted = false, - Romaji = "te", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 20, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "と", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1842), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 21, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "な", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1843), - IsDeleted = false, - Romaji = "na", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 22, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "に", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1844), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 23, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ぬ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 24, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ね", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1845), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 25, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "の", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1846), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 26, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "は", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1847), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 27, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ひ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1848), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 28, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "ふ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 29, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "へ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1849), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 30, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ほ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1850), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Hiragana" - }, - new - { - Id = 31, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "ま", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1851), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 32, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "み", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 33, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "む", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1852), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 34, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "め", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1913), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 35, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "も", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 36, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "や", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1915), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 37, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ゆ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1916), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 38, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "よ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1917), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 39, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ら", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1918), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 40, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "り", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1919), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 41, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "る", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 42, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "れ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1920), - IsDeleted = false, - Romaji = "re", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 43, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ろ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 44, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "わ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1922), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Hiragana" - }, - new - { - Id = 45, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "を", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1923), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Hiragana" - }, - new - { - Id = 46, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ん", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1924), - IsDeleted = false, - Romaji = "n", - StrokeCount = 1, - Type = "Hiragana" - }, - new - { - Id = 47, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/22/Ja-a.ogg", - Character = "ア", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1955), - IsDeleted = false, - Romaji = "a", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 48, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/28/Ja-i.ogg", - Character = "イ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1958), - IsDeleted = false, - Romaji = "i", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 49, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Ja-u.ogg", - Character = "ウ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1959), - IsDeleted = false, - Romaji = "u", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 50, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/21/Ja-e.ogg", - Character = "エ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1960), - IsDeleted = false, - Romaji = "e", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 51, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/df/Ja-o.ogg", - Character = "オ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "o", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 52, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2e/Ja-ka.ogg", - Character = "カ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1961), - IsDeleted = false, - Romaji = "ka", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 53, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/87/Ja-ki.ogg", - Character = "キ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1962), - IsDeleted = false, - Romaji = "ki", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 54, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Ja-ku.ogg", - Character = "ク", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1963), - IsDeleted = false, - Romaji = "ku", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 55, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b3/Ja-ke.ogg", - Character = "ケ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(1964), - IsDeleted = false, - Romaji = "ke", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 56, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/18/Ja-ko.ogg", - Character = "コ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2006), - IsDeleted = false, - Romaji = "ko", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 57, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Ja-sa.ogg", - Character = "サ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2009), - IsDeleted = false, - Romaji = "sa", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 58, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/80/Ja-shi.ogg", - Character = "シ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2010), - IsDeleted = false, - Romaji = "shi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 59, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Ja-su.ogg", - Character = "ス", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2011), - IsDeleted = false, - Romaji = "su", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 60, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a8/Ja-se.ogg", - Character = "セ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2012), - IsDeleted = false, - Romaji = "se", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 61, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/00/Ja-so.ogg", - Character = "ソ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2014), - IsDeleted = false, - Romaji = "so", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 62, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/d/d2/Ja-ta.ogg", - Character = "タ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2015), - IsDeleted = false, - Romaji = "ta", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 63, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/38/Ja-chi.ogg", - Character = "チ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2016), - IsDeleted = false, - Romaji = "chi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 64, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Ja-tsu.ogg", - Character = "ツ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2017), - IsDeleted = false, - Romaji = "tsu", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 65, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/10/Ja-te.ogg", - Character = "テ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2019), - IsDeleted = false, - Romaji = "te", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 66, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Ja-to.ogg", - Character = "ト", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2022), - IsDeleted = false, - Romaji = "to", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 67, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/92/Ja-na.ogg", - Character = "ナ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2023), - IsDeleted = false, - Romaji = "na", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 68, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ja-ni.ogg", - Character = "ニ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2024), - IsDeleted = false, - Romaji = "ni", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 69, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/b/b1/Ja-nu.ogg", - Character = "ヌ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2026), - IsDeleted = false, - Romaji = "nu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 70, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/86/Ja-ne.ogg", - Character = "ネ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2027), - IsDeleted = false, - Romaji = "ne", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 71, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/54/Ja-no.ogg", - Character = "ノ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2028), - IsDeleted = false, - Romaji = "no", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 72, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/08/Ja-ha.ogg", - Character = "ハ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2029), - IsDeleted = false, - Romaji = "ha", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 73, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/9/99/Ja-hi.ogg", - Character = "ヒ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2030), - IsDeleted = false, - Romaji = "hi", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 74, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/70/Ja-fu.ogg", - Character = "フ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2032), - IsDeleted = false, - Romaji = "fu", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 75, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Ja-he.ogg", - Character = "ヘ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2033), - IsDeleted = false, - Romaji = "he", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 76, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/a/a4/Ja-ho.ogg", - Character = "ホ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2034), - IsDeleted = false, - Romaji = "ho", - StrokeCount = 4, - Type = "Katakana" - }, - new - { - Id = 77, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0d/Ja-ma.ogg", - Character = "マ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2036), - IsDeleted = false, - Romaji = "ma", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 78, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/1/16/Ja-mi.ogg", - Character = "ミ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2037), - IsDeleted = false, - Romaji = "mi", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 79, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/eb/Ja-mu.ogg", - Character = "ム", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2038), - IsDeleted = false, - Romaji = "mu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 80, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/8/8b/Ja-me.ogg", - Character = "メ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2039), - IsDeleted = false, - Romaji = "me", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 81, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c1/Ja-mo.ogg", - Character = "モ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2086), - IsDeleted = false, - Romaji = "mo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 82, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/e8/Ja-ya.ogg", - Character = "ヤ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2087), - IsDeleted = false, - Romaji = "ya", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 83, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7b/Ja-yu.ogg", - Character = "ユ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2088), - IsDeleted = false, - Romaji = "yu", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 84, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/c/c9/Ja-yo.ogg", - Character = "ヨ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2089), - IsDeleted = false, - Romaji = "yo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 85, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/04/Ja-ra.ogg", - Character = "ラ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2090), - IsDeleted = false, - Romaji = "ra", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 86, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/76/Ja-ri.ogg", - Character = "リ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2092), - IsDeleted = false, - Romaji = "ri", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 87, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/56/Ja-ru.ogg", - Character = "ル", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2093), - IsDeleted = false, - Romaji = "ru", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 88, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/5/57/Ja-re.ogg", - Character = "レ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2094), - IsDeleted = false, - Romaji = "re", - StrokeCount = 1, - Type = "Katakana" - }, - new - { - Id = 89, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/e/ed/Ja-ro.ogg", - Character = "ロ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2096), - IsDeleted = false, - Romaji = "ro", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 90, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/f/f2/Ja-wa.ogg", - Character = "ワ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2097), - IsDeleted = false, - Romaji = "wa", - StrokeCount = 2, - Type = "Katakana" - }, - new - { - Id = 91, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/7/77/Ja-wo.ogg", - Character = "ヲ", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2098), - IsDeleted = false, - Romaji = "wo", - StrokeCount = 3, - Type = "Katakana" - }, - new - { - Id = 92, - AudioUrl = "https://upload.wikimedia.org/wikipedia/commons/0/0c/Ja-n.ogg", - Character = "ン", - CreatedDate = new DateTime(2026, 10, 26, 16, 6, 11, 768, DateTimeKind.Utc).AddTicks(2099), - IsDeleted = false, - Romaji = "n", - StrokeCount = 2, - Type = "Katakana" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaCharacterId") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaCharacterId"); - - b.HasIndex("UserId", "KanaCharacterId") - .IsUnique(); - - b.HasIndex("UserId", "NextReviewDate"); - - b.ToTable("KanaWritingPracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KanaWritingPracticeCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalMistakes") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("KanaWritingPracticeCardId"); - - b.ToTable("KanaWritingPracticeHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("Character") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KunYomi") - .HasColumnType("text"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OnYomi") - .HasColumnType("text"); - - b.Property("SinoVietnamese") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("StrokeCount") - .HasColumnType("integer"); - - b.Property("StrokeOrderImageUrl") - .HasColumnType("text"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("Character"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.ToTable("Kanjis"); - - b.HasData( - new - { - Id = 910001, - Character = "日", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、か", - Meaning = "Mặt trời; ngày", - OnYomi = "ニチ、ジツ", - SinoVietnamese = "Nhật", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910002, - Character = "月", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つき", - Meaning = "Mặt trăng; tháng", - OnYomi = "ゲツ、ガツ", - SinoVietnamese = "Nguyệt", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910003, - Character = "火", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひ、ほ", - Meaning = "Lửa", - OnYomi = "カ", - SinoVietnamese = "Hỏa", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910004, - Character = "水", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "みず", - Meaning = "Nước", - OnYomi = "スイ", - SinoVietnamese = "Thủy", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910005, - Character = "木", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "き、こ", - Meaning = "Cây; gỗ", - OnYomi = "モク、ボク", - SinoVietnamese = "Mộc", - Status = "Published", - StrokeCount = 4, - Version = 1 - }, - new - { - Id = 910006, - Character = "金", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かね、かな", - Meaning = "Vàng; tiền", - OnYomi = "キン、コン", - SinoVietnamese = "Kim", - Status = "Published", - StrokeCount = 8, - Version = 1 - }, - new - { - Id = 910007, - Character = "土", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "つち", - Meaning = "Đất", - OnYomi = "ド、ト", - SinoVietnamese = "Thổ", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910008, - Character = "山", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "やま", - Meaning = "Núi", - OnYomi = "サン", - SinoVietnamese = "Sơn", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910009, - Character = "川", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "かわ", - Meaning = "Sông", - OnYomi = "セン", - SinoVietnamese = "Xuyên", - Status = "Published", - StrokeCount = 3, - Version = 1 - }, - new - { - Id = 910010, - Character = "人", - CreatedDate = new DateTime(2026, 10, 3, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - KunYomi = "ひと", - Meaning = "Người", - OnYomi = "ジン、ニン", - SinoVietnamese = "Nhân", - Status = "Published", - StrokeCount = 2, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Code") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique() - .HasFilter("\"Code\" IS NOT NULL"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("LanguageSkills"); - - b.HasData( - new - { - Id = 1, - Code = "VOCABULARY", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese vocabulary learning skill.", - IsDeleted = false, - Name = "Vocabulary" - }, - new - { - Id = 2, - Code = "KANJI", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese kanji learning skill.", - IsDeleted = false, - Name = "Kanji" - }, - new - { - Id = 3, - Code = "GRAMMAR", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese grammar learning skill.", - IsDeleted = false, - Name = "Grammar" - }, - new - { - Id = 4, - Code = "LISTENING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese listening comprehension skill.", - IsDeleted = false, - Name = "Listening" - }, - new - { - Id = 5, - Code = "READING", - CreatedDate = new DateTime(2026, 9, 29, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Japanese reading comprehension skill.", - IsDeleted = false, - Name = "Reading" - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentText") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageStoragePath") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ImageUrl") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OcrLanguage") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("OriginalOcrText") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "CreatedDate"); - - b.ToTable("LearnerEssays"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetTitle") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("UpdatedAtUtc", "Id"); - - b.HasIndex("LearnerId", "TargetType", "TargetId") - .IsUnique(); - - b.ToTable("LearnerFeedback", null, t => - { - t.HasCheckConstraint("CK_LearnerFeedback_Rating", "\"Rating\" BETWEEN 1 AND 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnchorPrefix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AnchorSuffix") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Color") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ContentVersionHash") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndOffset") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LinkedNoteEntryId") - .HasColumnType("integer"); - - b.Property("LinkedReviewCardId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SelectedText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartOffset") - .HasColumnType("integer"); - - b.Property("TargetId") - .HasColumnType("integer"); - - b.Property("TargetKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TargetType") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TranslationSnapshot") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LinkedNoteEntryId"); - - b.HasIndex("LinkedReviewCardId"); - - b.HasIndex("UserId", "CreatedDate"); - - b.HasIndex("UserId", "TargetKey"); - - b.HasIndex("UserId", "TargetType", "TargetId"); - - b.ToTable("LearnerHighlights"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("FolderId") - .HasColumnType("integer"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FolderId"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_LearnerNotes_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "Name"); - - b.HasIndex("UserId", "FolderId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNotes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextSnippet") - .HasMaxLength(600) - .HasColumnType("character varying(600)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExampleSentence") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("HighlightColor") - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ItemKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("manual"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("LearnerNoteId") - .HasColumnType("integer") - .HasColumnName("VocabularyListId"); - - b.Property("ManualMeaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ManualReading") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ManualWord") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Note") - .HasColumnType("text"); - - b.Property("NotebookPageId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'[]'::jsonb"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("LearnerNoteId", "IsDeleted"); - - b.HasIndex("NotebookPageId", "IsDeleted", "SortOrder"); - - b.ToTable("LearnerNoteEntries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseAttemptId") - .HasColumnType("integer"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.Property("TextAnswer") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("PracticeExerciseAttemptId", "PracticeQuestionId") - .IsUnique(); - - b.ToTable("LearnerPracticeAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("EstimatedMinutes") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(15); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PrerequisiteLessonId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceProvenance") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PrerequisiteLessonId"); - - b.HasIndex("Status"); - - b.HasIndex("TopicId"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId"); - - b.ToTable("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.HasKey("LessonId", "GrammarPatternId"); - - b.HasIndex("GrammarPatternId"); - - b.ToTable("LessonGrammars"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.HasKey("LessonId", "KanjiId"); - - b.HasIndex("KanjiId"); - - b.ToTable("LessonKanjis"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstViewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("InteractionCount") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastInteractedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LastPositionSeconds") - .HasColumnType("integer"); - - b.Property("LastWatchedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProgressPercent") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("LessonId"); - - b.HasIndex("UserId", "LessonId") - .IsUnique(); - - b.ToTable("LessonProgresses"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer") - .HasColumnName("VocabularyEntryId"); - - b.HasKey("LessonId", "VocabularyId"); - - b.HasIndex("VocabularyId"); - - b.ToTable("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReporterId") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TargetUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("ReporterId") - .HasDatabaseName("IX_MentorAbuseReports_ReporterId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAbuseReports_Status"); - - b.HasIndex("TargetUserId") - .HasDatabaseName("IX_MentorAbuseReports_TargetUserId"); - - b.ToTable("MentorAbuseReports", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DecisionReason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceSummary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RawLearnerDurationSeconds") - .HasColumnType("integer"); - - b.Property("RawMentorDurationSeconds") - .HasColumnType("integer"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("ReviewedByAdminId"); - - b.ToTable("MentorAttendanceApprovals", t => - { - t.HasCheckConstraint("CK_MentorAttendanceApproval_Minutes", "\"ApprovedEligibleMinutes\" IS NULL OR (\"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90)"); - - t.HasCheckConstraint("CK_MentorAttendanceApproval_RawDuration", "\"RawMentorDurationSeconds\" >= 0 AND \"RawLearnerDurationSeconds\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseSessionId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FirstJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastJoinedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LeftAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ReconnectionCount") - .HasColumnType("integer"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TotalDurationSeconds") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CourseSessionId"); - - b.HasIndex("RoomId") - .HasDatabaseName("IX_MentorAttendanceRecords_RoomId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorAttendanceRecords_Status"); - - b.HasIndex("UserId") - .HasDatabaseName("IX_MentorAttendanceRecords_UserId"); - - b.HasIndex("MentorBookingId", "UserId") - .IsUnique() - .HasDatabaseName("IX_MentorAttendanceRecords_Booking_User"); - - b.HasIndex("RoomId", "UserId") - .IsUnique() - .HasFilter("\"MentorBookingId\" IS NULL"); - - b.ToTable("MentorAttendanceRecords", null, t => - { - t.HasCheckConstraint("CK_MentorAttendanceRecord_Duration", "\"TotalDurationSeconds\" >= 0"); - - t.HasCheckConstraint("CK_MentorAttendanceRecord_Reconnection", "\"ReconnectionCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminName") - .HasColumnType("text"); - - b.Property("AttendanceTrackingEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("BookedCount") - .HasColumnType("integer"); - - b.Property("CancelReason") - .HasColumnType("text"); - - b.Property("CancelRejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelRejectionReason") - .HasColumnType("text"); - - b.Property("CancelRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeRequestReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeRequestedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ChangeResolution") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp without time zone"); - - b.Property("GenerationKey") - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("IsApproved") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MaxLearners") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorScheduleRuleId") - .HasColumnType("bigint"); - - b.Property("MentorWeeklyAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasColumnType("text"); - - b.Property("RestMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("RoomId") - .HasColumnType("uuid"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("bytea"); - - b.Property("SessionMinutesSnapshot") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp without time zone"); - - b.Property("TeachingProposalId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("GenerationKey") - .IsUnique() - .HasFilter("\"GenerationKey\" IS NOT NULL"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorScheduleRuleId"); - - b.HasIndex("MentorWeeklyAvailabilityId"); - - b.HasIndex("RoomId") - .IsUnique(); - - b.HasIndex("TeachingProposalId") - .HasFilter("\"TeachingProposalId\" IS NOT NULL"); - - b.HasIndex("MentorId", "StartTime", "EndTime"); - - b.ToTable("MentorAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorAvailability_BookedCount", "\"BookedCount\" >= 0 AND \"BookedCount\" <= \"MaxLearners\""); - - t.HasCheckConstraint("CK_MentorAvailability_GeneratedSlot", "(\"GenerationKey\" IS NULL AND \"PolicyVersion\" IS NULL AND \"MentorScheduleRuleId\" IS NULL AND \"LocalBusinessDate\" IS NULL AND \"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL) OR (\"GenerationKey\" IS NOT NULL AND \"PolicyVersion\" IS NOT NULL AND \"PolicyVersion\" > 0 AND (\"MentorScheduleRuleId\" IS NOT NULL OR \"TeachingProposalId\" IS NOT NULL) AND \"LocalBusinessDate\" IS NOT NULL AND ((\"GroupPolicyId\" IS NULL AND \"SessionMinutesSnapshot\" IS NULL AND \"RestMinutesSnapshot\" IS NULL AND \"MaxLearners\" = 1 AND \"EndTime\" = \"StartTime\" + INTERVAL '90 minutes') OR (\"GroupPolicyId\" IS NOT NULL AND \"SessionMinutesSnapshot\" > 0 AND \"RestMinutesSnapshot\" >= 0 AND \"MaxLearners\" BETWEEN 1 AND 50 AND \"EndTime\" = \"StartTime\" + \"SessionMinutesSnapshot\" * INTERVAL '1 minute')))"); - }); - - b.HasData( - new - { - Id = 990001, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 2, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990001"), - StartTime = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990002, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 3, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900002, - RoomId = new Guid("a1000000-0000-0000-0000-000000990002"), - StartTime = new DateTime(2026, 10, 3, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990003, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 4, 10, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990003"), - StartTime = new DateTime(2026, 10, 4, 9, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }, - new - { - Id = 990004, - AdminName = "Seed Demo", - AttendanceTrackingEnabled = true, - BookedCount = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndTime = new DateTime(2026, 10, 5, 14, 0, 0, 0, DateTimeKind.Unspecified), - IsApproved = true, - IsDeleted = false, - MaxLearners = 4, - MentorId = 900003, - RoomId = new Guid("a1000000-0000-0000-0000-000000990004"), - StartTime = new DateTime(2026, 10, 5, 13, 0, 0, 0, DateTimeKind.Unspecified), - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("AccountNumberHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("AccountVersion") - .HasColumnType("integer"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EncryptedAccountNumber") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsCurrent") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("VerificationNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorUserId") - .IsUnique() - .HasDatabaseName("IX_MentorBankAccounts_MentorUserId_Current") - .HasFilter("\"IsCurrent\" = TRUE"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "AccountVersion") - .IsUnique(); - - b.ToTable("MentorBankAccounts", t => - { - t.HasCheckConstraint("CK_MentorBankAccount_Version", "\"AccountVersion\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CancellationReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CancelledByRole") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CancelledByUserId") - .HasColumnType("integer"); - - b.Property("CompensationCurrency") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("CompensationFormulaVersion") - .HasColumnType("integer"); - - b.Property("CompensationLevelId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("ExceptionApproved") - .HasColumnType("boolean"); - - b.Property("ExceptionReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExceptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MeetingLink") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeFeedback") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PracticeFeedbackAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeScore") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ScheduledCompensationAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CompensationLevelId"); - - b.HasIndex("CreditGrantId"); - - b.HasIndex("MentorAvailabilityId", "LearnerId") - .IsUnique() - .HasFilter("\"MentorAvailabilityId\" IS NOT NULL AND \"LearnerId\" IS NOT NULL AND NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("MentorAvailabilityId", "UserSubscriptionId") - .IsUnique() - .HasFilter("NOT \"IsDeleted\" AND \"Status\" <> 'Cancelled'"); - - b.HasIndex("UserSubscriptionId", "Status"); - - b.ToTable("MentorBookings"); - - b.HasData( - new - { - Id = 990001, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Meeting demo để kiểm thử phòng họp trên frontend.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990001, - Version = 0u - }, - new - { - Id = 990002, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Em muốn nhờ Mentor giải đáp phần ngữ pháp N3 bài 5.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990002, - Version = 0u - }, - new - { - Id = 990003, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Hỏi về cách phân biệt giữa ~てくる và ~ていく.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990003, - Version = 0u - }, - new - { - Id = 990004, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - ExceptionRequested = false, - IsDeleted = false, - MeetingLink = "http://localhost:5173/mentor-meeting/a1000000-0000-0000-0000-000000990001", - MentorAvailabilityId = 990001, - Question = "Tư vấn phương pháp luyện nghe JLPT N3 hiệu quả.", - ScheduledAt = new DateTime(2026, 10, 2, 9, 0, 0, 0, DateTimeKind.Unspecified), - Status = "Assigned", - UserSubscriptionId = 990004, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("ActiveBookingCount") - .HasColumnType("integer"); - - b.HasKey("MentorId", "LocalBusinessDate"); - - b.ToTable("MentorBookingDayGuards", null, t => - { - t.HasCheckConstraint("CK_MentorBookingDayGuard_Count", "\"ActiveBookingCount\" >= 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IntentKey") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("RequestHash") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId"); - - b.HasIndex("LearnerId", "IntentKey") - .IsUnique(); - - b.ToTable("MentorBookingIntents", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LocalBusinessDate") - .HasColumnType("date"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ReleasedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("RestProtectedUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("StartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("MentorAvailabilityId") - .HasFilter("\"ReleasedAtUtc\" IS NULL"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("MentorAvailabilityId", "MentorId"); - - b.HasIndex("MentorId", "LocalBusinessDate", "ReleasedAtUtc"); - - b.ToTable("MentorBookingReservations", null, t => - { - t.HasCheckConstraint("CK_MentorBookingReservation_Interval", "\"EndUtc\" > \"StartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingReservation_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorBookingReservation_Rest", "\"RestProtectedUntilUtc\" >= \"EndUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ConfirmedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("ScheduledEndUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ScheduledStartUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("MentorBookingId"); - - b.HasIndex("MentorAvailabilityId"); - - b.ToTable("MentorBookingTerms", null, t => - { - t.HasCheckConstraint("CK_MentorBookingTerms_Interval", "\"ScheduledEndUtc\" > \"ScheduledStartUtc\""); - - t.HasCheckConstraint("CK_MentorBookingTerms_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LastSyncedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ProtectedRefreshToken") - .HasColumnType("text"); - - b.Property("StateExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StateHash") - .HasColumnType("text"); - - b.Property("SyncedEventsJson") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MentorId") - .IsUnique(); - - b.HasIndex("StateHash") - .IsUnique(); - - b.ToTable("MentorCalendarConnections", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ReadAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SenderUserId") - .HasColumnType("integer"); - - b.Property("SentAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.HasKey("Id"); - - b.HasIndex("SenderUserId"); - - b.HasIndex("MentorBookingId", "Id"); - - b.HasIndex("MentorBookingId", "ReadAt", "SenderUserId"); - - b.ToTable("MentorChatMessages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreditGrantId") - .HasColumnType("bigint"); - - b.Property("EntryType") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("Reason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("CreditGrantId", "EntryType"); - - b.HasIndex("MentorBookingId", "EntryType"); - - b.ToTable("MentorCreditEntries", null, t => - { - t.HasCheckConstraint("CK_MentorCreditEntry_Amount", "\"Amount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("InitialQuantity") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("UserSubscriptionId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserSubscriptionId") - .IsUnique(); - - b.HasIndex("LearnerId", "ExpiresAtUtc"); - - b.HasIndex("LearnerId", "CertificateLevelId", "ExpiresAtUtc"); - - b.ToTable("MentorCreditGrants", null, t => - { - t.HasCheckConstraint("CK_MentorCreditGrant_PolicyVersion", "\"PolicyVersion\" > 0"); - - t.HasCheckConstraint("CK_MentorCreditGrant_Quantity", "\"InitialQuantity\" > 0 AND \"AvailableQuantity\" >= 0 AND \"AvailableQuantity\" <= \"InitialQuantity\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminDecision") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("AdminNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Category") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CreditRefunded") - .HasColumnType("boolean"); - - b.Property("EvidenceUrls") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("IsRefundApproved") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRespondedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorResponse") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RefundOperationKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("ResolvedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ResolvedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorDisputes_LearnerId"); - - b.HasIndex("MentorBookingId") - .HasDatabaseName("IX_MentorDisputes_MentorBookingId"); - - b.HasIndex("MentorId") - .HasDatabaseName("IX_MentorDisputes_MentorId"); - - b.HasIndex("ResolvedByAdminId"); - - b.HasIndex("Status") - .HasDatabaseName("IX_MentorDisputes_Status"); - - b.ToTable("MentorDisputes", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ActorId") - .HasColumnType("integer"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("DisputeId") - .HasColumnType("integer"); - - b.Property("NewStatus") - .HasColumnType("integer"); - - b.Property("Notes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PreviousStatus") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DisputeId") - .HasDatabaseName("IX_MentorDisputeHistories_DisputeId"); - - b.ToTable("MentorDisputeHistories", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("AttendanceApprovalId") - .HasColumnType("bigint"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FormulaVersion") - .HasColumnType("integer"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("GrossAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("JlptLevelCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceApprovalId") - .IsUnique(); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.HasIndex("MentorUserId", "Status"); - - b.ToTable("MentorEarningEntries", t => - { - t.HasCheckConstraint("CK_MentorEarningEntry_Positive", "\"FrozenHourlyRate\" > 0 AND \"FrozenLevelCoefficient\" > 0 AND \"ApprovedEligibleMinutes\" > 0 AND \"ApprovedEligibleMinutes\" <= 90 AND \"GrossAmount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationLeadHours") - .HasColumnType("integer"); - - b.Property("CheckoutHoldMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedByAdminId") - .HasColumnType("integer"); - - b.Property("DeletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedByAdminId") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("HomeworkDeadlineDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsArchivedRevision") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("KpiReportingPeriodDays") - .HasColumnType("integer"); - - b.Property("LastAppliedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("LastAppliedByAdminId") - .HasColumnType("integer"); - - b.Property("LearnerTransferEnabled") - .HasColumnType("boolean"); - - b.Property("MaxLearners") - .HasColumnType("integer"); - - b.Property("MentorReplacementEnabled") - .HasColumnType("boolean"); - - b.Property("MentorReplacementLeadHours") - .HasColumnType("integer"); - - b.Property("MinimumPreparationDays") - .HasColumnType("integer"); - - b.Property("MinimumPublishedEnrollmentDays") - .HasColumnType("integer"); - - b.Property("PlacementAttemptLimit") - .HasColumnType("integer"); - - b.Property("RemediationCompletionThresholdPercent") - .HasPrecision(5, 2) - .HasColumnType("numeric(5,2)"); - - b.Property("RemediationThresholdComparison") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("RequireAdminRemediationReview") - .HasColumnType("boolean"); - - b.Property("RequireOfficialExamEvidence") - .HasColumnType("boolean"); - - b.Property("ReschedulingLeadHours") - .HasColumnType("integer"); - - b.Property("RestMinutes") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("TransferAllowedAfterSourceStart") - .HasColumnType("boolean"); - - b.Property("TuitionPerSessionN2") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN3") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN4") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionN5") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedByAdminId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CreatedByAdminId"); - - b.HasIndex("DeletedByAdminId"); - - b.HasIndex("EffectiveFromUtc"); - - b.HasIndex("IsActive") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_SingleActive") - .HasFilter("\"IsActive\" = TRUE"); - - b.HasIndex("LastAppliedByAdminId"); - - b.HasIndex("UpdatedByAdminId"); - - b.HasIndex("Version") - .IsUnique() - .HasDatabaseName("IX_MentorGroupPolicies_LiveVersion") - .HasFilter("\"IsArchivedRevision\" = FALSE"); - - b.ToTable("MentorGroupPolicies", null, t => - { - t.HasCheckConstraint("CK_MentorGroupPolicy_Capacity", "\"MaxLearners\" BETWEEN 1 AND 50"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_CheckoutHold", "\"CheckoutHoldMinutes\" BETWEEN 1 AND 60"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Comparison", "\"RemediationThresholdComparison\" IN ('>', '>=')"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_EnrollmentDays", "\"MinimumPublishedEnrollmentDays\" BETWEEN 1 AND 180"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); - - t.HasCheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); - - t.HasCheckConstraint("CK_MentorGroupPolicy_Tuition", "\"TuitionPerSessionN5\" >= 0 AND \"TuitionPerSessionN4\" >= 0 AND \"TuitionPerSessionN3\" >= 0 AND \"TuitionPerSessionN2\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - CancellationLeadHours = 24, - CheckoutHoldMinutes = 10, - CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - EffectiveFromUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - HomeworkDeadlineDays = 7, - IsActive = true, - IsArchivedRevision = false, - IsDeleted = false, - KpiReportingPeriodDays = 30, - LastAppliedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), - LearnerTransferEnabled = true, - MaxLearners = 4, - MentorReplacementEnabled = true, - MentorReplacementLeadHours = 24, - MinimumPreparationDays = 1, - MinimumPublishedEnrollmentDays = 7, - PlacementAttemptLimit = 2, - RemediationCompletionThresholdPercent = 90m, - RemediationThresholdComparison = ">", - RequireAdminRemediationReview = true, - RequireOfficialExamEvidence = true, - ReschedulingLeadHours = 24, - RestMinutes = 15, - Revision = 1, - SessionMinutes = 90, - TransferAllowedAfterSourceStart = false, - TuitionPerSessionN2 = 110000m, - TuitionPerSessionN3 = 90000m, - TuitionPerSessionN4 = 75000m, - TuitionPerSessionN5 = 60000m, - Version = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountPerHour") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveUntilUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ConfiguredByAdminId"); - - b.HasIndex("MentorUserId", "EffectiveFromUtc") - .IsUnique(); - - b.ToTable("MentorHourlyRates", t => - { - t.HasCheckConstraint("CK_MentorHourlyRate_Positive", "\"AmountPerHour\" > 0"); - - t.HasCheckConstraint("CK_MentorHourlyRate_Range", "\"EffectiveUntilUtc\" IS NULL OR \"EffectiveUntilUtc\" > \"EffectiveFromUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AggregateId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("AggregateType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("Attempts") - .HasColumnType("integer"); - - b.Property("AvailableAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeliveredAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EventKey") - .IsRequired() - .HasMaxLength(160) - .HasColumnType("character varying(160)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("character varying(80)"); - - b.Property("EventVersion") - .HasColumnType("integer"); - - b.Property("PayloadJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("EventKey") - .IsUnique(); - - b.HasIndex("DeliveredAtUtc", "AvailableAtUtc", "CreatedAtUtc"); - - b.ToTable("MentorOutboxEvents", null, t => - { - t.HasCheckConstraint("CK_MentorOutbox_Attempts", "\"Attempts\" >= 0"); - - t.HasCheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("AttemptNumber") - .HasColumnType("integer"); - - b.Property("BatchId") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ConfirmedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ErrorCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ErrorMessage") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("EvidenceStorageKey") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ExecutionMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("IdempotencyKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("InitiatedByAdminId") - .HasColumnType("integer"); - - b.Property("InternalStatus") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("PayoutObligationId") - .HasColumnType("bigint"); - - b.Property("ProviderPayoutId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("TransferReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("ConfirmedByAdminId"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("InitiatedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("PayoutObligationId") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_OneSucceededPerObligation") - .HasFilter("\"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("TransferReference") - .IsUnique() - .HasDatabaseName("IX_MentorPayoutAttempts_SucceededTransferReference") - .HasFilter("\"TransferReference\" IS NOT NULL AND \"InternalStatus\" = 'Succeeded'"); - - b.HasIndex("PayoutObligationId", "AttemptNumber") - .IsUnique(); - - b.ToTable("MentorPayoutAttempts", t => - { - t.HasCheckConstraint("CK_MentorPayoutAttempt_ManualEvidence", "(\"ExecutionMethod\" <> 'ManualBankTransfer' OR \"InternalStatus\" <> 'Succeeded') OR (\"TransferReference\" IS NOT NULL AND \"EvidenceStorageKey\" IS NOT NULL)"); - - t.HasCheckConstraint("CK_MentorPayoutAttempt_Positive", "\"Amount\" > 0 AND \"AttemptNumber\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActiveAttemptId") - .HasColumnType("bigint"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("LockedBankAccountId") - .HasColumnType("bigint"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("OrganizationPayoutAccountId") - .HasColumnType("bigint"); - - b.Property("PayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("SelectedMethod") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SettledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("SettledAttemptId") - .HasColumnType("bigint"); - - b.Property("SettledReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("LockedBankAccountId"); - - b.HasIndex("MentorUserId"); - - b.HasIndex("OrganizationPayoutAccountId"); - - b.HasIndex("PayrollPeriodId") - .IsUnique(); - - b.ToTable("MentorPayoutObligations", t => - { - t.HasCheckConstraint("CK_MentorPayoutObligation_Positive", "\"PayableAmount\" > 0"); - - t.HasCheckConstraint("CK_MentorPayoutObligation_Settlement", "(\"Status\" <> 'Paid') OR (\"SettledAttemptId\" IS NOT NULL AND \"SettledReference\" IS NOT NULL AND \"SettledAtUtc\" IS NOT NULL)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OperationKey") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("RelatedBookingId") - .HasColumnType("integer"); - - b.Property("RelatedEarningEntryId") - .HasColumnType("bigint"); - - b.Property("SignedAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("OperationKey") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollAdjustments", t => - { - t.HasCheckConstraint("CK_MentorPayrollAdjustment_NonZero", "\"SignedAmount\" <> 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovedEligibleMinutes") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EarningEntryId") - .HasColumnType("bigint"); - - b.Property("FrozenHourlyRate") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("FrozenLevelCoefficient") - .HasPrecision(10, 4) - .HasColumnType("numeric(10,4)"); - - b.Property("LineAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("PayrollPeriodId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("EarningEntryId") - .IsUnique(); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("PayrollPeriodId"); - - b.ToTable("MentorPayrollLines", t => - { - t.HasCheckConstraint("CK_MentorPayrollLine_Positive", "\"LineAmount\" > 0 AND \"ApprovedEligibleMinutes\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApprovalNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ApprovedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ApprovedByAdminId") - .HasColumnType("integer"); - - b.Property("ClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("GrossPayableAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("Month") - .HasColumnType("integer"); - - b.Property("PreparedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("PreparedByAdminId") - .HasColumnType("integer"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SupplementalReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("TotalAdjustmentsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("TotalEarningsAmount") - .HasPrecision(18, 2) - .HasColumnType("numeric(18,2)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("Year") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedByAdminId"); - - b.HasIndex("PreparedByAdminId"); - - b.HasIndex("MentorUserId", "Year", "Month", "SequenceNumber", "Currency") - .IsUnique(); - - b.ToTable("MentorPayrollPeriods", t => - { - t.HasCheckConstraint("CK_MentorPayrollPeriod_Payable", "\"TotalEarningsAmount\" >= 0 AND \"GrossPayableAmount\" >= 0"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Period", "\"Year\" >= 2020 AND \"Year\" <= 2100 AND \"Month\" >= 1 AND \"Month\" <= 12 AND \"SequenceNumber\" >= 1"); - - t.HasCheckConstraint("CK_MentorPayrollPeriod_Supplemental", "\"SequenceNumber\" = 1 OR (\"SupplementalReason\" IS NOT NULL AND length(trim(\"SupplementalReason\")) > 0)"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Bio") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Expertise") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("IntroductionVideoUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("RejectionReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewNotes") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("VerificationDocumentUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("VerificationStatus") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Workplace") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("YearsOfExperience") - .HasColumnType("integer"); - - b.HasKey("MentorId"); - - b.ToTable("MentorProfiles", (string)null); - - b.HasData( - new - { - MentorId = 900002, - Bio = "Chuyên gia tiếng Nhật với 8 năm kinh nghiệm giảng dạy JLPT N1, N2 và tiếng Nhật doanh nghiệp.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Luyện thi JLPT N1-N2, Tiếng Nhật thương mại, Phỏng vấn xin việc", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 8 - }, - new - { - MentorId = 900003, - Bio = "Giảng viên tiếng Nhật bản xứ, chuyên sâu về phát âm và giao tiếp Kaiwa thực tế.", - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - Expertise = "Giao tiếp Kaiwa tự nhiên, Luyện phát âm chuẩn Tokyo, JLPT N3-N2", - IsDeleted = false, - JlptLevel = "N1", - ReviewedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - ReviewedByAdminName = "Admin System", - SubmittedAt = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - VerificationStatus = "Approved", - Workplace = "Riki Nihongo Academy", - YearsOfExperience = 5 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPublic") - .HasColumnType("boolean"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorRepliedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReply") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModerationStatus") - .HasColumnType("integer"); - - b.Property("Rating") - .HasColumnType("integer"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.HasKey("Id"); - - b.HasIndex("LearnerId") - .HasDatabaseName("IX_MentorReviews_LearnerId"); - - b.HasIndex("MentorBookingId") - .IsUnique() - .HasDatabaseName("IX_MentorReviews_MentorBookingId"); - - b.HasIndex("MentorId", "IsPublic", "ModerationStatus") - .HasDatabaseName("IX_MentorReviews_Mentor_Public_Status"); - - b.ToTable("MentorReviews", null, t => - { - t.HasCheckConstraint("CK_MentorReview_Rating_Range", "\"Rating\" >= 1 AND \"Rating\" <= 5"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoPublish") - .HasColumnType("boolean"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("GeneratedThrough") - .HasColumnType("date"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyVersion") - .HasColumnType("integer"); - - b.Property("TimeZoneId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "PolicyVersion") - .IsUnique(); - - b.ToTable("MentorSchedules", null, t => - { - t.HasCheckConstraint("CK_MentorSchedule_PolicyVersion", "\"PolicyVersion\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DaypartCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("EffectiveFrom") - .HasColumnType("date"); - - b.Property("EffectiveTo") - .HasColumnType("date"); - - b.Property("LocalEnd") - .HasColumnType("time without time zone"); - - b.Property("LocalStart") - .HasColumnType("time without time zone"); - - b.Property("ScheduleId") - .HasColumnType("bigint"); - - b.Property("Weekday") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleId", "Weekday", "DaypartCode", "EffectiveFrom") - .IsUnique(); - - b.ToTable("MentorScheduleRules", null, t => - { - t.HasCheckConstraint("CK_MentorScheduleRule_Daypart", "\"DaypartCode\" IN ('Morning', 'Noon', 'Afternoon', 'Evening')"); - - t.HasCheckConstraint("CK_MentorScheduleRule_Time", "\"LocalEnd\" > \"LocalStart\""); - - t.HasCheckConstraint("CK_MentorScheduleRule_Weekday", "\"Weekday\" BETWEEN 0 AND 6"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .HasColumnType("integer"); - - b.Property("CourseObjective") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("CoursePlanId") - .HasColumnType("integer"); - - b.Property("CourseTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpectedStartDate") - .HasColumnType("date"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("HiddenFromMentorAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsHiddenFromMentorHistory") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastSavedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("OpenEnrollmentIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("OpenedClassAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("OptionalAttachmentsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.Property("OptionalNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProgramType") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ReviewReason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionDurationMinutes") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("SubmissionIdempotencyKey") - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("WeeklySessionsJson") - .IsRequired() - .HasColumnType("jsonb"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CoursePlanId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("MentorId", "OpenEnrollmentIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_OpenEnrollmentIdempotencyKey") - .HasFilter("\"OpenEnrollmentIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("MentorId", "SubmissionIdempotencyKey") - .IsUnique() - .HasDatabaseName("IX_MentorTeachingProposals_MentorId_SubmissionIdempotencyKey") - .HasFilter("\"SubmissionIdempotencyKey\" IS NOT NULL"); - - b.HasIndex("Status", "SubmittedAtUtc"); - - b.HasIndex("MentorId", "Status", "UpdatedAtUtc"); - - b.ToTable("MentorTeachingProposals", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposal_Duration", "\"CourseDurationWeeks\" BETWEEN 1 AND 104 AND \"SessionDurationMinutes\" BETWEEN 30 AND 240"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_ProgramType", "\"ProgramType\" IN ('StandardJlpt', 'IntensiveJlpt', 'ExamPrepJlpt', 'CustomJlpt')"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Revision", "\"Revision\" > 0"); - - t.HasCheckConstraint("CK_MentorTeachingProposal_Status", "\"Status\" IN ('Draft', 'PendingReview', 'ChangesRequested', 'Approved', 'OpenedClass', 'Rejected', 'Withdrawn')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .IsRequired() - .HasMaxLength(48) - .HasColumnType("character varying(48)"); - - b.Property("ActorRole") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ActorUserId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("FromStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("ProposalId") - .HasColumnType("integer"); - - b.Property("Reason") - .HasMaxLength(1500) - .HasColumnType("character varying(1500)"); - - b.Property("RevisionAfter") - .HasColumnType("integer"); - - b.Property("SnapshotJson") - .HasColumnType("jsonb"); - - b.Property("ToStatus") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.HasKey("Id"); - - b.HasIndex("ProposalId", "CreatedAtUtc"); - - b.ToTable("MentorTeachingProposalEvents", null, t => - { - t.HasCheckConstraint("CK_MentorTeachingProposalEvent_RevisionAfter", "\"RevisionAfter\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("MentorUserId") - .HasColumnType("integer"); - - b.Property("RevokedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("VerifiedByAdminId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("VerifiedByAdminId"); - - b.HasIndex("MentorUserId", "CertificateLevelId") - .IsUnique() - .HasFilter("\"IsActive\" = TRUE"); - - b.ToTable("MentorTeachingQualifications", t => - { - t.HasCheckConstraint("CK_MentorTeachingQualification_Revoked", "\"RevokedAtUtc\" IS NULL OR \"RevokedAtUtc\" >= \"VerifiedAtUtc\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Period") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("MentorId", "Date", "Period") - .IsUnique() - .HasFilter("NOT \"IsDeleted\""); - - b.ToTable("MentorWeeklyAvailabilities", t => - { - t.HasCheckConstraint("CK_MentorWeeklyAvailability_Period", "\"Period\" IN ('Morning', 'Afternoon', 'Evening')"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("AnswerKeyJson") - .HasColumnType("jsonb"); - - b.Property("AudioTranscript") - .HasColumnType("text"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("ContentFingerprint") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Difficulty") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("GroupSortOrder") - .HasColumnType("integer"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("InteractionDataJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("PracticeTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionsJson") - .HasColumnType("jsonb"); - - b.Property("ParentQuestionId") - .HasColumnType("integer"); - - b.Property("PassageId") - .HasColumnType("integer"); - - b.Property("PlaybackPolicyJson") - .HasColumnType("jsonb"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionGroupTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QuestionIdentity") - .HasColumnType("uuid"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("QuestionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("SingleChoice"); - - b.Property("QuestionVersion") - .HasColumnType("integer"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SkillMetadataJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("SourceQuestionId") - .HasColumnType("integer"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TemplateKind") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Topic") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.HasKey("Id"); - - b.HasIndex("ContentFingerprint"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("PassageId"); - - b.HasIndex("QuestionIdentity"); - - b.HasIndex("SourceQuestionId"); - - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - - b.ToTable("MockQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.ToTable("MockQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiProvenanceJson") - .HasColumnType("jsonb"); - - b.Property("BlueprintPolicyJson") - .HasColumnType("jsonb"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ExamKind") - .HasColumnType("integer"); - - b.Property("FocusSkillId") - .HasColumnType("integer"); - - b.Property("IncludedSkillsJson") - .HasColumnType("jsonb"); - - b.Property("IsArchivedVersion") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsManagedWorkflow") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ParentExamId") - .HasColumnType("integer"); - - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("SourceReference") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("TagsJson") - .HasColumnType("jsonb"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserAccountId"); - - b.ToTable("MockTests"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiExplanationGeneratedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AiExplanationInputJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationJson") - .HasColumnType("jsonb"); - - b.Property("AiExplanationVersion") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockQuestionId") - .HasColumnType("integer") - .HasColumnName("PracticeQuestionId"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("PracticeTestAttemptId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ResponseJson") - .HasColumnType("jsonb"); - - b.Property("SelectedOptionId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockQuestionId"); - - b.HasIndex("SelectedOptionId"); - - b.HasIndex("MockTestAttemptId", "MockQuestionId") - .IsUnique(); - - b.ToTable("MockTestAnswers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttemptKind") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPlacementAssessment") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("QuestionSnapshotJson") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalScore") - .HasColumnType("double precision"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("StartedAt"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "AttemptKind") - .IsUnique() - .HasFilter("\"AttemptKind\" = 1 AND \"IsCompleted\" = false AND \"IsDeleted\" = false"); - - b.ToTable("MockTestAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateSectionId") - .HasColumnType("integer") - .HasColumnName("CertificationSectionId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationMinutes") - .HasColumnType("integer"); - - b.Property("Instructions") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer") - .HasColumnName("SkillId"); - - b.Property("MockTestId") - .HasColumnType("integer") - .HasColumnName("MockTestId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SectionPolicyJson") - .HasColumnType("jsonb"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateSectionId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("MockTestId", "CertificateSectionId"); - - b.ToTable("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MockTestAttemptId") - .HasColumnType("integer") - .HasColumnName("MockTestAttemptId"); - - b.Property("MockTestSectionId") - .HasColumnType("integer") - .HasColumnName("MockTestSectionId"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("TotalCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MockTestSectionId"); - - b.HasIndex("MockTestAttemptId", "MockTestSectionId") - .IsUnique(); - - b.ToTable("MockTestSectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AnsweredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AuthorRole") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MentorBookingId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MentorBookingId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("Notes"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookFolders_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("UserId", "NormalizedName") - .IsUnique() - .HasFilter("\"IsDeleted\" = false"); - - b.HasIndex("UserId", "IsDeleted", "SortOrder"); - - b.ToTable("NotebookFolders", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChecklistCompletedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ChecklistTotalCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ContentFormatVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("ContentJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{\"type\":\"doc\",\"version\":1,\"blocks\":[]}'::jsonb"); - - b.Property("ContentPlainText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue(""); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("FavoritedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDefault") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsFavorite") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false); - - b.Property("LastAutosavedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourcePath") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceTitle") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("IX_NotebookPages_UserId_IsDefault") - .HasFilter("\"IsDeleted\" = false AND \"IsDefault\" = true"); - - b.HasIndex("LearnerNoteId", "IsDeleted", "SortOrder"); - - b.HasIndex("UserId", "IsDeleted", "IsFavorite"); - - b.ToTable("NotebookPages", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeliveredTokens") - .HasColumnType("text"); - - b.Property("IdempotencyKey") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsRead") - .HasColumnType("boolean"); - - b.Property("LinkUrl") - .HasColumnType("text"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("UserId", "IsRead"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountHolderName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("BankCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("BankName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ChannelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConfiguredByAdminId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsVerified") - .HasColumnType("boolean"); - - b.Property("MaskedAccountNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderAccountReference") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProviderType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("VerifiedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ChannelCode") - .IsUnique(); - - b.HasIndex("ConfiguredByAdminId"); - - b.ToTable("OrganizationPayoutAccounts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LanguageSkillId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); - - b.Property("Scope") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("LessonQuickCheck"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("TopicId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("LanguageSkillId"); - - b.HasIndex("TopicId"); - - b.HasIndex("LessonId", "LanguageSkillId"); - - b.HasIndex("Scope", "CertificateLevelId"); - - b.HasIndex("Scope", "TopicId"); - - b.ToTable("PracticeExercises"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HomeworkAssignmentId") - .HasColumnType("integer"); - - b.Property("IsCompleted") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("ScorePercent") - .HasColumnType("double precision"); - - b.Property("StartedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.HasIndex("HomeworkAssignmentId", "PracticeExerciseId") - .IsUnique(); - - b.HasIndex("UserId", "PracticeExerciseId", "StartedAt"); - - b.ToTable("PracticeExerciseAttempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Explanation") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PracticeExerciseId") - .HasColumnType("integer"); - - b.Property("QuestionText") - .IsRequired() - .HasColumnType("text"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeExerciseId"); - - b.ToTable("PracticeQuestions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("OptionText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("PracticeQuestionId") - .HasColumnType("integer"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("PracticeQuestionId"); - - b.ToTable("PracticeQuestionOptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CertificateLevelId") - .HasColumnType("integer") - .HasColumnName("CertificationLevelId"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("TextContent") - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("UserId", "Type", "SubmittedAt"); - - b.ToTable("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BaseActivePathId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("GeneratedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsViewed") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreviewExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SuggestionJson") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("\"Status\" = 'Active'"); - - b.HasIndex("UserId", "GeneratedAt"); - - b.HasIndex("UserId", "Version") - .IsUnique(); - - b.ToTable("RecommendedLearningPaths"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("ArchivedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasDefaultValue(""); - - b.Property("CardType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasDefaultValue("Vocabulary"); - - b.Property("ContextSnippet") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CorrectCount") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("EaseFactor") - .HasColumnType("double precision"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasDefaultValue(""); - - b.Property("GrammarPatternId") - .HasColumnType("integer") - .HasColumnName("GrammarPointId"); - - b.Property("IncorrectCount") - .HasColumnType("integer"); - - b.Property("IntervalDays") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer") - .HasColumnName("KanjiEntryId"); - - b.Property("Lapses") - .HasColumnType("integer"); - - b.Property("LastReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("LearnerNoteEntryId") - .HasColumnType("integer") - .HasColumnName("VocabularyNoteEntryId"); - - b.Property("LearningState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("MasteredAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NextReviewDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasDefaultValue(""); - - b.Property("PersonalNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Repetitions") - .HasColumnType("integer"); - - b.Property("Revision") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("SourceLabel") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("SourceLinksJson") - .HasMaxLength(4000) - .HasColumnType("character varying(4000)"); - - b.Property("SourceType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasDefaultValue("Manual"); - - b.Property("SourceVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SrsCardTemplateId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Active"); - - b.Property("SuspendedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.Property("WritingCorrectStrokeCount") - .HasColumnType("integer"); - - b.Property("WritingPracticeMode") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("WritingScore") - .HasColumnType("integer"); - - b.Property("WritingScoreUpdatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("WritingTotalStrokeCount") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LearnerNoteEntryId"); - - b.HasIndex("LessonId"); - - b.HasIndex("SrsCardTemplateId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("UserId", "NextReviewDate"); - - b.HasIndex("UserId", "GrammarPatternId", "Mode") - .IsUnique() - .HasFilter("\"GrammarPointId\" IS NOT NULL"); - - b.HasIndex("UserId", "KanjiId", "Mode") - .IsUnique() - .HasFilter("\"KanjiEntryId\" IS NOT NULL"); - - b.HasIndex("UserId", "NormalizedContentKey", "Mode") - .IsUnique() - .HasFilter("\"NormalizedContentKey\" <> '' AND \"IsDeleted\" = false"); - - b.HasIndex("UserId", "VocabularyId", "Mode") - .IsUnique() - .HasFilter("\"VocabularyId\" IS NOT NULL"); - - b.HasIndex("UserId", "Status", "LearningState", "NextReviewDate"); - - b.ToTable("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IdempotencyKey") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("IsCorrect") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NewEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("NewIntervalDays") - .HasColumnType("integer"); - - b.Property("NewState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Learning"); - - b.Property("PreviousEaseFactor") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(2.5); - - b.Property("PreviousIntervalDays") - .HasColumnType("integer"); - - b.Property("PreviousState") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("New"); - - b.Property("Quality") - .HasColumnType("integer"); - - b.Property("Rating") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("ResponseTimeMs") - .HasColumnType("integer"); - - b.Property("ReviewCardId") - .HasColumnType("integer") - .HasColumnName("ReviewItemId"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("SessionReference") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("StudyMode") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("flip"); - - b.Property("UserAnswer") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.HasKey("Id"); - - b.HasIndex("SessionReference"); - - b.HasIndex("ReviewCardId", "IdempotencyKey") - .IsUnique() - .HasFilter("\"IdempotencyKey\" IS NOT NULL"); - - b.HasIndex("ReviewCardId", "ReviewedAt"); - - b.ToTable("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AcceptedReadingsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("AudioUrl") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("BackText") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CardType") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleMeaning") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ExampleSentence") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FrontText") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("GrammarPatternId") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("KanjiId") - .HasColumnType("integer"); - - b.Property("LessonId") - .HasColumnType("integer"); - - b.Property("Meaning") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NormalizedContentKey") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("Reading") - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ReviewNote") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ReviewedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ReviewedByAdminId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.Property("SubmittedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("SubmittedByUserId") - .HasColumnType("integer"); - - b.Property("SynonymsJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UsageNotes") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("VocabularyId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("GrammarPatternId"); - - b.HasIndex("KanjiId"); - - b.HasIndex("LessonId"); - - b.HasIndex("NormalizedContentKey"); - - b.HasIndex("ReviewedByAdminId"); - - b.HasIndex("VocabularyId"); - - b.HasIndex("SubmittedByUserId", "Status"); - - b.HasIndex("Status", "JlptLevel", "CardType"); - - b.ToTable("SrsCardTemplates"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CompletedCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DeadlineAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("FilterCardType") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("FilterJlptLevel") - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("FilterLearningState") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("FilterSourceType") - .HasMaxLength(40) - .HasColumnType("character varying(40)"); - - b.Property("ForgotCount") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastActivityAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ProcessedStepKeysJson") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)") - .HasDefaultValue("[]"); - - b.Property("QueueCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("RememberedCount") - .HasColumnType("integer"); - - b.Property("RequestedCount") - .HasColumnType("integer"); - - b.Property("RetryCardIdsJson") - .IsRequired() - .HasMaxLength(8000) - .HasColumnType("character varying(8000)"); - - b.Property("ReviewedCount") - .HasColumnType("integer"); - - b.Property("SelectionScope") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("SessionKey") - .HasColumnType("uuid"); - - b.Property("SessionKind") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Scheduled"); - - b.Property("ShuffleEnabled") - .HasColumnType("boolean"); - - b.Property("StartedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("StudyMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("TimeLimitMinutes") - .HasColumnType("integer"); - - b.Property("TotalInitialCards") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SessionKey") - .IsUnique(); - - b.HasIndex("UserId", "Status", "LastActivityAtUtc"); - - b.HasIndex("UserId", "SessionKind", "Status", "LastActivityAtUtc"); - - b.ToTable("SrsReviewSessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Capacity") - .HasColumnType("integer"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CourseDurationWeeks") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("EnrollmentClosedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentClosesAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EnrollmentOpensAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("Level") - .IsRequired() - .HasMaxLength(12) - .HasColumnType("character varying(12)"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SourceProposalId") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TotalTuitionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPerSessionSnapshot") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("TuitionPolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("TuitionSnapshotAtUtc") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("SourceProposalId") - .IsUnique() - .HasFilter("\"SourceProposalId\" IS NOT NULL"); - - b.ToTable("StudyCohorts", null, t => - { - t.HasCheckConstraint("CK_StudyCohort_Capacity", "\"Capacity\" > 0"); - - t.HasCheckConstraint("CK_StudyCohort_DurationWeeks", "\"CourseDurationWeeks\" >= 1"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffectedSessionCount") - .HasColumnType("integer"); - - b.Property("AssignedById") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("EffectiveFromSessionNumber") - .HasColumnType("integer"); - - b.Property("EffectiveFromUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("ImpactSnapshot") - .IsRequired() - .HasColumnType("text"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("PolicyId") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("PreviousMentorId") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedById"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId"); - - b.HasIndex("PolicyId"); - - b.HasIndex("PreviousMentorId"); - - b.HasIndex("CohortId", "Id"); - - b.ToTable("StudyCohortMentorAssignments", null, t => - { - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_DifferentMentor", "\"MentorId\" <> \"PreviousMentorId\""); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Reason", "length(btrim(\"Reason\")) > 0"); - - t.HasCheckConstraint("CK_StudyCohortMentorAssignment_Sessions", "\"EffectiveFromSessionNumber\" > 0 AND \"AffectedSessionCount\" > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssignedByAdminId") - .HasColumnType("integer"); - - b.Property("AssignmentReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ChangeReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CohortRevisionAtInvite") - .HasColumnType("integer"); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("DeclineReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("FromSessionNumber") - .HasColumnType("integer"); - - b.Property("IdempotencyKey") - .HasColumnType("uuid"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("RespondedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(24) - .HasColumnType("character varying(24)"); - - b.HasKey("Id"); - - b.HasIndex("AssignedByAdminId"); - - b.HasIndex("CohortId") - .IsUnique() - .HasFilter("\"Status\" = 'Pending'"); - - b.HasIndex("IdempotencyKey") - .IsUnique(); - - b.HasIndex("MentorId", "Status"); - - b.ToTable("StudyCohortMentorInvitations", null, t => - { - t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); - - t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActualEndedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ActualStartedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("Status") - .IsConcurrencyToken() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId") - .IsUnique(); - - b.HasIndex("CohortId", "Number") - .IsUnique(); - - b.ToTable("StudyCohortSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("CancellationReason") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("CancelledAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("CapacitySnapshot") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CheckoutUrl") - .HasColumnType("text"); - - b.Property("CohortId") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Currency") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("GroupPolicyId") - .HasColumnType("integer"); - - b.Property("LearnerId") - .HasColumnType("integer"); - - b.Property("MaximumAbsencePercent") - .HasColumnType("integer"); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MinimumHomeworkPercent") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("OrderSnapshot") - .HasColumnType("text"); - - b.Property("PaymentConfirmedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentReference") - .HasColumnType("text"); - - b.Property("PaymentReviewReason") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PaymentStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("PlanId") - .HasColumnType("integer"); - - b.Property("PlanRevision") - .HasColumnType("integer"); - - b.Property("PolicyVersionSnapshot") - .HasColumnType("integer"); - - b.Property("ProviderPaymentReference") - .HasMaxLength(120) - .HasColumnType("character varying(120)"); - - b.Property("PurchaseKey") - .HasColumnType("uuid"); - - b.Property("RefundedAmount") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RefundedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("RetakeOfId") - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("StartsAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.Property("TransferredAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("TransferredFromCourseId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("CohortId"); - - b.HasIndex("GroupPolicyId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PlanId"); - - b.HasIndex("ProviderPaymentReference") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_ProviderPaymentReference") - .HasFilter("\"ProviderPaymentReference\" IS NOT NULL"); - - b.HasIndex("RetakeOfId") - .IsUnique(); - - b.HasIndex("TransferredFromCourseId") - .IsUnique() - .HasFilter("\"TransferredFromCourseId\" IS NOT NULL"); - - b.HasIndex("CohortId", "LearnerId") - .IsUnique() - .HasDatabaseName("IX_StudyCourses_Cohort_ActiveLearner") - .HasFilter("\"CohortId\" IS NOT NULL AND \"Status\" = 'Active'"); - - b.HasIndex("LearnerId", "PurchaseKey") - .IsUnique(); - - b.ToTable("StudyCourses", null, t => - { - t.HasCheckConstraint("CK_StudyCourses_RefundedAmount", "\"RefundedAmount\" >= 0 AND \"RefundedAmount\" <= \"Amount\""); - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("DueAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Feedback") - .HasColumnType("text"); - - b.Property("Instructions") - .IsRequired() - .HasColumnType("text"); - - b.Property("Passed") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ReviewedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Submission") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("CourseId"); - - b.ToTable("StudyCourseHomework", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Capacity") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("DurationMonths") - .HasColumnType("integer"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasPrecision(18) - .HasColumnType("numeric(18,0)"); - - b.Property("RetakeClaimDays") - .HasColumnType("integer"); - - b.Property("Revision") - .IsConcurrencyToken() - .HasColumnType("integer"); - - b.Property("SessionMinutes") - .HasColumnType("integer"); - - b.Property("SessionType") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("text") - .HasDefaultValue("Individual"); - - b.Property("SessionsPerWeek") - .HasColumnType("integer"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TotalSessions") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("StudyCoursePlans", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Attempt") - .HasColumnType("integer"); - - b.Property("AvailabilityId") - .HasColumnType("integer"); - - b.Property("ConfirmedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ConfirmedById") - .HasColumnType("integer"); - - b.Property("CourseId") - .HasColumnType("integer"); - - b.Property("MeetingUrl") - .HasColumnType("text"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("ScheduledAt") - .HasColumnType("timestamp without time zone"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.HasKey("Id"); - - b.HasIndex("AvailabilityId"); - - b.HasIndex("CourseId", "Number", "Attempt") - .IsUnique(); - - b.ToTable("StudyCourseSessions", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DurationDays") - .HasColumnType("integer"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsPopular") - .HasColumnType("boolean"); - - b.Property("IsTrial") - .HasColumnType("boolean"); - - b.Property("MeetingSessionCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanCategory") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasDefaultValue("self_study"); - - b.Property("Price") - .HasColumnType("decimal(18,0)"); - - b.Property("Revision") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.ToTable("SubscriptionPlans", t => - { - t.HasCheckConstraint("CK_SubscriptionPlans_AiGradingQuota", "\"AiGradingQuota\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_DurationDays", "\"DurationDays\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_Price", "\"Price\" >= 0"); - - t.HasCheckConstraint("CK_SubscriptionPlans_SortOrder", "\"SortOrder\" >= 0"); - }); - - b.HasData( - new - { - Id = 1, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tuần.", - DurationDays = 7, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 6 - }, - new - { - Id = 2, - AiGradingQuota = 2, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tuần.", - DurationDays = 14, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tuần", - PlanCategory = "self_study", - Price = 1000m, - Revision = 1, - SortOrder = 5 - }, - new - { - Id = 3, - AiGradingQuota = 3, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tuần.", - DurationDays = 21, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tuần", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 4 - }, - new - { - Id = 4, - AiGradingQuota = 5, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 1 tháng.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = true, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 1 tháng", - PlanCategory = "self_study", - Price = 2000m, - Revision = 1, - SortOrder = 3 - }, - new - { - Id = 5, - AiGradingQuota = 10, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 2 tháng.", - DurationDays = 60, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 2 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 2 - }, - new - { - Id = 6, - AiGradingQuota = 15, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Truy cập nội dung ôn luyện các chứng chỉ tiếng Nhật trong 3 tháng.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Tự học tiếng Nhật - 3 tháng", - PlanCategory = "self_study", - Price = 3000m, - Revision = 1, - SortOrder = 1 - }, - new - { - Id = 7, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Gói demo gồm 12 buổi ôn luyện 1-1 với Mentor, thời hạn 90 ngày. Dữ liệu thanh toán demo được seed để kiểm thử đặt lịch trên frontend.", - DurationDays = 90, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 12, - Name = "Meeting 1-1 với Mentor - 12 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 7 - }, - new - { - Id = 8101, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt luyện nói và chấm phát âm tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện nói AI - 1 lượt", - PlanCategory = "speaking", - Price = 1000m, - Revision = 1, - SortOrder = 10 - }, - new - { - Id = 8102, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt chấm bài viết tiếng Nhật bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Luyện viết AI - 1 lượt", - PlanCategory = "writing", - Price = 1000m, - Revision = 1, - SortOrder = 11 - }, - new - { - Id = 8103, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt giải thích chi tiết đáp án đề thi thử bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Giải thích đáp án AI - 1 lượt", - PlanCategory = "ai_grading", - Price = 1000m, - Revision = 1, - SortOrder = 12 - }, - new - { - Id = 8104, - AiGradingQuota = 1, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một lượt tạo lộ trình học cá nhân hóa bằng AI.", - DurationDays = 0, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 0, - Name = "Lộ trình học AI - 1 lượt", - PlanCategory = "learning_path", - Price = 1000m, - Revision = 1, - SortOrder = 13 - }, - new - { - Id = 8105, - AiGradingQuota = 0, - CreatedDate = new DateTime(2026, 11, 23, 0, 0, 0, 0, DateTimeKind.Utc), - Description = "Một buổi ôn luyện với mentor.", - DurationDays = 30, - IsActive = true, - IsDeleted = false, - IsPopular = false, - IsTrial = false, - MeetingSessionCount = 1, - Name = "Mentor - 1 buổi", - PlanCategory = "mentor_legacy", - Price = 1000m, - Revision = 1, - SortOrder = 14 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SortOrder") - .HasColumnType("integer"); - - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId", "SortOrder"); - - b.ToTable("Topics"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AssessedCertificateLevelId") - .HasColumnType("integer"); - - b.Property("AvatarUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("CurrentStreak") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutes") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMax") - .HasColumnType("integer"); - - b.Property("DailyStudyMinutesMin") - .HasColumnType("integer"); - - b.Property("DeclaredJlptCertificateCode") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("FirebaseUid") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("GoogleSubject") - .IsConcurrencyToken() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsEmailVerified") - .HasColumnType("boolean"); - - b.Property("IsPhoneVerified") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("LastStudyDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LearningGoalVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("LearningMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("LongestStreak") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("NotificationPreferencesJson") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("PendingEmail") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("PendingEmailRequestedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PlacementDecision") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("SelfDeclaredCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StartingCertificateLevelId") - .HasColumnType("integer"); - - b.Property("StudyTimePreference") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SystemNotificationsEnabled") - .HasColumnType("boolean"); - - b.Property("TargetCertificateLevelId") - .HasColumnType("integer") - .HasColumnName("TargetCertificationLevelId"); - - b.Property("TargetExamDate") - .HasColumnType("timestamp without time zone"); - - b.Property("TokenVersion") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.HasKey("Id"); - - b.HasIndex("AssessedCertificateLevelId"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("GoogleSubject") - .IsUnique(); - - b.HasIndex("SelfDeclaredCertificateLevelId"); - - b.HasIndex("StartingCertificateLevelId"); - - b.HasIndex("TargetCertificateLevelId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 900001, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "admin@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Admin", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "System", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 91, 215, 217, 54, 239, 206, 181, 216, 143, 33, 82, 211, 9, 70, 197, 173, 197, 0, 72, 71, 59, 150, 46, 114, 96, 137, 52, 174, 137, 29, 196, 61, 50, 254, 249, 101, 114, 92, 149, 32, 55, 127, 205, 126, 216, 147, 197, 192, 248, 173, 158, 92, 104, 42, 195, 107, 150, 15, 3, 74, 103, 104, 3, 229 }, - PasswordSalt = new byte[] { 61, 240, 150, 172, 239, 48, 224, 17, 192, 54, 50, 58, 91, 100, 55, 168, 18, 69, 137, 112, 110, 59, 180, 37, 201, 241, 143, 238, 139, 33, 128, 70, 87, 158, 235, 219, 229, 184, 94, 72, 41, 160, 160, 197, 158, 217, 128, 188, 156, 255, 147, 13, 151, 37, 133, 164, 9, 252, 175, 124, 21, 15, 152, 196 }, - PlacementDecision = "NotTaken", - Role = "Admin", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900002, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 17, 253, 106, 25, 89, 176, 204, 31, 142, 252, 245, 31, 64, 101, 213, 135, 164, 116, 40, 46, 173, 175, 8, 0, 69, 101, 65, 4, 90, 25, 176, 223, 153, 237, 220, 94, 55, 133, 227, 181, 70, 97, 155, 122, 50, 139, 216, 136, 88, 52, 76, 98, 250, 64, 52, 71, 146, 221, 225, 137, 106, 6, 178, 239 }, - PasswordSalt = new byte[] { 233, 77, 244, 252, 171, 97, 38, 140, 50, 138, 10, 54, 122, 165, 186, 85, 129, 82, 49, 10, 98, 44, 165, 57, 50, 7, 238, 166, 142, 224, 94, 49, 134, 226, 247, 110, 154, 139, 99, 204, 95, 39, 171, 235, 212, 26, 217, 87, 139, 118, 253, 125, 241, 255, 57, 22, 140, 171, 11, 168, 174, 202, 32, 17 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900003, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "mentor2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Mentor", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 93, 130, 109, 171, 238, 187, 245, 15, 202, 89, 247, 220, 95, 192, 246, 138, 5, 75, 250, 28, 208, 28, 51, 79, 127, 28, 214, 237, 93, 221, 108, 26, 152, 66, 73, 65, 11, 147, 154, 102, 113, 49, 51, 24, 51, 197, 248, 254, 22, 98, 87, 249, 250, 104, 131, 74, 16, 18, 179, 200, 3, 3, 79, 47 }, - PasswordSalt = new byte[] { 240, 155, 254, 183, 129, 162, 74, 247, 41, 9, 67, 242, 128, 8, 226, 85, 5, 104, 104, 72, 101, 75, 130, 95, 47, 101, 116, 89, 207, 23, 119, 178, 38, 180, 185, 145, 58, 115, 14, 30, 85, 216, 169, 133, 94, 115, 11, 117, 96, 87, 227, 240, 204, 48, 51, 144, 170, 248, 167, 56, 175, 194, 253, 135 }, - PlacementDecision = "NotTaken", - Role = "Mentor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900004, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author1@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author One", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 168, 249, 82, 144, 178, 145, 94, 164, 34, 152, 2, 74, 204, 105, 84, 145, 96, 199, 153, 136, 110, 82, 114, 113, 22, 139, 117, 143, 50, 239, 197, 4, 51, 189, 137, 48, 175, 14, 104, 164, 218, 249, 148, 217, 33, 44, 202, 128, 237, 183, 110, 228, 185, 36, 209, 254, 183, 182, 55, 1, 78, 16, 234, 50 }, - PasswordSalt = new byte[] { 19, 216, 84, 143, 3, 184, 50, 39, 209, 137, 149, 82, 224, 206, 6, 240, 237, 242, 172, 27, 55, 92, 242, 101, 149, 76, 104, 38, 176, 43, 40, 8, 102, 202, 146, 224, 62, 43, 147, 132, 2, 158, 81, 170, 29, 103, 76, 248, 101, 105, 213, 205, 32, 51, 59, 39, 221, 11, 135, 250, 193, 8, 78, 219 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900005, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "author2@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Content", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Author Two", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 189, 121, 9, 1, 230, 137, 43, 239, 79, 56, 195, 196, 66, 116, 42, 1, 137, 55, 54, 249, 55, 231, 79, 224, 182, 182, 199, 133, 100, 39, 138, 5, 223, 215, 48, 46, 60, 214, 49, 88, 42, 186, 232, 116, 237, 89, 55, 144, 4, 78, 215, 231, 237, 220, 96, 225, 202, 97, 61, 165, 246, 28, 126, 198 }, - PasswordSalt = new byte[] { 66, 178, 77, 56, 234, 206, 29, 78, 136, 190, 160, 142, 226, 249, 14, 17, 26, 101, 167, 36, 193, 55, 150, 94, 239, 81, 69, 54, 81, 171, 80, 22, 208, 38, 242, 2, 55, 171, 64, 38, 48, 224, 36, 216, 133, 132, 147, 100, 174, 32, 65, 134, 128, 35, 50, 138, 204, 59, 167, 96, 11, 128, 101, 102 }, - PlacementDecision = "NotTaken", - Role = "ContentAuthor", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900006, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Meeting", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Test Learner", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 9, 206, 219, 58, 155, 234, 107, 145, 121, 174, 134, 51, 96, 253, 64, 216, 157, 114, 92, 36, 123, 206, 67, 217, 207, 166, 54, 71, 254, 251, 156, 200, 185, 110, 198, 135, 221, 146, 243, 40, 237, 229, 16, 133, 163, 161, 156, 79, 138, 103, 85, 25, 114, 81, 99, 182, 25, 73, 212, 198, 212, 192, 54, 129 }, - PasswordSalt = new byte[] { 231, 202, 97, 95, 11, 9, 242, 47, 62, 77, 67, 36, 170, 78, 120, 81, 56, 69, 47, 36, 209, 212, 107, 244, 15, 34, 189, 110, 57, 66, 205, 213, 224, 19, 245, 192, 104, 146, 130, 44, 54, 107, 2, 15, 109, 136, 118, 220, 228, 44, 110, 219, 31, 100, 161, 164, 63, 231, 196, 79, 120, 106, 181, 71 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900007, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner2.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Linh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Nguyen", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 217, 79, 50, 159, 85, 88, 67, 15, 23, 182, 103, 80, 220, 85, 86, 173, 204, 186, 57, 67, 183, 165, 253, 243, 150, 250, 150, 190, 122, 252, 55, 169, 85, 236, 69, 106, 19, 219, 244, 42, 239, 30, 189, 176, 52, 47, 30, 28, 125, 31, 162, 255, 61, 3, 238, 201, 168, 88, 161, 42, 216, 86, 172, 219 }, - PasswordSalt = new byte[] { 85, 97, 108, 158, 219, 70, 81, 106, 73, 23, 205, 163, 105, 159, 117, 19, 175, 147, 178, 99, 112, 116, 163, 243, 109, 178, 129, 229, 245, 175, 91, 174, 66, 198, 122, 88, 80, 68, 160, 64, 85, 118, 105, 41, 135, 89, 49, 160, 120, 13, 116, 148, 255, 27, 157, 207, 106, 203, 127, 74, 19, 61, 148, 120 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900008, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner3.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Minh", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Tran", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 84, 97, 164, 196, 63, 151, 182, 39, 139, 242, 152, 22, 179, 33, 174, 113, 0, 236, 253, 114, 234, 242, 209, 76, 196, 162, 143, 195, 180, 3, 178, 193, 205, 230, 18, 114, 49, 151, 198, 217, 254, 21, 94, 176, 146, 214, 235, 122, 28, 241, 164, 161, 4, 161, 209, 38, 102, 179, 31, 107, 157, 25, 35, 63 }, - PasswordSalt = new byte[] { 26, 188, 78, 205, 57, 115, 100, 129, 148, 135, 165, 205, 148, 203, 245, 36, 244, 177, 9, 104, 120, 140, 21, 164, 36, 75, 122, 51, 115, 69, 174, 180, 120, 155, 62, 37, 97, 227, 212, 134, 200, 7, 66, 255, 219, 10, 140, 149, 67, 86, 164, 170, 142, 165, 181, 103, 47, 100, 238, 24, 178, 29, 171, 226 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }, - new - { - Id = 900009, - CreatedDate = new DateTime(2026, 9, 28, 0, 0, 0, 0, DateTimeKind.Utc), - CurrentStreak = 0, - DailyStudyMinutes = 30, - Email = "learner4.meeting@rikipath.local", - EmailNotificationsEnabled = true, - FirstName = "Hoang", - IsDeleted = false, - IsEmailVerified = true, - IsPhoneVerified = false, - LastName = "Pham", - LearningGoalVersion = 0, - LearningMode = "Standard", - LongestStreak = 0, - PasswordHash = new byte[] { 42, 30, 236, 129, 234, 192, 63, 84, 148, 163, 154, 246, 107, 147, 189, 95, 33, 141, 196, 67, 181, 51, 157, 136, 93, 228, 237, 165, 164, 49, 4, 146, 87, 84, 9, 47, 28, 59, 33, 130, 37, 63, 43, 229, 8, 178, 123, 74, 61, 159, 235, 68, 217, 51, 225, 29, 201, 104, 44, 152, 53, 255, 199, 28 }, - PasswordSalt = new byte[] { 83, 214, 138, 3, 142, 91, 229, 97, 238, 61, 48, 237, 80, 82, 112, 249, 166, 81, 53, 95, 170, 120, 13, 87, 113, 159, 60, 37, 75, 229, 226, 107, 229, 89, 60, 57, 109, 196, 235, 81, 145, 154, 110, 120, 141, 13, 142, 77, 41, 132, 58, 80, 154, 57, 226, 168, 176, 251, 113, 167, 242, 139, 7, 177 }, - PlacementDecision = "NotTaken", - Role = "Learner", - SystemNotificationsEnabled = true, - TokenVersion = 1 - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("FcmToken") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastSeenAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Platform") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("UpdatedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("FcmToken") - .HasDatabaseName("IX_UserDeviceTokens_FcmToken"); - - b.HasIndex("UserId", "DeviceIdentifier") - .HasDatabaseName("IX_UserDeviceTokens_UserId_DeviceIdentifier"); - - b.HasIndex("UserId", "IsActive") - .HasDatabaseName("IX_UserDeviceTokens_UserId_IsActive"); - - b.ToTable("UserDeviceTokens", (string)null); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoEnrollAfterLesson") - .HasColumnType("boolean"); - - b.Property("AutoPlayAudio") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DailyNewLimit") - .HasColumnType("integer"); - - b.Property("DailyReminderEnabled") - .HasColumnType("boolean"); - - b.Property("DailyReviewLimit") - .HasColumnType("integer"); - - b.Property("EmailReminderEnabled") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastReminderSentAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("LastReminderSentLocalDate") - .HasColumnType("date"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PreferredLocale") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("PreferredReviewMode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("ReminderDaysJson") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ReminderFrequency") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("ReminderHour") - .HasColumnType("integer"); - - b.Property("ReminderMinute") - .HasColumnType("integer"); - - b.Property("ShowFuriganaHint") - .HasColumnType("boolean"); - - b.Property("TimezoneId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("DailyReminderEnabled", "LastReminderSentLocalDate"); - - b.ToTable("UserSrsPreferences"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AiGradingQuota") - .HasColumnType("integer"); - - b.Property("AiGradingUsedCount") - .HasColumnType("integer"); - - b.Property("AmountPaid") - .HasColumnType("decimal(18,2)"); - - b.Property("CertificateLevelId") - .HasColumnType("integer"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("DurationDaysSnapshot") - .HasColumnType("integer"); - - b.Property("EndDate") - .HasColumnType("timestamp without time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MeetingSessionsIncluded") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MeetingSessionsUsed") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0); - - b.Property("MentorId") - .HasColumnType("integer"); - - b.Property("MentorPracticeOutcomeJson") - .HasColumnType("text"); - - b.Property("MentorReviewCompletedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("MentorReviewPlan") - .HasMaxLength(6000) - .HasColumnType("character varying(6000)"); - - b.Property("MentorReviewSessionAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentExpiresAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentStatus") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("PaymentTransactionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PendingMentorAvailabilityId") - .HasColumnType("integer"); - - b.Property("PendingMentorQuestion") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("PlanCategorySnapshot") - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("PlanNameSnapshot") - .HasMaxLength(150) - .HasColumnType("character varying(150)"); - - b.Property("PlanRevisionSnapshot") - .HasColumnType("integer"); - - b.Property("PurchasedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("SubscriptionPlanId") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("CertificateLevelId"); - - b.HasIndex("MentorId"); - - b.HasIndex("PendingMentorAvailabilityId"); - - b.HasIndex("SubscriptionPlanId"); - - b.HasIndex("UserId", "PaymentStatus", "EndDate"); - - b.ToTable("UserSubscriptions"); - - b.HasData( - new - { - Id = 990001, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS", - PlanCategorySnapshot = "mentor_legacy", - PlanNameSnapshot = "Meeting 1-1 với Mentor - 12 buổi", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990002, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-2", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900007, - Version = 0u - }, - new - { - Id = 990003, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-3", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900008, - Version = 0u - }, - new - { - Id = 990004, - AiGradingQuota = 0, - AiGradingUsedCount = 0, - AmountPaid = 459000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - EndDate = new DateTime(2026, 12, 30, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 12, - MeetingSessionsUsed = 1, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-MENTOR-12-SESSIONS-4", - PurchasedAt = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 7, - UserId = 900009, - Version = 0u - }, - new - { - Id = 990005, - AiGradingQuota = 15, - AiGradingUsedCount = 0, - AmountPaid = 3000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 90, - EndDate = new DateTime(2099, 12, 31, 23, 59, 59, 0, DateTimeKind.Unspecified), - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-SELF-STUDY", - PlanCategorySnapshot = "self_study", - PlanNameSnapshot = "Tự học tiếng Nhật - 3 tháng", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - StartDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 6, - UserId = 900006, - Version = 0u - }, - new - { - Id = 990006, - AiGradingQuota = 1, - AiGradingUsedCount = 0, - AmountPaid = 1000m, - CreatedDate = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - DurationDaysSnapshot = 0, - IsDeleted = false, - MeetingSessionsIncluded = 0, - MeetingSessionsUsed = 0, - PaymentStatus = "Paid", - PaymentTransactionId = "DEMO-FULL-ACCESS-LEARNING-PATH", - PlanCategorySnapshot = "learning_path", - PlanNameSnapshot = "Mua 1 lượt AI đề xuất lộ trình", - PlanRevisionSnapshot = 1, - PurchasedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - SubscriptionPlanId = 8104, - UserId = 900006, - Version = 0u - }); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ExampleSentence") - .HasColumnType("text"); - - b.Property("ExampleSentenceMeaning") - .HasColumnType("text"); - - b.Property("ImageUrl") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Meaning") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)"); - - b.Property("ModifiedBy") - .HasColumnType("uuid"); - - b.Property("ModifiedDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Reading") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .ValueGeneratedOnAdd() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasDefaultValue("Published"); - - b.Property("UnpublishedAtUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("UnpublishedReason") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("UserAccountId") - .HasColumnType("integer"); - - b.Property("Version") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1); - - b.Property("Word") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("UserAccountId"); - - b.HasIndex("Word", "Reading"); - - b.ToTable("Vocabularies"); - }); - - modelBuilder.Entity("FeatureSubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.Feature", null) - .WithMany() - .HasForeignKey("FeaturesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", null) - .WithMany() - .HasForeignKey("SubscriptionPlansId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.AiCreditTopUp", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("AiCreditTopUps") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateType", "CertificateType") - .WithMany("Levels") - .HasForeignKey("CertificateTypeId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateType"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("DecidedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaintEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortComplaint", "Complaint") - .WithMany("History") - .HasForeignKey("ComplaintId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Complaint"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortEnrollmentEntitlement", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "StudyCohort") - .WithMany() - .HasForeignKey("StudyCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Plan"); - - b.Navigation("StudyCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortLearningFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("RespondedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Course"); - - b.Navigation("CourseSession"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortMentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - - b.Navigation("Course"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "RequestedBy") - .WithMany() - .HasForeignKey("RequestedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("RequestedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortScheduleRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "DestinationCourse") - .WithMany() - .HasForeignKey("DestinationCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "RequestedTargetCohort") - .WithMany() - .HasForeignKey("RequestedTargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("ReviewedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "SourceCohort") - .WithMany() - .HasForeignKey("SourceCohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "SourceCourse") - .WithMany() - .HasForeignKey("SourceCourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "TargetCohort") - .WithMany() - .HasForeignKey("TargetCohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationCourse"); - - b.Navigation("Learner"); - - b.Navigation("RequestedTargetCohort"); - - b.Navigation("SourceCohort"); - - b.Navigation("SourceCourse"); - - b.Navigation("TargetCohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequestEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.CohortTransferRequest", "Request") - .WithMany("History") - .HasForeignKey("RequestId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Request"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentApprovalRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedBy") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("SubmittedBy"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentAudioTranscription", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentBankItem", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Owner") - .WithMany() - .HasForeignKey("OwnerUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentLevelMapping", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("ContentLevelMappings") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ContentLevelMappings") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ContentLevelMappings") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("ContentLevelMappings") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Passages") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Audit") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseRetakeRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("RetakeRequests") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CourseScheduleRequest", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany() - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.EmailVerification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "User") - .WithMany("EmailVerifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GradingResult", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeSubmission", "PracticeSubmission") - .WithOne("GradingResult") - .HasForeignKey("RikiPath.Domain.Entities.GradingResult", "PracticeSubmissionId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("HomeworkSubmission"); - - b.Navigation("PracticeSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredGrammarPatterns") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "StudyCourse") - .WithMany() - .HasForeignKey("StudyCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Cohort"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("StudyCourse"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentAttachment", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Attachments") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("Exercises") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany() - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignmentLesson", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("HomeworkAssignmentLessons") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithOne("Submission") - .HasForeignKey("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("Learner"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmissionFile", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkSubmission", "HomeworkSubmission") - .WithMany("Files") - .HasForeignKey("HomeworkSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkSubmission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.JlptLevelPayCoefficient", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaCharacter", "KanaCharacter") - .WithMany("PracticeCards") - .HasForeignKey("KanaCharacterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("KanaCharacter"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.KanaWritingPracticeCard", "Card") - .WithMany("Histories") - .HasForeignKey("KanaWritingPracticeCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Card"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredKanjis") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerEssay", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerEssays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerFeedback", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Learner"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerHighlight", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LinkedNoteEntry") - .WithMany() - .HasForeignKey("LinkedNoteEntryId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "LinkedReviewCard") - .WithMany() - .HasForeignKey("LinkedReviewCardId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LinkedNoteEntry"); - - b.Navigation("LinkedReviewCard"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.HasOne("RikiPath.Domain.Entities.NotebookFolder", "Folder") - .WithMany("Files") - .HasForeignKey("FolderId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LearnerNotes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Folder"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LearnerNoteEntries") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("LearnerNoteEntries") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.NotebookPage", "NotebookPage") - .WithMany("SavedItems") - .HasForeignKey("NotebookPageId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LearnerNoteEntries") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNote"); - - b.Navigation("NotebookPage"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerPracticeAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExerciseAttempt", "PracticeExerciseAttempt") - .WithMany("Answers") - .HasForeignKey("PracticeExerciseAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Answers") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.PracticeQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("PracticeExerciseAttempt"); - - b.Navigation("PracticeQuestion"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("Lessons") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("Lessons") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") - .WithMany() - .HasForeignKey("PrerequisiteLessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany("Lessons") - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredLessons") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("PrerequisiteLesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonGrammar", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("LessonGrammars") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonGrammars") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GrammarPattern"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonKanji", b => - { - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("LessonKanjis") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonKanjis") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonProgress", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonProgresses") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("LessonProgresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LessonVocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany("LessonVocabularies") - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany("LessonVocabularies") - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Lesson"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAbuseReport", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Reporter") - .WithMany() - .HasForeignKey("ReporterId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "TargetUser") - .WithMany() - .HasForeignKey("TargetUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Reporter"); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceApproval", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorBooking"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAttendanceRecord", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourseSession", "CourseSession") - .WithMany() - .HasForeignKey("CourseSessionId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CourseSession"); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany("MentorAvailabilities") - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorScheduleRule", "ScheduleRule") - .WithMany() - .HasForeignKey("MentorScheduleRuleId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorWeeklyAvailability", "WeeklyAvailability") - .WithMany("Slots") - .HasForeignKey("MentorWeeklyAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "TeachingProposal") - .WithMany("GeneratedAvailabilities") - .HasForeignKey("TeachingProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ScheduleRule"); - - b.Navigation("TeachingProposal"); - - b.Navigation("WeeklyAvailability"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBankAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CompensationLevel") - .WithMany() - .HasForeignKey("CompensationLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany() - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany("MentorBookings") - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany("MentorBookings") - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CompensationLevel"); - - b.Navigation("CreditGrant"); - - b.Navigation("MentorAvailability"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingDayGuard", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingIntent", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingReservation", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId", "MentorId") - .HasPrincipalKey("Id", "MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBookingTerms", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "MentorAvailability") - .WithMany() - .HasForeignKey("MentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne() - .HasForeignKey("RikiPath.Domain.Entities.MentorBookingTerms", "MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorAvailability"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCalendarConnection", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorChatMessage", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Sender") - .WithMany() - .HasForeignKey("SenderUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorCreditGrant", "CreditGrant") - .WithMany("Entries") - .HasForeignKey("CreditGrantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreditGrant"); - - b.Navigation("Learner"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserSubscription", "UserSubscription") - .WithMany() - .HasForeignKey("UserSubscriptionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Learner"); - - b.Navigation("UserSubscription"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ResolvedByAdmin") - .WithMany() - .HasForeignKey("ResolvedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - - b.Navigation("ResolvedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDisputeHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorDispute", "Dispute") - .WithMany("Histories") - .HasForeignKey("DisputeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Dispute"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorEarningEntry", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAttendanceApproval", "AttendanceApproval") - .WithMany() - .HasForeignKey("AttendanceApprovalId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("AttendanceApproval"); - - b.Navigation("CertificateLevel"); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("MentorBooking"); - - b.Navigation("MentorUser"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorGroupPolicy", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") - .WithMany() - .HasForeignKey("CreatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "DeletedByAdmin") - .WithMany() - .HasForeignKey("DeletedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "LastAppliedByAdmin") - .WithMany() - .HasForeignKey("LastAppliedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UpdatedByAdmin") - .WithMany() - .HasForeignKey("UpdatedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CreatedByAdmin"); - - b.Navigation("DeletedByAdmin"); - - b.Navigation("LastAppliedByAdmin"); - - b.Navigation("UpdatedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorHourlyRate", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - - b.Navigation("MentorUser"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") - .WithMany() - .HasForeignKey("ConfirmedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "InitiatedByAdmin") - .WithMany() - .HasForeignKey("InitiatedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayoutObligation", "PayoutObligation") - .WithMany("Attempts") - .HasForeignKey("PayoutObligationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfirmedByAdmin"); - - b.Navigation("InitiatedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("PayoutObligation"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBankAccount", "LockedBankAccount") - .WithMany() - .HasForeignKey("LockedBankAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.OrganizationPayoutAccount", "OrganizationPayoutAccount") - .WithMany() - .HasForeignKey("OrganizationPayoutAccountId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany() - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("LockedBankAccount"); - - b.Navigation("MentorUser"); - - b.Navigation("OrganizationPayoutAccount"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollAdjustment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Adjustments") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollLine", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorEarningEntry", "EarningEntry") - .WithMany() - .HasForeignKey("EarningEntryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorPayrollPeriod", "PayrollPeriod") - .WithMany("Lines") - .HasForeignKey("PayrollPeriodId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("EarningEntry"); - - b.Navigation("MentorBooking"); - - b.Navigation("PayrollPeriod"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ApprovedByAdmin") - .WithMany() - .HasForeignKey("ApprovedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "PreparedByAdmin") - .WithMany() - .HasForeignKey("PreparedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ApprovedByAdmin"); - - b.Navigation("MentorUser"); - - b.Navigation("PreparedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorProfile", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithOne("MentorProfile") - .HasForeignKey("RikiPath.Domain.Entities.MentorProfile", "MentorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorReview", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithMany() - .HasForeignKey("MentorBookingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("MentorBooking"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorScheduleRule", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorSchedule", "Schedule") - .WithMany("Rules") - .HasForeignKey("ScheduleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "CoursePlan") - .WithMany() - .HasForeignKey("CoursePlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("CoursePlan"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("ReviewedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposalEvent", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "Proposal") - .WithMany("Events") - .HasForeignKey("ProposalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Proposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingQualification", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "MentorUser") - .WithMany() - .HasForeignKey("MentorUserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "VerifiedByAdmin") - .WithMany() - .HasForeignKey("VerifiedByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("MentorUser"); - - b.Navigation("VerifiedByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("Questions") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.ContentPassage", "Passage") - .WithMany("Questions") - .HasForeignKey("PassageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockTestSection"); - - b.Navigation("Passage"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Options") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MockQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("MockTests") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredMockTests") - .HasForeignKey("UserAccountId"); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAnswer", b => - { - b.HasOne("RikiPath.Domain.Entities.MockQuestion", "MockQuestion") - .WithMany("Answers") - .HasForeignKey("MockQuestionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("Answers") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockQuestionOption", "SelectedOption") - .WithMany() - .HasForeignKey("SelectedOptionId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("MockQuestion"); - - b.Navigation("MockTestAttempt"); - - b.Navigation("SelectedOption"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("MockTestAttempts") - .HasForeignKey("UserAccountId"); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateSection", "CertificateSection") - .WithMany("MockTestSections") - .HasForeignKey("CertificateSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany("MockTestSections") - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTest", "MockTest") - .WithMany("Sections") - .HasForeignKey("MockTestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateSection"); - - b.Navigation("LanguageSkill"); - - b.Navigation("MockTest"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSectionResult", b => - { - b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "MockTestAttempt") - .WithMany("SectionResults") - .HasForeignKey("MockTestAttemptId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") - .WithMany("SectionResults") - .HasForeignKey("MockTestSectionId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MockTestAttempt"); - - b.Navigation("MockTestSection"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Note", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorBooking", "MentorBooking") - .WithOne("Note") - .HasForeignKey("RikiPath.Domain.Entities.Note", "MentorBookingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("MentorBooking"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.HasOne("RikiPath.Domain.Entities.LearnerNote", "LearnerNote") - .WithMany("Pages") - .HasForeignKey("LearnerNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("LearnerNote"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Notification", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("Notifications") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.OrganizationPayoutAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfiguredByAdmin") - .WithMany() - .HasForeignKey("ConfiguredByAdminId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ConfiguredByAdmin"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Topic", "Topic") - .WithMany() - .HasForeignKey("TopicId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("LanguageSkill"); - - b.Navigation("Lesson"); - - b.Navigation("Topic"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.HasOne("RikiPath.Domain.Entities.HomeworkAssignment", "HomeworkAssignment") - .WithMany() - .HasForeignKey("HomeworkAssignmentId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Attempts") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HomeworkAssignment"); - - b.Navigation("PracticeExercise"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") - .WithMany("Questions") - .HasForeignKey("PracticeExerciseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeExercise"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestionOption", b => - { - b.HasOne("RikiPath.Domain.Entities.PracticeQuestion", "PracticeQuestion") - .WithMany("Options") - .HasForeignKey("PracticeQuestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PracticeQuestion"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany("PracticeSubmissions") - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("PracticeSubmissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.RecommendedLearningPath", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("RecommendedLearningPaths") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany("ReviewCards") - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany("ReviewCards") - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.LearnerNoteEntry", "LearnerNoteEntry") - .WithMany("ReviewCards") - .HasForeignKey("LearnerNoteEntryId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.SrsCardTemplate", "SrsCardTemplate") - .WithMany() - .HasForeignKey("SrsCardTemplateId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("ReviewCards") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("LearnerNoteEntry"); - - b.Navigation("Lesson"); - - b.Navigation("SrsCardTemplate"); - - b.Navigation("UserAccount"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewHistory", b => - { - b.HasOne("RikiPath.Domain.Entities.ReviewCard", "ReviewCard") - .WithMany("ReviewHistories") - .HasForeignKey("ReviewCardId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ReviewCard"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsCardTemplate", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.GrammarPattern", "GrammarPattern") - .WithMany() - .HasForeignKey("GrammarPatternId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Kanji", "Kanji") - .WithMany() - .HasForeignKey("KanjiId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Lesson", "Lesson") - .WithMany() - .HasForeignKey("LessonId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "ReviewedByAdmin") - .WithMany() - .HasForeignKey("ReviewedByAdminId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "SubmittedByUser") - .WithMany() - .HasForeignKey("SubmittedByUserId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.Vocabulary", "Vocabulary") - .WithMany() - .HasForeignKey("VocabularyId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("CertificateLevel"); - - b.Navigation("GrammarPattern"); - - b.Navigation("Kanji"); - - b.Navigation("Lesson"); - - b.Navigation("ReviewedByAdmin"); - - b.Navigation("SubmittedByUser"); - - b.Navigation("Vocabulary"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SrsReviewSession", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") - .WithMany() - .HasForeignKey("SourceProposalId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("GroupPolicy"); - - b.Navigation("Mentor"); - - b.Navigation("SourceProposal"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorAssignment", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("AssignedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", null) - .WithMany() - .HasForeignKey("PolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany() - .HasForeignKey("PreviousMentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") - .WithMany() - .HasForeignKey("AssignedByAdminId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany() - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("AssignedByAdmin"); - - b.Navigation("Cohort"); - - b.Navigation("Mentor"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Sessions") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Cohort"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") - .WithMany("Enrollments") - .HasForeignKey("CohortId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorGroupPolicy", "GroupPolicy") - .WithMany() - .HasForeignKey("GroupPolicyId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") - .WithMany() - .HasForeignKey("LearnerId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") - .WithMany() - .HasForeignKey("RetakeOfId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", null) - .WithMany() - .HasForeignKey("TransferredFromCourseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - - b.Navigation("Cohort"); - - b.Navigation("GroupPolicy"); - - b.Navigation("Learner"); - - b.Navigation("Mentor"); - - b.Navigation("Plan"); - - b.Navigation("RetakeOf"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseHomework", b => - { - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Homework") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCoursePlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourseSession", b => - { - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") - .WithMany() - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Course") - .WithMany("Sessions") - .HasForeignKey("CourseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Course"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") - .WithMany() - .HasForeignKey("AssessedCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "SelfDeclaredCertificateLevel") - .WithMany() - .HasForeignKey("SelfDeclaredCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "StartingCertificateLevel") - .WithMany() - .HasForeignKey("StartingCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "TargetCertificateLevel") - .WithMany("LearnersTargeting") - .HasForeignKey("TargetCertificateLevelId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("AssessedCertificateLevel"); - - b.Navigation("SelfDeclaredCertificateLevel"); - - b.Navigation("StartingCertificateLevel"); - - b.Navigation("TargetCertificateLevel"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserDeviceToken", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSrsPreference", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") - .WithMany() - .HasForeignKey("MentorId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "PendingMentorAvailability") - .WithMany() - .HasForeignKey("PendingMentorAvailabilityId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("RikiPath.Domain.Entities.SubscriptionPlan", "SubscriptionPlan") - .WithMany("UserSubscriptions") - .HasForeignKey("SubscriptionPlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.UserAccount", "UserAccount") - .WithMany("UserSubscriptions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CertificateLevel"); - - b.Navigation("Mentor"); - - b.Navigation("PendingMentorAvailability"); - - b.Navigation("SubscriptionPlan"); - - b.Navigation("UserAccount"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.HasOne("RikiPath.Domain.Entities.UserAccount", null) - .WithMany("AuthoredVocabularies") - .HasForeignKey("UserAccountId"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnersTargeting"); - - b.Navigation("Lessons"); - - b.Navigation("MockTests"); - - b.Navigation("PracticeSubmissions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateSection", b => - { - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CertificateType", b => - { - b.Navigation("Levels"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortScheduleRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.CohortTransferRequest", b => - { - b.Navigation("History"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => - { - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.GrammarPattern", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LessonGrammars"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkAssignment", b => - { - b.Navigation("Attachments"); - - b.Navigation("Exercises"); - - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("Submission"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.HomeworkSubmission", b => - { - b.Navigation("Files"); - - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaCharacter", b => - { - b.Navigation("PracticeCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.KanaWritingPracticeCard", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Kanji", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonKanjis"); - - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LanguageSkill", b => - { - b.Navigation("Lessons"); - - b.Navigation("MockTestSections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNote", b => - { - b.Navigation("LearnerNoteEntries"); - - b.Navigation("Pages"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.LearnerNoteEntry", b => - { - b.Navigation("ReviewCards"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Lesson", b => - { - b.Navigation("HomeworkAssignmentLessons"); - - b.Navigation("LessonGrammars"); - - b.Navigation("LessonKanjis"); - - b.Navigation("LessonProgresses"); - - b.Navigation("LessonVocabularies"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorAvailability", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorBooking", b => - { - b.Navigation("Note"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorCreditGrant", b => - { - b.Navigation("Entries"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorDispute", b => - { - b.Navigation("Histories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutObligation", b => - { - b.Navigation("Attempts"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayrollPeriod", b => - { - b.Navigation("Adjustments"); - - b.Navigation("Lines"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorSchedule", b => - { - b.Navigation("Rules"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorTeachingProposal", b => - { - b.Navigation("Events"); - - b.Navigation("GeneratedAvailabilities"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => - { - b.Navigation("Slots"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTest", b => - { - b.Navigation("Sections"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestAttempt", b => - { - b.Navigation("Answers"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.MockTestSection", b => - { - b.Navigation("Passages"); - - b.Navigation("Questions"); - - b.Navigation("SectionResults"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookFolder", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.NotebookPage", b => - { - b.Navigation("SavedItems"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExercise", b => - { - b.Navigation("Attempts"); - - b.Navigation("Questions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeExerciseAttempt", b => - { - b.Navigation("Answers"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => - { - b.Navigation("Answers"); - - b.Navigation("Options"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.PracticeSubmission", b => - { - b.Navigation("GradingResult"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.ReviewCard", b => - { - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohort", b => - { - b.Navigation("Enrollments"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.StudyCourse", b => - { - b.Navigation("Audit"); - - b.Navigation("Homework"); - - b.Navigation("RetakeRequests"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.SubscriptionPlan", b => - { - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.Navigation("Lessons"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => - { - b.Navigation("AiCreditTopUps"); - - b.Navigation("AuthoredGrammarPatterns"); - - b.Navigation("AuthoredKanjis"); - - b.Navigation("AuthoredLessons"); - - b.Navigation("AuthoredMockTests"); - - b.Navigation("AuthoredVocabularies"); - - b.Navigation("EmailVerifications"); - - b.Navigation("LearnerEssays"); - - b.Navigation("LearnerNotes"); - - b.Navigation("LessonProgresses"); - - b.Navigation("MentorAvailabilities"); - - b.Navigation("MentorProfile"); - - b.Navigation("MockTestAttempts"); - - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("PracticeSubmissions"); - - b.Navigation("RecommendedLearningPaths"); - - b.Navigation("ReviewCards"); - - b.Navigation("UserSubscriptions"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.UserSubscription", b => - { - b.Navigation("MentorBookings"); - }); - - modelBuilder.Entity("RikiPath.Domain.Entities.Vocabulary", b => - { - b.Navigation("ContentLevelMappings"); - - b.Navigation("LearnerNoteEntries"); - - b.Navigation("LessonVocabularies"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.cs b/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.cs deleted file mode 100644 index 288dfdc5..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201135156_RepairCohortInvitationRevision.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class RepairCohortInvitationRevision : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql(""" - DO $$ - BEGIN - IF to_regclass('public."StudyCohortMentorInvitations"') IS NULL THEN - RAISE EXCEPTION 'StudyCohortMentorInvitations is missing; review migration history before repair'; - END IF; - - LOCK TABLE public."StudyCohortMentorInvitations" IN ACCESS EXCLUSIVE MODE; - - IF NOT EXISTS ( - SELECT 1 FROM information_schema.columns - WHERE table_schema = 'public' - AND table_name = 'StudyCohortMentorInvitations' - AND column_name = 'CohortRevisionAtInvite' - ) THEN - IF EXISTS (SELECT 1 FROM public."StudyCohortMentorInvitations") THEN - RAISE EXCEPTION 'Cannot reconstruct CohortRevisionAtInvite for existing invitations; repair manually'; - END IF; - - ALTER TABLE public."StudyCohortMentorInvitations" - ADD COLUMN "CohortRevisionAtInvite" integer NOT NULL; - END IF; - - IF NOT EXISTS ( - SELECT 1 FROM information_schema.columns - WHERE table_schema = 'public' - AND table_name = 'StudyCohortMentorInvitations' - AND column_name = 'CohortRevisionAtInvite' - AND data_type = 'integer' - AND is_nullable = 'NO' - ) THEN - RAISE EXCEPTION 'CohortRevisionAtInvite has an incompatible definition; review schema before repair'; - END IF; - END $$; - """); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - // The original invitation migration owns this column; reverting the repair must not remove it. - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.cs b/RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.cs deleted file mode 100644 index 391ef311..00000000 --- a/RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace RikiPath.Infrastructure.Migrations -{ - /// - public partial class AddAdminAiRuntimeConfiguration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AiRuntimeConfigurations", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SettingsJson = table.Column(type: "jsonb", nullable: false), - ProtectedSecretsJson = table.Column(type: "text", nullable: false), - Revision = table.Column(type: "integer", nullable: false), - UpdatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedByAdminId = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AiRuntimeConfigurations", x => x.Id); - table.CheckConstraint("CK_AiRuntimeConfiguration_Singleton", "\"Id\" = 1 AND \"Revision\" > 0"); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql("DO $$ BEGIN IF EXISTS (SELECT 1 FROM \"AiRuntimeConfigurations\") THEN RAISE EXCEPTION 'Export AI runtime configuration before rollback'; END IF; END $$;"); - migrationBuilder.DropTable( - name: "AiRuntimeConfigurations"); - } - } -} diff --git a/RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.Designer.cs b/RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.Designer.cs similarity index 99% rename from RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.Designer.cs rename to RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.Designer.cs index 83cbfe61..380632a3 100644 --- a/RikiPath.Infrastructure/Migrations/20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments.Designer.cs +++ b/RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.Designer.cs @@ -12,8 +12,8 @@ namespace RikiPath.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20261201123934_AddMentorKpiPolicyAndTimesheetAdjustments")] - partial class AddMentorKpiPolicyAndTimesheetAdjustments + [Migration("20261203151848_InitialCreate")] + partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -362,6 +362,40 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AiCreditTopUps"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.AiRuntimeConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProtectedSecretsJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("SettingsJson") + .IsRequired() + .HasColumnType("jsonb"); + + b.Property("UpdatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("UpdatedByAdminId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AiRuntimeConfigurations", null, t => + { + t.HasCheckConstraint("CK_AiRuntimeConfiguration_Singleton", "\"Id\" = 1 AND \"Revision\" > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => { b.Property("Id") @@ -2141,12 +2175,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("SortOrder") .HasColumnType("integer"); @@ -8126,9 +8154,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("ContentFingerprint") .IsRequired() .HasMaxLength(64) @@ -8162,9 +8187,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") - .HasColumnType("integer"); - b.Property("MockTestSectionId") .HasColumnType("integer") .HasColumnName("PracticeTestSectionId"); @@ -8187,12 +8209,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("QuestionGroupTitle") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -8214,19 +8230,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("QuestionVersion") .HasColumnType("integer"); - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SkillMetadataJson") .HasColumnType("jsonb"); b.Property("SortOrder") .HasColumnType("integer"); - b.Property("SourceQuestionId") - .HasColumnType("integer"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8253,18 +8262,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentFingerprint"); - b.HasIndex("LanguageSkillId"); - b.HasIndex("PassageId"); b.HasIndex("QuestionIdentity"); - b.HasIndex("SourceQuestionId"); - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - b.ToTable("MockQuestions"); }); @@ -8373,16 +8376,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ParentExamId") .HasColumnType("integer"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -10070,6 +10063,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("GroupPolicyId") .HasColumnType("integer"); + b.Property("Level") + .IsRequired() + .HasMaxLength(12) + .HasColumnType("character varying(12)"); + b.Property("MentorId") .HasColumnType("integer"); @@ -10078,9 +10076,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("character varying(200)"); - b.Property("PlanId") - .HasColumnType("integer"); - b.Property("PolicyVersionSnapshot") .HasColumnType("integer"); @@ -10118,8 +10113,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("MentorId"); - b.HasIndex("PlanId"); - b.HasIndex("SourceProposalId") .IsUnique() .HasFilter("\"SourceProposalId\" IS NOT NULL"); @@ -10207,6 +10200,81 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssignedByAdminId") + .HasColumnType("integer"); + + b.Property("AssignmentReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ChangeReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("CohortId") + .HasColumnType("integer"); + + b.Property("CohortRevisionAtInvite") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeclineReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("FromSessionNumber") + .HasColumnType("integer"); + + b.Property("IdempotencyKey") + .HasColumnType("uuid"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("RespondedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("Status") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(24) + .HasColumnType("character varying(24)"); + + b.HasKey("Id"); + + b.HasIndex("AssignedByAdminId"); + + b.HasIndex("CohortId") + .IsUnique() + .HasFilter("\"Status\" = 'Pending'"); + + b.HasIndex("IdempotencyKey") + .IsUnique(); + + b.HasIndex("MentorId", "Status"); + + b.ToTable("StudyCohortMentorInvitations", null, t => + { + t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); + + t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.Property("Id") @@ -10334,7 +10402,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("text"); - b.Property("PlanId") + b.Property("PlanId") .HasColumnType("integer"); b.Property("PlanRevision") @@ -10910,9 +10978,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("CreatedBy") .HasColumnType("uuid"); @@ -10925,10 +10990,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - b.Property("ModifiedBy") .HasColumnType("uuid"); @@ -10938,10 +10999,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SortOrder") .HasColumnType("integer"); - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - b.Property("Title") .IsRequired() .HasMaxLength(300) @@ -10949,8 +11006,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CertificateLevelId", "SortOrder"); - b.ToTable("Topics"); }); @@ -13544,18 +13599,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") .WithMany("Questions") .HasForeignKey("MockTestSectionId") @@ -13566,11 +13609,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("PassageId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - b.Navigation("MockTestSection"); b.Navigation("Passage"); @@ -14010,12 +14048,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") .WithMany() .HasForeignKey("SourceProposalId") @@ -14025,8 +14057,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Mentor"); - b.Navigation("Plan"); - b.Navigation("SourceProposal"); }); @@ -14064,6 +14094,32 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Cohort"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") + .WithMany() + .HasForeignKey("AssignedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") + .WithMany() + .HasForeignKey("CohortId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + .WithMany() + .HasForeignKey("MentorId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("AssignedByAdmin"); + + b.Navigation("Cohort"); + + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") @@ -14115,8 +14171,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") .WithMany() .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") .WithMany() @@ -14193,16 +14248,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => { b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") diff --git a/RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.cs b/RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.cs similarity index 93% rename from RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.cs rename to RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.cs index e68c4d20..f972fe26 100644 --- a/RikiPath.Infrastructure/Migrations/20261130043054_InitialCreate.cs +++ b/RikiPath.Infrastructure/Migrations/20261203151848_InitialCreate.cs @@ -34,6 +34,24 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_AdminAuditLogs", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AiRuntimeConfigurations", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SettingsJson = table.Column(type: "jsonb", nullable: false), + ProtectedSecretsJson = table.Column(type: "text", nullable: false), + Revision = table.Column(type: "integer", nullable: false), + UpdatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedByAdminId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AiRuntimeConfigurations", x => x.Id); + table.CheckConstraint("CK_AiRuntimeConfiguration_Singleton", "\"Id\" = 1 AND \"Revision\" > 0"); + }); + migrationBuilder.CreateTable( name: "CertificateTypes", columns: table => new @@ -197,6 +215,26 @@ protected override void Up(MigrationBuilder migrationBuilder) table.CheckConstraint("CK_MentorOutbox_EventVersion", "\"EventVersion\" > 0"); }); + migrationBuilder.CreateTable( + name: "Topics", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Title = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), + Description = table.Column(type: "text", nullable: true), + SortOrder = table.Column(type: "integer", nullable: false), + CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), + ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), + CreatedBy = table.Column(type: "uuid", nullable: true), + ModifiedBy = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Topics", x => x.Id); + }); + migrationBuilder.CreateTable( name: "CertificateLevels", columns: table => new @@ -328,35 +366,6 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); - migrationBuilder.CreateTable( - name: "Topics", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Title = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), - Description = table.Column(type: "text", nullable: true), - SortOrder = table.Column(type: "integer", nullable: false), - CertificateLevelId = table.Column(type: "integer", nullable: true), - StageCode = table.Column(type: "character varying(60)", maxLength: 60, nullable: true), - LearningObjectives = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), - ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), - CreatedBy = table.Column(type: "uuid", nullable: true), - ModifiedBy = table.Column(type: "uuid", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Topics", x => x.Id); - table.ForeignKey( - name: "FK_Topics_CertificateLevels_CertificateLevelId", - column: x => x.CertificateLevelId, - principalTable: "CertificateLevels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "Users", columns: table => new @@ -999,6 +1008,8 @@ protected override void Up(MigrationBuilder migrationBuilder) RequireOfficialExamEvidence = table.Column(type: "boolean", nullable: false), RequireAdminRemediationReview = table.Column(type: "boolean", nullable: false), KpiReportingPeriodDays = table.Column(type: "integer", nullable: false), + RetakeSupportEnabled = table.Column(type: "boolean", nullable: false, defaultValue: true), + RemediationAttendanceThresholdPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false, defaultValue: 90m), TuitionPerSessionN5 = table.Column(type: "numeric(18,0)", precision: 18, scale: 0, nullable: false), TuitionPerSessionN4 = table.Column(type: "numeric(18,0)", precision: 18, scale: 0, nullable: false), TuitionPerSessionN3 = table.Column(type: "numeric(18,0)", precision: 18, scale: 0, nullable: false), @@ -1020,6 +1031,7 @@ protected override void Up(MigrationBuilder migrationBuilder) table.CheckConstraint("CK_MentorGroupPolicy_Evidence", "\"RequireOfficialExamEvidence\" AND \"RequireAdminRemediationReview\""); table.CheckConstraint("CK_MentorGroupPolicy_Positive", "\"Version\" > 0 AND \"SessionMinutes\" > 0 AND \"RestMinutes\" >= 0 AND \"MinimumPreparationDays\" >= 1 AND \"CancellationLeadHours\" >= 0 AND \"ReschedulingLeadHours\" >= 0 AND \"HomeworkDeadlineDays\" > 0 AND \"PlacementAttemptLimit\" > 0 AND \"KpiReportingPeriodDays\" > 0"); table.CheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); + table.CheckConstraint("CK_MentorGroupPolicy_RemediationAttendance", "\"RemediationAttendanceThresholdPercent\" > 0 AND \"RemediationAttendanceThresholdPercent\" <= 100"); table.CheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); table.CheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); table.CheckConstraint("CK_MentorGroupPolicy_TransferAfterStart", "\"LearnerTransferEnabled\" OR NOT \"TransferAllowedAfterSourceStart\""); @@ -1082,6 +1094,46 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "MentorKpiPolicies", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Version = table.Column(type: "integer", nullable: false), + EffectiveFromMonth = table.Column(type: "date", nullable: false), + MinimumPresencePercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), + TeachingCompletionTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), + HomeworkMinimumCount = table.Column(type: "integer", nullable: false), + HomeworkPerSessionCount = table.Column(type: "integer", nullable: false), + GradingCompletionTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), + ResponseSlaHours = table.Column(type: "integer", nullable: false), + OnTimeResponseTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), + AverageRatingTarget = table.Column(type: "numeric(3,2)", precision: 3, scale: 2, nullable: false), + PositiveReviewTargetPercent = table.Column(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false), + Note = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + CreatedByAdminId = table.Column(type: "integer", nullable: true), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + DeletedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + DeletedByAdminId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_MentorKpiPolicies", x => x.Id); + table.CheckConstraint("CK_MentorKpiPolicy_Homework", "\"HomeworkMinimumCount\" >= 0 AND \"HomeworkPerSessionCount\" > 0"); + table.CheckConstraint("CK_MentorKpiPolicy_Month", "EXTRACT(DAY FROM \"EffectiveFromMonth\") = 1"); + table.CheckConstraint("CK_MentorKpiPolicy_Percents", "\"MinimumPresencePercent\" > 0 AND \"MinimumPresencePercent\" <= 100 AND \"TeachingCompletionTargetPercent\" > 0 AND \"TeachingCompletionTargetPercent\" <= 100 AND \"GradingCompletionTargetPercent\" > 0 AND \"GradingCompletionTargetPercent\" <= 100 AND \"OnTimeResponseTargetPercent\" > 0 AND \"OnTimeResponseTargetPercent\" <= 100 AND \"PositiveReviewTargetPercent\" > 0 AND \"PositiveReviewTargetPercent\" <= 100"); + table.CheckConstraint("CK_MentorKpiPolicy_Rating", "\"AverageRatingTarget\" >= 1 AND \"AverageRatingTarget\" <= 5"); + table.CheckConstraint("CK_MentorKpiPolicy_Sla", "\"ResponseSlaHours\" > 0"); + table.ForeignKey( + name: "FK_MentorKpiPolicies_Users_CreatedByAdminId", + column: x => x.CreatedByAdminId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "MentorPayrollPeriods", columns: table => new @@ -2314,7 +2366,7 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - PlanId = table.Column(type: "integer", nullable: false), + Level = table.Column(type: "character varying(12)", maxLength: 12, nullable: false), Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), MentorId = table.Column(type: "integer", nullable: false), StartsAt = table.Column(type: "timestamp without time zone", nullable: false), @@ -2355,12 +2407,6 @@ protected override void Up(MigrationBuilder migrationBuilder) principalTable: "MentorTeachingProposals", principalColumn: "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StudyCohorts_StudyCoursePlans_PlanId", - column: x => x.PlanId, - principalTable: "StudyCoursePlans", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_StudyCohorts_Users_MentorId", column: x => x.MentorId, @@ -2657,6 +2703,54 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "ClassQuizzes", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CohortId = table.Column(type: "integer", nullable: false), + MentorId = table.Column(type: "integer", nullable: false), + CertificateLevelId = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + TimeLimitMinutes = table.Column(type: "integer", nullable: false), + DueAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + SkillCodes = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + QuestionCount = table.Column(type: "integer", nullable: false), + QuestionSnapshotJson = table.Column(type: "text", nullable: false), + StructureKey = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + PublishedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + Revision = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ClassQuizzes", x => x.Id); + table.CheckConstraint("CK_ClassQuiz_QuestionCount", "\"QuestionCount\" BETWEEN 1 AND 200"); + table.CheckConstraint("CK_ClassQuiz_Status", "\"Status\" IN ('Published','Cancelled')"); + table.CheckConstraint("CK_ClassQuiz_TimeLimit", "\"TimeLimitMinutes\" BETWEEN 1 AND 240"); + table.ForeignKey( + name: "FK_ClassQuizzes_CertificateLevels_CertificateLevelId", + column: x => x.CertificateLevelId, + principalTable: "CertificateLevels", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ClassQuizzes_StudyCohorts_CohortId", + column: x => x.CohortId, + principalTable: "StudyCohorts", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ClassQuizzes_Users_MentorId", + column: x => x.MentorId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "CohortEnrollmentEntitlements", columns: table => new @@ -2817,6 +2911,51 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "StudyCohortMentorInvitations", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CohortId = table.Column(type: "integer", nullable: false), + MentorId = table.Column(type: "integer", nullable: false), + AssignedByAdminId = table.Column(type: "integer", nullable: true), + Status = table.Column(type: "character varying(24)", maxLength: 24, nullable: false), + DeclineReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + ChangeReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + AssignmentReason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + FromSessionNumber = table.Column(type: "integer", nullable: true), + CohortRevisionAtInvite = table.Column(type: "integer", nullable: false), + IdempotencyKey = table.Column(type: "uuid", nullable: false), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + RespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + Revision = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_StudyCohortMentorInvitations", x => x.Id); + table.CheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); + table.CheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); + table.ForeignKey( + name: "FK_StudyCohortMentorInvitations_StudyCohorts_CohortId", + column: x => x.CohortId, + principalTable: "StudyCohorts", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_StudyCohortMentorInvitations_Users_AssignedByAdminId", + column: x => x.AssignedByAdminId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_StudyCohortMentorInvitations_Users_MentorId", + column: x => x.MentorId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "StudyCourses", columns: table => new @@ -2829,7 +2968,7 @@ protected override void Up(MigrationBuilder migrationBuilder) LearnerId = table.Column(type: "integer", nullable: false), PurchaseKey = table.Column(type: "uuid", nullable: false), MentorId = table.Column(type: "integer", nullable: true), - PlanId = table.Column(type: "integer", nullable: false), + PlanId = table.Column(type: "integer", nullable: true), RetakeOfId = table.Column(type: "integer", nullable: true), Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), CertificateLevelId = table.Column(type: "integer", nullable: false), @@ -2926,6 +3065,9 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: true), + ActualStartedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + ActualEndedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), CohortId = table.Column(type: "integer", nullable: false), Number = table.Column(type: "integer", nullable: false), AvailabilityId = table.Column(type: "integer", nullable: false) @@ -3171,67 +3313,45 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "CohortComplaints", + name: "ClassQuizAssignments", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CourseId = table.Column(type: "integer", nullable: false), - CohortId = table.Column(type: "integer", nullable: true), + QuizId = table.Column(type: "integer", nullable: false), LearnerId = table.Column(type: "integer", nullable: false), - MentorId = table.Column(type: "integer", nullable: true), - Category = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), - Message = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - EvidenceUrl = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - RefundReviewRequested = table.Column(type: "boolean", nullable: false), - Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - MentorResponse = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), - MentorRespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), - Decision = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), - DecidedById = table.Column(type: "integer", nullable: true), - DecidedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), - IdempotencyKey = table.Column(type: "uuid", nullable: false), - CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), - Revision = table.Column(type: "integer", nullable: false) + EnrollmentId = table.Column(type: "integer", nullable: false), + AttemptId = table.Column(type: "integer", nullable: true), + AssignedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + CompletedAtUtc = table.Column(type: "timestamp with time zone", nullable: true) }, constraints: table => { - table.PrimaryKey("PK_CohortComplaints", x => x.Id); - table.CheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); - table.CheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); - table.CheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); - table.CheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); - table.CheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'Resolved', 'Rejected')"); + table.PrimaryKey("PK_ClassQuizAssignments", x => x.Id); table.ForeignKey( - name: "FK_CohortComplaints_StudyCohorts_CohortId", - column: x => x.CohortId, - principalTable: "StudyCohorts", + name: "FK_ClassQuizAssignments_ClassQuizzes_QuizId", + column: x => x.QuizId, + principalTable: "ClassQuizzes", principalColumn: "Id", - onDelete: ReferentialAction.Restrict); + onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_CohortComplaints_StudyCourses_CourseId", - column: x => x.CourseId, - principalTable: "StudyCourses", + name: "FK_ClassQuizAssignments_MockTestAttempts_AttemptId", + column: x => x.AttemptId, + principalTable: "MockTestAttempts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_CohortComplaints_Users_DecidedById", - column: x => x.DecidedById, - principalTable: "Users", + name: "FK_ClassQuizAssignments_StudyCourses_EnrollmentId", + column: x => x.EnrollmentId, + principalTable: "StudyCourses", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_CohortComplaints_Users_LearnerId", + name: "FK_ClassQuizAssignments_Users_LearnerId", column: x => x.LearnerId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_CohortComplaints_Users_MentorId", - column: x => x.MentorId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -3506,6 +3626,36 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "MentorTimesheetAdjustments", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CohortSessionId = table.Column(type: "integer", nullable: false), + MentorId = table.Column(type: "integer", nullable: false), + PreviousStatus = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + NewStatus = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + PreviousConfirmedMinutes = table.Column(type: "integer", nullable: false), + NewConfirmedMinutes = table.Column(type: "integer", nullable: false), + Reason = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: false), + Evidence = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + AdminId = table.Column(type: "integer", nullable: false), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MentorTimesheetAdjustments", x => x.Id); + table.CheckConstraint("CK_MentorTimesheetAdjustment_Minutes", "\"NewConfirmedMinutes\" >= 0 AND \"PreviousConfirmedMinutes\" >= 0"); + table.CheckConstraint("CK_MentorTimesheetAdjustment_Status", "\"NewStatus\" IN ('Taught', 'Absent')"); + table.ForeignKey( + name: "FK_MentorTimesheetAdjustments_StudyCohortSessions_CohortSessio~", + column: x => x.CohortSessionId, + principalTable: "StudyCohortSessions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "MentorCreditGrants", columns: table => new @@ -3683,12 +3833,12 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "CohortComplaintEvents", + name: "CohortTransferRequestEvents", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ComplaintId = table.Column(type: "integer", nullable: false), + RequestId = table.Column(type: "integer", nullable: false), Action = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), ActorId = table.Column(type: "integer", nullable: false), ActorRole = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), @@ -3697,35 +3847,141 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_CohortComplaintEvents", x => x.Id); + table.PrimaryKey("PK_CohortTransferRequestEvents", x => x.Id); table.ForeignKey( - name: "FK_CohortComplaintEvents_CohortComplaints_ComplaintId", - column: x => x.ComplaintId, - principalTable: "CohortComplaints", + name: "FK_CohortTransferRequestEvents_CohortTransferRequests_RequestId", + column: x => x.RequestId, + principalTable: "CohortTransferRequests", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( - name: "CohortTransferRequestEvents", + name: "CohortComplaints", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - RequestId = table.Column(type: "integer", nullable: false), - Action = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), - ActorId = table.Column(type: "integer", nullable: false), - ActorRole = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - Detail = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - AtUtc = table.Column(type: "timestamp with time zone", nullable: false) + CourseId = table.Column(type: "integer", nullable: false), + CohortId = table.Column(type: "integer", nullable: true), + LearnerId = table.Column(type: "integer", nullable: false), + MentorId = table.Column(type: "integer", nullable: true), + Category = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), + Message = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + Title = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + CourseSessionId = table.Column(type: "integer", nullable: true), + MentorDisclosure = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + MentorAccessGrantedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + MentorEvidenceAllowed = table.Column(type: "boolean", nullable: false), + EvidenceUrl = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + RefundReviewRequested = table.Column(type: "boolean", nullable: false), + Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + MentorResponse = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + MentorRespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + Decision = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + DecidedById = table.Column(type: "integer", nullable: true), + DecidedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + IdempotencyKey = table.Column(type: "uuid", nullable: false), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + Revision = table.Column(type: "integer", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_CohortTransferRequestEvents", x => x.Id); + table.PrimaryKey("PK_CohortComplaints", x => x.Id); + table.CheckConstraint("CK_CohortComplaint_Category", "\"Category\" IN ('TeachingQuality', 'MentorConduct', 'Schedule', 'PaymentEnrollment', 'Other')"); + table.CheckConstraint("CK_CohortComplaint_Decision", "(\"Status\" NOT IN ('Resolved', 'Rejected') OR (\"Decision\" IS NOT NULL AND length(btrim(\"Decision\")) > 0 AND \"DecidedById\" IS NOT NULL AND \"DecidedAtUtc\" IS NOT NULL))"); + table.CheckConstraint("CK_CohortComplaint_Message", "length(btrim(\"Message\")) BETWEEN 10 AND 2000"); + table.CheckConstraint("CK_CohortComplaint_RefundReview", "NOT \"RefundReviewRequested\" OR \"Category\" = 'PaymentEnrollment'"); + table.CheckConstraint("CK_CohortComplaint_Status", "\"Status\" IN ('Open', 'UnderReview', 'NeedsInformation', 'Resolved', 'Rejected', 'Withdrawn')"); table.ForeignKey( - name: "FK_CohortTransferRequestEvents_CohortTransferRequests_RequestId", - column: x => x.RequestId, - principalTable: "CohortTransferRequests", + name: "FK_CohortComplaints_StudyCohorts_CohortId", + column: x => x.CohortId, + principalTable: "StudyCohorts", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortComplaints_StudyCourseSessions_CourseSessionId", + column: x => x.CourseSessionId, + principalTable: "StudyCourseSessions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortComplaints_StudyCourses_CourseId", + column: x => x.CourseId, + principalTable: "StudyCourses", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortComplaints_Users_DecidedById", + column: x => x.DecidedById, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortComplaints_Users_LearnerId", + column: x => x.LearnerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortComplaints_Users_MentorId", + column: x => x.MentorId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "CohortLearningFeedback", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CourseId = table.Column(type: "integer", nullable: false), + LearnerId = table.Column(type: "integer", nullable: false), + MentorId = table.Column(type: "integer", nullable: false), + CourseSessionId = table.Column(type: "integer", nullable: true), + Topic = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), + Message = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + EvidenceUrl = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + Response = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + RespondedById = table.Column(type: "integer", nullable: true), + RespondedAtUtc = table.Column(type: "timestamp with time zone", nullable: true), + CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + IdempotencyKey = table.Column(type: "uuid", nullable: false), + Revision = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CohortLearningFeedback", x => x.Id); + table.ForeignKey( + name: "FK_CohortLearningFeedback_StudyCourseSessions_CourseSessionId", + column: x => x.CourseSessionId, + principalTable: "StudyCourseSessions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortLearningFeedback_StudyCourses_CourseId", + column: x => x.CourseId, + principalTable: "StudyCourses", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortLearningFeedback_Users_LearnerId", + column: x => x.LearnerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortLearningFeedback_Users_MentorId", + column: x => x.MentorId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CohortLearningFeedback_Users_RespondedById", + column: x => x.RespondedById, + principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); @@ -3933,6 +4189,31 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "CohortComplaintEvents", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + EvidenceUrl = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + ComplaintId = table.Column(type: "integer", nullable: false), + Action = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + ActorId = table.Column(type: "integer", nullable: false), + ActorRole = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + Detail = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + AtUtc = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CohortComplaintEvents", x => x.Id); + table.ForeignKey( + name: "FK_CohortComplaintEvents_CohortComplaints_ComplaintId", + column: x => x.ComplaintId, + principalTable: "CohortComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "HomeworkAssignments", columns: table => new @@ -4430,6 +4711,37 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "HomeworkAssignmentAttachments", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + HomeworkAssignmentId = table.Column(type: "integer", nullable: false), + FileKey = table.Column(type: "uuid", nullable: false), + Kind = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + StorageReference = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + FileName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + ContentType = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + SizeBytes = table.Column(type: "bigint", nullable: false), + SortOrder = table.Column(type: "integer", nullable: false), + CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), + ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), + CreatedBy = table.Column(type: "uuid", nullable: true), + ModifiedBy = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_HomeworkAssignmentAttachments", x => x.Id); + table.ForeignKey( + name: "FK_HomeworkAssignmentAttachments_HomeworkAssignments_HomeworkA~", + column: x => x.HomeworkAssignmentId, + principalTable: "HomeworkAssignments", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "HomeworkAssignmentExercises", columns: table => new @@ -4692,6 +5004,36 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "HomeworkSubmissionFiles", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + HomeworkSubmissionId = table.Column(type: "integer", nullable: false), + FileKey = table.Column(type: "uuid", nullable: false), + StorageReference = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + FileName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + ContentType = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + SizeBytes = table.Column(type: "bigint", nullable: false), + SortOrder = table.Column(type: "integer", nullable: false), + CreatedDate = table.Column(type: "timestamp without time zone", nullable: true), + ModifiedDate = table.Column(type: "timestamp without time zone", nullable: true), + CreatedBy = table.Column(type: "uuid", nullable: true), + ModifiedBy = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_HomeworkSubmissionFiles", x => x.Id); + table.ForeignKey( + name: "FK_HomeworkSubmissionFiles_HomeworkSubmissions_HomeworkSubmiss~", + column: x => x.HomeworkSubmissionId, + principalTable: "HomeworkSubmissions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "LearnerPracticeAnswers", columns: table => new @@ -4949,8 +5291,13 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.InsertData( table: "MentorGroupPolicies", - columns: new[] { "Id", "CancellationLeadHours", "CheckoutHoldMinutes", "CreatedAtUtc", "CreatedByAdminId", "DeletedAtUtc", "DeletedByAdminId", "EffectiveFromUtc", "HomeworkDeadlineDays", "IsActive", "IsArchivedRevision", "IsDeleted", "KpiReportingPeriodDays", "LastAppliedAtUtc", "LastAppliedByAdminId", "LearnerTransferEnabled", "MaxLearners", "MentorReplacementEnabled", "MentorReplacementLeadHours", "MinimumPreparationDays", "MinimumPublishedEnrollmentDays", "PlacementAttemptLimit", "RemediationCompletionThresholdPercent", "RemediationThresholdComparison", "RequireAdminRemediationReview", "RequireOfficialExamEvidence", "ReschedulingLeadHours", "RestMinutes", "Revision", "SessionMinutes", "TransferAllowedAfterSourceStart", "TuitionPerSessionN2", "TuitionPerSessionN3", "TuitionPerSessionN4", "TuitionPerSessionN5", "UpdatedAtUtc", "UpdatedByAdminId", "Version" }, - values: new object[] { 1, 24, 10, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, null, null, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), 7, true, false, false, 30, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, true, 4, true, 24, 1, 7, 2, 90m, ">", true, true, 24, 15, 1, 90, false, 110000m, 90000m, 75000m, 60000m, null, null, 1 }); + columns: new[] { "Id", "CancellationLeadHours", "CheckoutHoldMinutes", "CreatedAtUtc", "CreatedByAdminId", "DeletedAtUtc", "DeletedByAdminId", "EffectiveFromUtc", "HomeworkDeadlineDays", "IsActive", "IsArchivedRevision", "IsDeleted", "KpiReportingPeriodDays", "LastAppliedAtUtc", "LastAppliedByAdminId", "LearnerTransferEnabled", "MaxLearners", "MentorReplacementEnabled", "MentorReplacementLeadHours", "MinimumPreparationDays", "MinimumPublishedEnrollmentDays", "PlacementAttemptLimit", "RemediationAttendanceThresholdPercent", "RemediationCompletionThresholdPercent", "RemediationThresholdComparison", "RequireAdminRemediationReview", "RequireOfficialExamEvidence", "ReschedulingLeadHours", "RestMinutes", "RetakeSupportEnabled", "Revision", "SessionMinutes", "TransferAllowedAfterSourceStart", "TuitionPerSessionN2", "TuitionPerSessionN3", "TuitionPerSessionN4", "TuitionPerSessionN5", "UpdatedAtUtc", "UpdatedByAdminId", "Version" }, + values: new object[] { 1, 24, 10, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, null, null, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), 7, true, false, false, 30, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, true, 4, true, 24, 1, 7, 2, 90m, 90m, ">", true, true, 24, 15, true, 1, 90, false, 110000m, 90000m, 75000m, 60000m, null, null, 1 }); + + migrationBuilder.InsertData( + table: "MentorKpiPolicies", + columns: new[] { "Id", "AverageRatingTarget", "CreatedAtUtc", "CreatedByAdminId", "DeletedAtUtc", "DeletedByAdminId", "EffectiveFromMonth", "GradingCompletionTargetPercent", "HomeworkMinimumCount", "HomeworkPerSessionCount", "IsDeleted", "MinimumPresencePercent", "Note", "OnTimeResponseTargetPercent", "PositiveReviewTargetPercent", "ResponseSlaHours", "TeachingCompletionTargetPercent", "Version" }, + values: new object[] { 1, 4m, new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), null, null, null, new DateOnly(2026, 1, 1), 90m, 1, 2, false, 80m, "Phiên bản khởi tạo", 90m, 80m, 24, 90m, 1 }); migrationBuilder.InsertData( table: "SubscriptionPlans", @@ -5194,6 +5541,44 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "Name", unique: true); + migrationBuilder.CreateIndex( + name: "IX_ClassQuizAssignments_AttemptId", + table: "ClassQuizAssignments", + column: "AttemptId", + unique: true, + filter: "\"AttemptId\" IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizAssignments_EnrollmentId", + table: "ClassQuizAssignments", + column: "EnrollmentId"); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizAssignments_LearnerId_EnrollmentId", + table: "ClassQuizAssignments", + columns: new[] { "LearnerId", "EnrollmentId" }); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizAssignments_QuizId_LearnerId", + table: "ClassQuizAssignments", + columns: new[] { "QuizId", "LearnerId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizzes_CertificateLevelId", + table: "ClassQuizzes", + column: "CertificateLevelId"); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizzes_CohortId_IsDeleted_DueAtUtc", + table: "ClassQuizzes", + columns: new[] { "CohortId", "IsDeleted", "DueAtUtc" }); + + migrationBuilder.CreateIndex( + name: "IX_ClassQuizzes_MentorId", + table: "ClassQuizzes", + column: "MentorId"); + migrationBuilder.CreateIndex( name: "IX_CohortComplaintEvents_ComplaintId_Id", table: "CohortComplaintEvents", @@ -5209,6 +5594,11 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "CohortComplaints", column: "CourseId"); + migrationBuilder.CreateIndex( + name: "IX_CohortComplaints_CourseSessionId", + table: "CohortComplaints", + column: "CourseSessionId"); + migrationBuilder.CreateIndex( name: "IX_CohortComplaints_DecidedById", table: "CohortComplaints", @@ -5253,6 +5643,32 @@ protected override void Up(MigrationBuilder migrationBuilder) unique: true, filter: "\"Status\" = 'Active' AND \"IsDeleted\" = false"); + migrationBuilder.CreateIndex( + name: "IX_CohortLearningFeedback_CourseId", + table: "CohortLearningFeedback", + column: "CourseId"); + + migrationBuilder.CreateIndex( + name: "IX_CohortLearningFeedback_CourseSessionId", + table: "CohortLearningFeedback", + column: "CourseSessionId"); + + migrationBuilder.CreateIndex( + name: "IX_CohortLearningFeedback_LearnerId_IdempotencyKey", + table: "CohortLearningFeedback", + columns: new[] { "LearnerId", "IdempotencyKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_CohortLearningFeedback_MentorId", + table: "CohortLearningFeedback", + column: "MentorId"); + + migrationBuilder.CreateIndex( + name: "IX_CohortLearningFeedback_RespondedById", + table: "CohortLearningFeedback", + column: "RespondedById"); + migrationBuilder.CreateIndex( name: "IX_CohortMentorReviews_CohortId", table: "CohortMentorReviews", @@ -5530,6 +5946,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "GrammarPatterns", column: "UserAccountId"); + migrationBuilder.CreateIndex( + name: "IX_HomeworkAssignmentAttachments_FileKey", + table: "HomeworkAssignmentAttachments", + column: "FileKey"); + + migrationBuilder.CreateIndex( + name: "IX_HomeworkAssignmentAttachments_HomeworkAssignmentId", + table: "HomeworkAssignmentAttachments", + column: "HomeworkAssignmentId"); + migrationBuilder.CreateIndex( name: "IX_HomeworkAssignmentExercises_PracticeExerciseId", table: "HomeworkAssignmentExercises", @@ -5565,6 +5991,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "HomeworkAssignments", column: "StudyCourseId"); + migrationBuilder.CreateIndex( + name: "IX_HomeworkSubmissionFiles_FileKey", + table: "HomeworkSubmissionFiles", + column: "FileKey"); + + migrationBuilder.CreateIndex( + name: "IX_HomeworkSubmissionFiles_HomeworkSubmissionId", + table: "HomeworkSubmissionFiles", + column: "HomeworkSubmissionId"); + migrationBuilder.CreateIndex( name: "IX_HomeworkSubmissions_HomeworkAssignmentId", table: "HomeworkSubmissions", @@ -6188,6 +6624,24 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "MentorUserId", "EffectiveFromUtc" }, unique: true); + migrationBuilder.CreateIndex( + name: "IX_MentorKpiPolicies_CreatedByAdminId", + table: "MentorKpiPolicies", + column: "CreatedByAdminId"); + + migrationBuilder.CreateIndex( + name: "IX_MentorKpiPolicies_EffectiveFromMonth", + table: "MentorKpiPolicies", + column: "EffectiveFromMonth", + unique: true, + filter: "\"IsDeleted\" = FALSE"); + + migrationBuilder.CreateIndex( + name: "IX_MentorKpiPolicies_Version", + table: "MentorKpiPolicies", + column: "Version", + unique: true); + migrationBuilder.CreateIndex( name: "IX_MentorOutboxEvents_DeliveredAtUtc_AvailableAtUtc_CreatedAtU~", table: "MentorOutboxEvents", @@ -6409,6 +6863,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "MentorTeachingQualifications", column: "VerifiedByAdminId"); + migrationBuilder.CreateIndex( + name: "IX_MentorTimesheetAdjustments_CohortSessionId_CreatedAtUtc", + table: "MentorTimesheetAdjustments", + columns: new[] { "CohortSessionId", "CreatedAtUtc" }); + + migrationBuilder.CreateIndex( + name: "IX_MentorTimesheetAdjustments_MentorId", + table: "MentorTimesheetAdjustments", + column: "MentorId"); + migrationBuilder.CreateIndex( name: "IX_MentorWeeklyAvailabilities_MentorId_Date_Period", table: "MentorWeeklyAvailabilities", @@ -6846,6 +7310,29 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "StudyCohortMentorAssignments", column: "PreviousMentorId"); + migrationBuilder.CreateIndex( + name: "IX_StudyCohortMentorInvitations_AssignedByAdminId", + table: "StudyCohortMentorInvitations", + column: "AssignedByAdminId"); + + migrationBuilder.CreateIndex( + name: "IX_StudyCohortMentorInvitations_CohortId", + table: "StudyCohortMentorInvitations", + column: "CohortId", + unique: true, + filter: "\"Status\" = 'Pending'"); + + migrationBuilder.CreateIndex( + name: "IX_StudyCohortMentorInvitations_IdempotencyKey", + table: "StudyCohortMentorInvitations", + column: "IdempotencyKey", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_StudyCohortMentorInvitations_MentorId_Status", + table: "StudyCohortMentorInvitations", + columns: new[] { "MentorId", "Status" }); + migrationBuilder.CreateIndex( name: "IX_StudyCohorts_GroupPolicyId", table: "StudyCohorts", @@ -6856,11 +7343,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "StudyCohorts", column: "MentorId"); - migrationBuilder.CreateIndex( - name: "IX_StudyCohorts_PlanId", - table: "StudyCohorts", - column: "PlanId"); - migrationBuilder.CreateIndex( name: "IX_StudyCohorts_SourceProposalId", table: "StudyCohorts", @@ -6964,11 +7446,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "SubscriptionPlans", column: "CertificateLevelId"); - migrationBuilder.CreateIndex( - name: "IX_Topics_CertificateLevelId_SortOrder", - table: "Topics", - columns: new[] { "CertificateLevelId", "SortOrder" }); - migrationBuilder.CreateIndex( name: "IX_UserDeviceTokens_FcmToken", table: "UserDeviceTokens", @@ -7077,12 +7554,21 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "AiCreditTopUps"); + migrationBuilder.DropTable( + name: "AiRuntimeConfigurations"); + + migrationBuilder.DropTable( + name: "ClassQuizAssignments"); + migrationBuilder.DropTable( name: "CohortComplaintEvents"); migrationBuilder.DropTable( name: "CohortEnrollmentEntitlements"); + migrationBuilder.DropTable( + name: "CohortLearningFeedback"); + migrationBuilder.DropTable( name: "CohortMentorReviews"); @@ -7125,12 +7611,18 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "GradingResults"); + migrationBuilder.DropTable( + name: "HomeworkAssignmentAttachments"); + migrationBuilder.DropTable( name: "HomeworkAssignmentExercises"); migrationBuilder.DropTable( name: "HomeworkAssignmentLessons"); + migrationBuilder.DropTable( + name: "HomeworkSubmissionFiles"); + migrationBuilder.DropTable( name: "JlptExamSchedules"); @@ -7197,6 +7689,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "MentorHourlyRates"); + migrationBuilder.DropTable( + name: "MentorKpiPolicies"); + migrationBuilder.DropTable( name: "MentorOutboxEvents"); @@ -7221,6 +7716,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "MentorTeachingQualifications"); + migrationBuilder.DropTable( + name: "MentorTimesheetAdjustments"); + migrationBuilder.DropTable( name: "MockTestAnswers"); @@ -7246,7 +7744,7 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "StudyCohortMentorAssignments"); migrationBuilder.DropTable( - name: "StudyCohortSessions"); + name: "StudyCohortMentorInvitations"); migrationBuilder.DropTable( name: "StudyCourseHomework"); @@ -7257,6 +7755,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "UserSrsPreferences"); + migrationBuilder.DropTable( + name: "ClassQuizzes"); + migrationBuilder.DropTable( name: "CohortComplaints"); @@ -7270,10 +7771,10 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "Features"); migrationBuilder.DropTable( - name: "HomeworkSubmissions"); + name: "PracticeSubmissions"); migrationBuilder.DropTable( - name: "PracticeSubmissions"); + name: "HomeworkSubmissions"); migrationBuilder.DropTable( name: "KanaWritingPracticeCards"); @@ -7284,9 +7785,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "PracticeQuestionOptions"); - migrationBuilder.DropTable( - name: "StudyCourseSessions"); - migrationBuilder.DropTable( name: "MentorDisputes"); @@ -7296,6 +7794,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "MentorEarningEntries"); + migrationBuilder.DropTable( + name: "StudyCohortSessions"); + migrationBuilder.DropTable( name: "MockQuestionOptions"); @@ -7305,6 +7806,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "ReviewCards"); + migrationBuilder.DropTable( + name: "StudyCourseSessions"); + migrationBuilder.DropTable( name: "KanaCharacters"); diff --git a/RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.Designer.cs b/RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.Designer.cs similarity index 97% rename from RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.Designer.cs rename to RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.Designer.cs index 9ea1684f..3d09e698 100644 --- a/RikiPath.Infrastructure/Migrations/20261201082900_AddRetakeSupportPolicyThresholds.Designer.cs +++ b/RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.Designer.cs @@ -12,8 +12,8 @@ namespace RikiPath.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20261201082900_AddRetakeSupportPolicyThresholds")] - partial class AddRetakeSupportPolicyThresholds + [Migration("20261204053500_AddPracticePassagesAndQuestionPoints")] + partial class AddPracticePassagesAndQuestionPoints { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -362,6 +362,40 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AiCreditTopUps"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.AiRuntimeConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProtectedSecretsJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("SettingsJson") + .IsRequired() + .HasColumnType("jsonb"); + + b.Property("UpdatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("UpdatedByAdminId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AiRuntimeConfigurations", null, t => + { + t.HasCheckConstraint("CK_AiRuntimeConfiguration_Singleton", "\"Id\" = 1 AND \"Revision\" > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => { b.Property("Id") @@ -2141,12 +2175,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") + b.Property("PracticeExerciseId") .HasColumnType("integer"); - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("SortOrder") .HasColumnType("integer"); @@ -2170,6 +2201,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("PassageIdentity"); + b.HasIndex("PracticeExerciseId"); + b.ToTable("ContentPassages"); }); @@ -6927,6 +6960,117 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AverageRatingTarget") + .HasPrecision(3, 2) + .HasColumnType("numeric(3,2)"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedByAdminId") + .HasColumnType("integer"); + + b.Property("DeletedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedByAdminId") + .HasColumnType("integer"); + + b.Property("EffectiveFromMonth") + .HasColumnType("date"); + + b.Property("GradingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("HomeworkMinimumCount") + .HasColumnType("integer"); + + b.Property("HomeworkPerSessionCount") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MinimumPresencePercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Note") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("OnTimeResponseTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("PositiveReviewTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("ResponseSlaHours") + .HasColumnType("integer"); + + b.Property("TeachingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedByAdminId"); + + b.HasIndex("EffectiveFromMonth") + .IsUnique() + .HasFilter("\"IsDeleted\" = FALSE"); + + b.HasIndex("Version") + .IsUnique(); + + b.ToTable("MentorKpiPolicies", null, t => + { + t.HasCheckConstraint("CK_MentorKpiPolicy_Homework", "\"HomeworkMinimumCount\" >= 0 AND \"HomeworkPerSessionCount\" > 0"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Month", "EXTRACT(DAY FROM \"EffectiveFromMonth\") = 1"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Percents", "\"MinimumPresencePercent\" > 0 AND \"MinimumPresencePercent\" <= 100 AND \"TeachingCompletionTargetPercent\" > 0 AND \"TeachingCompletionTargetPercent\" <= 100 AND \"GradingCompletionTargetPercent\" > 0 AND \"GradingCompletionTargetPercent\" <= 100 AND \"OnTimeResponseTargetPercent\" > 0 AND \"OnTimeResponseTargetPercent\" <= 100 AND \"PositiveReviewTargetPercent\" > 0 AND \"PositiveReviewTargetPercent\" <= 100"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Rating", "\"AverageRatingTarget\" >= 1 AND \"AverageRatingTarget\" <= 5"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Sla", "\"ResponseSlaHours\" > 0"); + }); + + b.HasData( + new + { + Id = 1, + AverageRatingTarget = 4m, + CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), + EffectiveFromMonth = new DateOnly(2026, 1, 1), + GradingCompletionTargetPercent = 90m, + HomeworkMinimumCount = 1, + HomeworkPerSessionCount = 2, + IsDeleted = false, + MinimumPresencePercent = 80m, + Note = "Phiên bản khởi tạo", + OnTimeResponseTargetPercent = 90m, + PositiveReviewTargetPercent = 80m, + ResponseSlaHours = 24, + TeachingCompletionTargetPercent = 90m, + Version = 1 + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => { b.Property("Id") @@ -7884,6 +8028,65 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AdminId") + .HasColumnType("integer"); + + b.Property("CohortSessionId") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Evidence") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("NewConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("NewStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("PreviousConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("PreviousStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.HasKey("Id"); + + b.HasIndex("MentorId"); + + b.HasIndex("CohortSessionId", "CreatedAtUtc"); + + b.ToTable("MentorTimesheetAdjustments", null, t => + { + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Minutes", "\"NewConfirmedMinutes\" >= 0 AND \"PreviousConfirmedMinutes\" >= 0"); + + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Status", "\"NewStatus\" IN ('Taught', 'Absent')"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { b.Property("Id") @@ -7956,9 +8159,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("ContentFingerprint") .IsRequired() .HasMaxLength(64) @@ -7992,9 +8192,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") - .HasColumnType("integer"); - b.Property("MockTestSectionId") .HasColumnType("integer") .HasColumnName("PracticeTestSectionId"); @@ -8017,12 +8214,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("QuestionGroupTitle") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -8044,19 +8235,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("QuestionVersion") .HasColumnType("integer"); - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SkillMetadataJson") .HasColumnType("jsonb"); b.Property("SortOrder") .HasColumnType("integer"); - b.Property("SourceQuestionId") - .HasColumnType("integer"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8083,18 +8267,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentFingerprint"); - b.HasIndex("LanguageSkillId"); - b.HasIndex("PassageId"); b.HasIndex("QuestionIdentity"); - b.HasIndex("SourceQuestionId"); - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - b.ToTable("MockQuestions"); }); @@ -8203,16 +8381,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ParentExamId") .HasColumnType("integer"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8901,9 +9069,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("timestamp without time zone"); b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); + .HasColumnType("double precision"); b.Property("Scope") .IsRequired() @@ -9004,6 +9170,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("ContentPassageId") + .HasColumnType("integer"); + b.Property("CreatedBy") .HasColumnType("uuid"); @@ -9025,6 +9194,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ModifiedDate") .HasColumnType("timestamp without time zone"); + b.Property("Points") + .ValueGeneratedOnAdd() + .HasColumnType("double precision") + .HasDefaultValue(1.0); + b.Property("PracticeExerciseId") .HasColumnType("integer"); @@ -9037,6 +9211,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("ContentPassageId"); + b.HasIndex("PracticeExerciseId"); b.ToTable("PracticeQuestions"); @@ -9900,6 +10076,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("GroupPolicyId") .HasColumnType("integer"); + b.Property("Level") + .IsRequired() + .HasMaxLength(12) + .HasColumnType("character varying(12)"); + b.Property("MentorId") .HasColumnType("integer"); @@ -9908,9 +10089,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("character varying(200)"); - b.Property("PlanId") - .HasColumnType("integer"); - b.Property("PolicyVersionSnapshot") .HasColumnType("integer"); @@ -9948,8 +10126,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("MentorId"); - b.HasIndex("PlanId"); - b.HasIndex("SourceProposalId") .IsUnique() .HasFilter("\"SourceProposalId\" IS NOT NULL"); @@ -10037,6 +10213,81 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssignedByAdminId") + .HasColumnType("integer"); + + b.Property("AssignmentReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ChangeReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("CohortId") + .HasColumnType("integer"); + + b.Property("CohortRevisionAtInvite") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeclineReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("FromSessionNumber") + .HasColumnType("integer"); + + b.Property("IdempotencyKey") + .HasColumnType("uuid"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("RespondedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("Status") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(24) + .HasColumnType("character varying(24)"); + + b.HasKey("Id"); + + b.HasIndex("AssignedByAdminId"); + + b.HasIndex("CohortId") + .IsUnique() + .HasFilter("\"Status\" = 'Pending'"); + + b.HasIndex("IdempotencyKey") + .IsUnique(); + + b.HasIndex("MentorId", "Status"); + + b.ToTable("StudyCohortMentorInvitations", null, t => + { + t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); + + t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.Property("Id") @@ -10164,7 +10415,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("text"); - b.Property("PlanId") + b.Property("PlanId") .HasColumnType("integer"); b.Property("PlanRevision") @@ -10740,9 +10991,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("CreatedBy") .HasColumnType("uuid"); @@ -10755,10 +11003,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - b.Property("ModifiedBy") .HasColumnType("uuid"); @@ -10768,10 +11012,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SortOrder") .HasColumnType("integer"); - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - b.Property("Title") .IsRequired() .HasMaxLength(300) @@ -10779,8 +11019,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CertificateLevelId", "SortOrder"); - b.ToTable("Topics"); }); @@ -12100,7 +12338,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("MockTestSectionId") .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") + .WithMany("Passages") + .HasForeignKey("PracticeExerciseId") + .OnDelete(DeleteBehavior.Cascade); + b.Navigation("MockTestSection"); + + b.Navigation("PracticeExercise"); }); modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => @@ -13057,6 +13302,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("MentorUser"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") + .WithMany() + .HasForeignKey("CreatedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedByAdmin"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => { b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") @@ -13340,31 +13595,30 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("VerifiedByAdmin"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + b.HasOne("RikiPath.Domain.Entities.StudyCohortSession", "CohortSession") .WithMany() - .HasForeignKey("MentorId") + .HasForeignKey("CohortSessionId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.Navigation("Mentor"); + b.Navigation("CohortSession"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") .WithMany() - .HasForeignKey("CertificateLevelId") + .HasForeignKey("MentorId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + { b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") .WithMany("Questions") .HasForeignKey("MockTestSectionId") @@ -13375,11 +13629,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("PassageId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - b.Navigation("MockTestSection"); b.Navigation("Passage"); @@ -13629,12 +13878,19 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => { + b.HasOne("RikiPath.Domain.Entities.ContentPassage", "ContentPassage") + .WithMany("PracticeQuestions") + .HasForeignKey("ContentPassageId") + .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") .WithMany("Questions") .HasForeignKey("PracticeExerciseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("ContentPassage"); + b.Navigation("PracticeExercise"); }); @@ -13819,12 +14075,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") .WithMany() .HasForeignKey("SourceProposalId") @@ -13834,8 +14084,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Mentor"); - b.Navigation("Plan"); - b.Navigation("SourceProposal"); }); @@ -13873,6 +14121,32 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Cohort"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") + .WithMany() + .HasForeignKey("AssignedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") + .WithMany() + .HasForeignKey("CohortId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + .WithMany() + .HasForeignKey("MentorId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("AssignedByAdmin"); + + b.Navigation("Cohort"); + + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") @@ -13924,8 +14198,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") .WithMany() .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") .WithMany() @@ -14002,16 +14275,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => { b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") @@ -14157,6 +14420,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => { + b.Navigation("PracticeQuestions"); + b.Navigation("Questions"); }); @@ -14331,6 +14596,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("Attempts"); + b.Navigation("Passages"); + b.Navigation("Questions"); }); diff --git a/RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.cs b/RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.cs new file mode 100644 index 00000000..a5b81683 --- /dev/null +++ b/RikiPath.Infrastructure/Migrations/20261204053500_AddPracticePassagesAndQuestionPoints.cs @@ -0,0 +1,109 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RikiPath.Infrastructure.Migrations +{ + /// + public partial class AddPracticePassagesAndQuestionPoints : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ContentPassageId", + table: "PracticeQuestions", + type: "integer", + nullable: true); + + migrationBuilder.AddColumn( + name: "Points", + table: "PracticeQuestions", + type: "double precision", + nullable: false, + defaultValue: 1.0); + + migrationBuilder.AlterColumn( + name: "PassingScorePercent", + table: "PracticeExercises", + type: "double precision", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision", + oldDefaultValue: 70.0); + + migrationBuilder.AddColumn( + name: "PracticeExerciseId", + table: "ContentPassages", + type: "integer", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_PracticeQuestions_ContentPassageId", + table: "PracticeQuestions", + column: "ContentPassageId"); + + migrationBuilder.CreateIndex( + name: "IX_ContentPassages_PracticeExerciseId", + table: "ContentPassages", + column: "PracticeExerciseId"); + + migrationBuilder.AddForeignKey( + name: "FK_ContentPassages_PracticeExercises_PracticeExerciseId", + table: "ContentPassages", + column: "PracticeExerciseId", + principalTable: "PracticeExercises", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_PracticeQuestions_ContentPassages_ContentPassageId", + table: "PracticeQuestions", + column: "ContentPassageId", + principalTable: "ContentPassages", + principalColumn: "Id", + onDelete: ReferentialAction.SetNull); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ContentPassages_PracticeExercises_PracticeExerciseId", + table: "ContentPassages"); + + migrationBuilder.DropForeignKey( + name: "FK_PracticeQuestions_ContentPassages_ContentPassageId", + table: "PracticeQuestions"); + + migrationBuilder.DropIndex( + name: "IX_PracticeQuestions_ContentPassageId", + table: "PracticeQuestions"); + + migrationBuilder.DropIndex( + name: "IX_ContentPassages_PracticeExerciseId", + table: "ContentPassages"); + + migrationBuilder.DropColumn( + name: "ContentPassageId", + table: "PracticeQuestions"); + + migrationBuilder.DropColumn( + name: "Points", + table: "PracticeQuestions"); + + migrationBuilder.DropColumn( + name: "PracticeExerciseId", + table: "ContentPassages"); + + migrationBuilder.AlterColumn( + name: "PassingScorePercent", + table: "PracticeExercises", + type: "double precision", + nullable: false, + defaultValue: 70.0, + oldClrType: typeof(double), + oldType: "double precision"); + } + } +} diff --git a/RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.Designer.cs b/RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.Designer.cs similarity index 97% rename from RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.Designer.cs rename to RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.Designer.cs index 9c53d4ce..12ef1a11 100644 --- a/RikiPath.Infrastructure/Migrations/20261201045335_AddClassQuizzes.Designer.cs +++ b/RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.Designer.cs @@ -12,8 +12,8 @@ namespace RikiPath.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20261201045335_AddClassQuizzes")] - partial class AddClassQuizzes + [Migration("20261204114325_MakeLessonCertificateLevelOptional")] + partial class MakeLessonCertificateLevelOptional { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -362,6 +362,40 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AiCreditTopUps"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.AiRuntimeConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProtectedSecretsJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("SettingsJson") + .IsRequired() + .HasColumnType("jsonb"); + + b.Property("UpdatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("UpdatedByAdminId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AiRuntimeConfigurations", null, t => + { + t.HasCheckConstraint("CK_AiRuntimeConfiguration_Singleton", "\"Id\" = 1 AND \"Revision\" > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CertificateLevel", b => { b.Property("Id") @@ -2141,12 +2175,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") + b.Property("PracticeExerciseId") .HasColumnType("integer"); - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("SortOrder") .HasColumnType("integer"); @@ -2170,6 +2201,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("PassageIdentity"); + b.HasIndex("PracticeExerciseId"); + b.ToTable("ContentPassages"); }); @@ -5157,7 +5190,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") + b.Property("CertificateLevelId") .HasColumnType("integer") .HasColumnName("CertificationLevelId"); @@ -6729,6 +6762,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlacementAttemptLimit") .HasColumnType("integer"); + b.Property("RemediationAttendanceThresholdPercent") + .ValueGeneratedOnAdd() + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)") + .HasDefaultValue(90m); + b.Property("RemediationCompletionThresholdPercent") .HasPrecision(5, 2) .HasColumnType("numeric(5,2)"); @@ -6750,6 +6789,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("RestMinutes") .HasColumnType("integer"); + b.Property("RetakeSupportEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + b.Property("Revision") .IsConcurrencyToken() .HasColumnType("integer"); @@ -6823,6 +6867,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); + t.HasCheckConstraint("CK_MentorGroupPolicy_RemediationAttendance", "\"RemediationAttendanceThresholdPercent\" > 0 AND \"RemediationAttendanceThresholdPercent\" <= 100"); + t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); @@ -6853,12 +6899,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) MinimumPreparationDays = 1, MinimumPublishedEnrollmentDays = 7, PlacementAttemptLimit = 2, + RemediationAttendanceThresholdPercent = 90m, RemediationCompletionThresholdPercent = 90m, RemediationThresholdComparison = ">", RequireAdminRemediationReview = true, RequireOfficialExamEvidence = true, ReschedulingLeadHours = 24, RestMinutes = 15, + RetakeSupportEnabled = true, Revision = 1, SessionMinutes = 90, TransferAllowedAfterSourceStart = false, @@ -6912,6 +6960,117 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AverageRatingTarget") + .HasPrecision(3, 2) + .HasColumnType("numeric(3,2)"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedByAdminId") + .HasColumnType("integer"); + + b.Property("DeletedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedByAdminId") + .HasColumnType("integer"); + + b.Property("EffectiveFromMonth") + .HasColumnType("date"); + + b.Property("GradingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("HomeworkMinimumCount") + .HasColumnType("integer"); + + b.Property("HomeworkPerSessionCount") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MinimumPresencePercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Note") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("OnTimeResponseTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("PositiveReviewTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("ResponseSlaHours") + .HasColumnType("integer"); + + b.Property("TeachingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedByAdminId"); + + b.HasIndex("EffectiveFromMonth") + .IsUnique() + .HasFilter("\"IsDeleted\" = FALSE"); + + b.HasIndex("Version") + .IsUnique(); + + b.ToTable("MentorKpiPolicies", null, t => + { + t.HasCheckConstraint("CK_MentorKpiPolicy_Homework", "\"HomeworkMinimumCount\" >= 0 AND \"HomeworkPerSessionCount\" > 0"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Month", "EXTRACT(DAY FROM \"EffectiveFromMonth\") = 1"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Percents", "\"MinimumPresencePercent\" > 0 AND \"MinimumPresencePercent\" <= 100 AND \"TeachingCompletionTargetPercent\" > 0 AND \"TeachingCompletionTargetPercent\" <= 100 AND \"GradingCompletionTargetPercent\" > 0 AND \"GradingCompletionTargetPercent\" <= 100 AND \"OnTimeResponseTargetPercent\" > 0 AND \"OnTimeResponseTargetPercent\" <= 100 AND \"PositiveReviewTargetPercent\" > 0 AND \"PositiveReviewTargetPercent\" <= 100"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Rating", "\"AverageRatingTarget\" >= 1 AND \"AverageRatingTarget\" <= 5"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Sla", "\"ResponseSlaHours\" > 0"); + }); + + b.HasData( + new + { + Id = 1, + AverageRatingTarget = 4m, + CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), + EffectiveFromMonth = new DateOnly(2026, 1, 1), + GradingCompletionTargetPercent = 90m, + HomeworkMinimumCount = 1, + HomeworkPerSessionCount = 2, + IsDeleted = false, + MinimumPresencePercent = 80m, + Note = "Phiên bản khởi tạo", + OnTimeResponseTargetPercent = 90m, + PositiveReviewTargetPercent = 80m, + ResponseSlaHours = 24, + TeachingCompletionTargetPercent = 90m, + Version = 1 + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => { b.Property("Id") @@ -7869,6 +8028,65 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AdminId") + .HasColumnType("integer"); + + b.Property("CohortSessionId") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Evidence") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("NewConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("NewStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("PreviousConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("PreviousStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.HasKey("Id"); + + b.HasIndex("MentorId"); + + b.HasIndex("CohortSessionId", "CreatedAtUtc"); + + b.ToTable("MentorTimesheetAdjustments", null, t => + { + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Minutes", "\"NewConfirmedMinutes\" >= 0 AND \"PreviousConfirmedMinutes\" >= 0"); + + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Status", "\"NewStatus\" IN ('Taught', 'Absent')"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { b.Property("Id") @@ -7941,9 +8159,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("ContentFingerprint") .IsRequired() .HasMaxLength(64) @@ -7977,9 +8192,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") - .HasColumnType("integer"); - b.Property("MockTestSectionId") .HasColumnType("integer") .HasColumnName("PracticeTestSectionId"); @@ -8002,12 +8214,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("QuestionGroupTitle") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -8029,19 +8235,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("QuestionVersion") .HasColumnType("integer"); - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SkillMetadataJson") .HasColumnType("jsonb"); b.Property("SortOrder") .HasColumnType("integer"); - b.Property("SourceQuestionId") - .HasColumnType("integer"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8068,18 +8267,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentFingerprint"); - b.HasIndex("LanguageSkillId"); - b.HasIndex("PassageId"); b.HasIndex("QuestionIdentity"); - b.HasIndex("SourceQuestionId"); - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - b.ToTable("MockQuestions"); }); @@ -8188,16 +8381,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ParentExamId") .HasColumnType("integer"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8886,9 +9069,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("timestamp without time zone"); b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); + .HasColumnType("double precision"); b.Property("Scope") .IsRequired() @@ -8989,6 +9170,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("ContentPassageId") + .HasColumnType("integer"); + b.Property("CreatedBy") .HasColumnType("uuid"); @@ -9010,6 +9194,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ModifiedDate") .HasColumnType("timestamp without time zone"); + b.Property("Points") + .ValueGeneratedOnAdd() + .HasColumnType("double precision") + .HasDefaultValue(1.0); + b.Property("PracticeExerciseId") .HasColumnType("integer"); @@ -9022,6 +9211,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("ContentPassageId"); + b.HasIndex("PracticeExerciseId"); b.ToTable("PracticeQuestions"); @@ -9885,6 +10076,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("GroupPolicyId") .HasColumnType("integer"); + b.Property("Level") + .IsRequired() + .HasMaxLength(12) + .HasColumnType("character varying(12)"); + b.Property("MentorId") .HasColumnType("integer"); @@ -9893,9 +10089,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("character varying(200)"); - b.Property("PlanId") - .HasColumnType("integer"); - b.Property("PolicyVersionSnapshot") .HasColumnType("integer"); @@ -9933,8 +10126,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("MentorId"); - b.HasIndex("PlanId"); - b.HasIndex("SourceProposalId") .IsUnique() .HasFilter("\"SourceProposalId\" IS NOT NULL"); @@ -10022,6 +10213,81 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssignedByAdminId") + .HasColumnType("integer"); + + b.Property("AssignmentReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("ChangeReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("CohortId") + .HasColumnType("integer"); + + b.Property("CohortRevisionAtInvite") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeclineReason") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("FromSessionNumber") + .HasColumnType("integer"); + + b.Property("IdempotencyKey") + .HasColumnType("uuid"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("RespondedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("Status") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(24) + .HasColumnType("character varying(24)"); + + b.HasKey("Id"); + + b.HasIndex("AssignedByAdminId"); + + b.HasIndex("CohortId") + .IsUnique() + .HasFilter("\"Status\" = 'Pending'"); + + b.HasIndex("IdempotencyKey") + .IsUnique(); + + b.HasIndex("MentorId", "Status"); + + b.ToTable("StudyCohortMentorInvitations", null, t => + { + t.HasCheckConstraint("CK_CohortMentorInvitation_ChangeReason", "\"Status\" <> 'ChangeRequested' OR length(btrim(coalesce(\"ChangeReason\", ''))) > 0"); + + t.HasCheckConstraint("CK_CohortMentorInvitation_DeclineReason", "\"Status\" <> 'Declined' OR length(btrim(coalesce(\"DeclineReason\", ''))) > 0"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.Property("Id") @@ -10149,7 +10415,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("text"); - b.Property("PlanId") + b.Property("PlanId") .HasColumnType("integer"); b.Property("PlanRevision") @@ -10725,9 +10991,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("CreatedBy") .HasColumnType("uuid"); @@ -10740,10 +11003,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - b.Property("ModifiedBy") .HasColumnType("uuid"); @@ -10753,10 +11012,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SortOrder") .HasColumnType("integer"); - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - b.Property("Title") .IsRequired() .HasMaxLength(300) @@ -10764,8 +11019,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CertificateLevelId", "SortOrder"); - b.ToTable("Topics"); }); @@ -12085,7 +12338,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("MockTestSectionId") .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") + .WithMany("Passages") + .HasForeignKey("PracticeExerciseId") + .OnDelete(DeleteBehavior.Cascade); + b.Navigation("MockTestSection"); + + b.Navigation("PracticeExercise"); }); modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => @@ -12473,8 +12733,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") .WithMany("Lessons") .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") .WithMany("Lessons") @@ -13042,6 +13301,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("MentorUser"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") + .WithMany() + .HasForeignKey("CreatedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedByAdmin"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => { b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") @@ -13325,31 +13594,30 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("VerifiedByAdmin"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + b.HasOne("RikiPath.Domain.Entities.StudyCohortSession", "CohortSession") .WithMany() - .HasForeignKey("MentorId") + .HasForeignKey("CohortSessionId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.Navigation("Mentor"); + b.Navigation("CohortSession"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") .WithMany() - .HasForeignKey("CertificateLevelId") + .HasForeignKey("MentorId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + { b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") .WithMany("Questions") .HasForeignKey("MockTestSectionId") @@ -13360,11 +13628,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("PassageId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - b.Navigation("MockTestSection"); b.Navigation("Passage"); @@ -13614,12 +13877,19 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => { + b.HasOne("RikiPath.Domain.Entities.ContentPassage", "ContentPassage") + .WithMany("PracticeQuestions") + .HasForeignKey("ContentPassageId") + .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") .WithMany("Questions") .HasForeignKey("PracticeExerciseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("ContentPassage"); + b.Navigation("PracticeExercise"); }); @@ -13804,12 +14074,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") - .WithMany() - .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.MentorTeachingProposal", "SourceProposal") .WithMany() .HasForeignKey("SourceProposalId") @@ -13819,8 +14083,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Mentor"); - b.Navigation("Plan"); - b.Navigation("SourceProposal"); }); @@ -13858,6 +14120,32 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Cohort"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortMentorInvitation", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "AssignedByAdmin") + .WithMany() + .HasForeignKey("AssignedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") + .WithMany() + .HasForeignKey("CohortId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + .WithMany() + .HasForeignKey("MentorId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("AssignedByAdmin"); + + b.Navigation("Cohort"); + + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.StudyCohortSession", b => { b.HasOne("RikiPath.Domain.Entities.MentorAvailability", "Availability") @@ -13909,8 +14197,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.StudyCoursePlan", "Plan") .WithMany() .HasForeignKey("PlanId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.StudyCourse", "RetakeOf") .WithMany() @@ -13987,16 +14274,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => { b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") @@ -14142,6 +14419,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => { + b.Navigation("PracticeQuestions"); + b.Navigation("Questions"); }); @@ -14316,6 +14595,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("Attempts"); + b.Navigation("Passages"); + b.Navigation("Questions"); }); diff --git a/RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.cs b/RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.cs new file mode 100644 index 00000000..c9743698 --- /dev/null +++ b/RikiPath.Infrastructure/Migrations/20261204114325_MakeLessonCertificateLevelOptional.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RikiPath.Infrastructure.Migrations +{ + /// + public partial class MakeLessonCertificateLevelOptional : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "CertificationLevelId", + table: "Lessons", + type: "integer", + nullable: true, + oldClrType: typeof(int), + oldType: "integer"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("DO $$ BEGIN IF EXISTS (SELECT 1 FROM \"Lessons\" WHERE \"CertificationLevelId\" IS NULL) THEN RAISE EXCEPTION 'Cannot make Lessons.CertificationLevelId required while level-less lessons exist'; END IF; END $$;"); + + migrationBuilder.AlterColumn( + name: "CertificationLevelId", + table: "Lessons", + type: "integer", + nullable: false, + oldClrType: typeof(int), + oldType: "integer", + oldNullable: true); + } + } +} diff --git a/RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.Designer.cs b/RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.Designer.cs similarity index 97% rename from RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.Designer.cs rename to RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.Designer.cs index 1d4f4555..8712ec04 100644 --- a/RikiPath.Infrastructure/Migrations/20261201143534_AddAdminAiRuntimeConfiguration.Designer.cs +++ b/RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.Designer.cs @@ -12,8 +12,8 @@ namespace RikiPath.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20261201143534_AddAdminAiRuntimeConfiguration")] - partial class AddAdminAiRuntimeConfiguration + [Migration("20261204115909_MakeLessonLanguageSkillOptional")] + partial class MakeLessonLanguageSkillOptional { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -847,6 +847,129 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.ClassQuiz", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CertificateLevelId") + .HasColumnType("integer"); + + b.Property("CohortId") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DueAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("PublishedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("QuestionCount") + .HasColumnType("integer"); + + b.Property("QuestionSnapshotJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("Revision") + .IsConcurrencyToken() + .HasColumnType("integer"); + + b.Property("SkillCodes") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("StructureKey") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("TimeLimitMinutes") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.HasKey("Id"); + + b.HasIndex("CertificateLevelId"); + + b.HasIndex("MentorId"); + + b.HasIndex("CohortId", "IsDeleted", "DueAtUtc"); + + b.ToTable("ClassQuizzes", null, t => + { + t.HasCheckConstraint("CK_ClassQuiz_QuestionCount", "\"QuestionCount\" BETWEEN 1 AND 200"); + + t.HasCheckConstraint("CK_ClassQuiz_Status", "\"Status\" IN ('Published','Cancelled')"); + + t.HasCheckConstraint("CK_ClassQuiz_TimeLimit", "\"TimeLimitMinutes\" BETWEEN 1 AND 240"); + }); + }); + + modelBuilder.Entity("RikiPath.Domain.Entities.ClassQuizAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssignedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("AttemptId") + .HasColumnType("integer"); + + b.Property("CompletedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("EnrollmentId") + .HasColumnType("integer"); + + b.Property("LearnerId") + .HasColumnType("integer"); + + b.Property("QuizId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("AttemptId") + .IsUnique() + .HasFilter("\"AttemptId\" IS NOT NULL"); + + b.HasIndex("EnrollmentId"); + + b.HasIndex("LearnerId", "EnrollmentId"); + + b.HasIndex("QuizId", "LearnerId") + .IsUnique(); + + b.ToTable("ClassQuizAssignments", (string)null); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => { b.Property("Id") @@ -2052,12 +2175,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") + b.Property("PracticeExerciseId") .HasColumnType("integer"); - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("SortOrder") .HasColumnType("integer"); @@ -2081,6 +2201,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("PassageIdentity"); + b.HasIndex("PracticeExerciseId"); + b.ToTable("ContentPassages"); }); @@ -5068,7 +5190,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") + b.Property("CertificateLevelId") .HasColumnType("integer") .HasColumnName("CertificationLevelId"); @@ -5092,7 +5214,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") + b.Property("LanguageSkillId") .HasColumnType("integer") .HasColumnName("SkillId"); @@ -6640,6 +6762,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlacementAttemptLimit") .HasColumnType("integer"); + b.Property("RemediationAttendanceThresholdPercent") + .ValueGeneratedOnAdd() + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)") + .HasDefaultValue(90m); + b.Property("RemediationCompletionThresholdPercent") .HasPrecision(5, 2) .HasColumnType("numeric(5,2)"); @@ -6661,6 +6789,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("RestMinutes") .HasColumnType("integer"); + b.Property("RetakeSupportEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + b.Property("Revision") .IsConcurrencyToken() .HasColumnType("integer"); @@ -6734,6 +6867,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) t.HasCheckConstraint("CK_MentorGroupPolicy_Remediation", "\"RemediationCompletionThresholdPercent\" > 0 AND \"RemediationCompletionThresholdPercent\" <= 100"); + t.HasCheckConstraint("CK_MentorGroupPolicy_RemediationAttendance", "\"RemediationAttendanceThresholdPercent\" > 0 AND \"RemediationAttendanceThresholdPercent\" <= 100"); + t.HasCheckConstraint("CK_MentorGroupPolicy_ReplacementLead", "\"MentorReplacementLeadHours\" BETWEEN 0 AND 720"); t.HasCheckConstraint("CK_MentorGroupPolicy_State", "\"Revision\" > 0 AND NOT (\"IsActive\" AND (\"IsArchivedRevision\" OR \"IsDeleted\"))"); @@ -6764,12 +6899,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) MinimumPreparationDays = 1, MinimumPublishedEnrollmentDays = 7, PlacementAttemptLimit = 2, + RemediationAttendanceThresholdPercent = 90m, RemediationCompletionThresholdPercent = 90m, RemediationThresholdComparison = ">", RequireAdminRemediationReview = true, RequireOfficialExamEvidence = true, ReschedulingLeadHours = 24, RestMinutes = 15, + RetakeSupportEnabled = true, Revision = 1, SessionMinutes = 90, TransferAllowedAfterSourceStart = false, @@ -6823,6 +6960,117 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AverageRatingTarget") + .HasPrecision(3, 2) + .HasColumnType("numeric(3,2)"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedByAdminId") + .HasColumnType("integer"); + + b.Property("DeletedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedByAdminId") + .HasColumnType("integer"); + + b.Property("EffectiveFromMonth") + .HasColumnType("date"); + + b.Property("GradingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("HomeworkMinimumCount") + .HasColumnType("integer"); + + b.Property("HomeworkPerSessionCount") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MinimumPresencePercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Note") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("OnTimeResponseTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("PositiveReviewTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("ResponseSlaHours") + .HasColumnType("integer"); + + b.Property("TeachingCompletionTargetPercent") + .HasPrecision(5, 2) + .HasColumnType("numeric(5,2)"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CreatedByAdminId"); + + b.HasIndex("EffectiveFromMonth") + .IsUnique() + .HasFilter("\"IsDeleted\" = FALSE"); + + b.HasIndex("Version") + .IsUnique(); + + b.ToTable("MentorKpiPolicies", null, t => + { + t.HasCheckConstraint("CK_MentorKpiPolicy_Homework", "\"HomeworkMinimumCount\" >= 0 AND \"HomeworkPerSessionCount\" > 0"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Month", "EXTRACT(DAY FROM \"EffectiveFromMonth\") = 1"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Percents", "\"MinimumPresencePercent\" > 0 AND \"MinimumPresencePercent\" <= 100 AND \"TeachingCompletionTargetPercent\" > 0 AND \"TeachingCompletionTargetPercent\" <= 100 AND \"GradingCompletionTargetPercent\" > 0 AND \"GradingCompletionTargetPercent\" <= 100 AND \"OnTimeResponseTargetPercent\" > 0 AND \"OnTimeResponseTargetPercent\" <= 100 AND \"PositiveReviewTargetPercent\" > 0 AND \"PositiveReviewTargetPercent\" <= 100"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Rating", "\"AverageRatingTarget\" >= 1 AND \"AverageRatingTarget\" <= 5"); + + t.HasCheckConstraint("CK_MentorKpiPolicy_Sla", "\"ResponseSlaHours\" > 0"); + }); + + b.HasData( + new + { + Id = 1, + AverageRatingTarget = 4m, + CreatedAtUtc = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), + EffectiveFromMonth = new DateOnly(2026, 1, 1), + GradingCompletionTargetPercent = 90m, + HomeworkMinimumCount = 1, + HomeworkPerSessionCount = 2, + IsDeleted = false, + MinimumPresencePercent = 80m, + Note = "Phiên bản khởi tạo", + OnTimeResponseTargetPercent = 90m, + PositiveReviewTargetPercent = 80m, + ResponseSlaHours = 24, + TeachingCompletionTargetPercent = 90m, + Version = 1 + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorOutboxEvent", b => { b.Property("Id") @@ -7780,6 +8028,65 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AdminId") + .HasColumnType("integer"); + + b.Property("CohortSessionId") + .HasColumnType("integer"); + + b.Property("CreatedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Evidence") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("MentorId") + .HasColumnType("integer"); + + b.Property("NewConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("NewStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("PreviousConfirmedMinutes") + .HasColumnType("integer"); + + b.Property("PreviousStatus") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.HasKey("Id"); + + b.HasIndex("MentorId"); + + b.HasIndex("CohortSessionId", "CreatedAtUtc"); + + b.ToTable("MentorTimesheetAdjustments", null, t => + { + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Minutes", "\"NewConfirmedMinutes\" >= 0 AND \"PreviousConfirmedMinutes\" >= 0"); + + t.HasCheckConstraint("CK_MentorTimesheetAdjustment_Status", "\"NewStatus\" IN ('Taught', 'Absent')"); + }); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { b.Property("Id") @@ -7852,9 +8159,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("ContentFingerprint") .IsRequired() .HasMaxLength(64) @@ -7888,9 +8192,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") - .HasColumnType("integer"); - b.Property("MockTestSectionId") .HasColumnType("integer") .HasColumnName("PracticeTestSectionId"); @@ -7913,12 +8214,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - b.Property("QuestionGroupTitle") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -7940,19 +8235,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("QuestionVersion") .HasColumnType("integer"); - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SkillMetadataJson") .HasColumnType("jsonb"); b.Property("SortOrder") .HasColumnType("integer"); - b.Property("SourceQuestionId") - .HasColumnType("integer"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -7979,18 +8267,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentFingerprint"); - b.HasIndex("LanguageSkillId"); - b.HasIndex("PassageId"); b.HasIndex("QuestionIdentity"); - b.HasIndex("SourceQuestionId"); - b.HasIndex("MockTestSectionId", "IsArchivedVersion"); - b.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion"); - b.ToTable("MockQuestions"); }); @@ -8099,16 +8381,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ParentExamId") .HasColumnType("integer"); - b.Property("PublishStatus") - .HasColumnType("integer"); - - b.Property("PublishedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RightsStatus") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - b.Property("SourceReference") .HasMaxLength(300) .HasColumnType("character varying(300)"); @@ -8797,9 +9069,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("timestamp without time zone"); b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); + .HasColumnType("double precision"); b.Property("Scope") .IsRequired() @@ -8900,6 +9170,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("ContentPassageId") + .HasColumnType("integer"); + b.Property("CreatedBy") .HasColumnType("uuid"); @@ -8921,6 +9194,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("ModifiedDate") .HasColumnType("timestamp without time zone"); + b.Property("Points") + .ValueGeneratedOnAdd() + .HasColumnType("double precision") + .HasDefaultValue(1.0); + b.Property("PracticeExerciseId") .HasColumnType("integer"); @@ -8933,6 +9211,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("ContentPassageId"); + b.HasIndex("PracticeExerciseId"); b.ToTable("PracticeQuestions"); @@ -10711,9 +10991,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("CreatedBy") .HasColumnType("uuid"); @@ -10726,10 +11003,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - b.Property("ModifiedBy") .HasColumnType("uuid"); @@ -10739,10 +11012,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SortOrder") .HasColumnType("integer"); - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - b.Property("Title") .IsRequired() .HasMaxLength(300) @@ -10750,8 +11019,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CertificateLevelId", "SortOrder"); - b.ToTable("Topics"); }); @@ -11680,6 +11947,67 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.ClassQuiz", b => + { + b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") + .WithMany() + .HasForeignKey("CertificateLevelId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") + .WithMany() + .HasForeignKey("CohortId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + .WithMany() + .HasForeignKey("MentorId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CertificateLevel"); + + b.Navigation("Cohort"); + + b.Navigation("Mentor"); + }); + + modelBuilder.Entity("RikiPath.Domain.Entities.ClassQuizAssignment", b => + { + b.HasOne("RikiPath.Domain.Entities.MockTestAttempt", "Attempt") + .WithMany() + .HasForeignKey("AttemptId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("RikiPath.Domain.Entities.StudyCourse", "Enrollment") + .WithMany() + .HasForeignKey("EnrollmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Learner") + .WithMany() + .HasForeignKey("LearnerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("RikiPath.Domain.Entities.ClassQuiz", "Quiz") + .WithMany("Assignments") + .HasForeignKey("QuizId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Attempt"); + + b.Navigation("Enrollment"); + + b.Navigation("Learner"); + + b.Navigation("Quiz"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => { b.HasOne("RikiPath.Domain.Entities.StudyCohort", "Cohort") @@ -12010,7 +12338,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("MockTestSectionId") .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") + .WithMany("Passages") + .HasForeignKey("PracticeExerciseId") + .OnDelete(DeleteBehavior.Cascade); + b.Navigation("MockTestSection"); + + b.Navigation("PracticeExercise"); }); modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => @@ -12398,14 +12733,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") .WithMany("Lessons") .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") .WithMany("Lessons") .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") .WithMany() @@ -12967,6 +13300,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("MentorUser"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorKpiPolicy", b => + { + b.HasOne("RikiPath.Domain.Entities.UserAccount", "CreatedByAdmin") + .WithMany() + .HasForeignKey("CreatedByAdminId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedByAdmin"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MentorPayoutAttempt", b => { b.HasOne("RikiPath.Domain.Entities.UserAccount", "ConfirmedByAdmin") @@ -13250,31 +13593,30 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("VerifiedByAdmin"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorTimesheetAdjustment", b => { - b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") + b.HasOne("RikiPath.Domain.Entities.StudyCohortSession", "CohortSession") .WithMany() - .HasForeignKey("MentorId") + .HasForeignKey("CohortSessionId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.Navigation("Mentor"); + b.Navigation("CohortSession"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + modelBuilder.Entity("RikiPath.Domain.Entities.MentorWeeklyAvailability", b => { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", null) + b.HasOne("RikiPath.Domain.Entities.UserAccount", "Mentor") .WithMany() - .HasForeignKey("CertificateLevelId") + .HasForeignKey("MentorId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.HasOne("RikiPath.Domain.Entities.LanguageSkill", null) - .WithMany() - .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + b.Navigation("Mentor"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.MockQuestion", b => + { b.HasOne("RikiPath.Domain.Entities.MockTestSection", "MockTestSection") .WithMany("Questions") .HasForeignKey("MockTestSectionId") @@ -13285,11 +13627,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("PassageId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("RikiPath.Domain.Entities.MockQuestion", null) - .WithMany() - .HasForeignKey("SourceQuestionId") - .OnDelete(DeleteBehavior.SetNull); - b.Navigation("MockTestSection"); b.Navigation("Passage"); @@ -13539,12 +13876,19 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => { + b.HasOne("RikiPath.Domain.Entities.ContentPassage", "ContentPassage") + .WithMany("PracticeQuestions") + .HasForeignKey("ContentPassageId") + .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") .WithMany("Questions") .HasForeignKey("PracticeExerciseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("ContentPassage"); + b.Navigation("PracticeExercise"); }); @@ -13929,16 +14273,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => { b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") @@ -14062,6 +14396,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Levels"); }); + modelBuilder.Entity("RikiPath.Domain.Entities.ClassQuiz", b => + { + b.Navigation("Assignments"); + }); + modelBuilder.Entity("RikiPath.Domain.Entities.CohortComplaint", b => { b.Navigation("History"); @@ -14079,6 +14418,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => { + b.Navigation("PracticeQuestions"); + b.Navigation("Questions"); }); @@ -14253,6 +14594,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("Attempts"); + b.Navigation("Passages"); + b.Navigation("Questions"); }); diff --git a/RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.cs b/RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.cs new file mode 100644 index 00000000..56b4fb41 --- /dev/null +++ b/RikiPath.Infrastructure/Migrations/20261204115909_MakeLessonLanguageSkillOptional.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RikiPath.Infrastructure.Migrations +{ + /// + public partial class MakeLessonLanguageSkillOptional : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "SkillId", + table: "Lessons", + type: "integer", + nullable: true, + oldClrType: typeof(int), + oldType: "integer"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("DO $$ BEGIN IF EXISTS (SELECT 1 FROM \"Lessons\" WHERE \"SkillId\" IS NULL) THEN RAISE EXCEPTION 'Cannot make Lessons.SkillId required while skill-less lessons exist'; END IF; END $$;"); + + migrationBuilder.AlterColumn( + name: "SkillId", + table: "Lessons", + type: "integer", + nullable: false, + oldClrType: typeof(int), + oldType: "integer", + oldNullable: true); + } + } +} diff --git a/RikiPath.Infrastructure/Migrations/AppDbContextModelSnapshot.cs b/RikiPath.Infrastructure/Migrations/AppDbContextModelSnapshot.cs index 53e59390..d1cdbe01 100644 --- a/RikiPath.Infrastructure/Migrations/AppDbContextModelSnapshot.cs +++ b/RikiPath.Infrastructure/Migrations/AppDbContextModelSnapshot.cs @@ -2172,6 +2172,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PlaybackPolicyJson") .HasColumnType("jsonb"); + b.Property("PracticeExerciseId") + .HasColumnType("integer"); + b.Property("SortOrder") .HasColumnType("integer"); @@ -2195,6 +2198,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PassageIdentity"); + b.HasIndex("PracticeExerciseId"); + b.ToTable("ContentPassages"); }); @@ -5182,7 +5187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("AudioUrl") .HasColumnType("text"); - b.Property("CertificateLevelId") + b.Property("CertificateLevelId") .HasColumnType("integer") .HasColumnName("CertificationLevelId"); @@ -5206,7 +5211,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LanguageSkillId") + b.Property("LanguageSkillId") .HasColumnType("integer") .HasColumnName("SkillId"); @@ -9061,9 +9066,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("timestamp without time zone"); b.Property("PassingScorePercent") - .ValueGeneratedOnAdd() - .HasColumnType("double precision") - .HasDefaultValue(70.0); + .HasColumnType("double precision"); b.Property("Scope") .IsRequired() @@ -9164,6 +9167,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("ContentPassageId") + .HasColumnType("integer"); + b.Property("CreatedBy") .HasColumnType("uuid"); @@ -9185,6 +9191,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ModifiedDate") .HasColumnType("timestamp without time zone"); + b.Property("Points") + .ValueGeneratedOnAdd() + .HasColumnType("double precision") + .HasDefaultValue(1.0); + b.Property("PracticeExerciseId") .HasColumnType("integer"); @@ -9197,6 +9208,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("ContentPassageId"); + b.HasIndex("PracticeExerciseId"); b.ToTable("PracticeQuestions"); @@ -10975,9 +10988,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CertificateLevelId") - .HasColumnType("integer"); - b.Property("CreatedBy") .HasColumnType("uuid"); @@ -10990,10 +11000,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("IsDeleted") .HasColumnType("boolean"); - b.Property("LearningObjectives") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - b.Property("ModifiedBy") .HasColumnType("uuid"); @@ -11003,10 +11009,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("SortOrder") .HasColumnType("integer"); - b.Property("StageCode") - .HasMaxLength(60) - .HasColumnType("character varying(60)"); - b.Property("Title") .IsRequired() .HasMaxLength(300) @@ -11014,8 +11016,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CertificateLevelId", "SortOrder"); - b.ToTable("Topics"); }); @@ -12335,7 +12335,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasForeignKey("MockTestSectionId") .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") + .WithMany("Passages") + .HasForeignKey("PracticeExerciseId") + .OnDelete(DeleteBehavior.Cascade); + b.Navigation("MockTestSection"); + + b.Navigation("PracticeExercise"); }); modelBuilder.Entity("RikiPath.Domain.Entities.CourseAuditEntry", b => @@ -12723,14 +12730,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") .WithMany("Lessons") .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.LanguageSkill", "LanguageSkill") .WithMany("Lessons") .HasForeignKey("LanguageSkillId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("RikiPath.Domain.Entities.Lesson", "PrerequisiteLesson") .WithMany() @@ -13868,12 +13873,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.PracticeQuestion", b => { + b.HasOne("RikiPath.Domain.Entities.ContentPassage", "ContentPassage") + .WithMany("PracticeQuestions") + .HasForeignKey("ContentPassageId") + .OnDelete(DeleteBehavior.SetNull); + b.HasOne("RikiPath.Domain.Entities.PracticeExercise", "PracticeExercise") .WithMany("Questions") .HasForeignKey("PracticeExerciseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("ContentPassage"); + b.Navigation("PracticeExercise"); }); @@ -14258,16 +14270,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("CertificateLevel"); }); - modelBuilder.Entity("RikiPath.Domain.Entities.Topic", b => - { - b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "CertificateLevel") - .WithMany() - .HasForeignKey("CertificateLevelId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("CertificateLevel"); - }); - modelBuilder.Entity("RikiPath.Domain.Entities.UserAccount", b => { b.HasOne("RikiPath.Domain.Entities.CertificateLevel", "AssessedCertificateLevel") @@ -14413,6 +14415,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("RikiPath.Domain.Entities.ContentPassage", b => { + b.Navigation("PracticeQuestions"); + b.Navigation("Questions"); }); @@ -14587,6 +14591,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Navigation("Attempts"); + b.Navigation("Passages"); + b.Navigation("Questions"); }); diff --git a/RikiPath.Infrastructure/OpenAiRegistration.cs b/RikiPath.Infrastructure/OpenAiRegistration.cs index 15d9f5ab..5fd5860f 100644 --- a/RikiPath.Infrastructure/OpenAiRegistration.cs +++ b/RikiPath.Infrastructure/OpenAiRegistration.cs @@ -31,6 +31,7 @@ public static IServiceCollection AddOpenAiFeatures(this IServiceCollection servi services.AddHttpClient(http => http.Timeout = Timeout.InfiniteTimeSpan); services.AddScoped(); services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/RikiPath.Infrastructure/Repositories/LessonRepository.cs b/RikiPath.Infrastructure/Repositories/LessonRepository.cs index 917a9ff7..6561a353 100644 --- a/RikiPath.Infrastructure/Repositories/LessonRepository.cs +++ b/RikiPath.Infrastructure/Repositories/LessonRepository.cs @@ -44,15 +44,14 @@ public async Task> GetAssessmentRoadmapLe CancellationToken cancellationToken = default) { return await LearnerVisibleLessons() - .Where(lesson => lesson.CertificateLevelId == certificateLevelId) - .OrderBy(lesson => lesson.Topic != null ? lesson.Topic.SortOrder : int.MaxValue) - .ThenBy(lesson => lesson.SortOrder) + .Where(lesson => lesson.CertificateLevelId == certificateLevelId && lesson.LanguageSkillId.HasValue) + .OrderBy(lesson => lesson.SortOrder) .ThenBy(lesson => lesson.Id) .Select(lesson => new AssessmentRoadmapLesson( lesson.Id, lesson.Title, - lesson.LanguageSkillId, - lesson.LanguageSkill.Name, + lesson.LanguageSkillId!.Value, + lesson.LanguageSkill!.Name, lesson.LessonProgresses! .Where(progress => progress.UserId == userId && !progress.IsDeleted) .OrderByDescending(progress => progress.IsCompleted) @@ -66,12 +65,12 @@ public async Task> GetAssessmentRoadmapLe lesson.EstimatedMinutes, lesson.TopicId, lesson.Topic != null && !lesson.Topic.IsDeleted ? lesson.Topic.Title : null, - lesson.Topic != null && !lesson.Topic.IsDeleted ? lesson.Topic.SortOrder : null, - lesson.Topic != null && !lesson.Topic.IsDeleted ? lesson.Topic.StageCode : null, - lesson.Topic != null && !lesson.Topic.IsDeleted ? lesson.Topic.LearningObjectives : null, + null, + null, + null, lesson.PrerequisiteLessonId, lesson.LearningObjectives, - lesson.LanguageSkill.Code)) + lesson.LanguageSkill!.Code)) .ToListAsync(cancellationToken); } @@ -93,6 +92,45 @@ public async Task> GetLearnerVisibleByIdsAsync( .ToListAsync(cancellationToken); } + public async Task<(int Total, IReadOnlyList Items)> SearchLearnerTopicsAsync( + string query, int page, int pageSize, CancellationToken cancellationToken = default) + { + var visible = LearnerVisibleLessons() + .Where(lesson => lesson.TopicId != null && !lesson.Topic!.IsDeleted); + if (!string.IsNullOrWhiteSpace(query)) + { + var term = query.Trim().ToLower(); + visible = visible.Where(lesson => + lesson.Topic!.Title.ToLower().Contains(term) + || (lesson.Topic.Description != null && lesson.Topic.Description.ToLower().Contains(term))); + } + + var topics = visible + .GroupBy(lesson => new { lesson.TopicId, lesson.Topic!.Title, lesson.Topic.Description }) + .Select(group => new LearnerTopicSummary( + group.Key.TopicId!.Value, group.Key.Title, group.Key.Description, group.Count())); + var total = await topics.CountAsync(cancellationToken); + var items = await topics.OrderBy(item => item.Title).ThenBy(item => item.Id) + .Skip((page - 1) * pageSize).Take(pageSize).ToListAsync(cancellationToken); + return (total, items); + } + + public async Task<(int Total, IReadOnlyList Items)> GetLearnerVisibleByTopicAsync( + int topicId, int userId, int page, int pageSize, CancellationToken cancellationToken = default) + { + var visible = LearnerVisibleLessons() + .Where(lesson => lesson.TopicId == topicId && !lesson.Topic!.IsDeleted); + var total = await visible.CountAsync(cancellationToken); + var items = await LearnerVisibleWithBankLinks() + .Where(lesson => lesson.TopicId == topicId && !lesson.Topic!.IsDeleted) + .Include(lesson => lesson.LessonProgresses! + .Where(progress => progress.UserId == userId && !progress.IsDeleted)) + .OrderBy(lesson => lesson.SortOrder).ThenBy(lesson => lesson.Id) + .Skip((page - 1) * pageSize).Take(pageSize) + .ToListAsync(cancellationToken); + return (total, items); + } + private IQueryable LearnerVisibleWithBankLinks() => LearnerVisibleLessons() .Include(lesson => lesson.CertificateLevel) .ThenInclude(level => level.CertificateType) @@ -112,11 +150,12 @@ private IQueryable LearnerVisibleLessons() => _context.Lessons.AsNoTracking().Where(lesson => !lesson.IsDeleted && lesson.Status == ContentStatus.Published - && !lesson.CertificateLevel.IsDeleted - && !lesson.CertificateLevel.CertificateType.IsDeleted - && lesson.CertificateLevel.CertificateType.IsActive - && lesson.CertificateLevel.CertificateType.Name == "JLPT" - && !lesson.LanguageSkill.IsDeleted); + && (lesson.CertificateLevelId == null || + (!lesson.CertificateLevel!.IsDeleted + && !lesson.CertificateLevel.CertificateType.IsDeleted + && lesson.CertificateLevel.CertificateType.IsActive + && lesson.CertificateLevel.CertificateType.Name == "JLPT")) + && (lesson.LanguageSkillId == null || !lesson.LanguageSkill!.IsDeleted)); public async Task<(int Total, int Completed)> GetCompletionStatsAsync(int userId) { @@ -138,7 +177,7 @@ public async Task> GetByCertificateLevelAsync(int certific && !lesson.CertificateLevel.CertificateType.IsDeleted && lesson.CertificateLevel.CertificateType.IsActive && lesson.CertificateLevel.CertificateType.Name == "JLPT" - && !lesson.LanguageSkill.IsDeleted) + && (lesson.LanguageSkillId == null || !lesson.LanguageSkill!.IsDeleted)) .Include(x => x.Topic) .Include(x => x.LessonKanjis!.Where(link => !link.Kanji.IsDeleted && link.Kanji.Status == ContentStatus.Published)) @@ -165,7 +204,7 @@ public async Task> GetByCertificateLevelAsync(int certific && !lesson.CertificateLevel.CertificateType.IsDeleted && lesson.CertificateLevel.CertificateType.IsActive && lesson.CertificateLevel.CertificateType.Name == "JLPT" - && !lesson.LanguageSkill.IsDeleted); + && (lesson.LanguageSkillId == null || !lesson.LanguageSkill!.IsDeleted)); var total = await visible.CountAsync(cancellationToken); if (zeroBasedPosition < 0 || zeroBasedPosition >= total) diff --git a/RikiPath.Infrastructure/Repositories/PracticeExerciseRepository.cs b/RikiPath.Infrastructure/Repositories/PracticeExerciseRepository.cs index f91db6cb..34f28744 100644 --- a/RikiPath.Infrastructure/Repositories/PracticeExerciseRepository.cs +++ b/RikiPath.Infrastructure/Repositories/PracticeExerciseRepository.cs @@ -6,5 +6,7 @@ public class PracticeExerciseRepository(AppDbContext context) : GenericRepositor { public Task GetWithQuestionsAndOptionsAsync(int id, CancellationToken cancellationToken = default) => context.PracticeExercises.Include(x => x.Questions).ThenInclude(x => x!.Options) + .Include(x => x.Questions).ThenInclude(x => x!.ContentPassage) + .Include(x => x.Passages) .FirstOrDefaultAsync(x => x.Id == id, cancellationToken); } diff --git a/RikiPath.Infrastructure/Services/AiRuntimeConfigurationService.cs b/RikiPath.Infrastructure/Services/AiRuntimeConfigurationService.cs index 9b0d3d4d..6c0f0033 100644 --- a/RikiPath.Infrastructure/Services/AiRuntimeConfigurationService.cs +++ b/RikiPath.Infrastructure/Services/AiRuntimeConfigurationService.cs @@ -221,7 +221,7 @@ private static bool Valid(AiRuntimeSettings settings, AdminAiConfigurationReques || !ValidUrl(settings.Gemini.BaseUrl, "generativelanguage.googleapis.com", "/v1beta/models/", prefix: true)) error = "URL provider AI phải là endpoint HTTPS chính thức."; else if (new[] { settings.OpenAi.LearningPathModel, settings.OpenAi.ContentModel, - settings.OpenAi.ReviewModel, settings.OpenAi.GradingModel, settings.OpenAi.OcrModel, + settings.OpenAi.ReviewModel, settings.OpenAi.GradingModel, settings.OpenAi.SpeakingAudioModel, settings.OpenAi.OcrModel, settings.OpenAi.TranscriptionModel, settings.OpenRouter.Model } .Any(x => string.IsNullOrWhiteSpace(x) || x.Length > 150 || x.Any(char.IsControl))) error = "Tên model AI phải có từ 1 đến 150 ký tự."; diff --git a/RikiPath.WebApi/Controllers/AdminLearningContentController.cs b/RikiPath.WebApi/Controllers/AdminLearningContentController.cs new file mode 100644 index 00000000..e165a2ee --- /dev/null +++ b/RikiPath.WebApi/Controllers/AdminLearningContentController.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using RikiPath.Application.Services; +using RikiPath.Domain.Enums; + +namespace RikiPath.WebApi.Controllers; + +[ApiController] +[Authorize(Roles = "Admin")] +[Route("api/admin/learning-content")] +public sealed class AdminLearningContentController(AdminLearningContentService service) : ControllerBase +{ + [HttpGet] + public async Task List( + [FromQuery] string entityType = "Lesson", [FromQuery] string? search = null, + [FromQuery] int? certificateLevelId = null, [FromQuery] ContentStatus? status = null, + [FromQuery] int page = 1, [FromQuery] int pageSize = 20, + CancellationToken ct = default) + { + var response = await service.ListAsync(entityType, search, certificateLevelId, status, page, pageSize, ct); + return StatusCode(response.StatusCode, response); + } + + [HttpGet("{entityType}/{id:int}")] + public async Task Detail(string entityType, int id, CancellationToken ct) + { + var response = await service.GetDetailAsync(entityType, id, ct); + return StatusCode(response.StatusCode, response); + } +} diff --git a/RikiPath.WebApi/Controllers/AdminLevelPreparationZipController.cs b/RikiPath.WebApi/Controllers/AdminLevelPreparationZipController.cs new file mode 100644 index 00000000..d7433570 --- /dev/null +++ b/RikiPath.WebApi/Controllers/AdminLevelPreparationZipController.cs @@ -0,0 +1,42 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using RikiPath.Application.IServices; +using RikiPath.Application.Responses; + +namespace RikiPath.WebApi.Controllers; + +[ApiController] +[Authorize(Roles = "Admin")] +[Route("api/admin/level-preparation-zips")] +public sealed class AdminLevelPreparationZipController(ICohortPreparationZipService service) : ControllerBase +{ + [HttpGet] + public async Task List(CancellationToken ct) + { + var result = await service.ListLevelsAsync(ct); + return StatusCode((int)result.StatusCode, result); + } + + [HttpGet("{level}")] + public async Task Get(string level, CancellationToken ct) + { + var result = await service.GetLevelAsync(level, ct); + return StatusCode((int)result.StatusCode, result); + } + + [HttpPut("{level}")] + [Consumes("multipart/form-data")] + [RequestSizeLimit(27 * 1024 * 1024)] + public async Task Upload(string level, IFormFile? file, CancellationToken ct) + { + if (file is null || !Path.GetExtension(file.FileName).Equals(".zip", StringComparison.OrdinalIgnoreCase) + || file.Length is <= 0 or > RikiPath.Application.Services.CohortPreparationZipService.MaxZipBytes) + return BadRequest(ApiResponse.Fail("Chọn tệp ZIP hợp lệ, dung lượng tối đa 25 MB.")); + await using var input = file.OpenReadStream(); + await using var buffer = new MemoryStream(); + await input.CopyToAsync(buffer, ct); + buffer.Position = 0; + var result = await service.UploadLevelAsync(level, buffer, ct); + return StatusCode((int)result.StatusCode, result); + } +} diff --git a/RikiPath.WebApi/Controllers/AdminOperationsController.cs b/RikiPath.WebApi/Controllers/AdminOperationsController.cs index 680d24f2..4d33ca55 100644 --- a/RikiPath.WebApi/Controllers/AdminOperationsController.cs +++ b/RikiPath.WebApi/Controllers/AdminOperationsController.cs @@ -18,6 +18,7 @@ namespace RikiPath.WebApi.Controllers; [Authorize(Roles = "Admin")] public class AdminOperationsController(IUnitOfWork uow, IClaimService claimService) : ControllerBase { + private const string DefaultStaffPassword = "12345678"; /// Lấy danh sách tài khoản, có thể lọc theo role và tùy chọn bao gồm tài khoản đã vô hiệu hóa. [HttpGet("users")] public async Task GetUsers( @@ -49,17 +50,14 @@ public async Task GetUser(int id, CancellationToken ct) return user is null ? NotFound(new { errorMessage = "Không tìm thấy người dùng." }) : Ok(UserDto(user)); } - /// Tạo tài khoản người dùng và tạo password hash/salt. - /// Không cho phép tạo thêm tài khoản Admin vì hệ thống chỉ có một Admin. + /// Tạo tài khoản Giáo viên hoặc Content Author với mật khẩu mặc định. [HttpPost("users")] public async Task CreateUser([FromBody] AdminCreateUserRequest r, CancellationToken ct) { - if (!ModelState.IsValid || string.IsNullOrWhiteSpace(r.Email) || string.IsNullOrWhiteSpace(r.Password) || r.Password.Length < 6) - return BadRequest(new { errorMessage = "Email và mật khẩu (ít nhất 6 ký tự) là bắt buộc." }); - if (!Enum.IsDefined(r.Role)) - return BadRequest(new { error = "Vai trò không hợp lệ.", errorMessage = "Vai trò không hợp lệ." }); - if (r.Role == Role.Admin) - return BadRequest(new { error = "Không thể tạo thêm tài khoản Quản trị viên.", errorMessage = "Không thể tạo thêm tài khoản Quản trị viên." }); + if (!ModelState.IsValid || string.IsNullOrWhiteSpace(r.Email)) + return BadRequest(new { errorMessage = "Email hợp lệ là bắt buộc." }); + if (r.Role is not (Role.Mentor or Role.ContentAuthor)) + return BadRequest(new { error = "Chỉ được tạo tài khoản Giáo viên hoặc Content Author.", errorMessage = "Chỉ được tạo tài khoản Giáo viên hoặc Content Author." }); var email = r.Email.Trim().ToLowerInvariant(); if (await uow.UserAccounts.AnyAsync(x => x.Email != null && x.Email.ToLower() == email, ct)) @@ -73,12 +71,12 @@ public async Task CreateUser([FromBody] AdminCreateUserRequest r, { Email = email, PasswordSalt = hmac.Key, - PasswordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(r.Password)), + PasswordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(DefaultStaffPassword)), FirstName = firstName, LastName = lastName, PhoneNumber = r.PhoneNumber?.Trim(), Role = r.Role, - IsEmailVerified = r.IsEmailVerified, + IsEmailVerified = true, CreatedDate = now, }; @@ -272,12 +270,10 @@ public sealed class AdminCreateUserRequest { [System.ComponentModel.DataAnnotations.Required, System.ComponentModel.DataAnnotations.EmailAddress] public string Email { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; [System.ComponentModel.DataAnnotations.MaxLength(200)] public string? FullName { get; set; } public string? PhoneNumber { get; set; } public Role Role { get; set; } = Role.Learner; - public bool IsEmailVerified { get; set; } } public sealed class AdminUpdateUserRequest diff --git a/RikiPath.WebApi/Controllers/ContentImportController.cs b/RikiPath.WebApi/Controllers/ContentImportController.cs index 4f4fd9f8..671d8900 100644 --- a/RikiPath.WebApi/Controllers/ContentImportController.cs +++ b/RikiPath.WebApi/Controllers/ContentImportController.cs @@ -29,7 +29,8 @@ public class ContentImportController(IExcelContentImportService importService, I [Consumes("multipart/form-data")] [RequestSizeLimit(260L * 1024 * 1024)] [RequestFormLimits(MultipartBodyLengthLimit = 260L * 1024 * 1024)] - public async Task PrepareZipExcel(IFormFile? file, CancellationToken ct) + public async Task PrepareZipExcel(IFormFile? file, + [FromQuery] double? passingScorePercent, [FromQuery] double? questionPoints, CancellationToken ct) { if (zipExcel is null) return StatusCode(503, ApiResponse.Fail("Dịch vụ nhập ZIP chưa sẵn sàng.")); @@ -39,7 +40,8 @@ public async Task PrepareZipExcel(IFormFile? file, CancellationTo try { await using var stream = file.OpenReadStream(); - var result = await zipExcel.PrepareAsync(stream, GetCurrentUserId() ?? 0, ct); + var result = await zipExcel.PrepareAsync(stream, GetCurrentUserId() ?? 0, ct, + passingScorePercent, questionPoints); return Ok(ApiResponse.Success(result)); } catch (InvalidDataException ex) { return BadRequest(ApiResponse.Fail(ex.Message)); } diff --git a/RikiPath.WebApi/Controllers/LessonProgressController.cs b/RikiPath.WebApi/Controllers/LessonProgressController.cs index e7f60a86..8ef87a82 100644 --- a/RikiPath.WebApi/Controllers/LessonProgressController.cs +++ b/RikiPath.WebApi/Controllers/LessonProgressController.cs @@ -13,6 +13,28 @@ namespace RikiPath.WebApi.Controllers [Authorize(Roles = "Learner")] public class LessonProgressController(ILessonProgressService lessonProgressService) : ControllerBase { + /// Tìm chủ đề có bài học đã công bố để luyện nói hoặc viết, không cần chọn cấp JLPT. + [HttpGet("topics")] + [RequireFeature(FeatureCodes.LessonsContent)] + [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] + public async Task SearchTopics( + [FromQuery] string? query, [FromQuery] int page = 1, CancellationToken cancellationToken = default) + { + var result = await lessonProgressService.SearchTopicsAsync(query, page, cancellationToken); + return StatusCode((int)result.StatusCode, result); + } + + /// Lấy bài học và Kanji, ngữ pháp, từ vựng thuộc chủ đề. + [HttpGet("topics/{topicId:int}/lessons")] + [RequireFeature(FeatureCodes.LessonsContent)] + [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] + public async Task GetTopicLessons( + int topicId, [FromQuery] int page = 1, CancellationToken cancellationToken = default) + { + var result = await lessonProgressService.GetTopicLessonsAsync(topicId, page, cancellationToken); + return StatusCode((int)result.StatusCode, result); + } + /// /// Lấy danh sách bài học khả dụng và tiến độ của Learner theo cấp độ JLPT. /// diff --git a/RikiPath.WebApi/Controllers/SpeechController.cs b/RikiPath.WebApi/Controllers/SpeechController.cs index 3a0a596d..e5b2df04 100644 --- a/RikiPath.WebApi/Controllers/SpeechController.cs +++ b/RikiPath.WebApi/Controllers/SpeechController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using RikiPath.Application.Exceptions; using RikiPath.Application.IServices; +using RikiPath.Application.IClients; using RikiPath.Application.Requests.Practice; using RikiPath.Domain.Enums; @@ -13,7 +14,9 @@ namespace RikiPath.WebApi.Controllers; [ApiController] [Authorize] public class SpeechController(ISpeechToTextService speechService, SubscriptionAccessService subscriptions, - IPracticeSubmissionService practice) : ControllerBase + IPracticeSubmissionService practice, IAzurePronunciationAssessmentClient azurePronunciation, + ISpeakingAudioFeedbackClient audioFeedbackClient, IClaimService claims, + ILogger logger) : ControllerBase { /// Issues a temporary Azure token for compatible streaming clients. [HttpGet("get-token")] @@ -51,31 +54,56 @@ public async Task Transcribe(IFormFile audioFile, CancellationTok [Authorize(Roles = "Learner,Mentor")] [RequestSizeLimit(27 * 1024 * 1024)] public async Task Grade(IFormFile audioFile, [FromForm] int certificateLevelId, - [FromForm] string? topic, CancellationToken cancellationToken) + [FromForm] string? topic, [FromForm] string? referenceText, CancellationToken cancellationToken) { if (certificateLevelId <= 0) return BadRequest(new { message = "Vui lòng chọn cấp độ JLPT." }); + if (referenceText?.Length > 500) + return BadRequest(new { message = "Câu mẫu tối đa 500 ký tự." }); try { var result = await subscriptions.UseAiAsync("speaking", async () => { - var audio = await speechService.ConvertAndSaveAudioAsync(audioFile, cancellationToken); + PronunciationAssessmentResult? assessment = null; + SpeakingAudioFeedback? audioFeedback = null; + if (!string.IsNullOrWhiteSpace(referenceText)) + { + await using var recording = audioFile.OpenReadStream(); + assessment = await azurePronunciation.AssessAsync(recording, referenceText, cancellationToken); + try + { + await using var recordingForAi = audioFile.OpenReadStream(); + audioFeedback = await audioFeedbackClient.AnalyzeAsync(claims.GetUserClaim().Id, + recordingForAi, referenceText, assessment.Transcript, assessment, cancellationToken); + } + catch (Exception ex) when (ex is AiQuotaExceededException or AiServiceException or HttpRequestException) + { + logger.LogWarning(ex, "Audio coaching unavailable; Azure assessment will still be saved."); + } + } + var audio = assessment is null + ? await speechService.ConvertAndSaveAudioAsync(audioFile, cancellationToken) + : new RikiPath.Application.Responses.SpeechToText.RecordedSpeechResult( + assessment.Transcript, await speechService.SaveAudioAsync(audioFile, cancellationToken)); return await practice.SubmitAsync(new SubmitPracticeRequest { Type = SubmissionType.Speaking, CertificateLevelId = certificateLevelId, TextContent = audio.Transcript, AudioUrl = audio.AudioUrl, - Topic = topic, + Topic = referenceText ?? topic, + PronunciationAssessment = assessment, + SpeakingAudioFeedback = audioFeedback, }, cancellationToken); }, cancellationToken, value => value?.Grading is not null); return StatusCode(result.StatusCode, result); } catch (ArgumentException ex) { return BadRequest(new { message = ex.Message }); } + catch (InvalidDataException) { return UnprocessableEntity(new { message = "Azure Speech không nhận dạng được câu đọc. Vui lòng thu âm lại." }); } catch (AiQuotaExceededException ex) { return StatusCode(429, new { message = ex.Message }); } catch (AiServiceException ex) { return StatusCode(502, new { message = ex.Message }); } - catch (InvalidOperationException) { return StatusCode(503, new { message = "Dịch vụ audio AWS chưa sẵn sàng. Kiểm tra cấu hình AwsAudio." }); } + catch (InvalidOperationException) { return StatusCode(503, new { message = "Azure Speech hoặc dịch vụ lưu audio chưa sẵn sàng." }); } catch (Amazon.Runtime.AmazonServiceException) { return StatusCode(502, new { message = "Không thể lưu hoặc nhận dạng audio trên AWS. Kiểm tra quyền S3 và Transcribe." }); } catch (HttpRequestException) { return StatusCode(502, new { message = "Không thể kết nối dịch vụ chấm bài." }); } } diff --git a/RikiPath.WebApi/Program.cs b/RikiPath.WebApi/Program.cs index c402ba9a..bb55a4c9 100644 --- a/RikiPath.WebApi/Program.cs +++ b/RikiPath.WebApi/Program.cs @@ -183,6 +183,7 @@ private static void Main(string[] args) // 3. Infrastructure & Helpers builder.Services.AddHttpContextAccessor(); builder.Services.AddHttpClient(); + builder.Services.AddScoped(); builder.Services.AddHttpClient(); var calendarProtection = builder.Services.AddDataProtection().SetApplicationName("RikiPath.MentorCalendar"); var calendarKeysPath = builder.Configuration["GoogleCalendar:DataProtectionKeysPath"] @@ -352,6 +353,7 @@ static bool ImplementsInterface(Type type, Type iface) builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/RikiPath.WebApi/Services/ZipExcelImportService.cs b/RikiPath.WebApi/Services/ZipExcelImportService.cs index 886fb762..a9a98758 100644 --- a/RikiPath.WebApi/Services/ZipExcelImportService.cs +++ b/RikiPath.WebApi/Services/ZipExcelImportService.cs @@ -13,8 +13,10 @@ namespace RikiPath.WebApi.Services; public sealed record ZipExcelMediaResult(string ArchivePath, string Url, string Kind, string? TranscriptStatus, string? Transcript, string? TranscriptError); +public sealed record ZipExcelSourceWorkbook(string FileName, string WorkbookBase64); + public sealed record PreparedZipExcelImport(string WorkbookFileName, string WorkbookBase64, string TranscriptToken, - IReadOnlyList Media); + IReadOnlyList Media, IReadOnlyList Workbooks); public sealed record ZipExcelTranscriptRequest(string WorkbookBase64, string TranscriptToken); @@ -40,9 +42,14 @@ private sealed record TranscriptTicket(int UserId, DateTime ExpiresAtUtc, string List Media); private sealed record MediaCell(IXLWorksheet Sheet, int Row, int Column, ArchiveMedia Asset); - public async Task PrepareAsync(Stream input, int userId, CancellationToken ct) + public async Task PrepareAsync(Stream input, int userId, CancellationToken ct, + double? passingScorePercent = null, double? questionPoints = null) { if (userId <= 0) throw new InvalidDataException("Không xác định được tài khoản nhập nội dung."); + if (passingScorePercent.HasValue && (!double.IsFinite(passingScorePercent.Value) || passingScorePercent is <= 0 or > 100)) + throw new InvalidDataException("PassingScorePercent phải từ 1 đến 100."); + if (questionPoints.HasValue && (!double.IsFinite(questionPoints.Value) || questionPoints <= 0)) + throw new InvalidDataException("Points của câu hỏi phải lớn hơn 0."); await using var buffer = new MemoryStream(); await CopyLimitedAsync(input, buffer, MaxZipBytes, ct); buffer.Position = 0; @@ -54,8 +61,7 @@ public async Task PrepareAsync(Stream input, int userId, throw new InvalidDataException($"Gói ZIP có quá nhiều tệp (tối đa {MaxEntries})."); var media = new List(); - byte[]? workbookBytes = null; - string? workbookName = null; + var workbookFiles = new List<(string Path, string Name, byte[] Bytes)>(); long total = 0; var paths = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (var entry in archive.Entries) @@ -72,8 +78,8 @@ public async Task PrepareAsync(Stream input, int userId, var ext = Path.GetExtension(entry.Name).ToLowerInvariant(); if (ext is not (".xlsx" or ".mp3" or ".jpg" or ".jpeg" or ".png" or ".webp" or ".gif")) continue; - if (ext == ".xlsx" && (workbookBytes is not null || entry.Length > MaxWorkbookBytes)) - throw new InvalidDataException("ZIP chỉ được chứa một file Excel .xlsx tối đa 20 MB."); + if (ext == ".xlsx" && entry.Length > MaxWorkbookBytes) + throw new InvalidDataException($"Excel {path} vượt quá 20 MB."); if (ext is ".jpg" or ".jpeg" or ".png" or ".webp" or ".gif" && entry.Length > ImportImageFiles.MaxImageBytes) throw new InvalidDataException($"Ảnh {path} vượt quá 10 MB."); await using var content = new MemoryStream(); @@ -82,8 +88,7 @@ public async Task PrepareAsync(Stream input, int userId, var bytes = content.ToArray(); if (ext == ".xlsx") { - workbookBytes = bytes; - workbookName = entry.Name; + workbookFiles.Add((path, entry.Name, bytes)); continue; } if (ext == ".mp3") @@ -99,22 +104,19 @@ public async Task PrepareAsync(Stream input, int userId, media.Add(new ArchiveMedia(path, entry.Name, "image", type, bytes)); } } - if (workbookBytes is null || workbookName is null) - throw new InvalidDataException("Gói ZIP cần đúng một file Excel .xlsx."); + if (workbookFiles.Count == 0) + throw new InvalidDataException("Gói ZIP cần ít nhất một file Excel .xlsx."); - using var workbookStream = new MemoryStream(workbookBytes, writable: false); - XLWorkbook workbook; - try { workbook = new XLWorkbook(workbookStream); } - catch (Exception ex) when (ex is not OperationCanceledException) + var workbooks = new List<(string Name, XLWorkbook Book)>(); + try { - throw new InvalidDataException("File Excel .xlsx trong ZIP không đọc được.", ex); - } - using (workbook) + foreach (var file in workbookFiles) { - if (!workbook.Worksheets.Any()) throw new InvalidDataException("Excel trong ZIP không có sheet dữ liệu."); - if (!handlers.Any(handler => ExcelSheetReader.FindSheet(workbook, handler.SheetName) is not null)) - throw new InvalidDataException("Excel trong ZIP không có sheet nội dung được hỗ trợ."); - var cells = FindMediaCells(workbook, media); + try { workbooks.Add((file.Path, new XLWorkbook(new MemoryStream(file.Bytes, writable: false)))); } + catch (Exception ex) when (ex is not OperationCanceledException) + { throw new InvalidDataException($"Excel {file.Path} trong ZIP không đọc được.", ex); } + } + var cells = workbooks.SelectMany(source => FindMediaCells(source.Book, media)).ToList(); var stored = new List(); try { @@ -137,14 +139,27 @@ public async Task PrepareAsync(Stream input, int userId, ?? throw new InvalidOperationException("Không thể xếp hàng nhận dạng MP3 trong ZIP."); stored[stored.FindIndex(candidate => candidate.Path == item.Path)] = item with { Status = transcription.Status }; } + var sourceWorkbooks = new List(); + foreach (var source in workbooks) + { + await using var sourceOutput = new MemoryStream(); + source.Book.SaveAs(sourceOutput); + sourceWorkbooks.Add(new ZipExcelSourceWorkbook(source.Name, + Convert.ToBase64String(sourceOutput.ToArray()))); + } + using var importWorkbook = ZipExcelWorkbookNormalizer.Combine(workbooks, handlers, + passingScorePercent, questionPoints); await using var output = new MemoryStream(); - workbook.SaveAs(output); + importWorkbook.SaveAs(output); + if (output.Length > MaxWorkbookBytes * 2) + throw new InvalidDataException("Excel tổng hợp từ ZIP vượt quá 40 MB."); var resultBytes = output.ToArray(); var ticket = new TranscriptTicket(userId, DateTime.UtcNow.AddHours(2), Hash(resultBytes), stored); - return new PreparedZipExcelImport(workbookName, Convert.ToBase64String(resultBytes), + return new PreparedZipExcelImport(workbookFiles.Count == 1 ? workbookFiles[0].Name : "Noi-dung-ZIP.xlsx", + Convert.ToBase64String(resultBytes), protector.Protect(JsonSerializer.Serialize(ticket)), stored.Select(item => new ZipExcelMediaResult(item.Path, item.Url, item.Kind, - item.Status, null, null)).ToList()); + item.Status, null, null)).ToList(), sourceWorkbooks); } catch { @@ -158,6 +173,10 @@ public async Task PrepareAsync(Stream input, int userId, throw; } } + finally + { + foreach (var source in workbooks) source.Book.Dispose(); + } } public async Task CompleteTranscriptsAsync( diff --git a/_codex-verify/Debug/net8.0/AWSSDK.Core.dll b/_codex-verify/Debug/net8.0/AWSSDK.Core.dll new file mode 100644 index 00000000..36df7147 Binary files /dev/null and b/_codex-verify/Debug/net8.0/AWSSDK.Core.dll differ diff --git a/_codex-verify/Debug/net8.0/AWSSDK.S3.dll b/_codex-verify/Debug/net8.0/AWSSDK.S3.dll new file mode 100644 index 00000000..331b40d8 Binary files /dev/null and b/_codex-verify/Debug/net8.0/AWSSDK.S3.dll differ diff --git a/_codex-verify/Debug/net8.0/AWSSDK.TranscribeService.dll b/_codex-verify/Debug/net8.0/AWSSDK.TranscribeService.dll new file mode 100644 index 00000000..916eb605 Binary files /dev/null and b/_codex-verify/Debug/net8.0/AWSSDK.TranscribeService.dll differ diff --git a/_codex-verify/Debug/net8.0/ClosedXML.Parser.dll b/_codex-verify/Debug/net8.0/ClosedXML.Parser.dll new file mode 100644 index 00000000..1613f298 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ClosedXML.Parser.dll differ diff --git a/_codex-verify/Debug/net8.0/ClosedXML.dll b/_codex-verify/Debug/net8.0/ClosedXML.dll new file mode 100644 index 00000000..221ea4c7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ClosedXML.dll differ diff --git a/_codex-verify/Debug/net8.0/Dapper.dll b/_codex-verify/Debug/net8.0/Dapper.dll new file mode 100644 index 00000000..c8a0de4b Binary files /dev/null and b/_codex-verify/Debug/net8.0/Dapper.dll differ diff --git a/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.Framework.dll b/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.Framework.dll new file mode 100644 index 00000000..5556e87e Binary files /dev/null and b/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.Framework.dll differ diff --git a/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.dll b/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.dll new file mode 100644 index 00000000..05bafaf6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/DocumentFormat.OpenXml.dll differ diff --git a/_codex-verify/Debug/net8.0/EntityFramework.SqlServer.dll b/_codex-verify/Debug/net8.0/EntityFramework.SqlServer.dll new file mode 100644 index 00000000..be131c09 Binary files /dev/null and b/_codex-verify/Debug/net8.0/EntityFramework.SqlServer.dll differ diff --git a/_codex-verify/Debug/net8.0/EntityFramework.dll b/_codex-verify/Debug/net8.0/EntityFramework.dll new file mode 100644 index 00000000..e077a0fd Binary files /dev/null and b/_codex-verify/Debug/net8.0/EntityFramework.dll differ diff --git a/_codex-verify/Debug/net8.0/ExcelNumberFormat.dll b/_codex-verify/Debug/net8.0/ExcelNumberFormat.dll new file mode 100644 index 00000000..aaf7bf8d Binary files /dev/null and b/_codex-verify/Debug/net8.0/ExcelNumberFormat.dll differ diff --git a/_codex-verify/Debug/net8.0/FirebaseAdmin.dll b/_codex-verify/Debug/net8.0/FirebaseAdmin.dll new file mode 100644 index 00000000..74d0637d Binary files /dev/null and b/_codex-verify/Debug/net8.0/FirebaseAdmin.dll differ diff --git a/_codex-verify/Debug/net8.0/FluentValidation.AspNetCore.dll b/_codex-verify/Debug/net8.0/FluentValidation.AspNetCore.dll new file mode 100644 index 00000000..91b4e0b9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/FluentValidation.AspNetCore.dll differ diff --git a/_codex-verify/Debug/net8.0/FluentValidation.DependencyInjectionExtensions.dll b/_codex-verify/Debug/net8.0/FluentValidation.DependencyInjectionExtensions.dll new file mode 100644 index 00000000..3f94755d Binary files /dev/null and b/_codex-verify/Debug/net8.0/FluentValidation.DependencyInjectionExtensions.dll differ diff --git a/_codex-verify/Debug/net8.0/FluentValidation.dll b/_codex-verify/Debug/net8.0/FluentValidation.dll new file mode 100644 index 00000000..99eb3310 Binary files /dev/null and b/_codex-verify/Debug/net8.0/FluentValidation.dll differ diff --git a/_codex-verify/Debug/net8.0/Google.Api.Gax.Rest.dll b/_codex-verify/Debug/net8.0/Google.Api.Gax.Rest.dll new file mode 100644 index 00000000..ef07284c Binary files /dev/null and b/_codex-verify/Debug/net8.0/Google.Api.Gax.Rest.dll differ diff --git a/_codex-verify/Debug/net8.0/Google.Api.Gax.dll b/_codex-verify/Debug/net8.0/Google.Api.Gax.dll new file mode 100644 index 00000000..042b506a Binary files /dev/null and b/_codex-verify/Debug/net8.0/Google.Api.Gax.dll differ diff --git a/_codex-verify/Debug/net8.0/Google.Apis.Auth.dll b/_codex-verify/Debug/net8.0/Google.Apis.Auth.dll new file mode 100644 index 00000000..ca414c73 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Google.Apis.Auth.dll differ diff --git a/_codex-verify/Debug/net8.0/Google.Apis.Core.dll b/_codex-verify/Debug/net8.0/Google.Apis.Core.dll new file mode 100644 index 00000000..27c83ca6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Google.Apis.Core.dll differ diff --git a/_codex-verify/Debug/net8.0/Google.Apis.dll b/_codex-verify/Debug/net8.0/Google.Apis.dll new file mode 100644 index 00000000..a3b4761a Binary files /dev/null and b/_codex-verify/Debug/net8.0/Google.Apis.dll differ diff --git a/_codex-verify/Debug/net8.0/Hangfire.AspNetCore.dll b/_codex-verify/Debug/net8.0/Hangfire.AspNetCore.dll new file mode 100644 index 00000000..b2996a69 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Hangfire.AspNetCore.dll differ diff --git a/_codex-verify/Debug/net8.0/Hangfire.Core.dll b/_codex-verify/Debug/net8.0/Hangfire.Core.dll new file mode 100644 index 00000000..2fbacfe7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Hangfire.Core.dll differ diff --git a/_codex-verify/Debug/net8.0/Hangfire.NetCore.dll b/_codex-verify/Debug/net8.0/Hangfire.NetCore.dll new file mode 100644 index 00000000..daeba389 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Hangfire.NetCore.dll differ diff --git a/_codex-verify/Debug/net8.0/Hangfire.PostgreSql.dll b/_codex-verify/Debug/net8.0/Hangfire.PostgreSql.dll new file mode 100644 index 00000000..32e554c0 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Hangfire.PostgreSql.dll differ diff --git a/_codex-verify/Debug/net8.0/Hangfire.SqlServer.dll b/_codex-verify/Debug/net8.0/Hangfire.SqlServer.dll new file mode 100644 index 00000000..6e121a80 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Hangfire.SqlServer.dll differ diff --git a/_codex-verify/Debug/net8.0/Humanizer.dll b/_codex-verify/Debug/net8.0/Humanizer.dll new file mode 100644 index 00000000..c9a7ef8a Binary files /dev/null and b/_codex-verify/Debug/net8.0/Humanizer.dll differ diff --git a/_codex-verify/Debug/net8.0/LinqKit.Core.dll b/_codex-verify/Debug/net8.0/LinqKit.Core.dll new file mode 100644 index 00000000..45b74f95 Binary files /dev/null and b/_codex-verify/Debug/net8.0/LinqKit.Core.dll differ diff --git a/_codex-verify/Debug/net8.0/LinqKit.dll b/_codex-verify/Debug/net8.0/LinqKit.dll new file mode 100644 index 00000000..ce857efa Binary files /dev/null and b/_codex-verify/Debug/net8.0/LinqKit.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll b/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll new file mode 100644 index 00000000..6bdacfc9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.OpenApi.dll b/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.OpenApi.dll new file mode 100644 index 00000000..1df70d42 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.AspNetCore.OpenApi.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll b/_codex-verify/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 00000000..fe6ba4c5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll new file mode 100644 index 00000000..dc218f98 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.dll b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.dll new file mode 100644 index 00000000..412e7ed2 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.CSharp.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.Workspaces.dll b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.Workspaces.dll new file mode 100644 index 00000000..8dec4418 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.Workspaces.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.dll b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.dll new file mode 100644 index 00000000..79e9046a Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.CodeAnalysis.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll new file mode 100644 index 00000000..3d366981 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Design.dll b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Design.dll new file mode 100644 index 00000000..5735c28d Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Design.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Relational.dll b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Relational.dll new file mode 100644 index 00000000..8b99c669 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.Relational.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.dll b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.dll new file mode 100644 index 00000000..3df9a94b Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.EntityFrameworkCore.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Extensions.Caching.Memory.dll b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Caching.Memory.dll new file mode 100644 index 00000000..077b1b61 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Caching.Memory.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll b/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll new file mode 100644 index 00000000..02397b96 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll b/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll new file mode 100644 index 00000000..c55e07f7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Extensions.Logging.Abstractions.dll b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Logging.Abstractions.dll new file mode 100644 index 00000000..648ca03a Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Logging.Abstractions.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Extensions.Options.dll b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Options.dll new file mode 100644 index 00000000..a7b3f21f Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Extensions.Options.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Abstractions.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 00000000..f80c56d4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll new file mode 100644 index 00000000..6366297b Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Logging.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Logging.dll new file mode 100644 index 00000000..a581b7d2 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Logging.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll new file mode 100644 index 00000000..fed943a2 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll new file mode 100644 index 00000000..da9cab09 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll new file mode 100644 index 00000000..5e194bcd Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.OpenApi.dll b/_codex-verify/Debug/net8.0/Microsoft.OpenApi.dll new file mode 100644 index 00000000..aac9a6db Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.OpenApi.dll differ diff --git a/_codex-verify/Debug/net8.0/Microsoft.Win32.SystemEvents.dll b/_codex-verify/Debug/net8.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 00000000..3ab58500 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/_codex-verify/Debug/net8.0/MiniExcel.dll b/_codex-verify/Debug/net8.0/MiniExcel.dll new file mode 100644 index 00000000..c0caaf24 Binary files /dev/null and b/_codex-verify/Debug/net8.0/MiniExcel.dll differ diff --git a/_codex-verify/Debug/net8.0/Mono.TextTemplating.dll b/_codex-verify/Debug/net8.0/Mono.TextTemplating.dll new file mode 100644 index 00000000..d5a4b3c4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Mono.TextTemplating.dll differ diff --git a/_codex-verify/Debug/net8.0/Newtonsoft.Json.dll b/_codex-verify/Debug/net8.0/Newtonsoft.Json.dll new file mode 100644 index 00000000..5813d8cf Binary files /dev/null and b/_codex-verify/Debug/net8.0/Newtonsoft.Json.dll differ diff --git a/_codex-verify/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll b/_codex-verify/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll new file mode 100644 index 00000000..042c1f05 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll differ diff --git a/_codex-verify/Debug/net8.0/Npgsql.dll b/_codex-verify/Debug/net8.0/Npgsql.dll new file mode 100644 index 00000000..c0eb4d90 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Npgsql.dll differ diff --git a/_codex-verify/Debug/net8.0/Pgvector.EntityFrameworkCore.dll b/_codex-verify/Debug/net8.0/Pgvector.EntityFrameworkCore.dll new file mode 100644 index 00000000..423d4459 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Pgvector.EntityFrameworkCore.dll differ diff --git a/_codex-verify/Debug/net8.0/Pgvector.dll b/_codex-verify/Debug/net8.0/Pgvector.dll new file mode 100644 index 00000000..9c08d9f6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Pgvector.dll differ diff --git a/_codex-verify/Debug/net8.0/QuestPDF.dll b/_codex-verify/Debug/net8.0/QuestPDF.dll new file mode 100644 index 00000000..74818c4f Binary files /dev/null and b/_codex-verify/Debug/net8.0/QuestPDF.dll differ diff --git a/_codex-verify/Debug/net8.0/RBush.dll b/_codex-verify/Debug/net8.0/RBush.dll new file mode 100644 index 00000000..dad8e8b4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/RBush.dll differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Application.deps.json b/_codex-verify/Debug/net8.0/RikiPath.Application.deps.json new file mode 100644 index 00000000..4ef5b519 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.Application.deps.json @@ -0,0 +1,896 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "RikiPath.Application/1.0.0": { + "dependencies": { + "ClosedXML": "0.104.1", + "FirebaseAdmin": "3.6.0", + "Google.Apis.Auth": "1.73.0", + "Microsoft.EntityFrameworkCore": "8.0.0", + "Microsoft.EntityFrameworkCore.Relational": "8.0.0", + "Microsoft.Extensions.Caching.Memory": "8.0.1", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2", + "Microsoft.IdentityModel.Tokens": "7.7.3", + "PdfPig": "0.1.16", + "QuestPDF": "2026.9.2", + "RikiPath.Domain": "1.0.0", + "SkiaSharp": "3.119.2", + "SkiaSharp.NativeAssets.Linux.NoDependencies": "3.119.2", + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "System.IO.Packaging": "8.0.1", + "System.IdentityModel.Tokens.Jwt": "7.7.3", + "Tesseract": "5.2.0" + }, + "runtime": { + "RikiPath.Application.dll": {} + } + }, + "ClosedXML/0.104.1": { + "dependencies": { + "ClosedXML.Parser": "1.2.0", + "DocumentFormat.OpenXml": "3.0.1", + "ExcelNumberFormat": "1.1.0", + "RBush": "3.2.0", + "SixLabors.Fonts": "1.0.0", + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/netstandard2.1/ClosedXML.dll": { + "assemblyVersion": "0.104.1.0", + "fileVersion": "0.104.1.0" + } + } + }, + "ClosedXML.Parser/1.2.0": { + "runtime": { + "lib/netstandard2.1/ClosedXML.Parser.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "DocumentFormat.OpenXml/3.0.1": { + "dependencies": { + "DocumentFormat.OpenXml.Framework": "3.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "dependencies": { + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.Framework.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "ExcelNumberFormat/1.1.0": { + "runtime": { + "lib/netstandard2.0/ExcelNumberFormat.dll": { + "assemblyVersion": "1.1.0.0", + "fileVersion": "1.1.0.0" + } + } + }, + "FirebaseAdmin/3.6.0": { + "dependencies": { + "Google.Api.Gax.Rest": "4.13.1", + "Google.Apis.Auth": "1.73.0" + }, + "runtime": { + "lib/net6.0/FirebaseAdmin.dll": { + "assemblyVersion": "3.6.0.0", + "fileVersion": "3.6.0.0" + } + } + }, + "Google.Api.Gax/4.13.1": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Newtonsoft.Json": "13.0.4", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Api.Gax.Rest/4.13.1": { + "dependencies": { + "Google.Api.Gax": "4.13.1", + "Google.Apis.Auth": "1.73.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.Rest.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Apis/1.73.0": { + "dependencies": { + "Google.Apis.Core": "1.73.0" + }, + "runtime": { + "lib/net6.0/Google.Apis.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Auth/1.73.0": { + "dependencies": { + "Google.Apis": "1.73.0", + "Google.Apis.Core": "1.73.0", + "System.Management": "7.0.2" + }, + "runtime": { + "lib/net6.0/Google.Apis.Auth.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Core/1.73.0": { + "dependencies": { + "Newtonsoft.Json": "13.0.4" + }, + "runtime": { + "lib/net6.0/Google.Apis.Core.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "runtime": { + "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.EntityFrameworkCore/8.0.0": { + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "8.0.0", + "Microsoft.Extensions.Caching.Memory": "8.0.1" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.0": { + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.0": { + "dependencies": { + "Microsoft.EntityFrameworkCore": "8.0.0" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Caching.Memory.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.Options/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Options.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.224.6711" + } + } + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Newtonsoft.Json/13.0.4": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.4.30916" + } + } + }, + "PdfPig/0.1.16": { + "runtime": { + "lib/net8.0/UglyToad.PdfPig.Core.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Fonts.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Package.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokenization.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokens.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + } + } + }, + "QuestPDF/2026.9.2": { + "runtime": { + "lib/net8.0/QuestPDF.dll": { + "assemblyVersion": "2026.9.2.0", + "fileVersion": "2026.9.2.0" + } + }, + "runtimeTargets": { + "runtimes/linux-arm64/native/libquestpdf_qpdf.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libquestpdf_skia.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_skia.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_skia.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_skia.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_skia.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_qpdf.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_skia.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_qpdf.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_skia.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_qpdf.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_skia.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "RBush/3.2.0": { + "runtime": { + "lib/net6.0/RBush.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.0.0" + } + } + }, + "SixLabors.Fonts/1.0.0": { + "runtime": { + "lib/netcoreapp3.1/SixLabors.Fonts.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "SkiaSharp/3.119.2": { + "dependencies": { + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "SkiaSharp.NativeAssets.macOS": "3.119.2" + }, + "runtime": { + "lib/net8.0/SkiaSharp.dll": { + "assemblyVersion": "3.119.0.0", + "fileVersion": "3.119.2.0" + } + } + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "runtimeTargets": { + "runtimes/linux-arm/native/libSkiaSharp.so": { + "rid": "linux-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libSkiaSharp.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm/native/libSkiaSharp.so": { + "rid": "linux-musl-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm64/native/libSkiaSharp.so": { + "rid": "linux-musl-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-musl-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-riscv64/native/libSkiaSharp.so": { + "rid": "linux-musl-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libSkiaSharp.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-riscv64/native/libSkiaSharp.so": { + "rid": "linux-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libSkiaSharp.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x86/native/libSkiaSharp.so": { + "rid": "linux-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "runtimeTargets": { + "runtimes/osx/native/libSkiaSharp.dylib": { + "rid": "osx", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "runtimeTargets": { + "runtimes/win-arm64/native/libSkiaSharp.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/libSkiaSharp.pdb": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.pdb": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.pdb": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "System.CodeDom/7.0.0": { + "runtime": { + "lib/net7.0/System.CodeDom.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "runtime": { + "lib/net8.0/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "7.7.3", + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "System.IO.Packaging/8.0.1": { + "runtime": { + "lib/net8.0/System.IO.Packaging.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "System.Management/7.0.2": { + "dependencies": { + "System.CodeDom": "7.0.0" + }, + "runtime": { + "lib/net7.0/System.Management.dll": { + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/System.Management.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + } + }, + "Tesseract/5.2.0": { + "runtime": { + "lib/netstandard2.0/Tesseract.dll": { + "assemblyVersion": "5.2.0.0", + "fileVersion": "5.2.0.0" + } + } + }, + "RikiPath.Domain/1.0.0": { + "runtime": { + "RikiPath.Domain.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "RikiPath.Application/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "ClosedXML/0.104.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RVm2fUNWJlBJlg07shrfeWzrHPG5ypI/vARqdUOUbUdaog8yBw8l4IbCHf2MXt0AXtzaZqGNqhFaCAHigCBdfw==", + "path": "closedxml/0.104.1", + "hashPath": "closedxml.0.104.1.nupkg.sha512" + }, + "ClosedXML.Parser/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w+/0tsxABS3lkSH8EUlA7IGme+mq5T/Puf3DbOiTckmSuUpAUO2LK29oXYByCcWkBv6wcRHxgWlQb1lxkwI0Tw==", + "path": "closedxml.parser/1.2.0", + "hashPath": "closedxml.parser.1.2.0.nupkg.sha512" + }, + "DocumentFormat.OpenXml/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DCK1cwFUJ1FGGyYyo++HWl9H1RkqMWIu+FGOLRy6E4L4y0/HIhlJ7N/n1HKboFfOwKn1cMBRxt1RCuDbIEy5YQ==", + "path": "documentformat.openxml/3.0.1", + "hashPath": "documentformat.openxml.3.0.1.nupkg.sha512" + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ifyI7OW7sggz7LQMIAD2aUsY/zVUON9QaHrpZ4MK33iVMeHlTG4uhUE2aLWb31nry+LCs2ALDAwf8OfUJGjgBg==", + "path": "documentformat.openxml.framework/3.0.1", + "hashPath": "documentformat.openxml.framework.3.0.1.nupkg.sha512" + }, + "ExcelNumberFormat/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-R3BVHPs9O+RkExbZYTGT0+9HLbi8ZrNij1Yziyw6znd3J7P3uoIR07uwTLGOogtz1p6+0sna66eBoXu7tBiVQA==", + "path": "excelnumberformat/1.1.0", + "hashPath": "excelnumberformat.1.1.0.nupkg.sha512" + }, + "FirebaseAdmin/3.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aP8UWyQYACDOZqnHN9WB77TS0DlB8kVj8/HB7evUaAhAgPJQ9y4NmISJ3kkYkWBG5va3PHvYN5H+ZDBhABSEFQ==", + "path": "firebaseadmin/3.6.0", + "hashPath": "firebaseadmin.3.6.0.nupkg.sha512" + }, + "Google.Api.Gax/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ujDpZk7O2VqAEIqcSlhH0FKzVpGZWly/qcNjHxpNUrL445Tei9PHnu4V1pwW2WDiMDvo3TpL1Bi4DeU525Afrg==", + "path": "google.api.gax/4.13.1", + "hashPath": "google.api.gax.4.13.1.nupkg.sha512" + }, + "Google.Api.Gax.Rest/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wDfFZXKoHC6sy+Yfub/4cLQOb5ozBVPqDOrxCUAeTfku4d96ILqgzulJSdkPHbiT3oWB3hlYTdJgUwNSJjyo+A==", + "path": "google.api.gax.rest/4.13.1", + "hashPath": "google.api.gax.rest.4.13.1.nupkg.sha512" + }, + "Google.Apis/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TnCjEyV2aCLQ6Zl40OCbEJULDuEkEWc6C/g81KYw5l1PqGo+G7pFZrV+YH8XgUL0JRUanz+IrUp8SsKF4dzkqg==", + "path": "google.apis/1.73.0", + "hashPath": "google.apis.1.73.0.nupkg.sha512" + }, + "Google.Apis.Auth/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wEu12uhnRv3zrPBSqv4E2vPH6lYLtc1RPAnU9MJRCMFlBVwZ7Lnq3NfbYXi6VG7EurkYInTaMpeBZkbM/HrAog==", + "path": "google.apis.auth/1.73.0", + "hashPath": "google.apis.auth.1.73.0.nupkg.sha512" + }, + "Google.Apis.Core/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vSc7CY4KCP7HE4QTElDx/ExnGLbg9kXb89MS6cdvI+0D4sxvTYb16vGtXmF2jSDMV3iDmykSXdIUPTz8TDS6gg==", + "path": "google.apis.core/1.73.0", + "hashPath": "google.apis.core.1.73.0.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "path": "microsoft.bcl.asyncinterfaces/6.0.0", + "hashPath": "microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SoODat83pGQUpWB9xULdMX6tuKpq/RTXDuJ2WeC1ldUKcKzLkaFJD1n+I0nOLY58odez/e7z8b6zdp235G/kyg==", + "path": "microsoft.entityframeworkcore/8.0.0", + "hashPath": "microsoft.entityframeworkcore.8.0.0.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VR22s3+zoqlVI7xauFKn1znSIFHO8xuILT+noSwS8bZCKcHz0ydkTDQMuaxSa5WBaQrZmwtTz9rmRvJ7X8mSPQ==", + "path": "microsoft.entityframeworkcore.abstractions/8.0.0", + "hashPath": "microsoft.entityframeworkcore.abstractions.8.0.0.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fFKkr24cYc7Zw5T6DC4tEyOEPgPbq23BBmym1r9kn4ET9F3HKaetpOeQtV2RryYyUxEeNkJuxgfiZHTisqZc+A==", + "path": "microsoft.entityframeworkcore.relational/8.0.0", + "hashPath": "microsoft.entityframeworkcore.relational.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HFDnhYLccngrzyGgHkjEDU5FMLn4MpOsr5ElgsBMC4yx6lJh4jeWO7fHS8+TXPq+dgxCmUa/Trl8svObmwW4QA==", + "path": "microsoft.extensions.caching.memory/8.0.1", + "hashPath": "microsoft.extensions.caching.memory.8.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9/qymSh7hVDMGTGwrLz8MRp5zRyXy9adGDOs4HwRdnLil3oZGYuWeZjbmHgCQ9BL1qBroVfgUK3U/nb61617Cw==", + "path": "microsoft.extensions.dependencyinjection.abstractions/10.0.12", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+24lC4plfbEDNfLAdTV/SWKS7dW+16X4HdydO3R++134kSNTzcbYA4KpR1Hdh6uWisB8Za3AzwyOn+K+NxWIug==", + "path": "microsoft.extensions.logging.abstractions/10.0.12", + "hashPath": "microsoft.extensions.logging.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.Options/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==", + "path": "microsoft.extensions.options/8.0.2", + "hashPath": "microsoft.extensions.options.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-48quPTCzrglBlNSh5XFeA4Cyd5qm8IY1uqYx9+/0NNGVAv7U19aWieJxgTvmCiUr5il3F1851wDNGWiaUOktVw==", + "path": "microsoft.identitymodel.abstractions/7.7.3", + "hashPath": "microsoft.identitymodel.abstractions.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-URCySdj7XJVVFvKI7XrfMe60pw14kx9HhSw8thBPZvVS2t7q2qosvib2zGjXRdu+xOg33RCdGHoRG7NzbGNPDg==", + "path": "microsoft.identitymodel.jsonwebtokens/7.7.3", + "hashPath": "microsoft.identitymodel.jsonwebtokens.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QCNNrmwqa+fe9GVipM2aSFkS/zeLPXd6G3HahyLv/8477aK6hxm4uxEbS8lgUJVRZE3vwrW/iKxeDYNh99TNDQ==", + "path": "microsoft.identitymodel.logging/7.7.3", + "hashPath": "microsoft.identitymodel.logging.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h8hxpd6MgZbrxcORtinVQ8rvjAw75G9vzucVFm6CI+JBXS2kUer8X7LclYaBS12/DEkHtJiG6pc1v8ybSr9BAg==", + "path": "microsoft.identitymodel.tokens/7.7.3", + "hashPath": "microsoft.identitymodel.tokens.7.7.3.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==", + "path": "newtonsoft.json/13.0.4", + "hashPath": "newtonsoft.json.13.0.4.nupkg.sha512" + }, + "PdfPig/0.1.16": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qQcbsNMYVY+K5ELptax2S8thNMk0+rSQq3H/KdYj3LLcko8yTCz8y5KIvsKxIyAuTN0ZYNnfsZkM+0EvxTwHVA==", + "path": "pdfpig/0.1.16", + "hashPath": "pdfpig.0.1.16.nupkg.sha512" + }, + "QuestPDF/2026.9.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Nc7nvV/CmL/lonuw1mTQbiETfU7EZoM2kZ9YRgdbC5VivVjxsMHPJ18g4t5FMx/jUGh6XpJXFfW1rFWvAYOeTg==", + "path": "questpdf/2026.9.2", + "hashPath": "questpdf.2026.9.2.nupkg.sha512" + }, + "RBush/3.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ijGh9N0zZ7JfXk3oQkWCwK8SwSSByexbyh/MjbCjNxOft9eG5ZqKC1vdgiYq78h4IZRFmN4s3JZ/b10Jipud5w==", + "path": "rbush/3.2.0", + "hashPath": "rbush.3.2.0.nupkg.sha512" + }, + "SixLabors.Fonts/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LFQsCZlV0xlUyXAOMUo5kkSl+8zAQXXbbdwWchtk0B4o7zotZhQsQOcJUELGHdfPfm/xDAsz6hONAuV25bJaAg==", + "path": "sixlabors.fonts/1.0.0", + "hashPath": "sixlabors.fonts.1.0.0.nupkg.sha512" + }, + "SkiaSharp/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nmy2dOFWPvQKMglfpjz8+/xQQcSrL9jzul3cUyzCJVSwrmSAw+6B1sEgU7jt6NZBptwGq2k/V0kjyu2GizMFtg==", + "path": "skiasharp/3.119.2", + "hashPath": "skiasharp.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1rmveKZ8Cz7k4QJQdtKV6RFXYIEqYBiX450Bm0Bk41EE50MMPUyF81cRnASsuV0qCwdZuzjZTaFvoqS0Q2zVfA==", + "path": "skiasharp.nativeassets.linux.nodependencies/3.119.2", + "hashPath": "skiasharp.nativeassets.linux.nodependencies.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I2jMGQ/26KOnc6iAoR+Mxh9vSJJ2vioJyj9aJ9OL5yEZyXothXJxf4vBMqnSaiXMqiiU1scG7KqtT0CLkmMmWA==", + "path": "skiasharp.nativeassets.macos/3.119.2", + "hashPath": "skiasharp.nativeassets.macos.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uYe+da6+GXVgPKkCopzvIZ83DmC8SXXKeUAPrNcztJNsg0SjPQAxfKMOPZqmVjbzznrq/QUIjLUlJSZV/e0IPA==", + "path": "skiasharp.nativeassets.win32/3.119.2", + "hashPath": "skiasharp.nativeassets.win32.3.119.2.nupkg.sha512" + }, + "System.CodeDom/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GLltyqEsE5/3IE+zYRP5sNa1l44qKl9v+bfdMcwg+M9qnQf47wK3H0SUR/T+3N4JEQXF3vV4CSuuo0rsg+nq2A==", + "path": "system.codedom/7.0.0", + "hashPath": "system.codedom.7.0.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CRZTWYO0rzEcJN/6SuN1kMvQOJT7vyHZ64CCkQs0RRWTj7kH2KMkaMalbsbSI/eg5dS5JAQfQFFuuWgn+XRMsQ==", + "path": "system.diagnostics.diagnosticsource/10.0.12", + "hashPath": "system.diagnostics.diagnosticsource.10.0.12.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xqg/Al8bXC7+K54sy9F095rkWGBHQ5aLXaBg0zWEbzDWx442DMP8xCJaSugHpYwOyW9gC0pyq5XWpWYN50IqIA==", + "path": "system.identitymodel.tokens.jwt/7.7.3", + "hashPath": "system.identitymodel.tokens.jwt.7.7.3.nupkg.sha512" + }, + "System.IO.Packaging/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KYkIOAvPexQOLDxPO2g0BVoWInnQhPpkFzRqvNrNrMhVT6kqhVr0zEb6KCHlptLFukxnZrjuMVAnxK7pOGUYrw==", + "path": "system.io.packaging/8.0.1", + "hashPath": "system.io.packaging.8.0.1.nupkg.sha512" + }, + "System.Management/7.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/qEUN91mP/MUQmJnM5y5BdT7ZoPuVrtxnFlbJ8a3kBJGhe2wCzBfnPFtK2wTtEEcf3DMGR9J00GZZfg6HRI6yA==", + "path": "system.management/7.0.2", + "hashPath": "system.management.7.0.2.nupkg.sha512" + }, + "Tesseract/5.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YB7feJlrTWSXtK8+WaCcseGSPK/1r2d2FWeKGyndlrPwYClrzTlCoHD4/oQEUjKafmpkWlhTZZ7pxiRJYZgj6w==", + "path": "tesseract/5.2.0", + "hashPath": "tesseract.5.2.0.nupkg.sha512" + }, + "RikiPath.Domain/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.Application.dll b/_codex-verify/Debug/net8.0/RikiPath.Application.dll new file mode 100644 index 00000000..40d7bdc6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Application.dll differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Application.pdb b/_codex-verify/Debug/net8.0/RikiPath.Application.pdb new file mode 100644 index 00000000..45f8aa0f Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Application.pdb differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Application.xml b/_codex-verify/Debug/net8.0/RikiPath.Application.xml new file mode 100644 index 00000000..20947426 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.Application.xml @@ -0,0 +1,3711 @@ + + + + RikiPath.Application + + + + + Phrase-safe Vietnamese display normalizer for system-generated notifications + (including legacy plain-text notifications already stored in the database). + Preserves user-generated content such as proper names (e.g. "Mentor One"), + class titles, document names, and original feedback text. + + + + + Session lifecycle is shown by the class workspace, calendar and meeting room. + Keep historical rows for audit, but exclude these notices from delivery and the center. + + + + + Dựng bảng so sánh "dữ liệu hiện tại trong DB" với "dữ liệu Content Author đề xuất" cho 1 loại nội dung. + Nạp bản ghi gốc của TẤT CẢ yêu cầu cùng loại bằng 1 truy vấn (tránh N+1). Loại nào chưa có builder riêng + thì handler dùng . + + + + Khóa = ContentApprovalRequest.Id. + + + Đọc DiffSummaryJson (field -> "cũ → mới") do bước import lưu lại. + + + Lấy phần "cũ" của "cũ → mới" (cũng chấp nhận "cũ => mới"). + + + Cùng quy tắc và cùng định dạng chuỗi với ImportHandlerSupport.CompareLesson. + + + + Dự phòng cho loại nội dung chưa có builder riêng: giá trị mới lấy từ PayloadJson, giá trị cũ chỉ lấy được + từ DiffSummaryJson (có cho các trường đã thay đổi). + + + + + Admin xem các yêu cầu Content Author đã gửi (thêm mới / cập nhật) kèm so sánh dữ liệu cũ (DB hiện tại) và dữ liệu đề xuất. + Chỉ ĐỌC, không ghi gì. Giá trị cũ luôn đọc trực tiếp từ DB tại thời điểm xem, nên nếu dữ liệu gốc đã bị sửa từ lúc + Author gửi thì Admin thấy ngay cảnh báo. + + + + + Admin xem các yêu cầu Content Author đã gửi (thêm mới / cập nhật) kèm so sánh dữ liệu cũ (DB hiện tại) và dữ liệu đề xuất. + Chỉ ĐỌC, không ghi gì. Giá trị cũ luôn đọc trực tiếp từ DB tại thời điểm xem, nên nếu dữ liệu gốc đã bị sửa từ lúc + Author gửi thì Admin thấy ngay cảnh báo. + + + + Danh sách yêu cầu (phân trang, mới nhất trước). Mọi bộ lọc đều tùy chọn. + + + Chi tiết 1 yêu cầu: từng trường cũ → mới. Trả null nếu không tồn tại. + + + Toàn bộ yêu cầu của 1 lần import (1 lần bấm Xác nhận), mỗi dòng đã kèm so sánh. Trả null nếu batch trống. + + + Khóa tự nhiên: Title (tên mẫu ngữ pháp). + + + Khóa tự nhiên: Title (tên mẫu ngữ pháp). + + + + Phần dùng chung của các ISheetImportHandler: nạp dữ liệu đã có 1 lần (tránh N+1), kiểm tra "đã có chưa" + (bảng chính + bản nháp đang chờ duyệt), so sánh field, đếm kết quả. + + + + + Lập chỉ mục theo khóa tự nhiên. Khóa nào xuất hiện nhiều lần trong DB thì KHÔNG ném lỗi (ToDictionary sẽ ném) + mà đưa vào tập "ambiguous" để dòng Excel tương ứng báo Error rõ ràng. + + + + Code -> Id của các CertificateLevel chưa xóa; Code trùng ở nhiều level thì vào tập ambiguous. + + + + true = dòng có bản nháp đang chờ duyệt (Draft/PendingReview) bị chặn bằng lỗi, không so sánh với DB. + false = vẫn so sánh đầy đủ với dữ liệu chính trong DB: Chưa có (New) / Cập nhật (Modified) / Đã có (Unchanged). + + + + + RowKey của các bản nháp đang mở (Draft hoặc PendingReview) cùng loại nội dung. + Khi = false trả về tập rỗng (bỏ qua truy vấn) để các handler không còn chặn dòng. + + + + Trim; chuỗi rỗng/chỉ có khoảng trắng -> null. + + + + Thuộc tính cấp "cha" lặp ở nhiều dòng (tiêu đề đề thi, thời gian...): lấy giá trị khác rỗng đầu tiên; + các dòng sau được để trống, nhưng nếu có ghi thì phải trùng - lệch nhau là lỗi (thường do gõ nhầm). + + + + Cột URL tùy chọn: rỗng -> null; có giá trị thì phải là URL media hoặc http/https hợp lệ. + + + + Đọc Option1..4 + số thứ tự đáp án đúng. Cần >= 2 đáp án, không được bỏ trống giữa chừng + (Option3 trống mà Option4 có), và đáp án đúng phải trỏ vào 1 đáp án có nội dung. Lỗi -> thêm vào errors và trả null. + + + + + Đọc giải thích lựa chọn theo cả hai cách đặt tên thường dùng trong workbook: + ExplanationOption1 (template hiện tại) và Option1Explanation (template cũ/tự soạn). + Cột này luôn tùy chọn để file Excel cũ vẫn import được. + + + + Chuỗi đại diện nội dung 1 câu hỏi, để so sánh câu cũ (DB) với câu mới (Excel). + + + Tóm tắt khác biệt giữa các câu hỏi cũ/mới theo số thứ tự câu; null nếu giống hệt. + + + + So khớp bài học Excel ghi với (các) bài mà nội dung ĐANG thuộc về trong DB, để báo cho Content Author + biết nội dung bị chuyển bài. Bài học là duy nhất theo (Title, CertificateLevelId) nên so cả level: + "Bài 1" của N5 và "Bài 1" của N4 là 2 bài khác nhau. + Ví dụ kết quả: "Bài 1 (N5) → Bài 2 (N5)" hoặc "(chưa thuộc bài nào) → Bài 2 (N5)". + + + + Tên sheet "chuẩn" cần tìm trong file - so khớp không phân biệt hoa/thường và khoảng trắng. + + + So khớp từng dòng Excel đã đọc với dữ liệu hiện có trong DB, KHÔNG được ghi gì xuống DB ở đây. + + + Import handler that can resolve lessons declared in another sheet of the same workbook. + + + Khóa tự nhiên: Title + CertificateLevelId (cùng tên bài ở 2 level khác nhau là 2 bài khác nhau). + + + Khóa tự nhiên: Title + CertificateLevelId (cùng tên bài ở 2 level khác nhau là 2 bài khác nhau). + + + Tên hiển thị của phần thi, lấy từ CertificateSection do Admin tạo sẵn (đổi property nếu entity đặt tên khác). + + + Suy tên kỹ năng (khớp LanguageSkill.Name, không phân biệt hoa/thường) từ từ khóa trong tên phần. + + + + Sheet "Practice Exercise" dạng phẳng (mỗi dòng 1 câu hỏi). Hỗ trợ cả 3 tầng: + LessonQuickCheck (gắn Lesson), GroupQuiz (gắn Topic/Stage) và StageAssessment (gắn CertificateLevel). + + + + + Sheet "Practice Exercise" dạng phẳng (mỗi dòng 1 câu hỏi). Hỗ trợ cả 3 tầng: + LessonQuickCheck (gắn Lesson), GroupQuiz (gắn Topic/Stage) và StageAssessment (gắn CertificateLevel). + + + + Khóa tự nhiên: Word + Reading (cùng chữ nhưng khác cách đọc là 2 từ khác nhau). + + + Khóa tự nhiên: Word + Reading (cùng chữ nhưng khác cách đọc là 2 từ khác nhau). + + + + Chính sách đường dẫn media an toàn (HTTPS external, Supabase/S3, đường dẫn local Dev/QA + hoặc audio proxy đã cấu hình). External HTTPS được bật tạm thời để hỗ trợ nội dung nhập liệu + đang lưu ở các CDN/proxy khác; HTTP thường vẫn bị từ chối. + + + + + Kiểm tra tính nhất quán giữa phần mở rộng, Content-Type và nội dung nhị phân thực tế, + đồng thời dựng bản xem trước chỉ đọc cho Word (.docx), bảng tính (.xlsx/.csv) và văn bản (.txt) + mà không bao giờ chỉnh sửa hay ghi đè tài liệu gốc. + + + + 1 dòng dữ liệu đã đọc từ Excel, key của Fields đã chuẩn hoá qua . + + + Lấy giá trị theo tên cột gốc (vd "Certificate Level Code") - tự chuẩn hoá để so khớp, không cần biết thứ tự cột. + + + + Đọc Excel theo tên cột/tên sheet (KHÔNG hardcode index) bằng ClosedXML. + Yêu cầu "Dynamic Columns" + "Dynamic Sheets" + "ignore case/spaces" nằm hết ở đây, + mỗi ISheetImportHandler chỉ việc gọi row.Get("Tên cột") là lấy được giá trị. + + + + Chuẩn hoá tên để so khớp: bỏ hết khoảng trắng, hạ thường. "Certificate Level Code" == "certificatelevelcode". + + + + Đọc toàn bộ dòng dữ liệu của 1 sheet. Dòng đầu tiên có dữ liệu luôn được coi là header. + Dòng trống hoàn toàn bị bỏ qua (không tính vào TotalRows). + + + + + Performs a cheap local quality gate before an uploaded handwriting image is sent to OCR. + This is deliberately deterministic so blurred/empty photos do not consume AI quota. + + + + + Shared Japanese text sanitizer and validator enforcing clean ja -> vi selection translation. + Rejects Vietnamese, English, pure numbers/punctuation/emojis, URLs, emails, isolated single kana, + and clearly Simplified-Chinese-only spans while preserving single valid Kanji words, half-width Katakana, + mixed Japanese sentences with numerals/Latin terms, and multi-line reading passages. + + + + + Pattern:
+ <[^>]+>
+ Options:
+ RegexOptions.Compiled
+ Explanation:
+ + ○ Match '<'.
+ ○ Match a character other than '>' atomically at least once.
+ ○ Match '>'.
+
+
+
+ + + Pattern:
+ [\\u200B-\\u200F\\u202A-\\u202E\\uFEFF\\u00AD]
+ Options:
+ RegexOptions.Compiled
+ Explanation:
+ + ○ Match a character in the set [\u00AD\u200B-\u200F\u202A-\u202E\uFEFF].
+
+
+
+ + + Pattern:
+ [ \\t\\u00A0]+
+ Options:
+ RegexOptions.Compiled
+ Explanation:
+ + ○ Match a character in the set [\t \u00A0] atomically at least once.
+
+
+
+ + + Pattern:
+ \\n{3,}
+ Options:
+ RegexOptions.Compiled
+ Explanation:
+ + ○ Match '\n' atomically at least 3 times.
+
+
+
+ + + Pattern:
+ (?:https?://|www\\.)\\S+
+ Options:
+ RegexOptions.IgnoreCase | RegexOptions.Compiled
+ Explanation:
+ + ○ Match with 2 alternative expressions.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Hh].
+ ○ Match a character in the set [Tt] exactly 2 times.
+ ○ Match a character in the set [Pp].
+ ○ Match a character in the set [Ss] atomically, optionally.
+ ○ Match the string "://".
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Ww] exactly 3 times.
+ ○ Match '.'.
+ ○ Match any character other than a whitespace character atomically at least once.
+
+
+
+ + + Pattern:
+ ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$
+ Options:
+ RegexOptions.Compiled
+ Explanation:
+ + ○ Match if at the beginning of the string.
+ ○ Match a character in the set [^@\s] atomically at least once.
+ ○ Match '@'.
+ ○ Match a character in the set [^@\s] greedily at least once.
+ ○ Match '.'.
+ ○ Match a character in the set [^@\s] atomically at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + Records learner journey milestones that have no timestamp of their own on the learner row (learning goal + confirmed, standard roadmap opened). Stored as a read, history-only whose unique + IdempotencyKey (journey:{kind}:{userId}:{goalVersion}) makes the write idempotent — no schema change. + Learning Moments derives the celebration from these rows; the client never declares a milestone itself. + The caller saves the unit of work, so the event commits atomically with the business change. + + + + Adds the event row (not saved). Returns false when the same event was already recorded. + + + + Canonical validator, XSS neutralizer, plain-text indexer, and checklist aggregator + for Personal Notebook V3 structured rich-text JSON AST documents. + + + + + Pattern:
+ <script\\b[^>]*>[\\s\\S]*?<\\/script>
+ Options:
+ RegexOptions.IgnoreCase | RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match '<'.
+ ○ Match a character in the set [Ss].
+ ○ Match a character in the set [Cc].
+ ○ Match a character in the set [Rr].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [Pp].
+ ○ Match a character in the set [Tt].
+ ○ Match if at a word boundary.
+ ○ Match a character other than '>' atomically any number of times.
+ ○ Match '>'.
+ ○ Match any character lazily any number of times.
+ ○ Match the string "</".
+ ○ Match a character in the set [Ss].
+ ○ Match a character in the set [Cc].
+ ○ Match a character in the set [Rr].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [Pp].
+ ○ Match a character in the set [Tt].
+ ○ Match '>'.
+
+
+
+ + + Pattern:
+ javascript\\s*:
+ Options:
+ RegexOptions.IgnoreCase | RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match a character in the set [Jj].
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Vv].
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Ss].
+ ○ Match a character in the set [Cc].
+ ○ Match a character in the set [Rr].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [Pp].
+ ○ Match a character in the set [Tt].
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match ':'.
+
+
+
+ + + Pattern:
+ data\\s*:\\s*text\\/html
+ Options:
+ RegexOptions.IgnoreCase | RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match a character in the set [Dd].
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Aa].
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match ':'.
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Ee].
+ ○ Match a character in the set [Xx].
+ ○ Match a character in the set [Tt].
+ ○ Match '/'.
+ ○ Match a character in the set [Hh].
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Mm].
+ ○ Match a character in the set [Ll].
+
+
+
+ + + Pattern:
+ \\son[a-z]+\\s*=
+ Options:
+ RegexOptions.IgnoreCase | RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match a whitespace character.
+ ○ Match a character in the set [Oo].
+ ○ Match a character in the set [Nn].
+ ○ Match a character in the set [A-Za-z\u212A] atomically at least once.
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match '='.
+
+
+
+ + + Pattern:
+ <!--rp-(nb|entry):[\\s\\S]*?-->
+ Options:
+ RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match the string "<!--rp-".
+ ○ 1st capture group.
+ ○ Match with 2 alternative expressions.
+ ○ Match the string "nb".
+ ○ Match the string "entry".
+ ○ Match ':'.
+ ○ Match any character lazily any number of times.
+ ○ Match the string "-->".
+
+
+
+ + + Manages per-role notification categories and real Backend delivery enforcement. + + + + + Centralizes semantic color classification (7 categories) and live business actionability + resolution against authoritative database state, completely independent of Notification.IsRead. + + + + + Fast type-level filter candidate check so ActionableCount can narrow SQL rows before batch enrichment. + Returns true for notification types that can represent pending work items. + + + + + Filters enriched notifications down to currently pending actionable work items, deduplicating + repeated historical notifications that point to the same underlying business entity or queue + (keeping the newest notification first). + + + + + Pattern:
+ /(\\d+)$
+ Options:
+ RegexOptions.CultureInvariant
+ Explanation:
+ + ○ Match '/'.
+ ○ 1st capture group.
+ ○ Match a Unicode digit atomically at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + Centralized server-side password policy aligned with NIST 800-63B & RikiPath Frontend rules. + Preserves exact user characters (never trims) and rejects common, predictable, or user-linked passwords. + + + + + Selects actionable due cards enforcing DailyNewLimit as a strict hard cap on New cards, + while treating DailyReviewLimit ("Mục tiêu ôn mỗi ngày") as a flexible soft goal so learners + are never locked out of reviewing overdue or active cards once they meet their daily goal. + + + + + Computes the exact actionable due count matching + without materializing full entities. + + + + + Pattern:
+ \\([^)]*\\)|([^)]*)
+ Explanation:
+ + ○ Match with 2 alternative expressions, atomically.
+ ○ Match a sequence of expressions.
+ ○ Match '('.
+ ○ Match a character other than ')' atomically any number of times.
+ ○ Match ')'.
+ ○ Match a sequence of expressions.
+ ○ Match '('.
+ ○ Match a character other than ')' atomically any number of times.
+ ○ Match ')'.
+
+
+
+ + + Pattern:
+ [。、.,.,;:!?!?・・()()\\[\\]「」『』~〜\\-‐\\s]
+ Explanation:
+ + ○ Match a character in the set [!(),-.:;?[]~\u2010\u3001\u3002\u300C-\u300F\u301C\u30FB\uFF01\uFF08\uFF09\uFF0C\uFF0E\uFF1F\uFF65\s].
+
+
+
+ + + Pattern:
+ \\s+
+ Explanation:
+ + ○ Match a whitespace character atomically at least once.
+
+
+
+ + + Chuẩn hóa và đồng bộ FullName trên API với các cột FirstName/LastName (tối đa 100 ký tự mỗi cột). + + + + + Pattern:
+ \\s+
+ Explanation:
+ + ○ Match a whitespace character atomically at least once.
+
+
+
+ + Adapts the supplied Excel templates to the existing import handlers. + + + + Gọi AI để soạn nội dung hỗ trợ content author (Kanji, Vocabulary, GrammarPattern, Lesson, ...). + Tách riêng khỏi IAiLearningPathClient vì mục đích khác hẳn (soạn nội dung, không phải lập lộ trình học). + + + + + Gửi systemPrompt (quy tắc cố định cho loại nội dung cần soạn) + userPrompt (yêu cầu tự do của + content author, đã kèm dữ liệu ngữ cảnh như bài học/cấp độ/danh sách đã có trong DB) tới AI, + trả về JSON thô (string) do AI sinh ra. + + + + + Gọi AI để kiểm tra nội dung. Trả về JSON thô (cùng pattern với IAiLearningPathClient). + Implementation nên dùng temperature thấp (0–0.2) để kết quả ổn định. + + + + Gọi AI để chấm bài luận (作文) của học viên theo rubric JLPT. + + + Gửi systemPrompt (rubric/quy tắc chấm cố định) + userPrompt (bài luận + ngữ cảnh + cấp độ/đề bài) tới AI, trả về JSON thô (string) do AI sinh ra. + + + + Sends the full grading prompt (system + user content already merged by the caller) + and returns the raw JSON string the model replied with. Must NOT swallow provider + errors — let them bubble up so the caller can map to 502 Bad Gateway. + + + + Why a payment-gateway call failed, so callers can answer the learner precisely without leaking provider configuration. + + + + A classified, sanitized gateway failure. / are the provider's own + short error code and description (never keys, headers or the request payload) and are safe to log. + + + + + A classified, sanitized gateway failure. / are the provider's own + short error code and description (never keys, headers or the request payload) and are safe to log. + + + + Whether the link may or may not exist at the provider (the request was sent but no definitive answer came back). + + + + Verifies the webhook signature over the raw data object exactly as PayOS sent it (all keys, sorted), + so fields PayOS adds later cannot break verification. Falls back to the typed check when the raw JSON is unavailable. + + + + Looks a payment link up by its provider id (PayOS accepts either the order code or the paymentLinkId). + + + Vô hiệu hóa/hủy link thanh toán trên cổng khi giữ chỗ hết hạn hoặc người dùng hủy (best-effort). + + + Tất cả mapping của một level (kèm Kanji/Vocabulary/GrammarPattern). + + + Các level mà một Kanji thuộc về (kèm CertificateLevel). + + + Các level mà một Vocabulary thuộc về (kèm CertificateLevel). + + + Các level mà một GrammarPattern thuộc về (kèm CertificateLevel). + + + Kiểm tra đã gán nội dung này vào level này chưa (truyền đúng MỘT trong 3 Id nội dung). + + + Danh sách Kanji thuộc một level. Mặc định chỉ lấy bản đã Published. + + + Danh sách Vocabulary thuộc một level. Mặc định chỉ lấy bản đã Published. + + + Danh sách GrammarPattern thuộc một level. Mặc định chỉ lấy bản đã Published. + + + + Base CRUD contract. Every entity-specific repository interface below extends this + and adds the query methods that entity actually needs — nothing is left exposed + on IUnitOfWork as a bare IGenericRepository<T>. + + + + Ownership is derived through LearnerNote (no direct UserId on this entity). + + + Chuỗi ngày học liên tục, tính từ hoạt động học (hoàn thành bài học, ôn SRS, làm bài thi thử). + + + Today's streak celebration event (if any) and whether it is still pending on every device. + + + Atomically claims today's celebration once per learner (unique idempotency key); losers get Claimed=false. + + + Điểm trung bình theo từng kỹ năng (Từ vựng/Kanji, Đọc hiểu, Nghe) từ các bài thi thử. + + + Monthly per-skill performance from completed Mock Tests and Placement Tests. + + + In-class skill quizzes (Stage 5): Mentor builds and publishes, Learner takes them on the assessment engine. + + + + Xử lý đóng tuyển sinh khi đến hạn (đồng bộ giữa Background Worker và kiểm tra trực tiếp trước khi vào lớp / thanh toán): + - Có từ 1 học viên ghi danh hợp lệ trở lên: đóng tuyển sinh, giữ nguyên lịch chính thức để chuẩn bị/bắt đầu giảng dạy. + - Không có học viên ghi danh hợp lệ (sau khi đối soát các giữ chỗ hết hạn): tự động hủy lớp, giải phóng toàn bộ khung giờ dạy của Giáo viên, và gửi thông báo idempotent. + + + + + Xem trước nội dung đọc từ file Excel import. + + + + + Gửi danh sách các yêu cầu thay đổi/thêm mới từ Excel vào hàng chờ duyệt. + + + + + Lấy danh sách các yêu cầu đang chờ duyệt (Pending Review). + + + + + Duyệt hoặc từ chối một yêu cầu duyệt nội dung cụ thể. + + + + + Duyệt hoặc từ chối hàng loạt nhiều yêu cầu cùng lúc. + + + + + AI hỗ trợ content author soạn nội dung. Luồng 2 bước cho mọi loại nội dung: + 1) Suggest: AI đề xuất + hệ thống tự kiểm tra/dò trùng, trả về để author xem/chỉnh (CHƯA lưu gì vào DB). + 2) Confirm: author xác nhận bản cuối, hệ thống ghi vào ContentApprovalRequest (Draft) để admin duyệt. + + + + Gợi ý tiêu đề/mô tả + danh sách Kanji/Vocabulary/Grammar ĐÃ CÓ để gắn vào bài học. Video do author tự upload. + + + + Quét nội dung Draft của author hiện tại. Kanji/Vocabulary/Grammar: AI đối chiếu kiến thức chuẩn. + PracticeExercise/MockTest: kiểm tra cấu trúc bằng code + AI giải lại đề (không thấy đáp án) để bắt đáp án sai. + KHÔNG tạo/sửa/xóa gì trong DB — chỉ trả về báo cáo. + + + + + Import hàng loạt nội dung (Lesson, Kanji, Vocabulary, GrammarPattern, PracticeExercise...) từ file Excel. + + + + + Lấy danh sách nội dung đang chờ duyệt theo loại entity. + + + + + Thực hiện phê duyệt hoặc từ chối một nội dung cụ thể. + + + + + Gửi nội dung lên hệ thống để chờ kiểm duyệt. + + + + + Lấy danh sách nội dung do chính tác giả hiện tại khởi tạo. + + + + + Điều phối Plan → Execute → Confirm đặt trên . + Plan: AI chuyển yêu cầu tự do thành danh sách công việc. Execute: sinh nội dung từng việc (chưa lưu DB). + Confirm: ghi cả gói vào ContentApprovalRequest (Draft) cùng một BatchId. + + + + Danh sách câu hỏi theo đúng thứ tự: hoặc tham chiếu QuestionBankItemId có sẵn, hoặc câu hỏi soạn trực tiếp. + + + + Step 1: chỉ đọc và so sánh nội dung; không ghi database hoặc storage. + onlyType = null -> Bulk upload (đọc mọi sheet handler hỗ trợ + mà file có); onlyType có giá trị -> Single upload (chỉ đọc đúng 1 sheet tương ứng, bỏ qua sheet khác dù file có). + + + + Lưu các dòng New/Modified thành bản nháp của tác giả. + + + + Removes a private object that was uploaded but never referenced (compensation after a failed save). + Never call it for a reference already persisted in the database. + + + + + Ranh giới quyền ghi danh lớp nhóm tách biệt hoàn toàn với vé tư vấn 1-1. + Fail-closed mặc định khi học viên chưa có quyền ghi danh hợp lệ cho lớp nhóm tương ứng. + + + + Danh sách chữ Kanji cần luyện viết hôm nay: ưu tiên chữ đã đến hạn ôn lại + (NextReviewDate <= hôm nay), rồi mới bổ sung chữ mới nếu chưa đủ count. + + + Ghi nhận kết quả 1 lượt luyện viết, tính lại lịch ôn theo SM-2. + + + + Centralized authoritative resolver for Learner onboarding, goal confirmation, + placement assessment state, standard/AI roadmap eligibility, and roadmap-scoped progress. + + + + + Learning Moments: celebration-worthy progress derived from verified learning data, shown at most once + per learner + occurrence (atomic claim across tabs/devices), plus the learner's achievement history. + + + + + Lưu vị trí phát video hiện tại (resume), tự tính lại % tiến độ, và tự động đánh dấu + hoàn thành khi progress >= 95% (ngưỡng tránh trường hợp video kết thúc lệch vài giây). + + + + Chính sách chấm công & KPI (phiên bản theo tháng, độc lập với Chính sách lớp học). + + + + Một nguồn tính duy nhất cho Chấm công & KPI Giáo viên: Mentor (cá nhân), Admin (chi tiết từng Giáo viên) và + tổng quan toàn trung tâm đều dùng cùng bộ tính toán. + + + + + Tổng hợp chấm công, thời lượng giảng dạy và chỉ số KPI thực tế của Cố vấn (không tính lương/thù lao). + + + + The signed-in Learner's own competency profile for one class enrollment (same data and rules as the Mentor view). + + + Khung giờ dạy dự kiến (UTC, nửa mở [StartUtc, EndUtc)). + + + Khung giờ dạy dự kiến (UTC, nửa mở [StartUtc, EndUtc)). + + + Tùy chọn kiểm tra; giá trị null lấy theo chính sách nhóm hiệu lực. + + + Bỏ qua các buổi của lớp này (lớp đang được sửa/thay Mentor). + + + Bỏ qua đề xuất mở lớp này khi kiểm tra (tránh tự xung đột khi chỉnh sửa/gửi lại). + + + Bỏ qua các khung giờ này (ví dụ buổi đang được dời đi). + + + Kiểm tra trùng/nghỉ giữa chính các khung giờ dự kiến với nhau. + + + Cam kết tạm thời bổ sung trong bộ nhớ (ví dụ các đề xuất cùng Giáo viên đã xếp lịch trước trong cùng đợt duyệt hàng loạt). + + + Một xung đột lịch dạy. Không bao giờ chứa dữ liệu học viên. + + + Một xung đột lịch dạy. Không bao giờ chứa dữ liệu học viên. + + + + Nguồn kiểm tra trùng lịch dạy chuẩn duy nhất của Mentor (chỉ kiểm tra lịch giảng dạy chính thức của cùng một Giáo viên; + không khóa slot theo đề xuất chưa duyệt và không kiểm tra chéo giữa nhiều Giáo viên). + Bên gọi phải giữ LockScheduleAsync(mentorId, ...) trong cùng giao dịch trước khi ghi lịch. + + + + + Autosave 1 câu trả lời cho bài đánh giá năng lực (placement) ngay khi học viên chọn đáp án, + để nếu mất điện/tắt web giữa chừng thì quay lại vẫn còn tiến độ đã làm. + + + + + Xử lý webhook PayOS: xác minh chữ ký (trên đúng object data gốc khi có ), + đối chiếu đơn hàng, rồi cập nhật trạng thái/kích hoạt quyền lợi đúng một lần. + + + + Nộp bài luyện tập (bài luận/Kanji/Speaking) và chấm điểm bằng AI. Hiện chỉ Writing + (bài luận) có pipeline chấm tự động; Kanji/Speaking được lưu lại, chờ bổ sung sau. + + + Chấm lại một bài đã nộp (ghi đè GradingResult cũ nếu có). + + + Starts or resumes the learner's attempt for one assigned in-class quiz. + + + Server-side completion of quiz attempts whose time is over, from answers saved before the deadline. + + + End-of-course assessment state for one of the learner's class enrollments. + + + Starts (or resumes) the end-of-course assessment; answers/submit/result reuse the Placement attempt endpoints. + + + Số khung giờ tối đa được gửi trong một lần đăng ký / batch (mặc định 14). + + + Tổng số khung giờ đang chờ Admin duyệt tối đa của một Giáo viên tại một thời điểm (mặc định 24). + + + Thời gian chờ tối thiểu (giây) giữa hai lần gửi đăng ký lịch liên tiếp (mặc định 5 giây). + + + + Feature policy update. AccessMode is the access policy (FREE / PLAN_REQUIRED / CREDIT_REQUIRED / PLAN_AND_CREDIT); + Availability (ACTIVE / DISABLED) is independent. Legacy clients may still send AccessMode = "DISABLED" + without Availability: that suspends the feature and keeps its current policy. + ExpectedState is the stored state the Admin edited (optimistic concurrency); ConfirmImpact is required + for sensitive changes (suspending a feature, or any change to a core-free feature). + + + + + Feature policy update. AccessMode is the access policy (FREE / PLAN_REQUIRED / CREDIT_REQUIRED / PLAN_AND_CREDIT); + Availability (ACTIVE / DISABLED) is independent. Legacy clients may still send AccessMode = "DISABLED" + without Availability: that suspends the feature and keeps its current policy. + ExpectedState is the stored state the Admin edited (optimistic concurrency); ConfirmImpact is required + for sensitive changes (suspending a feature, or any change to a core-free feature). + + + + + Claims (acknowledges) today's streak celebration right before the client displays it. + The server recomputes the event itself; only guards against a stale client + (e.g. a tab left open across midnight) and is never trusted as the source of the streak value. + + + + Chỉ dùng cho phần Nghe. + + + Tùy chọn: nếu gửi thì cấp độ phải thuộc loại chứng chỉ này. + + + Null = lấy theo kỹ năng của bài học. + + + Null/trống = lấy tên của CertificateSection. + + + Chỉ quét một lần gửi cụ thể. Null = quét toàn bộ Draft hiện có của author. + + + Các loại công việc AI có thể được giao trong một kế hoạch. Thứ tự giá trị = thứ tự thực thi. + + + Author viết một yêu cầu tự do; AI chỉ chuyển thành danh sách công việc, chưa sinh nội dung. + + + Một công việc trong kế hoạch. Author có thể sửa/xóa/thêm trước khi chạy. + + + Định danh trong kế hoạch (t1, t2...). Dùng để khớp kết quả và tham chiếu giữa các công việc. + + + Yêu cầu chi tiết, tự đủ ý (chủ đề, cấp độ, lưu ý riêng của author) cho công việc này. + + + Kanji/Vocabulary/Grammar: số mục. PracticeExercise: số câu hỏi. Lesson/MockTest: bỏ qua. + + + + PracticeExercise: gắn vào bài học ĐÃ CÓ trong hệ thống. + Kanji/Vocabulary/Grammar: bổ sung nội dung cho bài học ĐÃ CÓ (cấp độ lấy theo bài học đó). + + + + PracticeExercise: gắn vào bài học (Lesson task) sẽ được tạo trong chính kế hoạch này. + + + MockTest: các phần thi cần sinh. + + + Kế hoạch (có thể đã được author chỉnh sửa) gửi lại để chạy. + + + Cấp độ để map nội dung (ContentLevelMapping) khi admin duyệt. Null = không map. + + + Bài học ĐÃ CÓ mà nhóm này được bổ sung vào (lấy từ ExistingLessonId của công việc). Null = nội dung mới của gói. + + + + Bài học trong gói. Liên kết tới nội dung ĐÃ CÓ bằng Id; liên kết tới nội dung MỚI (cùng gói, chưa có Id) + bằng khóa tự nhiên: ký tự Kanji / Word+Reading / Title ngữ pháp. + + + + Bài luyện tập: gắn bài học đã có (ExistingLessonId) HOẶC bài học mới cùng gói (NewLessonTitle) — chọn đúng một. + + + Input for the matching content type; fields unrelated to that type are ignored. + + + Optional — gắn bài nộp với 1 lesson cụ thể nếu có. + + + Đề bài / yêu cầu (VD: "Viết đoạn văn 200 chữ về sở thích của bạn"). + + + Bài làm của học viên (text; với KanjiWriting có thể là kết quả OCR). + + + Kết quả luyện một ký tự Kana. + + + Số nét vẽ sai trong lượt luyện - lấy thẳng từ HanziWriter.quiz()'s + onComplete callback (summaryData.totalMistakes) ở phía FE, không cần FE tự tính điểm. + + + + Claims one pending learning moment right before the client shows it. The server re-checks that the + key is currently eligible for this learner; the key itself is never trusted as proof of completion. + + + + Alias retained for the JLPT frontend. + + + Deprecated and ignored. Horizon is computed from skill gaps and study workload. + + + Khóa idempotency tùy chọn để chống tạo trùng khi double-click hoặc retry mạng. + + + Khóa idempotency tùy chọn để chống tạo trùng khi double-click hoặc retry mạng. + + + Khi bật, phiên bản chính sách và bảng học phí mới có hiệu lực ngay lập tức đối với các đề xuất và lớp mới. + + + 0 = Chủ nhật, 1 = Thứ 2 .. 6 = Thứ 7 (theo giờ Việt Nam Asia/Ho_Chi_Minh). + + + Phút kể từ 00:00 giờ Việt Nam (VD: 480 = 08:00, 1140 = 19:00). + + + Phút kết thúc kể từ 00:00 giờ Việt Nam. + + + Approve | RequestChanges | Reject + + + Mã kiểm tra nhất quán giữa bản xem trước Admin đã xác nhận và thời điểm phê duyệt. + + + + Id option được chọn. Null nghĩa là bỏ chọn (học viên đổi ý, chưa chọn lại). + + + + Null nếu bỏ trống; riêng bài Placement, 0 là lựa chọn chưa học hoặc không biết. + + + Structured response for non-choice questions; shape depends on question type. + + + Monotonic client sequence per answer update to guard against stale out-of-order autosaves. + + + Monotonic sequence token from client to ignore stale out-of-order autosaves. + + + Elapsed active seconds reported on practice save/pause (validated server-side). + + + Only allowed for PracticeSet/MixedPractice when explicitly starting a new attempt and abandoning the active one. + + + Notebook V3 boundary: saving text into Notebook never creates SRS cards unless explicitly requested. + + + Tùy chọn di chuyển mục sang tệp / trang ghi chú khác thuộc cùng Learner. + + + Optional JLPT level ID (N5-N2) selected specifically for this assessment without mutating TargetCertificateLevelId. + + + COMPREHENSIVE (multi-level estimation) or TARGETED (specific level). Optional. + + + Lưu bài viết mà chưa chấm khi giá trị là false. + + + Nội dung bài viết hoặc bản chép lời đã nhận dạng cho bài nói. + + + Bắt buộc khi Type = Kanji (ảnh chữ viết tay/typed). + + + Đường dẫn ghi âm nếu bài nói có lưu tệp. + + + Cấp độ JLPT dùng làm rubric chấm (bắt buộc). + + + Tùy chọn: đề bài/chủ đề học viên đã viết, giúp AI chấm đúng ngữ cảnh hơn + (vd: "Hãy viết về kỳ nghỉ hè của bạn"). Không có cũng chấm được, chỉ là kém ngữ cảnh hơn. + + + True when caller explicitly edits or clears PhoneNumber; prevents partial callers from wiping it. + + + Số phút học mong muốn mỗi ngày, dùng để tính streak/nhắc học. + + + Ngày dự định thi, dùng để tạo lộ trình học. Phải sau ngày hiện tại. + + + Only true explicitly clears an existing date; omitted/null preserves it. + + + + True when the learner pressed "Xác nhận mục tiêu" at the end of onboarding. Only decides whether a + goal-confirmed celebration is recorded; it never changes validation or the saved goal. + + + + Complete-form semantics: null explicitly clears the planned date. + + + Mentor retake plan: structured fields (preferred) or the legacy free-text . + + + Mentor retake plan: structured fields (preferred) or the legacy free-text . + + + Mentor chính/Admin yêu cầu dời toàn bộ lớp trống (Kind = "ShiftWeeks", ShiftWeeks 1..8) hoặc hủy lớp trống (Kind = "CancelEmptyCohort"). + + + Mentor chính/Admin yêu cầu dời toàn bộ lớp trống (Kind = "ShiftWeeks", ShiftWeeks 1..8) hoặc hủy lớp trống (Kind = "CancelEmptyCohort"). + + + + Streak celebration state derived by the server (Asia/Ho_Chi_Minh study day). A celebration event exists only + when today already has a valid learning activity; it is pending until claimed once (any tab/device). + + + + True when today's streak event exists and has not been claimed on any device yet. + + + Stable event identity: streak:{yyyyMMdd}:{days}. Null when no event exists today. + + + + daily / milestone (today already studied — celebrate) or atRisk (live streak, nothing + studied yet today — keep-the-streak reminder). Each kind is claimable once per study day. + + + + UTC instant when today's Asia/Ho_Chi_Minh study day ends (keep-streak countdown). + + + Milestone reached by this event, when is milestone. + + + Study days (Asia/Ho_Chi_Minh) with verified activity in the current Monday–Sunday week. + + + Set by the claim endpoint: true only for the single request that won the claim. + + + One question of the bank or of a quiz version. Answer fields are filled only where the viewer may see them. + + + One question of the bank or of a quiz version. Answer fields are filled only where the viewer may see them. + + + Status: NotStarted | InProgress | Completed | Overdue. + + + Status: NotStarted | InProgress | Completed | Overdue. + + + Learner/Mentor result. controls whether answer keys and explanations are included. + + + Learner/Mentor result. controls whether answer keys and explanations are included. + + + Null or empty = every learner currently enrolled in the class. + + + Earlier quiz of this class with the same structure that this quiz is an equivalent re-test of + (Mentor's explicit choice). Without it the quiz starts its own series and is never used to measure change. + + + Either a bank question () or a Mentor-authored single-choice question. + + + Mục nội dung được gắn vào bài học. ExistingId null = chưa có trong hệ thống. + + + Kanji: ký tự. Vocabulary: Word. Grammar: Title. + + + Chỉ dùng cho Vocabulary. + + + True = nội dung MỚI được sinh trong cùng kế hoạch (chưa có Id), liên kết bằng khóa tự nhiên. + + + Id của ContentApprovalRequest được kiểm tra. + + + False = loại nội dung này AI chưa hỗ trợ kiểm tra tự động. + + + Kế hoạch AI đề xuất. Nếu ClarifyingQuestion khác null thì Tasks rỗng: cần author trả lời rồi gửi lại yêu cầu. + + + Kết quả của MỘT công việc. Chỉ đúng một thuộc tính nội dung được điền, tùy theo Type. + + + Cấp độ của công việc — FE gửi lại khi Confirm để map nội dung vào cấp độ. + + + Kanji/Vocabulary/Grammar bổ sung cho bài học ĐÃ CÓ: FE gửi lại làm LessonId của nhóm khi Confirm. + + + Bản nháp bài luyện tập; gắn với bài học đã có (ExistingLessonId) hoặc bài học mới cùng kế hoạch (NewLessonTitle). + + + Một lỗi/cảnh báo cụ thể, chỉ rõ phần nào của nội dung bị sai và vì sao. + + + Rule (kiểm tra bằng code, chắc chắn) | AI (kiểm tra ngữ nghĩa). + + + Error (bắt buộc sửa) | Warning (nên xem lại) | Info + + + Lesson | Kanji | Vocabulary | Grammar — mục bị lỗi (lesson có thể chứa nhiều mục liên kết). + + + Nhãn dễ đọc cho author, ví dụ: "Từ vựng: 勉強". + + + Tên trường sai, trùng tên input trên form (Meaning, Reading, ExampleSentence...). + + + Lý do sai — để author hiểu và tự kiểm tra. + + + Độ tin cậy 0..1 (Rule luôn = 1). + + + Passed | PassedWithWarnings | NeedsRevision + + + Khóa camelCase, trùng với khóa trong DiffSummaryJson (meaning, exampleSentence, lessonTitle...). + + + Giá trị hiện tại trong DB. null khi là yêu cầu thêm mới. + + + Các request không xử lý được (đã bị xử lý trước đó, không tồn tại, hoặc lỗi khi map dữ liệu) kèm lý do. + + + true nếu yêu cầu "cập nhật" nhưng bản ghi gốc không còn trong DB. + + + Các trường (kể cả không đổi) để Admin xem cạnh nhau: cũ -> mới. + + + Cảnh báo cho Admin: dữ liệu gốc đã đổi từ lúc gửi, thêm mới nhưng đã tồn tại, payload lỗi... + + + New (thêm mới) hoặc Modified (cập nhật). + + + Số trường thay đổi theo bản tóm tắt lưu lúc import (null nếu không có). + + + Dữ liệu 1 mẫu ngữ pháp đã parse + resolve, serialize vào ContentApprovalRequest.PayloadJson. Khóa tự nhiên: Title. + + + Tổng số bản nháp đã lưu trong BatchId này, kể cả các phần gửi trước. + + + Số dòng bị bỏ qua trong request hiện tại, gồm cả các dòng đã lưu trước đó. + + + Giải thích riêng cho lựa chọn này (đúng hoặc sai), lấy từ Excel. + + + Kết quả Step 1 (Dry Run) - KHÔNG có gì được ghi xuống DB khi trả response này. + + + Id tương quan phía client cho lần preview này (không phải Id trong DB vì chưa lưu gì). + + + Mỗi sheet tìm thấy trong file trả về 1 phần tử. Sheet không có trong file (single upload, hoặc bulk thiếu sheet) thì không xuất hiện ở đây. + + + Các sheet gốc đã đọc, kể cả sheet chỉ có tiêu đề cột. + + + Khóa tự nhiên dùng để so khớp (Character / Word / Title...), hiển thị cho admin dễ nhận diện dòng. + + + Id bản ghi đang có trong bảng chính - null nếu Action = New. + + + Toàn bộ field đã parse từ Excel (giá trị MỚI), key là tên field chuẩn hoá (không khoảng trắng, lowercase). + + + Chỉ có khi Action = Modified: field -> "giá trị cũ → giá trị mới". + + + Chỉ có khi Action = Error. + + + + Payload JSON server đã build sẵn cho dòng này (chỉ có khi Action = New/Modified). + FE KHÔNG cần đọc hay sửa field này - chỉ cần gửi y nguyên lại ở Step 2 (ConfirmImportRequest) + cho đúng những dòng admin chọn giữ lại, để server khỏi phải parse lại Excel lần nữa. + + + + Optional - Kanji liên kết Lesson qua bảng LessonKanji (nhiều-nhiều), không phải FK trực tiếp. + Không tham gia so sánh Modified/Unchanged ở bước diff này, chỉ mang theo cho bước Apply sau. + + + Dữ liệu 1 bài học đã parse + resolve, serialize vào ContentApprovalRequest.PayloadJson. Khóa tự nhiên: Title + CertificateLevelId. + + + Số thứ tự câu trong CẢ đề (không reset theo từng phần). + + + Type-specific settings, such as draggable tokens or blank positions. + + + Structured correct answer for non-option interactions, for example token order. + + + Bản chép lời tiếng Nhật do author nhập sẵn, dùng cho chấm/giải thích Listening. + + + Thứ tự xuất hiện của phần trong file (1..n). + + + ID của yêu cầu phê duyệt (ContentApprovalRequest.Id). + + + Loại nội dung (Vocabulary, Kanji, GrammarPattern...). + + + Hành động đề xuất (New: Thêm mới, Modified: Sửa đổi). + + + Khóa định danh hiển thị (Ví dụ: Từ vựng "猫 / ねこ", Kanji "日"...). + + + ID của bản ghi gốc trong DB (nếu là hành động Modified). + + + Tên Content Author gửi yêu cầu. + + + Thời gian gửi yêu cầu. + + + Danh sách so sánh chi tiết từng trường dữ liệu (Cũ vs Mới). + + + Các cảnh báo hệ thống (VD: Phát hiện trùng lặp, bản ghi gốc bị xóa...). + + + Cờ đánh dấu bản ghi gốc trong DB đã bị xóa trong lúc chờ duyệt. + + + Requests nội dung có cùng Lesson, phục vụ admin xem và duyệt chung. + + + Đoạn đọc/nhóm nghe của đề MockTest đang chờ duyệt, lấy từ payload gửi duyệt. + + + Null khi Lesson mới chỉ có bản nháp chờ duyệt - lúc Admin duyệt phải tra lại Lesson theo LessonTitle + CertificateLevelId. + + + CertificateLevelId của Lesson / Stage. + + + Trả về TẤT CẢ các dòng (kể cả Unchanged/Error) - theo đúng yêu cầu, không được lọc bớt. + + + Dữ liệu 1 từ vựng đã parse + resolve, serialize vào ContentApprovalRequest.PayloadJson. Khóa tự nhiên: Word + Reading. + + + Optional. Null = không đổi giá trị đang có. + + + True when OCR marked an unclear or ambiguous character for the learner to correct. + + + true nếu đây là chữ mới (chưa từng luyện viết lần nào) - FE nên bật + animateCharacter() cho FE xem trước cách viết đúng, thay vì vào quiz ngay. + + + + One celebration-worthy moment derived by the server from verified learning data (never from a + client-declared completion). The client renders copy/visuals from + . + + + + Stable occurrence key, unique per learner + moment (e.g. moment:first-lesson:42). + + + ONBOARDING_COMPLETED, PLACEMENT_COMPLETED, LEARNING_PATH_CREATED, FIRST_LESSON_COMPLETED, DAILY_SRS_COMPLETED, MOCK_TEST_COMPLETED. + + + major (prominent dialog) or milestone (compact dialog). + + + Lower value = shown first. + + + Verified route for the primary action, chosen from the learner's real state. + + + Small, display-only facts (level codes, lesson title, counts). Never fabricated. + + + + Purchase moments only: the features the purchased plan grants, from the plan's real feature bindings. + is false when another active order already granted it. + + + + True only for the single request that won the claim; other tabs/devices get false. + + + An achievement already earned, for the learner's achievement history. + + + The nearest real next goals (e.g. next streak badge), for gentle motivation. + + + Id bài học trong hệ thống (để frontend mở đúng bài). + + + Tiêu đề các bài học tương ứng với LessonIds (cùng thứ tự). + + + Ngày này có thể bắt đầu/tiếp tục theo thứ tự lộ trình hay chưa. + + + Ngày đã được người học bắt đầu. + + + Ngày đã được người học xác nhận hoàn thành. + + + Số ngày trong chặng ôn AI được tạo, tối đa bảy ngày. + + + Số ngày học chi tiết của chặng hiện tại; ước tính tới kỳ thi nằm ở RecommendedStudyDays. + + + Exclusive study deadline: the first of three rest days before the planned exam. + + + true = ngày thi có vẻ khả thi; false = khuyến nghị dời lịch; null = chưa đặt ngày thi. + + + Số ngày ôn tối thiểu hệ thống ước tính theo năng lực hiện tại. + + + Ngày thi gợi ý. Chỉ có giá trị khi IsExamDateRealistic = false. + + + Passing score (percent, 0–100) of this lesson's Quick Check, from the exercise configuration. + + + + KPI evaluation status. Met/NotMet are decided on exact numerator/denominator (never on a rounded percent). + NoData = nothing to measure yet, NotApplicable = the policy disables the target, PendingConfirmation = unresolved data + could still change the result. marks a period that has not ended. + + + + Timesheet status of one class session for its Mentor. + + + How a taught session was confirmed. + + + Mentor and ≥1 learner joined the room and the Mentor completed the session (includes the Time Skip flow): scheduled minutes. + + + Completed session with Mentor presence ≥ policy minimum: min(presence, scheduled). + + + Admin reconciliation (latest adjustment wins; history is kept). + + + + Result of "Kết thúc buổi học" (workspace or Meeting Room — one lifecycle source). + lets the API close the realtime room for every connected member. + is true for an idempotent repeat (nothing was changed twice). + + + + + Result of "Kết thúc buổi học" (workspace or Meeting Room — one lifecycle source). + lets the API close the realtime room for every connected member. + is true for an idempotent repeat (nothing was changed twice). + + + + Role-correct workspace to return to (Mentor workspace or the learner's own enrollment). + + + Learner's own enrollment (StudyCourse) id, used only for the learner's return link. + + + True when the caller is a member of the class and this room's session has officially ended. + + + Mã nhóm yêu cầu đăng ký cùng đợt để Admin dễ lọc và duyệt hàng loạt. + + + One completed in-class quiz (0–100%), with results only for the skills it actually tested. + + + One completed in-class quiz (0–100%), with results only for the skills it actually tested. + + + First vs latest result of one skill across comparable quizzes (same level and structure). + + + First vs latest result of one skill across comparable quizzes (same level and structure). + + + Quiz statistics kept apart from homework (0–10) and from the end-of-course assessment. + + + Quiz statistics kept apart from homework (0–10) and from the end-of-course assessment. + + + Published homework score on the 0–10 display scale, in grading order (never includes unpublished drafts). + + + Published homework score on the 0–10 display scale, in grading order (never includes unpublished drafts). + + + End-of-course assessment state and official result for one class enrollment (same source for Mentor and Learner). + + + End-of-course assessment state and official result for one class enrollment (same source for Mentor and Learner). + + + Data for the post-course reinforcement policy: raw homework ratio vs class threshold and official final result. + + + Data for the post-course reinforcement policy: raw homework ratio vs class threshold and official final result. + + + + Toàn bộ nội dung một bài test để học viên làm bài, câu hỏi được + nhóm theo từng Section. KHÔNG chứa đáp án đúng (IsCorrect/AnswerKey/Explanation) + để tránh lộ đáp án qua response khi học viên đang làm bài. + + + + Giải thích do content author cung cấp, dùng khi AI tạo phản hồi sau bài thi. + + + + Explicit lifecycle action state: "pending" | "resolved" | "unavailable" | null (informational). + Strictly independent of IsRead. + + + + + Learner-facing state of the end-of-course competency assessment for one class enrollment. + Availability: NotOpen (class still running) | NotEligible | Available | InProgress | PendingSubmission | Completed. + + + + A completed attempt of the current quota scope; AttemptNumber is its stable start order in that scope (1, 2…). + + + A completed attempt of the current quota scope; AttemptNumber is its stable start order in that scope (1, 2…). + + + Completed attempts of the same quota scope, oldest first (Lần 1, Lần 2). Never mixes other scopes. + + + NONE | GOAL_NOT_SET | COMPATIBLE | INSUFFICIENT_FOR_TARGET + + + JLPT level codes covered by the general assessment for the confirmed goal (lower comparison level first). + + + Skills the general assessment measures (vocabulary, grammar, reading, listening). + + + Last saved learner choice; null if unanswered. + + + Elapsed time from server start until submission, in seconds. + + + + Roadmap progression after this submission (Standard roadmap Quick Checks and checkpoints only), read back + from the roadmap the server now serves. Null when not applicable or when it could not be computed. + + + + + What a roadmap submission changed. is only set on a real transition (first pass): + LESSON_COMPLETED, STAGE_CHECKPOINT_UNLOCKED (last lesson done → stage check opens), STAGE_COMPLETED, + ROADMAP_COMPLETED. A retake of something already passed reports NONE; a failed attempt reports NOT_PASSED. + + + + Learning Moment occurrence key the client claims when it shows this celebration (no dashboard replay). + + + true nếu tiếp tục lượt làm bài chưa hoàn thành trước đó. + + + Câu hỏi gửi cho learner — cố ý KHÔNG chứa IsCorrect / Explanation. + + + Số câu được chấm tự động (có option đúng). Câu tự luận không tính. + + + Điểm + nhận xét cho MỘT tiêu chí chấm (vd: Ngữ pháp, Từ vựng, Nội dung...). + + + Thang điểm 0-10 cho tiêu chí này. + + + Một lỗi cụ thể AI tìm thấy trong bài, kèm câu gốc + đề xuất sửa. + + + Thang điểm 0-100, quy đổi từ các tiêu chí. + + + null nếu loại bài này chưa hỗ trợ chấm tự động, hoặc AI chấm thất bại. + + + Lý do chưa có Grading (vd: "Loại bài này chưa hỗ trợ chấm tự động." hoặc lỗi AI tạm thời). + Bài vẫn được lưu — học viên có thể gọi Regrade để chấm lại sau. + + + + Authoritative backend state for Learner onboarding, learning goal, placement assessment, + roadmap eligibility, AI roadmap generation status, active roadmap selection, and scoped progress. + + + + NOT_STARTED | IN_PROGRESS | PENDING_SUBMISSION | EXPLICITLY_SKIPPED | COMPLETED + + + NOT_TAKEN | SKIPPED | COMPLETED + + + NONE | GOAL_NOT_SET | COMPATIBLE | INSUFFICIENT_FOR_TARGET + + + NOT_ELIGIBLE | NOT_GENERATED | DRAFT_PREVIEW | READY + + + NONE | STANDARD | AI_PERSONALIZED + + + GOAL_REQUIRED | PLACEMENT_REQUIRED | PLACEMENT_IN_PROGRESS | STANDARD_READY | AI_READY_TO_GENERATE | ROADMAP_ACTIVE + + + COMPLETE_ONBOARDING | CHOOSE_PLACEMENT_OR_SKIP | RESUME_PLACEMENT | SUBMIT_EXPIRED_PLACEMENT | OPEN_STANDARD_ROADMAP | GENERATE_AI_ROADMAP | CONTINUE_ROADMAP + + + True when the frontend should add this incorrect card to the current session's retry queue. + + + Published Vietnamese translation of (null when the author did not provide one). + + + Short-lived capability for a single Transcribe WebSocket connection; never log the URL. + + + Short-lived capability for a single Transcribe WebSocket connection; never log the URL. + + + + Centralized, deterministic lesson and checkpoint recommendation ranking rules for Standard Roadmap V2. + Internal ranking weights never leak into UI responses; only human-readable explanations are surfaced. + + + + + Weighted learner skill evidence aggregator combining Placement, Mock Tests, + Practice Exercises (Quick Check / Group Quiz / Stage Assessment), and Scheduled SRS recall. + Never promotes unassessed skills to fake percentages or treats flashcard count alone as JLPT mastery. + + + + + Weighted learner skill evidence aggregator combining Placement, Mock Tests, + Practice Exercises (Quick Check / Group Quiz / Stage Assessment), and Scheduled SRS recall. + Never promotes unassessed skills to fake percentages or treats flashcard count alone as JLPT mastery. + + + + + Pattern:
+ \\s+
+ Explanation:
+ + ○ Match a whitespace character atomically at least once.
+
+
+
+ + The raw stored availability+policy value, echoed back by the Admin UI for optimistic concurrency. + + + + "SaleStopped" / "SaleResumed" when only the selling status changed (so history never reads "deleted" for a plan + that was merely taken off sale), otherwise "Updated". Revision is ignored because every save bumps it. + + + + + Streak milestones (days). Mirrors the learner UI milestone chain; the server decides which event a day earns. + + + + + Single source of truth for streak values: valid learning activity = lesson progress, SRS review history, + or a mock test attempt, bucketed into Asia/Ho_Chi_Minh study days. Visiting pages never creates activity. + + + + + Server-decided streak event for today (Asia/Ho_Chi_Minh), at most one of each kind per study day: + - "daily"/"milestone": today already holds a verified learning activity (celebrate the extended streak); + - "atRisk": a live streak (last activity yesterday) and nothing studied yet today (keep-the-streak reminder). + Visiting pages never creates activity; the event kind only reflects real activity data. + + + + + In-class skill quizzes. Questions come from the approved, non-protected question bank of the class level + (never the Placement / end-of-course bank) or are authored by the Mentor for this class only (never added to + the shared bank). A quiz is frozen at publication; attempts, autosave and scoring run on the assessment engine. + Results are 0–100% per skill and stay separate from Homework (0–10) and from the end-of-course assessment. + + + + + In-class skill quizzes. Questions come from the approved, non-protected question bank of the class level + (never the Placement / end-of-course bank) or are authored by the Mentor for this class only (never added to + the shared bank). A quiz is frozen at publication; attempts, autosave and scoring run on the assessment engine. + Results are 0–100% per skill and stay separate from Homework (0–10) and from the end-of-course assessment. + + + + Approved, auto-gradable single-choice questions of the level, excluding the protected assessment bank. + + + NotStarted | InProgress | Completed | Overdue (deadline passed without a submitted attempt). + + + Synthetic option ids for Mentor-authored questions, far outside the bank's identity range. + + + + Single rule for the learning-record lock of a completed class: once a class (StudyCohort) is "Completed", + homework, in-class quizzes, attendance and schedule data become read-only for every role (Admin included). + Post-course flows (end-of-course assessment, Mentor review, complaints, retake support) are not learning + records and stay open. Use inside a transaction so a write can never + slip in after the class-completion transaction (both take the same class advisory lock). + + + + Takes the class lock (transaction-scoped) and then re-reads the class status. + + + + Single source of truth for "which class session is open" (Session Lifecycle "Đang mở"). + A session is opened by the system — when enrollment is closed (first session) and when the Mentor ends the + previous session (next session) — never by the device clock or a manual "Bắt đầu buổi học" button. + Opening only grants Meeting Room access and attendance; it does NOT record that teaching happened: + stays null until the Mentor really connects to the room. + Callers must hold the class lock (LockCohortAsync) and load Sessions with Availability. + + + + Valid required sessions in teaching order (cancelled / replaced slots excluded). + + + + Opens the next valid required session when the class is open and none is open yet. + At most one open session per class; never skips order; idempotent (returns the already-open session). + Returns null when the class is not open or every required session is finished. + + + + + AI kiểm tra nội dung Content Author mới thêm: Lesson (+Kanji/Vocabulary/Grammar liên kết), + Kanji, Vocabulary, GrammarPattern, MockTest (+Section +Question +Option), PracticeExercise (+Question +Option). + 2 lớp: (1) Rule — kiểm tra bằng code (chắc chắn); (2) AI — kiểm tra ngữ nghĩa. + Mọi lỗi chỉ rõ: mục nào (ItemType/ItemId/ItemLabel), trường nào (Field), giá trị hiện tại, lý do, gợi ý sửa. + + + + + AI kiểm tra nội dung Content Author mới thêm: Lesson (+Kanji/Vocabulary/Grammar liên kết), + Kanji, Vocabulary, GrammarPattern, MockTest (+Section +Question +Option), PracticeExercise (+Question +Option). + 2 lớp: (1) Rule — kiểm tra bằng code (chắc chắn); (2) AI — kiểm tra ngữ nghĩa. + Mọi lỗi chỉ rõ: mục nào (ItemType/ItemId/ItemLabel), trường nào (Field), giá trị hiện tại, lý do, gợi ý sửa. + + + + Danh sách đáp án (đã sắp xếp) và vị trí (1-based) các đáp án được đánh dấu đúng. + + + Danh sách đáp án (đã sắp xếp) và vị trí (1-based) các đáp án được đánh dấu đúng. + + + + Một mục cần kiểm tra. Fields = trường author nhập (AI/Rule được phép báo lỗi), + Context = thông tin tham chiếu (không báo lỗi trên đó). + + + + + Một mục cần kiểm tra. Fields = trường author nhập (AI/Rule được phép báo lỗi), + Context = thông tin tham chiếu (không báo lỗi trên đó). + + + + Ghi các đáp án vào Fields thành Option1..OptionN + CorrectOptions để chỉ rõ từng đáp án khi báo lỗi. + + + + AI hỗ trợ content author soạn nội dung: Kanji, Vocabulary, GrammarPattern, Lesson, + PracticeExercise, MockTest. Mọi loại đều theo pattern 2 bước (Suggest -> Confirm). + + GIẢ ĐỊNH CẦN XÁC NHẬN (không có trong Entities.zip, đã đánh dấu TODO ở chỗ dùng): + - unitOfWork có các repo: Vocabularies, GrammarPatterns, LanguageSkills, CertificateLevels, CertificateSections. + - ImportEntityType có các giá trị: Kanji, Vocabulary, Lesson, PracticeExercise, MockTest và một giá trị cho ngữ pháp (GrammarPattern hoặc Grammar). + - Tầng Apply (sau khi admin duyệt) deserialize PayloadJson theo đúng shape ở các hàm Confirm* bên dưới. + + + + + AI hỗ trợ content author soạn nội dung: Kanji, Vocabulary, GrammarPattern, Lesson, + PracticeExercise, MockTest. Mọi loại đều theo pattern 2 bước (Suggest -> Confirm). + + GIẢ ĐỊNH CẦN XÁC NHẬN (không có trong Entities.zip, đã đánh dấu TODO ở chỗ dùng): + - unitOfWork có các repo: Vocabularies, GrammarPatterns, LanguageSkills, CertificateLevels, CertificateSections. + - ImportEntityType có các giá trị: Kanji, Vocabulary, Lesson, PracticeExercise, MockTest và một giá trị cho ngữ pháp (GrammarPattern hoặc Grammar). + - Tầng Apply (sau khi admin duyệt) deserialize PayloadJson theo đúng shape ở các hàm Confirm* bên dưới. + + + + + Giá trị ImportEntityType dành cho ngữ pháp. Dò theo tên (GrammarPattern / Grammar) để service vẫn build + được dù enum đặt tên nào. Khuyến nghị: thêm đúng giá trị "GrammarPattern" vào enum ImportEntityType. + + + + Kiểm tra độ chính xác cho các loại "bảng phẳng" (Vocabulary, Grammar): gửi nguyên PayloadJson cho AI chấm. + + + + Kiểm tra PracticeExercise / MockTest: (1) kiểm tra cấu trúc bằng code (đúng 1 đáp án đúng, đủ 4 đáp án...), + (2) cho AI tự giải lại đề KHÔNG thấy đáp án, rồi so với đáp án đang đánh dấu. Lệch => gắn cờ để author xem lại. + Lưu ý: AI giải lệch KHÔNG chứng minh đáp án sai, chỉ là dấu hiệu cần người kiểm tra. + + + + Kiểm tra cấu trúc câu hỏi trắc nghiệm bằng code (không tốn AI). Trả về danh sách vấn đề (tiếng Việt). + + + + Xác định ngữ cảnh cho Suggest/Confirm Kanji, Vocabulary, Grammar. + - Author chọn bài học: cấp độ lấy TỪ CHÍNH BÀI HỌC đó (nếu request cũng gửi cấp độ mà lệch thì báo lỗi). + - Không chọn bài học: bắt buộc phải có CertificateLevelId trong request. + + + + + Nạp cấp độ kèm loại chứng chỉ. Nếu request có chọn CertificateTypeId thì cấp độ phải thuộc đúng loại đó + (ví dụ N4 thuộc JLPT, không thuộc NAT-TEST). Loại chứng chỉ phải còn hoạt động. + + + + Thêm khối [NGỮ CẢNH] vào prompt: cấp độ, bài học đang soạn, và các mục ĐÃ có sẵn trong bài này. + + + Gọi AI + parse/validate, thử lại tối đa MaxAiAttempts lần, kèm lý do lần trước bị từ chối. + + + Ghi các bản nháp vào ContentApprovalRequest (cùng 1 BatchId) để admin duyệt — giống luồng Confirm Kanji. + + + Xáo trộn thứ tự đáp án bằng code để loại bỏ thiên kiến vị trí của AI (hay đặt đáp án đúng ở A/B). + + + Chuyển đổi các draft câu hỏi/đề thi về payload chuẩn hóa dùng chung cho ContentApprovalService. + + + Bộ kiểm tra hợp lệ chuẩn hóa dùng chung cho Biên soạn thủ công, Trợ lý AI, Nhập liệu đa định dạng, Exam Builder và Kiểm duyệt. + + + + Pattern:
+ \\s+
+ Explanation:
+ + ○ Match a whitespace character atomically at least once.
+
+
+
+ + + Pattern:
+ [\\u3040-\\u309F\\u30A0-\\u30FF]
+ Explanation:
+ + ○ Match a character in the set [\u3040-\u30FF].
+
+
+
+ + + Pattern:
+ [\\u4E00-\\u9FFF]
+ Explanation:
+ + ○ Match a character in the set [\u4E00-\u9FFF].
+
+
+
+ + + Pattern:
+ [\\u3040-\\u30FF\\u4E00-\\u9FFF]
+ Explanation:
+ + ○ Match a character in the set [\u3040-\u30FF\u4E00-\u9FFF].
+
+
+
+ + Chống lỗi Formula Injection khi xuất CSV/Excel. + + + + + Review state lives in ContentApprovalRequest; approved payload is mapped by ContentApprovalService. + + + Review state lives in ContentApprovalRequest; approved payload is mapped by ContentApprovalService. + + + Dịch vụ lắp ráp Bộ đề luyện tập, Luyện tập hỗn hợp và Đề thi thử JLPT từ Ngân hàng câu hỏi thống nhất. + + + Dịch vụ lắp ráp Bộ đề luyện tập, Luyện tập hỗn hợp và Đề thi thử JLPT từ Ngân hàng câu hỏi thống nhất. + + + + Chính sách cấu trúc đề thi JLPT chính thức (phiên bản JLPT-2026-V1). + Nguồn tham chiếu: https://www.jlpt.jp/e/guideline/testsections.html + + + + Approval requests own publication state; the mock content tables only hold content. + + + Trợ lý AI nội tuyến cho trình biên soạn câu hỏi JLPT (5 kỹ năng + phân tích + before/after + schema check). + + + Trợ lý AI nội tuyến cho trình biên soạn câu hỏi JLPT (5 kỹ năng + phân tích + before/after + schema check). + + + Read section-bound questions. Authors edit questions through the exam builder. + + + Read section-bound questions. Authors edit questions through the exam builder. + + + + Ensures a legacy review decision already stored on the request row is captured in + ReviewHistoryJson before an author revision clears current ReviewNote/ReviewedAt columns. + + + + Sinh 7 mẫu nhập liệu JLPT chuẩn (.xlsx / .json) kèm hướng dẫn, phiên bản và dữ liệu mẫu tách biệt. + + + Pipeline nhập liệu đa định dạng hợp nhất (.xlsx, .json, .zip, text .pdf) với Preview không side-effect và Confirm transaction + idempotent. + + + Pipeline nhập liệu đa định dạng hợp nhất (.xlsx, .json, .zip, text .pdf) với Preview không side-effect và Confirm transaction + idempotent. + + + + Pattern:
+ ^(?:(?:Q|Câu|問)?\\s*(\\d{1,3}))[\\.\\):]\\s*(.+)$
+ Options:
+ RegexOptions.IgnoreCase
+ Explanation:
+ + ○ Match if at the beginning of the string.
+ ○ Optional (greedy).
+ ○ Match with 3 alternative expressions.
+ ○ Match a character in the set [Qq].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Cc].
+ ○ Match a character in the set [\u00C2\u00E2].
+ ○ Match a character in the set [Uu].
+ ○ Match '問'.
+ ○ Match a whitespace character atomically any number of times.
+ ○ 1st capture group.
+ ○ Match a Unicode digit atomically at least 1 and at most 3 times.
+ ○ Match a character in the set [).:].
+ ○ Match a whitespace character greedily any number of times.
+ ○ 2nd capture group.
+ ○ Match a character other than '\n' greedily at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + Pattern:
+ ^([A-D1-4ア-エ])[\\.\\):]\\s*(.+)$
+ Explanation:
+ + ○ Match if at the beginning of the string.
+ ○ 1st capture group.
+ ○ Match a character in the set [1-4A-D\u30A2-\u30A8].
+ ○ Match a character in the set [).:].
+ ○ Match a whitespace character greedily any number of times.
+ ○ 2nd capture group.
+ ○ Match a character other than '\n' greedily at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + Pattern:
+ ^(?:Đáp án|Answer|Ans|正解|答え)\\s*[::]\\s*(.+)$
+ Options:
+ RegexOptions.IgnoreCase
+ Explanation:
+ + ○ Match if at the beginning of the string.
+ ○ Match with 5 alternative expressions.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [\u0110\u0111].
+ ○ Match a character in the set [\u00C1\u00E1].
+ ○ Match a character in the set [Pp].
+ ○ Match ' '.
+ ○ Match a character in the set [\u00C1\u00E1].
+ ○ Match a character in the set [Nn].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Nn].
+ ○ Match a character in the set [Ss].
+ ○ Match a character in the set [Ww].
+ ○ Match a character in the set [Ee].
+ ○ Match a character in the set [Rr].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Nn].
+ ○ Match a character in the set [Ss].
+ ○ Match the string "正解".
+ ○ Match the string "答え".
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match a character in the set [:\uFF1A].
+ ○ Match a whitespace character greedily any number of times.
+ ○ 1st capture group.
+ ○ Match a character other than '\n' greedily at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + Pattern:
+ ^(?:Giải thích|Explanation|Note|解説)\\s*[::]\\s*(.+)$
+ Options:
+ RegexOptions.IgnoreCase
+ Explanation:
+ + ○ Match if at the beginning of the string.
+ ○ Match with 4 alternative expressions.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Gg].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [\u1EA2\u1EA3].
+ ○ Match a character in the set [Ii].
+ ○ Match ' '.
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Hh].
+ ○ Match a character in the set [\u00CD\u00ED].
+ ○ Match a character in the set [Cc].
+ ○ Match a character in the set [Hh].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Ee].
+ ○ Match a character in the set [Xx].
+ ○ Match a character in the set [Pp].
+ ○ Match a character in the set [Ll].
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Nn].
+ ○ Match a character in the set [Aa].
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [Oo].
+ ○ Match a character in the set [Nn].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Nn].
+ ○ Match a character in the set [Oo].
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Ee].
+ ○ Match the string "解説".
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match a character in the set [:\uFF1A].
+ ○ Match a whitespace character greedily any number of times.
+ ○ 1st capture group.
+ ○ Match a character other than '\n' greedily at least once.
+ ○ Match if at the end of the string or if before an ending newline.
+
+
+
+ + + AI kiểm tra nội dung (Rule + AI) và trả danh sách lỗi chỉ rõ mục/trường/lý do. + Lesson/Kanji/Vocabulary/GrammarPattern: kiểm tra bản nháp (PayloadJson); MockTest/PracticeExercise: đọc từ DB. + + + + Kết quả AI kiểm tra gần nhất (Author xem để sửa, Admin xem khi duyệt). + + + + Lớp điều phối Plan → Execute → Confirm đặt trên . + + Nguyên tắc: AI chỉ làm việc "hiểu yêu cầu" (Plan) và "viết nội dung" (Execute từng việc). Mọi thứ còn lại do code + quyết định: id cấp độ/kỹ năng/phần thi lấy từ danh mục thật trong DB, thứ tự phụ thuộc, giới hạn số lượng, + liên kết giữa các nội dung, kiểm tra cấu trúc trước khi gửi duyệt. + + GIẢ ĐỊNH CẦN XÁC NHẬN (không có trong Entities.zip): + - ApiResponse có các thuộc tính IsSuccess, Result, StatusCode (HttpStatusCode), Message. + - unitOfWork có repo CertificateLevels, CertificateSections, LanguageSkills, Lessons, Kanjis, Vocabularies, + GrammarPatterns, ContentApprovalRequests; CertificateLevel có nav CertificateType (Name), SortOrder. + - ImportEntityType có các giá trị Kanji, Vocabulary, Lesson, PracticeExercise, MockTest và một giá trị cho ngữ pháp (Grammar/GrammarPattern). + - Tầng Apply (sau khi admin duyệt) xử lý các dòng của cùng BatchId THEO THỨ TỰ SourceRowNumber + (Kanji → Vocabulary → Grammar → Lesson → PracticeExercise → MockTest) và hiểu shape PayloadJson ở ConfirmPlanAsync, + đặc biệt các liên kết theo khóa tự nhiên (newKanji / newVocabulary / newGrammar / newLessonTitle). + + + + + Lớp điều phối Plan → Execute → Confirm đặt trên . + + Nguyên tắc: AI chỉ làm việc "hiểu yêu cầu" (Plan) và "viết nội dung" (Execute từng việc). Mọi thứ còn lại do code + quyết định: id cấp độ/kỹ năng/phần thi lấy từ danh mục thật trong DB, thứ tự phụ thuộc, giới hạn số lượng, + liên kết giữa các nội dung, kiểm tra cấu trúc trước khi gửi duyệt. + + GIẢ ĐỊNH CẦN XÁC NHẬN (không có trong Entities.zip): + - ApiResponse có các thuộc tính IsSuccess, Result, StatusCode (HttpStatusCode), Message. + - unitOfWork có repo CertificateLevels, CertificateSections, LanguageSkills, Lessons, Kanjis, Vocabularies, + GrammarPatterns, ContentApprovalRequests; CertificateLevel có nav CertificateType (Name), SortOrder. + - ImportEntityType có các giá trị Kanji, Vocabulary, Lesson, PracticeExercise, MockTest và một giá trị cho ngữ pháp (Grammar/GrammarPattern). + - Tầng Apply (sau khi admin duyệt) xử lý các dòng của cùng BatchId THEO THỨ TỰ SourceRowNumber + (Kanji → Vocabulary → Grammar → Lesson → PracticeExercise → MockTest) và hiểu shape PayloadJson ở ConfirmPlanAsync, + đặc biệt các liên kết theo khóa tự nhiên (newKanji / newVocabulary / newGrammar / newLessonTitle). + + + + + Kiểm tra kế hoạch bằng code (dùng cho cả Plan lẫn Execute vì author có thể đã sửa tay). + Chuẩn hóa luôn các giá trị (clamp số lượng, suy ra cấp độ/kỹ năng từ bài học trong kế hoạch). + Trả về thông báo lỗi tiếng Việt, hoặc null nếu hợp lệ. + + + + + Lấy thông báo lỗi từ ApiResponse. ApiResponse không có thuộc tính "Message" nên dò theo tên các thuộc tính + thường gặp; nếu bạn biết đúng tên thuộc tính thì thay hàm này bằng truy cập trực tiếp. + + + + Gọi AI + parse/validate, thử lại tối đa MaxAiAttempts lần, kèm lý do lần trước bị từ chối. + + + + Ánh xạ ContentEntityType (loại nội dung Author thao tác) sang ImportEntityType + (loại lưu trong ContentApprovalRequest). Chỉ các loại đi qua bản nháp/duyệt mới có mapping: + Lesson, Kanji, Vocabulary, GrammarPattern. + + + + Loại nội dung đi qua ContentApprovalRequest (staging) thay vì ghi thẳng vào bảng chính. + + + + Single source of the Stage 5 business rules shared by the Learner assessment flow and the + Mentor/Learner competency profile: who may take the end-of-course assessment, which attempt is the official + milestone, and how a pre-course vs end-of-course comparison is scoped so both sides use the same scale. + + + + One official end-of-course attempt per class enrollment (the first completed attempt is the milestone). + + + Same pass mark the assessment engine uses to recognise a tested JLPT level (60% correct). + + + A skill change below this many percentage points is reported as "unchanged" (same rule as before). + + + End-of-course attempts that belong to exactly this class enrollment (link stored in the attempt snapshot). + + + + A pre-course result pinned to this class enrollment (CourseAssessment attempt with Purpose "CourseBaseline"), + completed before the class started. When present it is the class baseline and takes precedence over the + learner's global Placement history. + + + + + Correct / total per assessed JLPT skill, restricted to the given JLPT levels. Listening questions without + audio are excluded (never scored). Skills with no question in scope are absent — never reported as 0%. + + + + PayOS order codes for cohort enrollment. The snapshot binds a random code to one course without a schema change. + + + + Pattern:
+ <br\\s*/?>
+ Options:
+ RegexOptions.IgnoreCase
+ Explanation:
+ + ○ Match '<'.
+ ○ Match a character in the set [Bb].
+ ○ Match a character in the set [Rr].
+ ○ Match a whitespace character atomically any number of times.
+ ○ Match '/' atomically, optionally.
+ ○ Match '>'.
+
+
+
+ + + Pattern:
+ </(p|div|h1|h2|h3|h4|li|tr)>
+ Options:
+ RegexOptions.IgnoreCase
+ Explanation:
+ + ○ Match the string "</".
+ ○ 1st capture group.
+ ○ Match with 8 alternative expressions.
+ ○ Match a character in the set [Pp].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Dd].
+ ○ Match a character in the set [Ii].
+ ○ Match a character in the set [Vv].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Hh].
+ ○ Match '1'.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Hh].
+ ○ Match '2'.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Hh].
+ ○ Match '3'.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Hh].
+ ○ Match '4'.
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Ll].
+ ○ Match a character in the set [Ii].
+ ○ Match a sequence of expressions.
+ ○ Match a character in the set [Tt].
+ ○ Match a character in the set [Rr].
+ ○ Match '>'.
+
+
+
+ + + Pattern:
+ <[^>]+>
+ Explanation:
+ + ○ Match '<'.
+ ○ Match a character other than '>' atomically at least once.
+ ○ Match '>'.
+
+
+
+ + + Pattern:
+ [ \\t]{2,}
+ Explanation:
+ + ○ Match a character in the set [\t ] atomically at least twice.
+
+
+
+ + + Pattern:
+ \\n{3,}
+ Explanation:
+ + ○ Match '\n' atomically at least 3 times.
+
+
+
+ + + Orchestrator: đọc workbook -> với mỗi handler đã đăng ký, tìm đúng sheet theo tên -> gọi handler + diff -> gộp kết quả. Service này KHÔNG biết gì về Kanji/Vocabulary/... cụ thể, toàn bộ nghiệp vụ + riêng từng loại nằm trong các ISheetImportHandler (xem thư mục Handlers/). + + + + + Orchestrator: đọc workbook -> với mỗi handler đã đăng ký, tìm đúng sheet theo tên -> gọi handler + diff -> gộp kết quả. Service này KHÔNG biết gì về Kanji/Vocabulary/... cụ thể, toàn bộ nghiệp vụ + riêng từng loại nằm trong các ISheetImportHandler (xem thư mục Handlers/). + + + + + Kiểm tra quyền ghi danh lớp nhóm dựa trên sổ cái CohortEnrollmentEntitlement tách biệt. + Từ chối mặc định (fail-closed) khi thiếu UnitOfWork hoặc không có quyền Active hợp lệ cho lớp. + + + + Extracts text of one private file; is used in warnings (no file names / personal data). + + + Validated files of a new giao bài plus the Mentor's private answer guide. + + + Validated files of a new giao bài plus the Mentor's private answer guide. + + + Store a Mentor draft privately; the short-lived signed URL is for preview only. + + + Detects JPG/PNG/PDF/DOCX from the real content (declared Content-Type and extension are not trusted). + + + Learners only ever see "Prompt" attachments; Mentor/Admin also see the internal answer key. + + + All rows of the same giao bài the Mentor may manage (rows of one request share a group key). + + + + Best-effort compensation for private objects uploaded during a request that then failed before saving. + Uses CancellationToken.None so an aborted request still cleans up; a cleanup failure never hides the original error. + + + + Giao bài with content, private answer guide and files in one request (multipart). + + + + Multi-file submission. lists already-submitted files to keep (edit before the + deadline); others are soft-deleted, are added. Same deadline/grade rules as every submit. + + + + + Private homework document formats beyond images/PDF. Only Word DOCX (OOXML) is accepted: it is a ZIP package + that must contain word/document.xml and no VBA project. Legacy binary DOC (OLE, macro-capable) is rejected. + + + + Structural check of a DOCX package (no macros, bounded entry count). Never executes content. + + + Supported learner roadmap levels and canonical skill mappings, ordered from foundational to advanced. + + + Adaptive and standard study roadmap levels (N5-N2). + + + + Pattern:
+ <[^>]*>
+ Explanation:
+ + ○ Match '<'.
+ ○ Match a character other than '>' atomically any number of times.
+ ○ Match '>'.
+
+
+
+ + + Authoritative prerequisite resolver for flexible Learner setup: + Independent Goal (N5–N2) & Placement Assessment (flexible order) -> + Placement Compatibility & Explicit Skip -> Roadmap Eligibility (Standard / AI) -> + Initialized Roadmap State -> Scoped Progress. + + + + + Authoritative prerequisite resolver for flexible Learner setup: + Independent Goal (N5–N2) & Placement Assessment (flexible order) -> + Placement Compatibility & Explicit Skip -> Roadmap Eligibility (Standard / AI) -> + Initialized Roadmap State -> Scoped Progress. + + + + + Learning Moments V1. Every moment is derived from data the backend already verified (saved learning goal, + submitted + graded placement/mock attempts, completed lesson progress, confirmed learning path, finished + scheduled SRS session with nothing left due). Opening a page never creates one. + + Presentation is exactly-once per learner + occurrence key: the claim inserts a + whose unique IdempotencyKey makes concurrent tabs/devices lose the race (no schema change needed). + Only recent occurrences are offered as pop-ups so existing learners are not flooded with old milestones; + everything earned stays visible in the achievement history. + + + + + Learning Moments V1. Every moment is derived from data the backend already verified (saved learning goal, + submitted + graded placement/mock attempts, completed lesson progress, confirmed learning path, finished + scheduled SRS session with nothing left due). Opening a page never creates one. + + Presentation is exactly-once per learner + occurrence key: the claim inserts a + whose unique IdempotencyKey makes concurrent tabs/devices lose the race (no schema change needed). + Only recent occurrences are offered as pop-ups so existing learners are not flooded with old milestones; + everything earned stays visible in the achievement history. + + + + Copies display-only facts (phase count, plan length) from a stored AI path; ignores bad JSON. + + + Transparent planning heuristics, not a JLPT pass predictor. + + + Một bài học trong DB, gắn với 1 trong 4 kỹ năng ôn luyện JLPT và mức độ của bài học đó. + + + Một bài học trong DB, gắn với 1 trong 4 kỹ năng ôn luyện JLPT và mức độ của bài học đó. + + + + Bốn kỹ năng ôn luyện: từ vựng, ngữ pháp, đọc hiểu, nghe hiểu. + Phân biệt với cách gộp phần thi/chấm điểm JLPT thật theo cấp độ. + + Kết quả đánh giá năng lực của người học cho MỘT nhóm kỹ năng, dựa trên bài Placement gần nhất. + + + + Bốn kỹ năng ôn luyện: từ vựng, ngữ pháp, đọc hiểu, nghe hiểu. + Phân biệt với cách gộp phần thi/chấm điểm JLPT thật theo cấp độ. + + Kết quả đánh giá năng lực của người học cho MỘT nhóm kỹ năng, dựa trên bài Placement gần nhất. + + + Điểm mạnh / điểm yếu theo từng kỹ năng — viết sẵn bằng tiếng Việt, không qua AI. + + + Đoạn đánh giá khả thi + đề xuất ngày thi — viết sẵn bằng tiếng Việt, không qua AI. + + + Chấp nhận N1-N5 (trước đây hard-code chỉ N5/N4/N3, chặn nhầm N2/N1). + + + + Giữ lại đúng bài học trong danh mục hợp lệ của người học, loại id khác, gán tiêu đề thật và chuẩn hóa stt ngày. + + + + Trả null nếu hợp lệ, ngược lại trả lý do bị từ chối (để AI tự sửa ở lần retry). + + + AI đôi khi bọc JSON trong ```json ... ```; bỏ lớp bọc đó. + + + Hub gọi khi có 1 connection mới vào phòng (đếm người để biết khi nào phòng trống). + + + + Kiểm tra trùng lặp, chồng lấn và khoảng nghỉ tối thiểu trong tuần (bao gồm ranh giới cuối ngày sang đầu ngày hôm sau + và ranh giới Chủ nhật sang Thứ 2 tuần kế tiếp nếu khóa học >= 2 tuần). + + + + + V4 Full-Week Scheduling Engine (Thứ 2 -> Chủ nhật): + Từ Hạn tuyển sinh () và số ngày chuẩn bị tối thiểu, + xác định tuần đầy đủ (Thứ 2..Chủ nhật) hợp lệ sớm nhất sao cho toàn bộ khóa học khớp khung giờ tuần + và không xung đột với bất kỳ lịch chính thức nào của chính Giáo viên. + + + + + + Lấy trọng số thực tế của câu hỏi từ SkillMetadataJson nếu có cấu hình; mặc định = 1.0. + + + + Placement chỉ có câu chọn 1 đáp án: validate option thuộc câu hỏi rồi chấm luôn. + + + Lấy attempt placement đang làm dở của chính learner. + + + + Loads attempt answers without materializing legacy shadow columns from MockQuestions or MockTests. + Those columns are not present in every deployed schema, but the learner flows below only need + question content, options, section, test and level data. + + + + + Dựng kết quả placement từ các answer đã chấm. Trình độ hiện tại = level khó nhất đạt >= PlacementPassPercent + (không level nào đạt thì lấy level dễ nhất); mục tiêu đề xuất = level liền trên đó. + Giả định LevelInfo.SortOrder tăng dần theo độ khó (N5 -> N2). + + + + Joins the normalized Excel sheets by natural keys, never by database IDs. + + + + V3 SRS Boundary: removing or soft-deleting Notebook items NEVER deletes or archives existing ReviewCards. + Any linked SRS card stays Active with its review history and scheduling preserved cleanly. + + + + Processes PayOS callbacks for learner subscriptions, AI top-ups, and cohort courses. + + Response policy (PayOS retries any non-2xx webhook): + forged/unsigned → 400 (nothing changes); a signed event that can never apply here (unknown order, amount or link + mismatch, PayOS's own confirm-webhook test) → 200 acknowledged with no grant, logged for review; + a transient failure (database/concurrency) → 5xx so PayOS retries — the order is never marked done on a failed write. + + + + Processes PayOS callbacks for learner subscriptions, AI top-ups, and cohort courses. + + Response policy (PayOS retries any non-2xx webhook): + forged/unsigned → 400 (nothing changes); a signed event that can never apply here (unknown order, amount or link + mismatch, PayOS's own confirm-webhook test) → 200 acknowledged with no grant, logged for review; + a transient failure (database/concurrency) → 5xx so PayOS retries — the order is never marked done on a failed write. + + + + + Reads the roadmap back (same service the Stage Detail page uses) after the attempt is saved and reports the + transition this submission caused. A milestone is only reported on the first passing attempt, so retakes, + duplicate requests (rejected earlier as already submitted) and refreshes never produce a second celebration. + Never fails the submission: progression problems return null and the page simply refetches the roadmap. + + + + + In-class quiz attempts on the shared assessment engine: the frozen quiz version becomes the attempt snapshot, + autosave/submit/result reuse the Placement attempt endpoints, and scoring is the same engine core. + The attempt deadline is the earlier of (start + time limit) and the quiz deadline; the server is authoritative. + + + End-of-course competency assessment (Stage 5). Reuses the Placement assessment engine end to end: + the same question selection policy, snapshot, autosave, timer, scoring and result model. The attempt is + stored as and linked to one class enrollment through its snapshot, + so it never changes the learner's global Placement history, level or learning-path decision. + + + + + Completes, from the answers saved before the deadline, any of the given quiz attempts whose time is over + and that the learner never submitted. Idempotent; used before lists and reports are built. + + + + A quiz is a test, not a placement: drop the Placement-only "not studied yet" choice. + + + Marks the learner's class quiz assignment as completed when its attempt is graded. + + + + Shared question selection for the competency assessment engine (Placement and CourseFinal): + same per-skill structure, level scope (target + one lower comparison level), audio/passage validity rules, + and preference for questions the learner has not seen before. + + + + + Engine scoring core shared by learner submission and server-side finalisation of expired attempts: + marks every frozen question, persists answer/section rows and the canonical result on the attempt. + Class quiz attempts also complete their assignment. The caller saves the unit of work. + + + + + Fills the graded-question scope used by every analysis view: a listening section without audio evidence + (the same rule the skill breakdown uses) is "chưa đánh giá" and leaves the denominator. Stored scores are untouched. + Blank = no answer or the "chưa học" option. + + + + + Safely reconstructs completed Placement results when legacy attempts lack `CompletedResult` in QuestionSnapshotJson, + strictly from existing frozen snapshot questions, persisted MockTestSectionResults, or persisted MockTestAnswers. + Never mutates historical scores or fabricates missing question data. + + + + + Rebuilds only the legacy recovery graph from explicit columns. The repository Include query + materializes shadow metadata columns that are absent in some deployed databases. + + + + + Completed attempts in the same quota scope as (same snapshot rules), numbered by + start order so "Lần 1/Lần 2" never changes after refresh or a later attempt. Read-only; scores are the stored ones. + + + + "CourseFinal" for an end-of-course assessment; null for the learner's own Placement. + + + Class (StudyCohort) the end-of-course attempt belongs to. + + + Learner enrollment (StudyCourse) the end-of-course attempt belongs to. + + + In-class quiz (Purpose "ClassQuiz") and the learner assignment this attempt belongs to. + + + Answer explanation (class quiz review only; never sent while the attempt is running). + + + Optional topic/difficulty labels copied from the bank (class quiz only). + + + + One place that resolves the class policy pinned to an enrollment and evaluates JLPT retake-support eligibility, + so Learner, Mentor and Admin screens and the request/review endpoints never compute it differently. + + + + + Policy that applies to the enrollment: the version pinned on the enrollment, else the version pinned on its class, + else (legacy rows only) the version effective when the course started. Never "the latest" policy. + + + + Stores the Mentor retake plan in the existing MentorSupportPlan column (JSON v1 or legacy text). + + + + Best-effort SignalR delivery of authoritative sidebar counter snapshots. + Never throws or aborts domain transactions. + + + + + Best-effort SignalR delivery of authoritative sidebar counter snapshots. + Never throws or aborts domain transactions. + + + + + Centralized, role-aware sidebar action/due counter service backed by live DB aggregations. + Every EF query executes sequentially on the scoped UnitOfWork DbContext and enforces strict RBAC + and ownership filtering from . + + + + + Centralized, role-aware sidebar action/due counter service backed by live DB aggregations. + Every EF query executes sequentially on the scoped UnitOfWork DbContext and enforces strict RBAC + and ownership filtering from . + + + + Deterministic, skill-adaptive curriculum roadmap built over canonical lesson progress and multi-source evidence. + + + Deterministic, skill-adaptive curriculum roadmap built over canonical lesson progress and multi-source evidence. + + + + Sequential gate over the ordered roadmap: once a step is not cleared, every later unfinished lesson is locked + and every later checkpoint stays closed. Lessons clear by passing their Quick Check (or by being studied when + they have none); a Group Quiz / Stage Assessment gates the following steps only when it has questions, so an + empty checkpoint never deadlocks the roadmap. Completed lessons stay open for review; explicit prerequisites + from Pass 2 are kept. + + + + + Completed classes where the signed-in Learner may still rate their Mentor (same rule as + : completed + paid, at least one Present session, not yet reviewed). + Drives the optional "Đánh giá Giáo viên" CTA on "Lớp của tôi"; it never blocks other features. + + + + + Pattern:
+ \\s+
+ Explanation:
+ + ○ Match a whitespace character atomically at least once.
+
+
+
+ + Learning notifications through the existing transactional outbox (same channel as class completion). + + + + PayOS order codes for self-study purchases. + + The legacy code was 900_000_000 + purchaseId. Several databases (local, shared, other machines) share one PayOS + channel and reuse the same id range, so PayOS rejected new orders whose code another environment had already used + ("Đơn thanh toán đã tồn tại", code 231) and checkout failed with HTTP 502. + + + V2 codes are 1_000_000_000_000 + purchaseId × 100_000 + nonce with a random 5-digit nonce, drawn again on a + duplicate. The purchase id stays decodable for webhook routing, while the binding to the order is the stored + PayOS paymentLinkId (checked on every webhook and reconciliation). Max value stays under 2^53−1 (PayOS limit). + + + + + + What a Pending order stores in PaymentTransactionId: {paymentLinkId}|{orderCode}, binding the order to the + exact PayOS link and code (no schema change; on activation the field holds the bank reference as before). + + + + Reads the link id and order code bound to a Pending order; legacy rows hold only the link id and the 900M code. + + + + The one mode the engine evaluates: DISABLED while an Admin suspends the feature, otherwise its stored access + policy. `IsCoreFree` is only the seed's original classification; every feature's policy is Admin-configurable. + + + + + Effective feature state for one learner/plan scenario (internal codes; UIs translate them): + AVAILABLE · ADMIN_DISABLED · CREDIT_LOCKED · PLAN_AND_CREDIT_LOCKED · PLAN_LOCKED. + + + + PayOS hosted-checkout link lifetime for a self-study order; the order is held Pending for the same window. + + + PayOS hosted-checkout address of a payment link (the same URL PayOS returns as checkoutUrl). + + + + Server-to-server reconciliation of one Pending order with PayOS (covers a lost/late webhook, a webhook that hit a + database error, a closed tab or a new device). Only an authenticated provider lookup whose link id, amount and order + code all match the stored order can change it; a provider outage leaves it Pending for the next attempt. + + + + Moves a Pending order to its final state under the learner lock; a concurrent webhook/poll that already did it wins. + + + Reconciles the learner's recent Pending orders so entitlements appear on any device even if no webhook arrived. + + + Validates media references without writing to storage during preview. + + + Custom -derived type for the HtmlTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the ZeroWidthCharsRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Custom -derived type for the HorizontalWhitespaceRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the ExcessiveNewlinesRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the UrlRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the EmailRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the ScriptTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the JavascriptSchemeRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the DataHtmlRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the InlineEventAttrRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the LegacyCommentMarkerRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the TrailingIntRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the ParentheticalRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the PunctuationRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Custom -derived type for the MultiSpaceRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the KanaRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Custom -derived type for the KanjiRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Custom -derived type for the JapaneseRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Custom -derived type for the PdfQuestionHeaderRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the PdfOptionRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the PdfAnswerRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the PdfExplanationRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the BreakTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the BlockEndTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the HtmlTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the MultiSpaceRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the MultiNewlineRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Custom -derived type for the HtmlTagRegex method. + + + Cached, thread-safe singleton instance. + + + Initializes the instance. + + + Provides a factory for creating instances to be used by methods on . + + + Creates an instance of a used by methods on . + + + Provides the runner that contains the custom logic implementing the specified regular expression. + + + Scan the starting from base.runtextstart for the next match. + The text being scanned by the regular expression. + + + Search starting from base.runtextpos for the next location a match could possibly start. + The text being scanned by the regular expression. + true if a possible match was found; false if no more matches are possible. + + + Determine whether at base.runtextpos is a match for the regular expression. + The text being scanned by the regular expression. + true if the regular expression matches at the current position; otherwise, false. + + + Helper methods used by generated -derived implementations. + + + Default timeout value set in , or if none was set. + + + Whether is non-infinite. + + + Finds the next index of any character that matches a whitespace character. + + + Finds the next index of any character that matches a character in the set [!(),-.:;?[]~\u2010\u3001\u3002\u300C-\u300F\u301C\u30FB\uFF01\uFF08\uFF09\uFF0C\uFF0E\uFF1F\uFF65\s]. + + + Finds the next index of any character that matches a character in the set [\u3040-\u30FF\u4E00-\u9FFF]. + + + Determines whether the specified index is a boundary. + + + Determines whether the character is part of the [\w] set. + + + Pushes 2 values onto the backtracking stack. + + + Supports searching for characters in or not in "\0\u0001\u0002\u0003\u0004\u0005\u0006\a\b\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f". + + + Supports searching for characters in or not in "HWhw". + + + Supports searching for characters in or not in "\0\u0001\u0002\u0003\u0004\u0005\u0006\a\b\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f\"#$%&'*+/0123456789<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz{|}\u007f". + + + Supports searching for characters in or not in "­​‌‍‎‏‪‫‬‭‮". + +
+
diff --git a/_codex-verify/Debug/net8.0/RikiPath.Domain.deps.json b/_codex-verify/Debug/net8.0/RikiPath.Domain.deps.json new file mode 100644 index 00000000..a5d66dd3 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.Domain.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "RikiPath.Domain/1.0.0": { + "runtime": { + "RikiPath.Domain.dll": {} + } + } + } + }, + "libraries": { + "RikiPath.Domain/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.Domain.dll b/_codex-verify/Debug/net8.0/RikiPath.Domain.dll new file mode 100644 index 00000000..844c2a09 Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Domain.dll differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Domain.pdb b/_codex-verify/Debug/net8.0/RikiPath.Domain.pdb new file mode 100644 index 00000000..2da50342 Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Domain.pdb differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.deps.json b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.deps.json new file mode 100644 index 00000000..d34da180 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.deps.json @@ -0,0 +1,1821 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "RikiPath.Infrastructure/1.0.0": { + "dependencies": { + "AWSSDK.S3": "3.7.511.8", + "AWSSDK.TranscribeService": "3.7.503.32", + "ClosedXML": "0.104.1", + "FluentValidation.AspNetCore": "11.3.0", + "LinqKit": "1.3.7", + "Microsoft.EntityFrameworkCore.Design": "8.0.8", + "MiniExcel": "1.46.0", + "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.8", + "Pgvector.EntityFrameworkCore": "0.2.1", + "RikiPath.Application": "1.0.0", + "RikiPath.Domain": "1.0.0" + }, + "runtime": { + "RikiPath.Infrastructure.dll": {} + } + }, + "AWSSDK.Core/3.7.501.1": { + "runtime": { + "lib/net8.0/AWSSDK.Core.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.501.1" + } + } + }, + "AWSSDK.S3/3.7.511.8": { + "dependencies": { + "AWSSDK.Core": "3.7.501.1" + }, + "runtime": { + "lib/net8.0/AWSSDK.S3.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.511.8" + } + } + }, + "AWSSDK.TranscribeService/3.7.503.32": { + "dependencies": { + "AWSSDK.Core": "3.7.501.1" + }, + "runtime": { + "lib/net8.0/AWSSDK.TranscribeService.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.503.32" + } + } + }, + "ClosedXML/0.104.1": { + "dependencies": { + "ClosedXML.Parser": "1.2.0", + "DocumentFormat.OpenXml": "3.0.1", + "ExcelNumberFormat": "1.1.0", + "RBush": "3.2.0", + "SixLabors.Fonts": "1.0.0", + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/netstandard2.1/ClosedXML.dll": { + "assemblyVersion": "0.104.1.0", + "fileVersion": "0.104.1.0" + } + } + }, + "ClosedXML.Parser/1.2.0": { + "runtime": { + "lib/netstandard2.1/ClosedXML.Parser.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "DocumentFormat.OpenXml/3.0.1": { + "dependencies": { + "DocumentFormat.OpenXml.Framework": "3.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "dependencies": { + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.Framework.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "EntityFramework/6.5.0": { + "dependencies": { + "System.CodeDom": "7.0.0", + "System.Configuration.ConfigurationManager": "6.0.1", + "System.Data.SqlClient": "4.8.6" + }, + "runtime": { + "lib/netstandard2.1/EntityFramework.SqlServer.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.500.24.31301" + }, + "lib/netstandard2.1/EntityFramework.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.500.24.31301" + } + } + }, + "ExcelNumberFormat/1.1.0": { + "runtime": { + "lib/netstandard2.0/ExcelNumberFormat.dll": { + "assemblyVersion": "1.1.0.0", + "fileVersion": "1.1.0.0" + } + } + }, + "FirebaseAdmin/3.6.0": { + "dependencies": { + "Google.Api.Gax.Rest": "4.13.1", + "Google.Apis.Auth": "1.73.0" + }, + "runtime": { + "lib/net6.0/FirebaseAdmin.dll": { + "assemblyVersion": "3.6.0.0", + "fileVersion": "3.6.0.0" + } + } + }, + "FluentValidation/11.5.1": { + "runtime": { + "lib/net7.0/FluentValidation.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.5.1.0" + } + } + }, + "FluentValidation.AspNetCore/11.3.0": { + "dependencies": { + "FluentValidation": "11.5.1", + "FluentValidation.DependencyInjectionExtensions": "11.5.1" + }, + "runtime": { + "lib/net6.0/FluentValidation.AspNetCore.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.3.0.0" + } + } + }, + "FluentValidation.DependencyInjectionExtensions/11.5.1": { + "dependencies": { + "FluentValidation": "11.5.1", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.1/FluentValidation.DependencyInjectionExtensions.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.5.1.0" + } + } + }, + "Google.Api.Gax/4.13.1": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Newtonsoft.Json": "13.0.4", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Api.Gax.Rest/4.13.1": { + "dependencies": { + "Google.Api.Gax": "4.13.1", + "Google.Apis.Auth": "1.73.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.Rest.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Apis/1.73.0": { + "dependencies": { + "Google.Apis.Core": "1.73.0" + }, + "runtime": { + "lib/net6.0/Google.Apis.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Auth/1.73.0": { + "dependencies": { + "Google.Apis": "1.73.0", + "Google.Apis.Core": "1.73.0", + "System.Management": "7.0.2" + }, + "runtime": { + "lib/net6.0/Google.Apis.Auth.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Core/1.73.0": { + "dependencies": { + "Newtonsoft.Json": "13.0.4" + }, + "runtime": { + "lib/net6.0/Google.Apis.Core.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Humanizer.Core/2.14.1": { + "runtime": { + "lib/net6.0/Humanizer.dll": { + "assemblyVersion": "2.14.0.0", + "fileVersion": "2.14.1.48190" + } + } + }, + "LinqKit/1.3.7": { + "dependencies": { + "EntityFramework": "6.5.0", + "LinqKit.Core": "1.2.7" + }, + "runtime": { + "lib/netstandard2.1/LinqKit.dll": { + "assemblyVersion": "1.3.7.0", + "fileVersion": "1.3.7.0" + } + } + }, + "LinqKit.Core/1.2.7": { + "runtime": { + "lib/netstandard2.1/LinqKit.Core.dll": { + "assemblyVersion": "1.2.7.0", + "fileVersion": "1.2.7.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "runtime": { + "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.CodeAnalysis.Common/4.5.0": { + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.CSharp/4.5.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Common": "4.5.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.CodeAnalysis.CSharp": "4.5.0", + "Microsoft.CodeAnalysis.Common": "4.5.0", + "Microsoft.CodeAnalysis.Workspaces.Common": "4.5.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.CodeAnalysis.Common": "4.5.0", + "System.Composition": "6.0.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.EntityFrameworkCore/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "8.0.8", + "Microsoft.Extensions.Caching.Memory": "8.0.1" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.8": { + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Design/8.0.8": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.CodeAnalysis.CSharp.Workspaces": "4.5.0", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Microsoft.Extensions.DependencyModel": "8.0.1", + "Mono.TextTemplating": "2.2.1" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Design.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore": "8.0.8" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Caching.Memory.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.DependencyModel/8.0.1": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyModel.dll": { + "assemblyVersion": "8.0.0.1", + "fileVersion": "8.0.724.31311" + } + } + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.Options/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Options.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.224.6711" + } + } + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.Win32.SystemEvents/6.0.0": { + "runtime": { + "lib/net6.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "MiniExcel/1.46.0": { + "runtime": { + "lib/net8.0/MiniExcel.dll": { + "assemblyVersion": "1.46.0.0", + "fileVersion": "1.46.0.0" + } + } + }, + "Mono.TextTemplating/2.2.1": { + "dependencies": { + "System.CodeDom": "7.0.0" + }, + "runtime": { + "lib/netstandard2.0/Mono.TextTemplating.dll": { + "assemblyVersion": "2.2.0.0", + "fileVersion": "2.2.1.1" + } + } + }, + "Newtonsoft.Json/13.0.4": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.4.30916" + } + } + }, + "Npgsql/8.0.4": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "10.0.12" + }, + "runtime": { + "lib/net8.0/Npgsql.dll": { + "assemblyVersion": "8.0.4.0", + "fileVersion": "8.0.4.0" + } + } + }, + "Npgsql.EntityFrameworkCore.PostgreSQL/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore": "8.0.8", + "Microsoft.EntityFrameworkCore.Abstractions": "8.0.8", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Npgsql": "8.0.4" + }, + "runtime": { + "lib/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.8.0" + } + } + }, + "PdfPig/0.1.16": { + "runtime": { + "lib/net8.0/UglyToad.PdfPig.Core.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Fonts.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Package.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokenization.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokens.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + } + } + }, + "Pgvector/0.3.0": { + "dependencies": { + "Npgsql": "8.0.4" + }, + "runtime": { + "lib/net6.0/Pgvector.dll": { + "assemblyVersion": "0.3.0.0", + "fileVersion": "0.3.0.0" + } + } + }, + "Pgvector.EntityFrameworkCore/0.2.1": { + "dependencies": { + "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.8", + "Pgvector": "0.3.0" + }, + "runtime": { + "lib/net8.0/Pgvector.EntityFrameworkCore.dll": { + "assemblyVersion": "0.2.1.0", + "fileVersion": "0.2.1.0" + } + } + }, + "QuestPDF/2026.9.2": { + "runtime": { + "lib/net8.0/QuestPDF.dll": { + "assemblyVersion": "2026.9.2.0", + "fileVersion": "2026.9.2.0" + } + }, + "runtimeTargets": { + "runtimes/linux-arm64/native/libquestpdf_qpdf.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libquestpdf_skia.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_skia.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_skia.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_skia.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_skia.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_qpdf.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_skia.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_qpdf.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_skia.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_qpdf.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_skia.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "RBush/3.2.0": { + "runtime": { + "lib/net6.0/RBush.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.0.0" + } + } + }, + "runtime.native.System.Data.SqlClient.sni/4.7.0": { + "dependencies": { + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni": "4.4.0", + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni": "4.4.0", + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni": "4.4.0" + } + }, + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-arm64/native/sni.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-x64/native/sni.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-x86/native/sni.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "SixLabors.Fonts/1.0.0": { + "runtime": { + "lib/netcoreapp3.1/SixLabors.Fonts.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "SkiaSharp/3.119.2": { + "dependencies": { + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "SkiaSharp.NativeAssets.macOS": "3.119.2" + }, + "runtime": { + "lib/net8.0/SkiaSharp.dll": { + "assemblyVersion": "3.119.0.0", + "fileVersion": "3.119.2.0" + } + } + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "runtimeTargets": { + "runtimes/linux-arm/native/libSkiaSharp.so": { + "rid": "linux-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libSkiaSharp.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm/native/libSkiaSharp.so": { + "rid": "linux-musl-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm64/native/libSkiaSharp.so": { + "rid": "linux-musl-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-musl-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-riscv64/native/libSkiaSharp.so": { + "rid": "linux-musl-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libSkiaSharp.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-riscv64/native/libSkiaSharp.so": { + "rid": "linux-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libSkiaSharp.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x86/native/libSkiaSharp.so": { + "rid": "linux-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "runtimeTargets": { + "runtimes/osx/native/libSkiaSharp.dylib": { + "rid": "osx", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "runtimeTargets": { + "runtimes/win-arm64/native/libSkiaSharp.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/libSkiaSharp.pdb": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.pdb": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.pdb": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "System.CodeDom/7.0.0": { + "runtime": { + "lib/net7.0/System.CodeDom.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "System.Composition/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0", + "System.Composition.Convention": "6.0.0", + "System.Composition.Hosting": "6.0.0", + "System.Composition.Runtime": "6.0.0", + "System.Composition.TypedParts": "6.0.0" + } + }, + "System.Composition.AttributedModel/6.0.0": { + "runtime": { + "lib/net6.0/System.Composition.AttributedModel.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Convention/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.Convention.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Hosting/6.0.0": { + "dependencies": { + "System.Composition.Runtime": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.Hosting.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Runtime/6.0.0": { + "runtime": { + "lib/net6.0/System.Composition.Runtime.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.TypedParts/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0", + "System.Composition.Hosting": "6.0.0", + "System.Composition.Runtime": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.TypedParts.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Configuration.ConfigurationManager/6.0.1": { + "dependencies": { + "System.Security.Cryptography.ProtectedData": "6.0.0", + "System.Security.Permissions": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Configuration.ConfigurationManager.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.922.41905" + } + } + }, + "System.Data.SqlClient/4.8.6": { + "dependencies": { + "runtime.native.System.Data.SqlClient.sni": "4.7.0" + }, + "runtime": { + "lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + }, + "runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + } + } + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "runtime": { + "lib/net8.0/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "System.Drawing.Common/6.0.0": { + "dependencies": { + "Microsoft.Win32.SystemEvents": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Drawing.Common.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/net6.0/System.Drawing.Common.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + }, + "runtimes/win/lib/net6.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "7.7.3", + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "System.IO.Packaging/8.0.1": { + "runtime": { + "lib/net8.0/System.IO.Packaging.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "System.Management/7.0.2": { + "dependencies": { + "System.CodeDom": "7.0.0" + }, + "runtime": { + "lib/net7.0/System.Management.dll": { + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/System.Management.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + } + }, + "System.Security.Cryptography.ProtectedData/6.0.0": { + "runtime": { + "lib/net6.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Security.Permissions/6.0.0": { + "dependencies": { + "System.Windows.Extensions": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Security.Permissions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Windows.Extensions/6.0.0": { + "dependencies": { + "System.Drawing.Common": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Windows.Extensions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Windows.Extensions.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Tesseract/5.2.0": { + "runtime": { + "lib/netstandard2.0/Tesseract.dll": { + "assemblyVersion": "5.2.0.0", + "fileVersion": "5.2.0.0" + } + } + }, + "RikiPath.Application/1.0.0": { + "dependencies": { + "ClosedXML": "0.104.1", + "FirebaseAdmin": "3.6.0", + "Google.Apis.Auth": "1.73.0", + "Microsoft.EntityFrameworkCore": "8.0.8", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Microsoft.Extensions.Caching.Memory": "8.0.1", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2", + "Microsoft.IdentityModel.Tokens": "7.7.3", + "PdfPig": "0.1.16", + "QuestPDF": "2026.9.2", + "RikiPath.Domain": "1.0.0", + "SkiaSharp": "3.119.2", + "SkiaSharp.NativeAssets.Linux.NoDependencies": "3.119.2", + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "System.IO.Packaging": "8.0.1", + "System.IdentityModel.Tokens.Jwt": "7.7.3", + "Tesseract": "5.2.0" + }, + "runtime": { + "RikiPath.Application.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "RikiPath.Domain/1.0.0": { + "runtime": { + "RikiPath.Domain.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "RikiPath.Infrastructure/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "AWSSDK.Core/3.7.501.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VZR0LRAawpn5FQwXNPzhOO8DHhfffhBSvcSZT1d0ctcZ+kmsz3tzTArZnTQ9Haf/TNEqNLzKupHfjV2ndWAL4A==", + "path": "awssdk.core/3.7.501.1", + "hashPath": "awssdk.core.3.7.501.1.nupkg.sha512" + }, + "AWSSDK.S3/3.7.511.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QLHt7ucegMurWnwB3GomMeP6DiCG033aEittRiabMGnTOMZ5xyu7tbmTkqs3ZU5tBz4AK53Ak8WJkF+kk+s4Tw==", + "path": "awssdk.s3/3.7.511.8", + "hashPath": "awssdk.s3.3.7.511.8.nupkg.sha512" + }, + "AWSSDK.TranscribeService/3.7.503.32": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lkK7mo1JGyiXVCij5/BH5TPLDn36pBQb656K6Q9YpMs60t4vmp8kHVm0v748jjDIUo93bt+mKAApxzNqpPWL8Q==", + "path": "awssdk.transcribeservice/3.7.503.32", + "hashPath": "awssdk.transcribeservice.3.7.503.32.nupkg.sha512" + }, + "ClosedXML/0.104.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RVm2fUNWJlBJlg07shrfeWzrHPG5ypI/vARqdUOUbUdaog8yBw8l4IbCHf2MXt0AXtzaZqGNqhFaCAHigCBdfw==", + "path": "closedxml/0.104.1", + "hashPath": "closedxml.0.104.1.nupkg.sha512" + }, + "ClosedXML.Parser/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w+/0tsxABS3lkSH8EUlA7IGme+mq5T/Puf3DbOiTckmSuUpAUO2LK29oXYByCcWkBv6wcRHxgWlQb1lxkwI0Tw==", + "path": "closedxml.parser/1.2.0", + "hashPath": "closedxml.parser.1.2.0.nupkg.sha512" + }, + "DocumentFormat.OpenXml/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DCK1cwFUJ1FGGyYyo++HWl9H1RkqMWIu+FGOLRy6E4L4y0/HIhlJ7N/n1HKboFfOwKn1cMBRxt1RCuDbIEy5YQ==", + "path": "documentformat.openxml/3.0.1", + "hashPath": "documentformat.openxml.3.0.1.nupkg.sha512" + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ifyI7OW7sggz7LQMIAD2aUsY/zVUON9QaHrpZ4MK33iVMeHlTG4uhUE2aLWb31nry+LCs2ALDAwf8OfUJGjgBg==", + "path": "documentformat.openxml.framework/3.0.1", + "hashPath": "documentformat.openxml.framework.3.0.1.nupkg.sha512" + }, + "EntityFramework/6.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tkFMdLBBLKODe5uXkrDrBmpj5NRTg8Z3lnZz/uvyFIWQhVaYkbn+n8dlPk9OWpxeWS1OAjQDjT2uNOjpyzMOrA==", + "path": "entityframework/6.5.0", + "hashPath": "entityframework.6.5.0.nupkg.sha512" + }, + "ExcelNumberFormat/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-R3BVHPs9O+RkExbZYTGT0+9HLbi8ZrNij1Yziyw6znd3J7P3uoIR07uwTLGOogtz1p6+0sna66eBoXu7tBiVQA==", + "path": "excelnumberformat/1.1.0", + "hashPath": "excelnumberformat.1.1.0.nupkg.sha512" + }, + "FirebaseAdmin/3.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aP8UWyQYACDOZqnHN9WB77TS0DlB8kVj8/HB7evUaAhAgPJQ9y4NmISJ3kkYkWBG5va3PHvYN5H+ZDBhABSEFQ==", + "path": "firebaseadmin/3.6.0", + "hashPath": "firebaseadmin.3.6.0.nupkg.sha512" + }, + "FluentValidation/11.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0h1Q5lNOLLyYTWMJmyNoMqhY4CBRvvUWvJP1R4F2CnmmzuWwvB0A8aVmw5+lOuwYnwUwCRrdeMLbc81F38ahNQ==", + "path": "fluentvalidation/11.5.1", + "hashPath": "fluentvalidation.11.5.1.nupkg.sha512" + }, + "FluentValidation.AspNetCore/11.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtFVgKnDFySyBlPS8bZbTKEEwJZnn11rXXJ2SQnjDhZ56rQqybBg9Joq4crRLz3y0QR8WoOq4iE4piV81w/Djg==", + "path": "fluentvalidation.aspnetcore/11.3.0", + "hashPath": "fluentvalidation.aspnetcore.11.3.0.nupkg.sha512" + }, + "FluentValidation.DependencyInjectionExtensions/11.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iWM0LS1MDYX06pcjMEQKqHirl2zkjHlNV23mEJSoR1IZI7KQmTa0RcTtGEJpj5+iHvBCfrzP2mYKM4FtRKVb+A==", + "path": "fluentvalidation.dependencyinjectionextensions/11.5.1", + "hashPath": "fluentvalidation.dependencyinjectionextensions.11.5.1.nupkg.sha512" + }, + "Google.Api.Gax/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ujDpZk7O2VqAEIqcSlhH0FKzVpGZWly/qcNjHxpNUrL445Tei9PHnu4V1pwW2WDiMDvo3TpL1Bi4DeU525Afrg==", + "path": "google.api.gax/4.13.1", + "hashPath": "google.api.gax.4.13.1.nupkg.sha512" + }, + "Google.Api.Gax.Rest/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wDfFZXKoHC6sy+Yfub/4cLQOb5ozBVPqDOrxCUAeTfku4d96ILqgzulJSdkPHbiT3oWB3hlYTdJgUwNSJjyo+A==", + "path": "google.api.gax.rest/4.13.1", + "hashPath": "google.api.gax.rest.4.13.1.nupkg.sha512" + }, + "Google.Apis/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TnCjEyV2aCLQ6Zl40OCbEJULDuEkEWc6C/g81KYw5l1PqGo+G7pFZrV+YH8XgUL0JRUanz+IrUp8SsKF4dzkqg==", + "path": "google.apis/1.73.0", + "hashPath": "google.apis.1.73.0.nupkg.sha512" + }, + "Google.Apis.Auth/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wEu12uhnRv3zrPBSqv4E2vPH6lYLtc1RPAnU9MJRCMFlBVwZ7Lnq3NfbYXi6VG7EurkYInTaMpeBZkbM/HrAog==", + "path": "google.apis.auth/1.73.0", + "hashPath": "google.apis.auth.1.73.0.nupkg.sha512" + }, + "Google.Apis.Core/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vSc7CY4KCP7HE4QTElDx/ExnGLbg9kXb89MS6cdvI+0D4sxvTYb16vGtXmF2jSDMV3iDmykSXdIUPTz8TDS6gg==", + "path": "google.apis.core/1.73.0", + "hashPath": "google.apis.core.1.73.0.nupkg.sha512" + }, + "Humanizer.Core/2.14.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==", + "path": "humanizer.core/2.14.1", + "hashPath": "humanizer.core.2.14.1.nupkg.sha512" + }, + "LinqKit/1.3.7": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSMG2VfPAd9ipPKRIxG7mGAi69W5qfiLH9Bn1wrmhhHWI5SaLweOeE6xk7qzp+HiSc+LIWqxJpK13yk4t3b1nw==", + "path": "linqkit/1.3.7", + "hashPath": "linqkit.1.3.7.nupkg.sha512" + }, + "LinqKit.Core/1.2.7": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RfFeWWEGxh7Pt/fCpoTU23aSD6QEzTXdx5B1SuxpBpL5jsIvbBAAXp12UGc5yISg+O3c/kjs+3UZSghjmhsi1Q==", + "path": "linqkit.core/1.2.7", + "hashPath": "linqkit.core.1.2.7.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "path": "microsoft.bcl.asyncinterfaces/6.0.0", + "hashPath": "microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==", + "path": "microsoft.codeanalysis.common/4.5.0", + "hashPath": "microsoft.codeanalysis.common.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==", + "path": "microsoft.codeanalysis.csharp/4.5.0", + "hashPath": "microsoft.codeanalysis.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h74wTpmGOp4yS4hj+EvNzEiPgg/KVs2wmSfTZ81upJZOtPkJsVkgfsgtxxqmAeapjT/vLKfmYV0bS8n5MNVP+g==", + "path": "microsoft.codeanalysis.csharp.workspaces/4.5.0", + "hashPath": "microsoft.codeanalysis.csharp.workspaces.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-l4dDRmGELXG72XZaonnOeORyD/T5RpEu5LGHOUIhnv+MmUWDY/m1kWXGwtcgQ5CJ5ynkFiRnIYzTKXYjUs7rbw==", + "path": "microsoft.codeanalysis.workspaces.common/4.5.0", + "hashPath": "microsoft.codeanalysis.workspaces.common.4.5.0.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iK+jrJzkfbIxutB7or808BPmJtjUEi5O+eSM7cLDwsyde6+3iOujCSfWnrHrLxY3u+EQrJD+aD8DJ6ogPA2Rtw==", + "path": "microsoft.entityframeworkcore/8.0.8", + "hashPath": "microsoft.entityframeworkcore.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9mMQkZsfL1c2iifBD8MWRmwy59rvsVtR9NOezJj7+g1j4P7g49MJHd8k8faC/v7d5KuHkQ6KOQiSItvoRt9PXA==", + "path": "microsoft.entityframeworkcore.abstractions/8.0.8", + "hashPath": "microsoft.entityframeworkcore.abstractions.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Design/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MmQAMHdjZR8Iyn/FVQrh9weJQTn0HqtKa3vELS9ffQJat/qXgnTam9M9jqvePphjkYp5Scee+Hy+EJR4nmWmOA==", + "path": "microsoft.entityframeworkcore.design/8.0.8", + "hashPath": "microsoft.entityframeworkcore.design.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3WnrwdXxKg4L98cDx0lNEEau8U2lsfuBJCs0Yzht+5XVTmahboM7MukKfQHAzVsHUPszm6ci929S7Qas0WfVHA==", + "path": "microsoft.entityframeworkcore.relational/8.0.8", + "hashPath": "microsoft.entityframeworkcore.relational.8.0.8.nupkg.sha512" + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HFDnhYLccngrzyGgHkjEDU5FMLn4MpOsr5ElgsBMC4yx6lJh4jeWO7fHS8+TXPq+dgxCmUa/Trl8svObmwW4QA==", + "path": "microsoft.extensions.caching.memory/8.0.1", + "hashPath": "microsoft.extensions.caching.memory.8.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9/qymSh7hVDMGTGwrLz8MRp5zRyXy9adGDOs4HwRdnLil3oZGYuWeZjbmHgCQ9BL1qBroVfgUK3U/nb61617Cw==", + "path": "microsoft.extensions.dependencyinjection.abstractions/10.0.12", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyModel/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Ou6varcxLBzQ+Agfm0k0pnH7vrEITYlXMDuE6s7ZHlZHz6/G8XJ3iISZDr5rfwfge6RnXJ1+Wc479mMn52vjA==", + "path": "microsoft.extensions.dependencymodel/8.0.1", + "hashPath": "microsoft.extensions.dependencymodel.8.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+24lC4plfbEDNfLAdTV/SWKS7dW+16X4HdydO3R++134kSNTzcbYA4KpR1Hdh6uWisB8Za3AzwyOn+K+NxWIug==", + "path": "microsoft.extensions.logging.abstractions/10.0.12", + "hashPath": "microsoft.extensions.logging.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.Options/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==", + "path": "microsoft.extensions.options/8.0.2", + "hashPath": "microsoft.extensions.options.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-48quPTCzrglBlNSh5XFeA4Cyd5qm8IY1uqYx9+/0NNGVAv7U19aWieJxgTvmCiUr5il3F1851wDNGWiaUOktVw==", + "path": "microsoft.identitymodel.abstractions/7.7.3", + "hashPath": "microsoft.identitymodel.abstractions.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-URCySdj7XJVVFvKI7XrfMe60pw14kx9HhSw8thBPZvVS2t7q2qosvib2zGjXRdu+xOg33RCdGHoRG7NzbGNPDg==", + "path": "microsoft.identitymodel.jsonwebtokens/7.7.3", + "hashPath": "microsoft.identitymodel.jsonwebtokens.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QCNNrmwqa+fe9GVipM2aSFkS/zeLPXd6G3HahyLv/8477aK6hxm4uxEbS8lgUJVRZE3vwrW/iKxeDYNh99TNDQ==", + "path": "microsoft.identitymodel.logging/7.7.3", + "hashPath": "microsoft.identitymodel.logging.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h8hxpd6MgZbrxcORtinVQ8rvjAw75G9vzucVFm6CI+JBXS2kUer8X7LclYaBS12/DEkHtJiG6pc1v8ybSr9BAg==", + "path": "microsoft.identitymodel.tokens/7.7.3", + "hashPath": "microsoft.identitymodel.tokens.7.7.3.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==", + "path": "microsoft.win32.systemevents/6.0.0", + "hashPath": "microsoft.win32.systemevents.6.0.0.nupkg.sha512" + }, + "MiniExcel/1.46.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-IMmli1Hc3/Axst8hcuUx30q/2HTKH2f3nmduiy59wvpth1u0881fZMEMAy4Inl3GBkdrVXA8UUpF5lyoWREdLQ==", + "path": "miniexcel/1.46.0", + "hashPath": "miniexcel.1.46.0.nupkg.sha512" + }, + "Mono.TextTemplating/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==", + "path": "mono.texttemplating/2.2.1", + "hashPath": "mono.texttemplating.2.2.1.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==", + "path": "newtonsoft.json/13.0.4", + "hashPath": "newtonsoft.json.13.0.4.nupkg.sha512" + }, + "Npgsql/8.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vaYEUlF/pB9m8bs21wQv3Da0kMHT4A9USe47VfY/L2BO97xz5KfIxhEu22QS9d68ZrLxvtL3wQDfDLPr2OjbjA==", + "path": "npgsql/8.0.4", + "hashPath": "npgsql.8.0.4.nupkg.sha512" + }, + "Npgsql.EntityFrameworkCore.PostgreSQL/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-D5WWJZJTgZYUmGv66BARXbTlinp2a5f5RueJqGYoHuWJw02J0i2va/RA+8N4A5hLORK5YKMRqXhFWtKsZdrksw==", + "path": "npgsql.entityframeworkcore.postgresql/8.0.8", + "hashPath": "npgsql.entityframeworkcore.postgresql.8.0.8.nupkg.sha512" + }, + "PdfPig/0.1.16": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qQcbsNMYVY+K5ELptax2S8thNMk0+rSQq3H/KdYj3LLcko8yTCz8y5KIvsKxIyAuTN0ZYNnfsZkM+0EvxTwHVA==", + "path": "pdfpig/0.1.16", + "hashPath": "pdfpig.0.1.16.nupkg.sha512" + }, + "Pgvector/0.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-asa5XkgE3rXCNi5qHGavWZ5w+pmqWjjM1T5vN5VuPaKqV52h4TLiOM9ZJFofYgYtfhReo1QWe4NeD+hbv7ydfw==", + "path": "pgvector/0.3.0", + "hashPath": "pgvector.0.3.0.nupkg.sha512" + }, + "Pgvector.EntityFrameworkCore/0.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P3h1U7ajdIGqwTQZASdEMMrL5j4Kzc6s8o/1HX3Tc+zeeQPgcXMC1cymJY4ZVzEtBkL4rB9TG8PcaxxQd6kx2Q==", + "path": "pgvector.entityframeworkcore/0.2.1", + "hashPath": "pgvector.entityframeworkcore.0.2.1.nupkg.sha512" + }, + "QuestPDF/2026.9.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Nc7nvV/CmL/lonuw1mTQbiETfU7EZoM2kZ9YRgdbC5VivVjxsMHPJ18g4t5FMx/jUGh6XpJXFfW1rFWvAYOeTg==", + "path": "questpdf/2026.9.2", + "hashPath": "questpdf.2026.9.2.nupkg.sha512" + }, + "RBush/3.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ijGh9N0zZ7JfXk3oQkWCwK8SwSSByexbyh/MjbCjNxOft9eG5ZqKC1vdgiYq78h4IZRFmN4s3JZ/b10Jipud5w==", + "path": "rbush/3.2.0", + "hashPath": "rbush.3.2.0.nupkg.sha512" + }, + "runtime.native.System.Data.SqlClient.sni/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9kyFSIdN3T0qjDQ2R0HRXYIhS3l5psBzQi6qqhdLz+SzFyEy4sVxNOke+yyYv8Cu8rPER12c3RDjLT8wF3WBYQ==", + "path": "runtime.native.system.data.sqlclient.sni/4.7.0", + "hashPath": "runtime.native.system.data.sqlclient.sni.4.7.0.nupkg.sha512" + }, + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbrynESTp3bm5O/+jGL8v0Qg5SJlTV08lpIpFesXjF6uGNMWqFnUQbYBJwZTeua6E/Y7FIM1C54Ey1btLWupdg==", + "path": "runtime.win-arm64.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-arm64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-38ugOfkYJqJoX9g6EYRlZB5U2ZJH51UP8ptxZgdpS07FgOEToV+lS11ouNK2PM12Pr6X/PpT5jK82G3DwH/SxQ==", + "path": "runtime.win-x64.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YhEdSQUsTx+C8m8Bw7ar5/VesXvCFMItyZF7G1AUY+OM0VPZUOeAVpJ4Wl6fydBGUYZxojTDR3I6Bj/+BPkJNA==", + "path": "runtime.win-x86.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-x86.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "SixLabors.Fonts/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LFQsCZlV0xlUyXAOMUo5kkSl+8zAQXXbbdwWchtk0B4o7zotZhQsQOcJUELGHdfPfm/xDAsz6hONAuV25bJaAg==", + "path": "sixlabors.fonts/1.0.0", + "hashPath": "sixlabors.fonts.1.0.0.nupkg.sha512" + }, + "SkiaSharp/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nmy2dOFWPvQKMglfpjz8+/xQQcSrL9jzul3cUyzCJVSwrmSAw+6B1sEgU7jt6NZBptwGq2k/V0kjyu2GizMFtg==", + "path": "skiasharp/3.119.2", + "hashPath": "skiasharp.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1rmveKZ8Cz7k4QJQdtKV6RFXYIEqYBiX450Bm0Bk41EE50MMPUyF81cRnASsuV0qCwdZuzjZTaFvoqS0Q2zVfA==", + "path": "skiasharp.nativeassets.linux.nodependencies/3.119.2", + "hashPath": "skiasharp.nativeassets.linux.nodependencies.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I2jMGQ/26KOnc6iAoR+Mxh9vSJJ2vioJyj9aJ9OL5yEZyXothXJxf4vBMqnSaiXMqiiU1scG7KqtT0CLkmMmWA==", + "path": "skiasharp.nativeassets.macos/3.119.2", + "hashPath": "skiasharp.nativeassets.macos.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uYe+da6+GXVgPKkCopzvIZ83DmC8SXXKeUAPrNcztJNsg0SjPQAxfKMOPZqmVjbzznrq/QUIjLUlJSZV/e0IPA==", + "path": "skiasharp.nativeassets.win32/3.119.2", + "hashPath": "skiasharp.nativeassets.win32.3.119.2.nupkg.sha512" + }, + "System.CodeDom/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GLltyqEsE5/3IE+zYRP5sNa1l44qKl9v+bfdMcwg+M9qnQf47wK3H0SUR/T+3N4JEQXF3vV4CSuuo0rsg+nq2A==", + "path": "system.codedom/7.0.0", + "hashPath": "system.codedom.7.0.0.nupkg.sha512" + }, + "System.Composition/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-d7wMuKQtfsxUa7S13tITC8n1cQzewuhD5iDjZtK2prwFfKVzdYtgrTHgjaV03Zq7feGQ5gkP85tJJntXwInsJA==", + "path": "system.composition/6.0.0", + "hashPath": "system.composition.6.0.0.nupkg.sha512" + }, + "System.Composition.AttributedModel/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-WK1nSDLByK/4VoC7fkNiFuTVEiperuCN/Hyn+VN30R+W2ijO1d0Z2Qm0ScEl9xkSn1G2MyapJi8xpf4R8WRa/w==", + "path": "system.composition.attributedmodel/6.0.0", + "hashPath": "system.composition.attributedmodel.6.0.0.nupkg.sha512" + }, + "System.Composition.Convention/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XYi4lPRdu5bM4JVJ3/UIHAiG6V6lWWUlkhB9ab4IOq0FrRsp0F4wTyV4Dj+Ds+efoXJ3qbLqlvaUozDO7OLeXA==", + "path": "system.composition.convention/6.0.0", + "hashPath": "system.composition.convention.6.0.0.nupkg.sha512" + }, + "System.Composition.Hosting/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w/wXjj7kvxuHPLdzZ0PAUt++qJl03t7lENmb2Oev0n3zbxyNULbWBlnd5J5WUMMv15kg5o+/TCZFb6lSwfaUUQ==", + "path": "system.composition.hosting/6.0.0", + "hashPath": "system.composition.hosting.6.0.0.nupkg.sha512" + }, + "System.Composition.Runtime/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qkRH/YBaMPTnzxrS5RDk1juvqed4A6HOD/CwRcDGyPpYps1J27waBddiiq1y93jk2ZZ9wuA/kynM+NO0kb3PKg==", + "path": "system.composition.runtime/6.0.0", + "hashPath": "system.composition.runtime.6.0.0.nupkg.sha512" + }, + "System.Composition.TypedParts/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iUR1eHrL8Cwd82neQCJ00MpwNIBs4NZgXzrPqx8NJf/k4+mwBO0XCRmHYJT4OLSwDDqh5nBLJWkz5cROnrGhRA==", + "path": "system.composition.typedparts/6.0.0", + "hashPath": "system.composition.typedparts.6.0.0.nupkg.sha512" + }, + "System.Configuration.ConfigurationManager/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==", + "path": "system.configuration.configurationmanager/6.0.1", + "hashPath": "system.configuration.configurationmanager.6.0.1.nupkg.sha512" + }, + "System.Data.SqlClient/4.8.6": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2Ij/LCaTQRyAi5lAv7UUTV9R2FobC8xN9mE0fXBZohum/xLl8IZVmE98Rq5ugQHjCgTBRKqpXRb4ORulRdA6Ig==", + "path": "system.data.sqlclient/4.8.6", + "hashPath": "system.data.sqlclient.4.8.6.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CRZTWYO0rzEcJN/6SuN1kMvQOJT7vyHZ64CCkQs0RRWTj7kH2KMkaMalbsbSI/eg5dS5JAQfQFFuuWgn+XRMsQ==", + "path": "system.diagnostics.diagnosticsource/10.0.12", + "hashPath": "system.diagnostics.diagnosticsource.10.0.12.nupkg.sha512" + }, + "System.Drawing.Common/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", + "path": "system.drawing.common/6.0.0", + "hashPath": "system.drawing.common.6.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xqg/Al8bXC7+K54sy9F095rkWGBHQ5aLXaBg0zWEbzDWx442DMP8xCJaSugHpYwOyW9gC0pyq5XWpWYN50IqIA==", + "path": "system.identitymodel.tokens.jwt/7.7.3", + "hashPath": "system.identitymodel.tokens.jwt.7.7.3.nupkg.sha512" + }, + "System.IO.Packaging/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KYkIOAvPexQOLDxPO2g0BVoWInnQhPpkFzRqvNrNrMhVT6kqhVr0zEb6KCHlptLFukxnZrjuMVAnxK7pOGUYrw==", + "path": "system.io.packaging/8.0.1", + "hashPath": "system.io.packaging.8.0.1.nupkg.sha512" + }, + "System.Management/7.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/qEUN91mP/MUQmJnM5y5BdT7ZoPuVrtxnFlbJ8a3kBJGhe2wCzBfnPFtK2wTtEEcf3DMGR9J00GZZfg6HRI6yA==", + "path": "system.management/7.0.2", + "hashPath": "system.management.7.0.2.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==", + "path": "system.security.cryptography.protecteddata/6.0.0", + "hashPath": "system.security.cryptography.protecteddata.6.0.0.nupkg.sha512" + }, + "System.Security.Permissions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==", + "path": "system.security.permissions/6.0.0", + "hashPath": "system.security.permissions.6.0.0.nupkg.sha512" + }, + "System.Windows.Extensions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==", + "path": "system.windows.extensions/6.0.0", + "hashPath": "system.windows.extensions.6.0.0.nupkg.sha512" + }, + "Tesseract/5.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YB7feJlrTWSXtK8+WaCcseGSPK/1r2d2FWeKGyndlrPwYClrzTlCoHD4/oQEUjKafmpkWlhTZZ7pxiRJYZgj6w==", + "path": "tesseract/5.2.0", + "hashPath": "tesseract.5.2.0.nupkg.sha512" + }, + "RikiPath.Application/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "RikiPath.Domain/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.dll b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.dll new file mode 100644 index 00000000..1215a76f Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.dll differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.pdb b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.pdb new file mode 100644 index 00000000..888b2ace Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.pdb differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.runtimeconfig.json b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.runtimeconfig.json new file mode 100644 index 00000000..a42fa34f --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.Infrastructure.runtimeconfig.json @@ -0,0 +1,19 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "8.0.0" + } + ], + "configProperties": { + "System.Reflection.NullabilityInfoContext.IsSupported": true, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.deps.json b/_codex-verify/Debug/net8.0/RikiPath.WebApi.deps.json new file mode 100644 index 00000000..e6c86d26 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.WebApi.deps.json @@ -0,0 +1,2182 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "RikiPath.WebApi/1.0.0": { + "dependencies": { + "ClosedXML": "0.104.1", + "FluentValidation.AspNetCore": "11.3.0", + "Hangfire": "1.8.14", + "Hangfire.AspNetCore": "1.8.14", + "Hangfire.PostgreSql": "1.20.10", + "Microsoft.AspNetCore.Authentication.JwtBearer": "8.0.6", + "Microsoft.AspNetCore.OpenApi": "8.0.6", + "Microsoft.EntityFrameworkCore.Design": "8.0.8", + "Newtonsoft.Json": "13.0.4", + "Pgvector.EntityFrameworkCore": "0.2.1", + "RikiPath.Application": "1.0.0", + "RikiPath.Domain": "1.0.0", + "RikiPath.Infrastructure": "1.0.0", + "Swashbuckle.AspNetCore": "6.6.2", + "Swashbuckle.AspNetCore.Filters": "8.0.2" + }, + "runtime": { + "RikiPath.WebApi.dll": {} + } + }, + "AWSSDK.Core/3.7.501.1": { + "runtime": { + "lib/net8.0/AWSSDK.Core.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.501.1" + } + } + }, + "AWSSDK.S3/3.7.511.8": { + "dependencies": { + "AWSSDK.Core": "3.7.501.1" + }, + "runtime": { + "lib/net8.0/AWSSDK.S3.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.511.8" + } + } + }, + "AWSSDK.TranscribeService/3.7.503.32": { + "dependencies": { + "AWSSDK.Core": "3.7.501.1" + }, + "runtime": { + "lib/net8.0/AWSSDK.TranscribeService.dll": { + "assemblyVersion": "3.3.0.0", + "fileVersion": "3.7.503.32" + } + } + }, + "ClosedXML/0.104.1": { + "dependencies": { + "ClosedXML.Parser": "1.2.0", + "DocumentFormat.OpenXml": "3.0.1", + "ExcelNumberFormat": "1.1.0", + "RBush": "3.2.0", + "SixLabors.Fonts": "1.0.0", + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/netstandard2.1/ClosedXML.dll": { + "assemblyVersion": "0.104.1.0", + "fileVersion": "0.104.1.0" + } + } + }, + "ClosedXML.Parser/1.2.0": { + "runtime": { + "lib/netstandard2.1/ClosedXML.Parser.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "Dapper/2.0.123": { + "runtime": { + "lib/net5.0/Dapper.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.0.123.33578" + } + } + }, + "DocumentFormat.OpenXml/3.0.1": { + "dependencies": { + "DocumentFormat.OpenXml.Framework": "3.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "dependencies": { + "System.IO.Packaging": "8.0.1" + }, + "runtime": { + "lib/net8.0/DocumentFormat.OpenXml.Framework.dll": { + "assemblyVersion": "3.0.1.0", + "fileVersion": "3.0.1.0" + } + } + }, + "EntityFramework/6.5.0": { + "dependencies": { + "System.CodeDom": "7.0.0", + "System.Configuration.ConfigurationManager": "6.0.1", + "System.Data.SqlClient": "4.8.6" + }, + "runtime": { + "lib/netstandard2.1/EntityFramework.SqlServer.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.500.24.31301" + }, + "lib/netstandard2.1/EntityFramework.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.500.24.31301" + } + } + }, + "ExcelNumberFormat/1.1.0": { + "runtime": { + "lib/netstandard2.0/ExcelNumberFormat.dll": { + "assemblyVersion": "1.1.0.0", + "fileVersion": "1.1.0.0" + } + } + }, + "FirebaseAdmin/3.6.0": { + "dependencies": { + "Google.Api.Gax.Rest": "4.13.1", + "Google.Apis.Auth": "1.73.0" + }, + "runtime": { + "lib/net6.0/FirebaseAdmin.dll": { + "assemblyVersion": "3.6.0.0", + "fileVersion": "3.6.0.0" + } + } + }, + "FluentValidation/11.5.1": { + "runtime": { + "lib/net7.0/FluentValidation.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.5.1.0" + } + } + }, + "FluentValidation.AspNetCore/11.3.0": { + "dependencies": { + "FluentValidation": "11.5.1", + "FluentValidation.DependencyInjectionExtensions": "11.5.1" + }, + "runtime": { + "lib/net6.0/FluentValidation.AspNetCore.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.3.0.0" + } + } + }, + "FluentValidation.DependencyInjectionExtensions/11.5.1": { + "dependencies": { + "FluentValidation": "11.5.1", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.1/FluentValidation.DependencyInjectionExtensions.dll": { + "assemblyVersion": "11.0.0.0", + "fileVersion": "11.5.1.0" + } + } + }, + "Google.Api.Gax/4.13.1": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Newtonsoft.Json": "13.0.4", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Api.Gax.Rest/4.13.1": { + "dependencies": { + "Google.Api.Gax": "4.13.1", + "Google.Apis.Auth": "1.73.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.0/Google.Api.Gax.Rest.dll": { + "assemblyVersion": "4.13.1.0", + "fileVersion": "4.13.1.0" + } + } + }, + "Google.Apis/1.73.0": { + "dependencies": { + "Google.Apis.Core": "1.73.0" + }, + "runtime": { + "lib/net6.0/Google.Apis.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Auth/1.73.0": { + "dependencies": { + "Google.Apis": "1.73.0", + "Google.Apis.Core": "1.73.0", + "System.Management": "7.0.2" + }, + "runtime": { + "lib/net6.0/Google.Apis.Auth.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Google.Apis.Core/1.73.0": { + "dependencies": { + "Newtonsoft.Json": "13.0.4" + }, + "runtime": { + "lib/net6.0/Google.Apis.Core.dll": { + "assemblyVersion": "1.73.0.0", + "fileVersion": "1.73.0.0" + } + } + }, + "Hangfire/1.8.14": { + "dependencies": { + "Hangfire.AspNetCore": "1.8.14", + "Hangfire.Core": "1.8.14", + "Hangfire.SqlServer": "1.8.14" + } + }, + "Hangfire.AspNetCore/1.8.14": { + "dependencies": { + "Hangfire.NetCore": "1.8.14" + }, + "runtime": { + "lib/netcoreapp3.0/Hangfire.AspNetCore.dll": { + "assemblyVersion": "1.8.14.0", + "fileVersion": "1.8.14.0" + } + } + }, + "Hangfire.Core/1.8.14": { + "dependencies": { + "Newtonsoft.Json": "13.0.4" + }, + "runtime": { + "lib/netstandard2.0/Hangfire.Core.dll": { + "assemblyVersion": "1.8.14.0", + "fileVersion": "1.8.14.0" + } + } + }, + "Hangfire.NetCore/1.8.14": { + "dependencies": { + "Hangfire.Core": "1.8.14", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12" + }, + "runtime": { + "lib/netstandard2.1/Hangfire.NetCore.dll": { + "assemblyVersion": "1.8.14.0", + "fileVersion": "1.8.14.0" + } + } + }, + "Hangfire.PostgreSql/1.20.10": { + "dependencies": { + "Dapper": "2.0.123", + "Hangfire.Core": "1.8.14", + "Npgsql": "8.0.4" + }, + "runtime": { + "lib/netstandard2.0/Hangfire.PostgreSql.dll": { + "assemblyVersion": "1.20.10.0", + "fileVersion": "1.20.10.0" + } + } + }, + "Hangfire.SqlServer/1.8.14": { + "dependencies": { + "Hangfire.Core": "1.8.14" + }, + "runtime": { + "lib/netstandard2.0/Hangfire.SqlServer.dll": { + "assemblyVersion": "1.8.14.0", + "fileVersion": "1.8.14.0" + } + } + }, + "Humanizer.Core/2.14.1": { + "runtime": { + "lib/net6.0/Humanizer.dll": { + "assemblyVersion": "2.14.0.0", + "fileVersion": "2.14.1.48190" + } + } + }, + "LinqKit/1.3.7": { + "dependencies": { + "EntityFramework": "6.5.0", + "LinqKit.Core": "1.2.7" + }, + "runtime": { + "lib/netstandard2.1/LinqKit.dll": { + "assemblyVersion": "1.3.7.0", + "fileVersion": "1.3.7.0" + } + } + }, + "LinqKit.Core/1.2.7": { + "runtime": { + "lib/netstandard2.1/LinqKit.Core.dll": { + "assemblyVersion": "1.2.7.0", + "fileVersion": "1.2.7.0" + } + } + }, + "Microsoft.AspNetCore.Authentication.JwtBearer/8.0.6": { + "dependencies": { + "Microsoft.IdentityModel.Protocols.OpenIdConnect": "7.1.2" + }, + "runtime": { + "lib/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll": { + "assemblyVersion": "8.0.6.0", + "fileVersion": "8.0.624.26909" + } + } + }, + "Microsoft.AspNetCore.OpenApi/8.0.6": { + "dependencies": { + "Microsoft.OpenApi": "1.6.14" + }, + "runtime": { + "lib/net8.0/Microsoft.AspNetCore.OpenApi.dll": { + "assemblyVersion": "8.0.6.0", + "fileVersion": "8.0.624.26909" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "runtime": { + "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.CodeAnalysis.Common/4.5.0": { + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.CSharp/4.5.0": { + "dependencies": { + "Microsoft.CodeAnalysis.Common": "4.5.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.CodeAnalysis.CSharp": "4.5.0", + "Microsoft.CodeAnalysis.Common": "4.5.0", + "Microsoft.CodeAnalysis.Workspaces.Common": "4.5.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.CodeAnalysis.Common": "4.5.0", + "System.Composition": "6.0.0" + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll": { + "assemblyVersion": "4.5.0.0", + "fileVersion": "4.500.23.10905" + } + }, + "resources": { + "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.EntityFrameworkCore/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "8.0.8", + "Microsoft.Extensions.Caching.Memory": "8.0.1" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.8": { + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Design/8.0.8": { + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.CodeAnalysis.CSharp.Workspaces": "4.5.0", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Microsoft.Extensions.DependencyModel": "8.0.1", + "Mono.TextTemplating": "2.2.1" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Design.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore": "8.0.8" + }, + "runtime": { + "lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.824.36704" + } + } + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Caching.Memory.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.DependencyModel/8.0.1": { + "runtime": { + "lib/net8.0/Microsoft.Extensions.DependencyModel.dll": { + "assemblyVersion": "8.0.0.1", + "fileVersion": "8.0.724.31311" + } + } + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "System.Diagnostics.DiagnosticSource": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "Microsoft.Extensions.Options/8.0.2": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12" + }, + "runtime": { + "lib/net8.0/Microsoft.Extensions.Options.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.224.6711" + } + } + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.IdentityModel.Protocols/7.1.2": { + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.7.3", + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.dll": { + "assemblyVersion": "7.1.2.0", + "fileVersion": "7.1.2.41121" + } + } + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect/7.1.2": { + "dependencies": { + "Microsoft.IdentityModel.Protocols": "7.1.2", + "System.IdentityModel.Tokens.Jwt": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll": { + "assemblyVersion": "7.1.2.0", + "fileVersion": "7.1.2.41121" + } + } + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.7.3" + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "Microsoft.OpenApi/1.6.14": { + "runtime": { + "lib/netstandard2.0/Microsoft.OpenApi.dll": { + "assemblyVersion": "1.6.14.0", + "fileVersion": "1.6.14.0" + } + } + }, + "Microsoft.Win32.SystemEvents/6.0.0": { + "runtime": { + "lib/net6.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "MiniExcel/1.46.0": { + "runtime": { + "lib/net8.0/MiniExcel.dll": { + "assemblyVersion": "1.46.0.0", + "fileVersion": "1.46.0.0" + } + } + }, + "Mono.TextTemplating/2.2.1": { + "dependencies": { + "System.CodeDom": "7.0.0" + }, + "runtime": { + "lib/netstandard2.0/Mono.TextTemplating.dll": { + "assemblyVersion": "2.2.0.0", + "fileVersion": "2.2.1.1" + } + } + }, + "Newtonsoft.Json/13.0.4": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.4.30916" + } + } + }, + "Npgsql/8.0.4": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "10.0.12" + }, + "runtime": { + "lib/net8.0/Npgsql.dll": { + "assemblyVersion": "8.0.4.0", + "fileVersion": "8.0.4.0" + } + } + }, + "Npgsql.EntityFrameworkCore.PostgreSQL/8.0.8": { + "dependencies": { + "Microsoft.EntityFrameworkCore": "8.0.8", + "Microsoft.EntityFrameworkCore.Abstractions": "8.0.8", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Npgsql": "8.0.4" + }, + "runtime": { + "lib/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll": { + "assemblyVersion": "8.0.8.0", + "fileVersion": "8.0.8.0" + } + } + }, + "PdfPig/0.1.16": { + "runtime": { + "lib/net8.0/UglyToad.PdfPig.Core.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Fonts.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Package.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokenization.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.Tokens.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + }, + "lib/net8.0/UglyToad.PdfPig.dll": { + "assemblyVersion": "0.1.16.0", + "fileVersion": "0.1.16.0" + } + } + }, + "Pgvector/0.3.0": { + "dependencies": { + "Npgsql": "8.0.4" + }, + "runtime": { + "lib/net6.0/Pgvector.dll": { + "assemblyVersion": "0.3.0.0", + "fileVersion": "0.3.0.0" + } + } + }, + "Pgvector.EntityFrameworkCore/0.2.1": { + "dependencies": { + "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.8", + "Pgvector": "0.3.0" + }, + "runtime": { + "lib/net8.0/Pgvector.EntityFrameworkCore.dll": { + "assemblyVersion": "0.2.1.0", + "fileVersion": "0.2.1.0" + } + } + }, + "QuestPDF/2026.9.2": { + "runtime": { + "lib/net8.0/QuestPDF.dll": { + "assemblyVersion": "2026.9.2.0", + "fileVersion": "2026.9.2.0" + } + }, + "runtimeTargets": { + "runtimes/linux-arm64/native/libquestpdf_qpdf.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libquestpdf_skia.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libquestpdf_skia.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_qpdf.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libquestpdf_skia.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-arm64/native/libquestpdf_skia.dylib": { + "rid": "osx-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_qpdf.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/osx-x64/native/libquestpdf_skia.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_qpdf.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/questpdf_skia.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_qpdf.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/questpdf_skia.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_qpdf.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/questpdf_skia.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "RBush/3.2.0": { + "runtime": { + "lib/net6.0/RBush.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.2.0.0" + } + } + }, + "runtime.native.System.Data.SqlClient.sni/4.7.0": { + "dependencies": { + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni": "4.4.0", + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni": "4.4.0", + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni": "4.4.0" + } + }, + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-arm64/native/sni.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-x64/native/sni.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "runtimeTargets": { + "runtimes/win-x86/native/sni.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "4.6.25512.1" + } + } + }, + "Scrutor/3.3.0": { + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.12", + "Microsoft.Extensions.DependencyModel": "8.0.1" + }, + "runtime": { + "lib/netcoreapp3.1/Scrutor.dll": { + "assemblyVersion": "3.0.2.0", + "fileVersion": "3.0.2.0" + } + } + }, + "SixLabors.Fonts/1.0.0": { + "runtime": { + "lib/netcoreapp3.1/SixLabors.Fonts.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "SkiaSharp/3.119.2": { + "dependencies": { + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "SkiaSharp.NativeAssets.macOS": "3.119.2" + }, + "runtime": { + "lib/net8.0/SkiaSharp.dll": { + "assemblyVersion": "3.119.0.0", + "fileVersion": "3.119.2.0" + } + } + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "runtimeTargets": { + "runtimes/linux-arm/native/libSkiaSharp.so": { + "rid": "linux-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-arm64/native/libSkiaSharp.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm/native/libSkiaSharp.so": { + "rid": "linux-musl-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-arm64/native/libSkiaSharp.so": { + "rid": "linux-musl-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-loongarch64/native/libSkiaSharp.so": { + "rid": "linux-musl-loongarch64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-riscv64/native/libSkiaSharp.so": { + "rid": "linux-musl-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-musl-x64/native/libSkiaSharp.so": { + "rid": "linux-musl-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-riscv64/native/libSkiaSharp.so": { + "rid": "linux-riscv64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x64/native/libSkiaSharp.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/linux-x86/native/libSkiaSharp.so": { + "rid": "linux-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "runtimeTargets": { + "runtimes/osx/native/libSkiaSharp.dylib": { + "rid": "osx", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "runtimeTargets": { + "runtimes/win-arm64/native/libSkiaSharp.dll": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-arm64/native/libSkiaSharp.pdb": { + "rid": "win-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.dll": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x64/native/libSkiaSharp.pdb": { + "rid": "win-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.dll": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + }, + "runtimes/win-x86/native/libSkiaSharp.pdb": { + "rid": "win-x86", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "Swashbuckle.AspNetCore/6.6.2": { + "dependencies": { + "Swashbuckle.AspNetCore.Swagger": "6.6.2", + "Swashbuckle.AspNetCore.SwaggerGen": "6.6.2", + "Swashbuckle.AspNetCore.SwaggerUI": "6.6.2" + } + }, + "Swashbuckle.AspNetCore.Filters/8.0.2": { + "dependencies": { + "Microsoft.OpenApi": "1.6.14", + "Scrutor": "3.3.0", + "Swashbuckle.AspNetCore.Filters.Abstractions": "8.0.2", + "Swashbuckle.AspNetCore.SwaggerGen": "6.6.2" + }, + "runtime": { + "lib/net5.0/Swashbuckle.AspNetCore.Filters.dll": { + "assemblyVersion": "8.0.2.0", + "fileVersion": "8.0.2.0" + } + } + }, + "Swashbuckle.AspNetCore.Filters.Abstractions/8.0.2": { + "runtime": { + "lib/net5.0/Swashbuckle.AspNetCore.Filters.Abstractions.dll": { + "assemblyVersion": "8.0.2.0", + "fileVersion": "8.0.2.0" + } + } + }, + "Swashbuckle.AspNetCore.Swagger/6.6.2": { + "dependencies": { + "Microsoft.OpenApi": "1.6.14" + }, + "runtime": { + "lib/net8.0/Swashbuckle.AspNetCore.Swagger.dll": { + "assemblyVersion": "6.6.2.0", + "fileVersion": "6.6.2.401" + } + } + }, + "Swashbuckle.AspNetCore.SwaggerGen/6.6.2": { + "dependencies": { + "Swashbuckle.AspNetCore.Swagger": "6.6.2" + }, + "runtime": { + "lib/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll": { + "assemblyVersion": "6.6.2.0", + "fileVersion": "6.6.2.401" + } + } + }, + "Swashbuckle.AspNetCore.SwaggerUI/6.6.2": { + "runtime": { + "lib/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll": { + "assemblyVersion": "6.6.2.0", + "fileVersion": "6.6.2.401" + } + } + }, + "System.CodeDom/7.0.0": { + "runtime": { + "lib/net7.0/System.CodeDom.dll": { + "assemblyVersion": "7.0.0.0", + "fileVersion": "7.0.22.51805" + } + } + }, + "System.Composition/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0", + "System.Composition.Convention": "6.0.0", + "System.Composition.Hosting": "6.0.0", + "System.Composition.Runtime": "6.0.0", + "System.Composition.TypedParts": "6.0.0" + } + }, + "System.Composition.AttributedModel/6.0.0": { + "runtime": { + "lib/net6.0/System.Composition.AttributedModel.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Convention/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.Convention.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Hosting/6.0.0": { + "dependencies": { + "System.Composition.Runtime": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.Hosting.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.Runtime/6.0.0": { + "runtime": { + "lib/net6.0/System.Composition.Runtime.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Composition.TypedParts/6.0.0": { + "dependencies": { + "System.Composition.AttributedModel": "6.0.0", + "System.Composition.Hosting": "6.0.0", + "System.Composition.Runtime": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Composition.TypedParts.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Configuration.ConfigurationManager/6.0.1": { + "dependencies": { + "System.Security.Cryptography.ProtectedData": "6.0.0", + "System.Security.Permissions": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Configuration.ConfigurationManager.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.922.41905" + } + } + }, + "System.Data.SqlClient/4.8.6": { + "dependencies": { + "runtime.native.System.Data.SqlClient.sni": "4.7.0" + }, + "runtime": { + "lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + }, + "runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.6.1.6", + "fileVersion": "4.700.23.52603" + } + } + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "runtime": { + "lib/net8.0/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.1226.42308" + } + } + }, + "System.Drawing.Common/6.0.0": { + "dependencies": { + "Microsoft.Win32.SystemEvents": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Drawing.Common.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/net6.0/System.Drawing.Common.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + }, + "runtimes/win/lib/net6.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "7.7.3", + "Microsoft.IdentityModel.Tokens": "7.7.3" + }, + "runtime": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "assemblyVersion": "7.7.3.0", + "fileVersion": "7.7.3.26195" + } + } + }, + "System.IO.Packaging/8.0.1": { + "runtime": { + "lib/net8.0/System.IO.Packaging.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46610" + } + } + }, + "System.Management/7.0.2": { + "dependencies": { + "System.CodeDom": "7.0.0" + }, + "runtime": { + "lib/net7.0/System.Management.dll": { + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net7.0/System.Management.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "7.0.0.2", + "fileVersion": "7.0.723.27404" + } + } + }, + "System.Security.Cryptography.ProtectedData/6.0.0": { + "runtime": { + "lib/net6.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Security.Permissions/6.0.0": { + "dependencies": { + "System.Windows.Extensions": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Security.Permissions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "System.Windows.Extensions/6.0.0": { + "dependencies": { + "System.Drawing.Common": "6.0.0" + }, + "runtime": { + "lib/net6.0/System.Windows.Extensions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net6.0/System.Windows.Extensions.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Tesseract/5.2.0": { + "runtime": { + "lib/netstandard2.0/Tesseract.dll": { + "assemblyVersion": "5.2.0.0", + "fileVersion": "5.2.0.0" + } + } + }, + "RikiPath.Application/1.0.0": { + "dependencies": { + "ClosedXML": "0.104.1", + "FirebaseAdmin": "3.6.0", + "Google.Apis.Auth": "1.73.0", + "Microsoft.EntityFrameworkCore": "8.0.8", + "Microsoft.EntityFrameworkCore.Relational": "8.0.8", + "Microsoft.Extensions.Caching.Memory": "8.0.1", + "Microsoft.Extensions.Logging.Abstractions": "10.0.12", + "Microsoft.Extensions.Options": "8.0.2", + "Microsoft.IdentityModel.Tokens": "7.7.3", + "PdfPig": "0.1.16", + "QuestPDF": "2026.9.2", + "RikiPath.Domain": "1.0.0", + "SkiaSharp": "3.119.2", + "SkiaSharp.NativeAssets.Linux.NoDependencies": "3.119.2", + "SkiaSharp.NativeAssets.Win32": "3.119.2", + "System.IO.Packaging": "8.0.1", + "System.IdentityModel.Tokens.Jwt": "7.7.3", + "Tesseract": "5.2.0" + }, + "runtime": { + "RikiPath.Application.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "RikiPath.Domain/1.0.0": { + "runtime": { + "RikiPath.Domain.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "RikiPath.Infrastructure/1.0.0": { + "dependencies": { + "AWSSDK.S3": "3.7.511.8", + "AWSSDK.TranscribeService": "3.7.503.32", + "ClosedXML": "0.104.1", + "FluentValidation.AspNetCore": "11.3.0", + "LinqKit": "1.3.7", + "MiniExcel": "1.46.0", + "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.8", + "Pgvector.EntityFrameworkCore": "0.2.1", + "RikiPath.Application": "1.0.0", + "RikiPath.Domain": "1.0.0" + }, + "runtime": { + "RikiPath.Infrastructure.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "RikiPath.WebApi/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "AWSSDK.Core/3.7.501.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VZR0LRAawpn5FQwXNPzhOO8DHhfffhBSvcSZT1d0ctcZ+kmsz3tzTArZnTQ9Haf/TNEqNLzKupHfjV2ndWAL4A==", + "path": "awssdk.core/3.7.501.1", + "hashPath": "awssdk.core.3.7.501.1.nupkg.sha512" + }, + "AWSSDK.S3/3.7.511.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QLHt7ucegMurWnwB3GomMeP6DiCG033aEittRiabMGnTOMZ5xyu7tbmTkqs3ZU5tBz4AK53Ak8WJkF+kk+s4Tw==", + "path": "awssdk.s3/3.7.511.8", + "hashPath": "awssdk.s3.3.7.511.8.nupkg.sha512" + }, + "AWSSDK.TranscribeService/3.7.503.32": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lkK7mo1JGyiXVCij5/BH5TPLDn36pBQb656K6Q9YpMs60t4vmp8kHVm0v748jjDIUo93bt+mKAApxzNqpPWL8Q==", + "path": "awssdk.transcribeservice/3.7.503.32", + "hashPath": "awssdk.transcribeservice.3.7.503.32.nupkg.sha512" + }, + "ClosedXML/0.104.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RVm2fUNWJlBJlg07shrfeWzrHPG5ypI/vARqdUOUbUdaog8yBw8l4IbCHf2MXt0AXtzaZqGNqhFaCAHigCBdfw==", + "path": "closedxml/0.104.1", + "hashPath": "closedxml.0.104.1.nupkg.sha512" + }, + "ClosedXML.Parser/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w+/0tsxABS3lkSH8EUlA7IGme+mq5T/Puf3DbOiTckmSuUpAUO2LK29oXYByCcWkBv6wcRHxgWlQb1lxkwI0Tw==", + "path": "closedxml.parser/1.2.0", + "hashPath": "closedxml.parser.1.2.0.nupkg.sha512" + }, + "Dapper/2.0.123": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RDFF4rBLLmbpi6pwkY7q/M6UXHRJEOerplDGE5jwEkP/JGJnBauAClYavNKJPW1yOTWRPIyfj4is3EaJxQXILQ==", + "path": "dapper/2.0.123", + "hashPath": "dapper.2.0.123.nupkg.sha512" + }, + "DocumentFormat.OpenXml/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DCK1cwFUJ1FGGyYyo++HWl9H1RkqMWIu+FGOLRy6E4L4y0/HIhlJ7N/n1HKboFfOwKn1cMBRxt1RCuDbIEy5YQ==", + "path": "documentformat.openxml/3.0.1", + "hashPath": "documentformat.openxml.3.0.1.nupkg.sha512" + }, + "DocumentFormat.OpenXml.Framework/3.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ifyI7OW7sggz7LQMIAD2aUsY/zVUON9QaHrpZ4MK33iVMeHlTG4uhUE2aLWb31nry+LCs2ALDAwf8OfUJGjgBg==", + "path": "documentformat.openxml.framework/3.0.1", + "hashPath": "documentformat.openxml.framework.3.0.1.nupkg.sha512" + }, + "EntityFramework/6.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tkFMdLBBLKODe5uXkrDrBmpj5NRTg8Z3lnZz/uvyFIWQhVaYkbn+n8dlPk9OWpxeWS1OAjQDjT2uNOjpyzMOrA==", + "path": "entityframework/6.5.0", + "hashPath": "entityframework.6.5.0.nupkg.sha512" + }, + "ExcelNumberFormat/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-R3BVHPs9O+RkExbZYTGT0+9HLbi8ZrNij1Yziyw6znd3J7P3uoIR07uwTLGOogtz1p6+0sna66eBoXu7tBiVQA==", + "path": "excelnumberformat/1.1.0", + "hashPath": "excelnumberformat.1.1.0.nupkg.sha512" + }, + "FirebaseAdmin/3.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aP8UWyQYACDOZqnHN9WB77TS0DlB8kVj8/HB7evUaAhAgPJQ9y4NmISJ3kkYkWBG5va3PHvYN5H+ZDBhABSEFQ==", + "path": "firebaseadmin/3.6.0", + "hashPath": "firebaseadmin.3.6.0.nupkg.sha512" + }, + "FluentValidation/11.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0h1Q5lNOLLyYTWMJmyNoMqhY4CBRvvUWvJP1R4F2CnmmzuWwvB0A8aVmw5+lOuwYnwUwCRrdeMLbc81F38ahNQ==", + "path": "fluentvalidation/11.5.1", + "hashPath": "fluentvalidation.11.5.1.nupkg.sha512" + }, + "FluentValidation.AspNetCore/11.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jtFVgKnDFySyBlPS8bZbTKEEwJZnn11rXXJ2SQnjDhZ56rQqybBg9Joq4crRLz3y0QR8WoOq4iE4piV81w/Djg==", + "path": "fluentvalidation.aspnetcore/11.3.0", + "hashPath": "fluentvalidation.aspnetcore.11.3.0.nupkg.sha512" + }, + "FluentValidation.DependencyInjectionExtensions/11.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iWM0LS1MDYX06pcjMEQKqHirl2zkjHlNV23mEJSoR1IZI7KQmTa0RcTtGEJpj5+iHvBCfrzP2mYKM4FtRKVb+A==", + "path": "fluentvalidation.dependencyinjectionextensions/11.5.1", + "hashPath": "fluentvalidation.dependencyinjectionextensions.11.5.1.nupkg.sha512" + }, + "Google.Api.Gax/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ujDpZk7O2VqAEIqcSlhH0FKzVpGZWly/qcNjHxpNUrL445Tei9PHnu4V1pwW2WDiMDvo3TpL1Bi4DeU525Afrg==", + "path": "google.api.gax/4.13.1", + "hashPath": "google.api.gax.4.13.1.nupkg.sha512" + }, + "Google.Api.Gax.Rest/4.13.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wDfFZXKoHC6sy+Yfub/4cLQOb5ozBVPqDOrxCUAeTfku4d96ILqgzulJSdkPHbiT3oWB3hlYTdJgUwNSJjyo+A==", + "path": "google.api.gax.rest/4.13.1", + "hashPath": "google.api.gax.rest.4.13.1.nupkg.sha512" + }, + "Google.Apis/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TnCjEyV2aCLQ6Zl40OCbEJULDuEkEWc6C/g81KYw5l1PqGo+G7pFZrV+YH8XgUL0JRUanz+IrUp8SsKF4dzkqg==", + "path": "google.apis/1.73.0", + "hashPath": "google.apis.1.73.0.nupkg.sha512" + }, + "Google.Apis.Auth/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wEu12uhnRv3zrPBSqv4E2vPH6lYLtc1RPAnU9MJRCMFlBVwZ7Lnq3NfbYXi6VG7EurkYInTaMpeBZkbM/HrAog==", + "path": "google.apis.auth/1.73.0", + "hashPath": "google.apis.auth.1.73.0.nupkg.sha512" + }, + "Google.Apis.Core/1.73.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vSc7CY4KCP7HE4QTElDx/ExnGLbg9kXb89MS6cdvI+0D4sxvTYb16vGtXmF2jSDMV3iDmykSXdIUPTz8TDS6gg==", + "path": "google.apis.core/1.73.0", + "hashPath": "google.apis.core.1.73.0.nupkg.sha512" + }, + "Hangfire/1.8.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-8ve7Di0xvy0ZxCxibcDEzjVVx/H4mJiYSrc5A7Oj2Q62y5vB+Fq6k03zkFj96Xlgs5ivVSeEGfreF/NECJ7tlQ==", + "path": "hangfire/1.8.14", + "hashPath": "hangfire.1.8.14.nupkg.sha512" + }, + "Hangfire.AspNetCore/1.8.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aTPzKN/g9SW30QB1SLTOMuckKqTVL1YAhtEpWll4LPbPTgyeBHJTChdRhrN127fj+mqJ6P4P7+HJBhNYUFTfNw==", + "path": "hangfire.aspnetcore/1.8.14", + "hashPath": "hangfire.aspnetcore.1.8.14.nupkg.sha512" + }, + "Hangfire.Core/1.8.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tj/+J8/UdaxydFX6VQr5IEyBtVbAOvkQ8X8tIQKwY9zlpmK83hP4iHEQQQ26zzGUpcE1HlPc6PBUv0NgUDXS3A==", + "path": "hangfire.core/1.8.14", + "hashPath": "hangfire.core.1.8.14.nupkg.sha512" + }, + "Hangfire.NetCore/1.8.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fBLdsxWYFdrQuenvVHEj/z8nOXoOTqpWIl4qYoinBAUCVmp4qlxfFsY3Aq3VVbwket0wBH472aG2LAmYm6hjxw==", + "path": "hangfire.netcore/1.8.14", + "hashPath": "hangfire.netcore.1.8.14.nupkg.sha512" + }, + "Hangfire.PostgreSql/1.20.10": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Nn/88KoBvmy/xyopC9s+lXkwxQ6VB+RKyM8tjX3EgfSARDFxl2sEsFu0lw7WrjFdosg+E3naGzM5MzyiiL5i6w==", + "path": "hangfire.postgresql/1.20.10", + "hashPath": "hangfire.postgresql.1.20.10.nupkg.sha512" + }, + "Hangfire.SqlServer/1.8.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OrsxbJD0UYanIk4E1oqwffZSWRfltYXJa89Icn+fcWmOLGyWTiAg9j5UX4MoS2RaS3WyZG8xbZzbhoRqnujo8g==", + "path": "hangfire.sqlserver/1.8.14", + "hashPath": "hangfire.sqlserver.1.8.14.nupkg.sha512" + }, + "Humanizer.Core/2.14.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==", + "path": "humanizer.core/2.14.1", + "hashPath": "humanizer.core.2.14.1.nupkg.sha512" + }, + "LinqKit/1.3.7": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSMG2VfPAd9ipPKRIxG7mGAi69W5qfiLH9Bn1wrmhhHWI5SaLweOeE6xk7qzp+HiSc+LIWqxJpK13yk4t3b1nw==", + "path": "linqkit/1.3.7", + "hashPath": "linqkit.1.3.7.nupkg.sha512" + }, + "LinqKit.Core/1.2.7": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RfFeWWEGxh7Pt/fCpoTU23aSD6QEzTXdx5B1SuxpBpL5jsIvbBAAXp12UGc5yISg+O3c/kjs+3UZSghjmhsi1Q==", + "path": "linqkit.core/1.2.7", + "hashPath": "linqkit.core.1.2.7.nupkg.sha512" + }, + "Microsoft.AspNetCore.Authentication.JwtBearer/8.0.6": { + "type": "package", + "serviceable": true, + "sha512": "sha512-devoUZd8YqikCheBVYpIyvp9psM2Y2ZhOvq1zL2YSjIoq3FUQH8LpLkGak+8oAi/5DGqX8KWyLpZJSUXtOAVCw==", + "path": "microsoft.aspnetcore.authentication.jwtbearer/8.0.6", + "hashPath": "microsoft.aspnetcore.authentication.jwtbearer.8.0.6.nupkg.sha512" + }, + "Microsoft.AspNetCore.OpenApi/8.0.6": { + "type": "package", + "serviceable": true, + "sha512": "sha512-G0Qdo5ZtxmBFZ41CFRopZbSVeS/xwezmqZE0vLYcggoB7EEsPOUKSWnSrJPC2C+02iANAnnq6bSMIlKBgdqCmA==", + "path": "microsoft.aspnetcore.openapi/8.0.6", + "hashPath": "microsoft.aspnetcore.openapi.8.0.6.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "path": "microsoft.bcl.asyncinterfaces/6.0.0", + "hashPath": "microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==", + "path": "microsoft.codeanalysis.common/4.5.0", + "hashPath": "microsoft.codeanalysis.common.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==", + "path": "microsoft.codeanalysis.csharp/4.5.0", + "hashPath": "microsoft.codeanalysis.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h74wTpmGOp4yS4hj+EvNzEiPgg/KVs2wmSfTZ81upJZOtPkJsVkgfsgtxxqmAeapjT/vLKfmYV0bS8n5MNVP+g==", + "path": "microsoft.codeanalysis.csharp.workspaces/4.5.0", + "hashPath": "microsoft.codeanalysis.csharp.workspaces.4.5.0.nupkg.sha512" + }, + "Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-l4dDRmGELXG72XZaonnOeORyD/T5RpEu5LGHOUIhnv+MmUWDY/m1kWXGwtcgQ5CJ5ynkFiRnIYzTKXYjUs7rbw==", + "path": "microsoft.codeanalysis.workspaces.common/4.5.0", + "hashPath": "microsoft.codeanalysis.workspaces.common.4.5.0.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iK+jrJzkfbIxutB7or808BPmJtjUEi5O+eSM7cLDwsyde6+3iOujCSfWnrHrLxY3u+EQrJD+aD8DJ6ogPA2Rtw==", + "path": "microsoft.entityframeworkcore/8.0.8", + "hashPath": "microsoft.entityframeworkcore.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Abstractions/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9mMQkZsfL1c2iifBD8MWRmwy59rvsVtR9NOezJj7+g1j4P7g49MJHd8k8faC/v7d5KuHkQ6KOQiSItvoRt9PXA==", + "path": "microsoft.entityframeworkcore.abstractions/8.0.8", + "hashPath": "microsoft.entityframeworkcore.abstractions.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Design/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MmQAMHdjZR8Iyn/FVQrh9weJQTn0HqtKa3vELS9ffQJat/qXgnTam9M9jqvePphjkYp5Scee+Hy+EJR4nmWmOA==", + "path": "microsoft.entityframeworkcore.design/8.0.8", + "hashPath": "microsoft.entityframeworkcore.design.8.0.8.nupkg.sha512" + }, + "Microsoft.EntityFrameworkCore.Relational/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3WnrwdXxKg4L98cDx0lNEEau8U2lsfuBJCs0Yzht+5XVTmahboM7MukKfQHAzVsHUPszm6ci929S7Qas0WfVHA==", + "path": "microsoft.entityframeworkcore.relational/8.0.8", + "hashPath": "microsoft.entityframeworkcore.relational.8.0.8.nupkg.sha512" + }, + "Microsoft.Extensions.Caching.Memory/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HFDnhYLccngrzyGgHkjEDU5FMLn4MpOsr5ElgsBMC4yx6lJh4jeWO7fHS8+TXPq+dgxCmUa/Trl8svObmwW4QA==", + "path": "microsoft.extensions.caching.memory/8.0.1", + "hashPath": "microsoft.extensions.caching.memory.8.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9/qymSh7hVDMGTGwrLz8MRp5zRyXy9adGDOs4HwRdnLil3oZGYuWeZjbmHgCQ9BL1qBroVfgUK3U/nb61617Cw==", + "path": "microsoft.extensions.dependencyinjection.abstractions/10.0.12", + "hashPath": "microsoft.extensions.dependencyinjection.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.DependencyModel/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5Ou6varcxLBzQ+Agfm0k0pnH7vrEITYlXMDuE6s7ZHlZHz6/G8XJ3iISZDr5rfwfge6RnXJ1+Wc479mMn52vjA==", + "path": "microsoft.extensions.dependencymodel/8.0.1", + "hashPath": "microsoft.extensions.dependencymodel.8.0.1.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+24lC4plfbEDNfLAdTV/SWKS7dW+16X4HdydO3R++134kSNTzcbYA4KpR1Hdh6uWisB8Za3AzwyOn+K+NxWIug==", + "path": "microsoft.extensions.logging.abstractions/10.0.12", + "hashPath": "microsoft.extensions.logging.abstractions.10.0.12.nupkg.sha512" + }, + "Microsoft.Extensions.Options/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==", + "path": "microsoft.extensions.options/8.0.2", + "hashPath": "microsoft.extensions.options.8.0.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Abstractions/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-48quPTCzrglBlNSh5XFeA4Cyd5qm8IY1uqYx9+/0NNGVAv7U19aWieJxgTvmCiUr5il3F1851wDNGWiaUOktVw==", + "path": "microsoft.identitymodel.abstractions/7.7.3", + "hashPath": "microsoft.identitymodel.abstractions.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.JsonWebTokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-URCySdj7XJVVFvKI7XrfMe60pw14kx9HhSw8thBPZvVS2t7q2qosvib2zGjXRdu+xOg33RCdGHoRG7NzbGNPDg==", + "path": "microsoft.identitymodel.jsonwebtokens/7.7.3", + "hashPath": "microsoft.identitymodel.jsonwebtokens.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Logging/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QCNNrmwqa+fe9GVipM2aSFkS/zeLPXd6G3HahyLv/8477aK6hxm4uxEbS8lgUJVRZE3vwrW/iKxeDYNh99TNDQ==", + "path": "microsoft.identitymodel.logging/7.7.3", + "hashPath": "microsoft.identitymodel.logging.7.7.3.nupkg.sha512" + }, + "Microsoft.IdentityModel.Protocols/7.1.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SydLwMRFx6EHPWJ+N6+MVaoArN1Htt92b935O3RUWPY1yUF63zEjvd3lBu79eWdZUwedP8TN2I5V9T3nackvIQ==", + "path": "microsoft.identitymodel.protocols/7.1.2", + "hashPath": "microsoft.identitymodel.protocols.7.1.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect/7.1.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6lHQoLXhnMQ42mGrfDkzbIOR3rzKM1W1tgTeMPLgLCqwwGw0d96xFi/UiX/fYsu7d6cD5MJiL3+4HuI8VU+sVQ==", + "path": "microsoft.identitymodel.protocols.openidconnect/7.1.2", + "hashPath": "microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512" + }, + "Microsoft.IdentityModel.Tokens/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h8hxpd6MgZbrxcORtinVQ8rvjAw75G9vzucVFm6CI+JBXS2kUer8X7LclYaBS12/DEkHtJiG6pc1v8ybSr9BAg==", + "path": "microsoft.identitymodel.tokens/7.7.3", + "hashPath": "microsoft.identitymodel.tokens.7.7.3.nupkg.sha512" + }, + "Microsoft.OpenApi/1.6.14": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tTaBT8qjk3xINfESyOPE2rIellPvB7qpVqiWiyA/lACVvz+xOGiXhFUfohcx82NLbi5avzLW0lx+s6oAqQijfw==", + "path": "microsoft.openapi/1.6.14", + "hashPath": "microsoft.openapi.1.6.14.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==", + "path": "microsoft.win32.systemevents/6.0.0", + "hashPath": "microsoft.win32.systemevents.6.0.0.nupkg.sha512" + }, + "MiniExcel/1.46.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-IMmli1Hc3/Axst8hcuUx30q/2HTKH2f3nmduiy59wvpth1u0881fZMEMAy4Inl3GBkdrVXA8UUpF5lyoWREdLQ==", + "path": "miniexcel/1.46.0", + "hashPath": "miniexcel.1.46.0.nupkg.sha512" + }, + "Mono.TextTemplating/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==", + "path": "mono.texttemplating/2.2.1", + "hashPath": "mono.texttemplating.2.2.1.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==", + "path": "newtonsoft.json/13.0.4", + "hashPath": "newtonsoft.json.13.0.4.nupkg.sha512" + }, + "Npgsql/8.0.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vaYEUlF/pB9m8bs21wQv3Da0kMHT4A9USe47VfY/L2BO97xz5KfIxhEu22QS9d68ZrLxvtL3wQDfDLPr2OjbjA==", + "path": "npgsql/8.0.4", + "hashPath": "npgsql.8.0.4.nupkg.sha512" + }, + "Npgsql.EntityFrameworkCore.PostgreSQL/8.0.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-D5WWJZJTgZYUmGv66BARXbTlinp2a5f5RueJqGYoHuWJw02J0i2va/RA+8N4A5hLORK5YKMRqXhFWtKsZdrksw==", + "path": "npgsql.entityframeworkcore.postgresql/8.0.8", + "hashPath": "npgsql.entityframeworkcore.postgresql.8.0.8.nupkg.sha512" + }, + "PdfPig/0.1.16": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qQcbsNMYVY+K5ELptax2S8thNMk0+rSQq3H/KdYj3LLcko8yTCz8y5KIvsKxIyAuTN0ZYNnfsZkM+0EvxTwHVA==", + "path": "pdfpig/0.1.16", + "hashPath": "pdfpig.0.1.16.nupkg.sha512" + }, + "Pgvector/0.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-asa5XkgE3rXCNi5qHGavWZ5w+pmqWjjM1T5vN5VuPaKqV52h4TLiOM9ZJFofYgYtfhReo1QWe4NeD+hbv7ydfw==", + "path": "pgvector/0.3.0", + "hashPath": "pgvector.0.3.0.nupkg.sha512" + }, + "Pgvector.EntityFrameworkCore/0.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P3h1U7ajdIGqwTQZASdEMMrL5j4Kzc6s8o/1HX3Tc+zeeQPgcXMC1cymJY4ZVzEtBkL4rB9TG8PcaxxQd6kx2Q==", + "path": "pgvector.entityframeworkcore/0.2.1", + "hashPath": "pgvector.entityframeworkcore.0.2.1.nupkg.sha512" + }, + "QuestPDF/2026.9.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Nc7nvV/CmL/lonuw1mTQbiETfU7EZoM2kZ9YRgdbC5VivVjxsMHPJ18g4t5FMx/jUGh6XpJXFfW1rFWvAYOeTg==", + "path": "questpdf/2026.9.2", + "hashPath": "questpdf.2026.9.2.nupkg.sha512" + }, + "RBush/3.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ijGh9N0zZ7JfXk3oQkWCwK8SwSSByexbyh/MjbCjNxOft9eG5ZqKC1vdgiYq78h4IZRFmN4s3JZ/b10Jipud5w==", + "path": "rbush/3.2.0", + "hashPath": "rbush.3.2.0.nupkg.sha512" + }, + "runtime.native.System.Data.SqlClient.sni/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9kyFSIdN3T0qjDQ2R0HRXYIhS3l5psBzQi6qqhdLz+SzFyEy4sVxNOke+yyYv8Cu8rPER12c3RDjLT8wF3WBYQ==", + "path": "runtime.native.system.data.sqlclient.sni/4.7.0", + "hashPath": "runtime.native.system.data.sqlclient.sni.4.7.0.nupkg.sha512" + }, + "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbrynESTp3bm5O/+jGL8v0Qg5SJlTV08lpIpFesXjF6uGNMWqFnUQbYBJwZTeua6E/Y7FIM1C54Ey1btLWupdg==", + "path": "runtime.win-arm64.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-arm64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "runtime.win-x64.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-38ugOfkYJqJoX9g6EYRlZB5U2ZJH51UP8ptxZgdpS07FgOEToV+lS11ouNK2PM12Pr6X/PpT5jK82G3DwH/SxQ==", + "path": "runtime.win-x64.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "runtime.win-x86.runtime.native.System.Data.SqlClient.sni/4.4.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YhEdSQUsTx+C8m8Bw7ar5/VesXvCFMItyZF7G1AUY+OM0VPZUOeAVpJ4Wl6fydBGUYZxojTDR3I6Bj/+BPkJNA==", + "path": "runtime.win-x86.runtime.native.system.data.sqlclient.sni/4.4.0", + "hashPath": "runtime.win-x86.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512" + }, + "Scrutor/3.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BwqCnFzp2/Z+pq17iztxlIkR/ZANyPRR4PdE57WL1w/JW4AM/2imoxBWTL3+G+YXA46ce4s9OUgwWqTXYrtI8A==", + "path": "scrutor/3.3.0", + "hashPath": "scrutor.3.3.0.nupkg.sha512" + }, + "SixLabors.Fonts/1.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LFQsCZlV0xlUyXAOMUo5kkSl+8zAQXXbbdwWchtk0B4o7zotZhQsQOcJUELGHdfPfm/xDAsz6hONAuV25bJaAg==", + "path": "sixlabors.fonts/1.0.0", + "hashPath": "sixlabors.fonts.1.0.0.nupkg.sha512" + }, + "SkiaSharp/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nmy2dOFWPvQKMglfpjz8+/xQQcSrL9jzul3cUyzCJVSwrmSAw+6B1sEgU7jt6NZBptwGq2k/V0kjyu2GizMFtg==", + "path": "skiasharp/3.119.2", + "hashPath": "skiasharp.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Linux.NoDependencies/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1rmveKZ8Cz7k4QJQdtKV6RFXYIEqYBiX450Bm0Bk41EE50MMPUyF81cRnASsuV0qCwdZuzjZTaFvoqS0Q2zVfA==", + "path": "skiasharp.nativeassets.linux.nodependencies/3.119.2", + "hashPath": "skiasharp.nativeassets.linux.nodependencies.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.macOS/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I2jMGQ/26KOnc6iAoR+Mxh9vSJJ2vioJyj9aJ9OL5yEZyXothXJxf4vBMqnSaiXMqiiU1scG7KqtT0CLkmMmWA==", + "path": "skiasharp.nativeassets.macos/3.119.2", + "hashPath": "skiasharp.nativeassets.macos.3.119.2.nupkg.sha512" + }, + "SkiaSharp.NativeAssets.Win32/3.119.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uYe+da6+GXVgPKkCopzvIZ83DmC8SXXKeUAPrNcztJNsg0SjPQAxfKMOPZqmVjbzznrq/QUIjLUlJSZV/e0IPA==", + "path": "skiasharp.nativeassets.win32/3.119.2", + "hashPath": "skiasharp.nativeassets.win32.3.119.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore/6.6.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NB4UYVYN6AhDSjW0IJAd1AGD8V33gemFNLPaxKTtPkHB+HaKAKf9MGAEUPivEWvqeQfcKIw8lJaHq6LHljRuw==", + "path": "swashbuckle.aspnetcore/6.6.2", + "hashPath": "swashbuckle.aspnetcore.6.6.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore.Filters/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-S4pR+265NwY9saAhK+3Jn2oL2Wfy0qvy9871b0KiEPW/iLPRgg2HrkrdMwC1wpjNkRXWGDFRRj+LkUD4lyuAaQ==", + "path": "swashbuckle.aspnetcore.filters/8.0.2", + "hashPath": "swashbuckle.aspnetcore.filters.8.0.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore.Filters.Abstractions/8.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RgQ1RbxmofrkBSrLkA/34DWwzz4rKHRwC4vHOvevru2CNqymUPn3kRhbIX29g4yvj2sCff1glf19djnyM9kuUQ==", + "path": "swashbuckle.aspnetcore.filters.abstractions/8.0.2", + "hashPath": "swashbuckle.aspnetcore.filters.abstractions.8.0.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore.Swagger/6.6.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ovgPTSYX83UrQUWiS5vzDcJ8TEX1MAxBgDFMK45rC24MorHEPQlZAHlaXj/yth4Zf6xcktpUgTEBvffRQVwDKA==", + "path": "swashbuckle.aspnetcore.swagger/6.6.2", + "hashPath": "swashbuckle.aspnetcore.swagger.6.6.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore.SwaggerGen/6.6.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zv4ikn4AT1VYuOsDCpktLq4QDq08e7Utzbir86M5/ZkRaLXbCPF11E1/vTmOiDzRTl0zTZINQU2qLKwTcHgfrA==", + "path": "swashbuckle.aspnetcore.swaggergen/6.6.2", + "hashPath": "swashbuckle.aspnetcore.swaggergen.6.6.2.nupkg.sha512" + }, + "Swashbuckle.AspNetCore.SwaggerUI/6.6.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mBBb+/8Hm2Q3Wygag+hu2jj69tZW5psuv0vMRXY07Wy+Rrj40vRP8ZTbKBhs91r45/HXT4aY4z0iSBYx1h6JvA==", + "path": "swashbuckle.aspnetcore.swaggerui/6.6.2", + "hashPath": "swashbuckle.aspnetcore.swaggerui.6.6.2.nupkg.sha512" + }, + "System.CodeDom/7.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GLltyqEsE5/3IE+zYRP5sNa1l44qKl9v+bfdMcwg+M9qnQf47wK3H0SUR/T+3N4JEQXF3vV4CSuuo0rsg+nq2A==", + "path": "system.codedom/7.0.0", + "hashPath": "system.codedom.7.0.0.nupkg.sha512" + }, + "System.Composition/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-d7wMuKQtfsxUa7S13tITC8n1cQzewuhD5iDjZtK2prwFfKVzdYtgrTHgjaV03Zq7feGQ5gkP85tJJntXwInsJA==", + "path": "system.composition/6.0.0", + "hashPath": "system.composition.6.0.0.nupkg.sha512" + }, + "System.Composition.AttributedModel/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-WK1nSDLByK/4VoC7fkNiFuTVEiperuCN/Hyn+VN30R+W2ijO1d0Z2Qm0ScEl9xkSn1G2MyapJi8xpf4R8WRa/w==", + "path": "system.composition.attributedmodel/6.0.0", + "hashPath": "system.composition.attributedmodel.6.0.0.nupkg.sha512" + }, + "System.Composition.Convention/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-XYi4lPRdu5bM4JVJ3/UIHAiG6V6lWWUlkhB9ab4IOq0FrRsp0F4wTyV4Dj+Ds+efoXJ3qbLqlvaUozDO7OLeXA==", + "path": "system.composition.convention/6.0.0", + "hashPath": "system.composition.convention.6.0.0.nupkg.sha512" + }, + "System.Composition.Hosting/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-w/wXjj7kvxuHPLdzZ0PAUt++qJl03t7lENmb2Oev0n3zbxyNULbWBlnd5J5WUMMv15kg5o+/TCZFb6lSwfaUUQ==", + "path": "system.composition.hosting/6.0.0", + "hashPath": "system.composition.hosting.6.0.0.nupkg.sha512" + }, + "System.Composition.Runtime/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qkRH/YBaMPTnzxrS5RDk1juvqed4A6HOD/CwRcDGyPpYps1J27waBddiiq1y93jk2ZZ9wuA/kynM+NO0kb3PKg==", + "path": "system.composition.runtime/6.0.0", + "hashPath": "system.composition.runtime.6.0.0.nupkg.sha512" + }, + "System.Composition.TypedParts/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iUR1eHrL8Cwd82neQCJ00MpwNIBs4NZgXzrPqx8NJf/k4+mwBO0XCRmHYJT4OLSwDDqh5nBLJWkz5cROnrGhRA==", + "path": "system.composition.typedparts/6.0.0", + "hashPath": "system.composition.typedparts.6.0.0.nupkg.sha512" + }, + "System.Configuration.ConfigurationManager/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==", + "path": "system.configuration.configurationmanager/6.0.1", + "hashPath": "system.configuration.configurationmanager.6.0.1.nupkg.sha512" + }, + "System.Data.SqlClient/4.8.6": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2Ij/LCaTQRyAi5lAv7UUTV9R2FobC8xN9mE0fXBZohum/xLl8IZVmE98Rq5ugQHjCgTBRKqpXRb4ORulRdA6Ig==", + "path": "system.data.sqlclient/4.8.6", + "hashPath": "system.data.sqlclient.4.8.6.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/10.0.12": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CRZTWYO0rzEcJN/6SuN1kMvQOJT7vyHZ64CCkQs0RRWTj7kH2KMkaMalbsbSI/eg5dS5JAQfQFFuuWgn+XRMsQ==", + "path": "system.diagnostics.diagnosticsource/10.0.12", + "hashPath": "system.diagnostics.diagnosticsource.10.0.12.nupkg.sha512" + }, + "System.Drawing.Common/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", + "path": "system.drawing.common/6.0.0", + "hashPath": "system.drawing.common.6.0.0.nupkg.sha512" + }, + "System.IdentityModel.Tokens.Jwt/7.7.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xqg/Al8bXC7+K54sy9F095rkWGBHQ5aLXaBg0zWEbzDWx442DMP8xCJaSugHpYwOyW9gC0pyq5XWpWYN50IqIA==", + "path": "system.identitymodel.tokens.jwt/7.7.3", + "hashPath": "system.identitymodel.tokens.jwt.7.7.3.nupkg.sha512" + }, + "System.IO.Packaging/8.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KYkIOAvPexQOLDxPO2g0BVoWInnQhPpkFzRqvNrNrMhVT6kqhVr0zEb6KCHlptLFukxnZrjuMVAnxK7pOGUYrw==", + "path": "system.io.packaging/8.0.1", + "hashPath": "system.io.packaging.8.0.1.nupkg.sha512" + }, + "System.Management/7.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/qEUN91mP/MUQmJnM5y5BdT7ZoPuVrtxnFlbJ8a3kBJGhe2wCzBfnPFtK2wTtEEcf3DMGR9J00GZZfg6HRI6yA==", + "path": "system.management/7.0.2", + "hashPath": "system.management.7.0.2.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==", + "path": "system.security.cryptography.protecteddata/6.0.0", + "hashPath": "system.security.cryptography.protecteddata.6.0.0.nupkg.sha512" + }, + "System.Security.Permissions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==", + "path": "system.security.permissions/6.0.0", + "hashPath": "system.security.permissions.6.0.0.nupkg.sha512" + }, + "System.Windows.Extensions/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==", + "path": "system.windows.extensions/6.0.0", + "hashPath": "system.windows.extensions.6.0.0.nupkg.sha512" + }, + "Tesseract/5.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YB7feJlrTWSXtK8+WaCcseGSPK/1r2d2FWeKGyndlrPwYClrzTlCoHD4/oQEUjKafmpkWlhTZZ7pxiRJYZgj6w==", + "path": "tesseract/5.2.0", + "hashPath": "tesseract.5.2.0.nupkg.sha512" + }, + "RikiPath.Application/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "RikiPath.Domain/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "RikiPath.Infrastructure/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.dll b/_codex-verify/Debug/net8.0/RikiPath.WebApi.dll new file mode 100644 index 00000000..f7dc264e Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.WebApi.dll differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.exe b/_codex-verify/Debug/net8.0/RikiPath.WebApi.exe new file mode 100644 index 00000000..e360013e Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.WebApi.exe differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.pdb b/_codex-verify/Debug/net8.0/RikiPath.WebApi.pdb new file mode 100644 index 00000000..33d24641 Binary files /dev/null and b/_codex-verify/Debug/net8.0/RikiPath.WebApi.pdb differ diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.runtimeconfig.json b/_codex-verify/Debug/net8.0/RikiPath.WebApi.runtimeconfig.json new file mode 100644 index 00000000..b8a4a9c3 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.WebApi.runtimeconfig.json @@ -0,0 +1,20 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + { + "name": "Microsoft.AspNetCore.App", + "version": "8.0.0" + } + ], + "configProperties": { + "System.GC.Server": true, + "System.Reflection.NullabilityInfoContext.IsSupported": true, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.staticwebassets.endpoints.json b/_codex-verify/Debug/net8.0/RikiPath.WebApi.staticwebassets.endpoints.json new file mode 100644 index 00000000..5576e889 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.WebApi.staticwebassets.endpoints.json @@ -0,0 +1 @@ +{"Version":1,"ManifestType":"Build","Endpoints":[]} \ No newline at end of file diff --git a/_codex-verify/Debug/net8.0/RikiPath.WebApi.xml b/_codex-verify/Debug/net8.0/RikiPath.WebApi.xml new file mode 100644 index 00000000..bf3be442 --- /dev/null +++ b/_codex-verify/Debug/net8.0/RikiPath.WebApi.xml @@ -0,0 +1,1630 @@ + + + + RikiPath.WebApi + + + + API Admin quản lý CertificateSection theo từng cấp độ JLPT. + + + API Admin quản lý CertificateSection theo từng cấp độ JLPT. + + + Lấy danh sách CertificateSection phục vụ màn hình quản trị. + Lọc theo ID CertificateLevel; bỏ trống để lấy mọi cấp độ. + Bao gồm section đã lưu trữ mềm. + Token hủy request. + Trả về danh sách section theo bộ lọc. + Bộ lọc CertificateLevelId không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role Admin. + Không thể tải dữ liệu section. + + + Lấy chi tiết một CertificateSection, kể cả section đã lưu trữ. + Trả về chi tiết section. + Thiếu hoặc sai Bearer Token. + Token không có role Admin. + Không tìm thấy section. + Không thể tải dữ liệu section. + + + Tạo CertificateSection mới cho một CertificateLevel JLPT đang khả dụng. + Code không có unique constraint trong schema hiện tại; API không tự đặt thêm quy tắc trùng mã. + Tạo section thành công. + Dữ liệu hoặc CertificateLevel không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role Admin. + Không thể tạo section. + + + Cập nhật các trường quản trị của một CertificateSection đang hoạt động. + Cập nhật section thành công. + Dữ liệu hoặc CertificateLevel không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role Admin. + Không tìm thấy section đang hoạt động. + Không thể cập nhật section. + + + Lưu trữ mềm CertificateSection để không phá vỡ nội dung Mock Test đang tham chiếu. + Lưu trữ section thành công hoặc section đã được lưu trữ trước đó. + Thiếu hoặc sai Bearer Token. + Token không có role Admin. + Không tìm thấy section. + Không thể lưu trữ section. + + + Đọc chứng chỉ ứng tuyển qua quyền quản trị hiện tại. + + + API quản trị tài khoản người dùng. + + + API quản trị tài khoản người dùng. + + + Lấy danh sách tài khoản, có thể lọc theo role và tùy chọn bao gồm tài khoản đã vô hiệu hóa. + + + Lấy thông tin một tài khoản theo ID. + + + Tạo tài khoản Giáo viên hoặc Content Author với mật khẩu mặc định. + + + Cập nhật thông tin hồ sơ, role hoặc trạng thái hoạt động của tài khoản. + + + Vô hiệu hóa tài khoản bằng soft delete. + + + + Lấy chuỗi ngày học liên tiếp (study streak) của người dùng hiện tại. + + + - Màn hình sử dụng: Hiển thị trên dashboard / Progress của Learner để khuyến khích thói quen học. + - Luồng xử lý: API chỉ đọc dữ liệu phân tích từ CSDL/Cache (không gọi AI). Có thể có cache để trả nhanh. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Thường trả nhanh (<200ms); FE nên hiển thị loading placeholder khi chờ. + + Token hủy request (Optional). + Thành công: Trả về số ngày liên tiếp hiện tại và metadata (JSON). + Yêu cầu không hợp lệ: tham số không hợp lệ (hiếm). + Chưa xác thực: Thiếu hoặc sai Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi truy vấn dữ liệu hoặc cache. + + + + Kiểm tra sự kiện chúc mừng chuỗi ngày học của hôm nay (giờ Việt Nam) cho người học hiện tại. + + + - Chỉ đọc: không bao giờ tạo hoạt động học hay sự kiện mới khi mở trang. + - `hasPendingEvent = true` chỉ khi hôm nay đã có hoạt động học hợp lệ và sự kiện chưa được nhận trên bất kỳ thiết bị nào. + + Trạng thái sự kiện, chuỗi hiện tại, mốc và các ngày học trong tuần. + + + + Nhận (claim) sự kiện chúc mừng chuỗi ngày học của hôm nay ngay trước khi hiển thị popup. + + + - Idempotent theo learner + ngày học: chỉ một request thắng (`claimed = true`); tab/thiết bị khác nhận `claimed = false`. + - Máy chủ tự tính lại sự kiện; `eventId` cũ (ví dụ qua nửa đêm) không được nhận. + + `claimed = true` nếu request này được phép hiển thị popup. + + + + Lấy thống kê hoàn thành khóa học / bài tập của người dùng (completion stats). + + + - Màn hình sử dụng: Dashboard hoặc trang Progress/Statistics của Learner. + - Luồng xử lý: Đọc từ CSDL/OLAP; có thể tính toán tổng hợp (aggregate) tại server, không gọi AI. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Response có thể gồm nhiều trường (percent, counts); FE nên xử lý null/empty. + + Token hủy request (Optional). + Thành công: Trả về các chỉ số hoàn thành (JSON) như percentComplete, lessonsCompleted. + Yêu cầu không hợp lệ: tham số truy vấn sai định dạng (nếu có). + Chưa xác thực: Thiếu hoặc sai Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi tổng hợp dữ liệu. + + + + Lấy phân tích theo kỹ năng (skill breakdown) của người học. + + + - Màn hình sử dụng: Trang chi tiết năng lực / LanguageSkill Insights trong ứng dụng Learner. + - Luồng xử lý: Server tổng hợp điểm/tiến độ theo từng kỹ năng từ CSDL; không gọi AI. Có thể trả theo dạng danh sách {skill, score, progress}. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Kết quả có thể được cache; FE nên support cập nhật khi user làm mới dữ liệu. + + Token hủy request (Optional). + Thành công: Trả về danh sách kỹ năng cùng điểm/tiến độ. + Yêu cầu không hợp lệ: tham số truyền vào sai (nếu có). + Chưa xác thực: Thiếu hoặc sai Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi tổng hợp hoặc truy vấn dữ liệu. + + + + Lấy năng lực cá nhân theo từng kỹ năng theo tháng, từ Placement Test và Mock Test đã nộp. + + Số tháng cần xem, từ 1 đến 24; mặc định 12 tháng. + Token hủy request. + + + + Đăng ký tài khoản mới. + + + - Màn hình sử dụng: Màn hình đăng ký (Sign Up) của ứng dụng. + - Luồng xử lý: Tạo user mới trong CSDL, gửi email xác thực (gọi Mail service) với token; không đăng nhập tự động. + - Lưu ý cho FE: Gửi body JSON theo RegisterRequest. Response có thể mất ~0.5-2s do gửi email. Không cần Bearer Token. + + Thông tin đăng ký: Email (Required), Password (Required), FullName (Optional). + Token hủy request (Optional). + Thành công: Tạo tài khoản và gửi email xác thực. + Dữ liệu không hợp lệ: email đã tồn tại hoặc password không đủ mạnh. + Lỗi server khi tạo user hoặc gửi email. + + + Gửi liên kết đặt lại mật khẩu đến email đã xác thực, không tiết lộ tài khoản có tồn tại hay không. + + + Đặt mật khẩu mới bằng liên kết đã ký, còn hạn và chưa được sử dụng. + + + + Gửi lại mã xác thực email cho tài khoản chưa xác thực. + + + Mỗi email được gửi lại tối đa 5 lần trong 1 giờ và cách nhau ít nhất 60 giây. + + + + Đổi địa chỉ email của tài khoản chưa xác thực sau khi kiểm tra mật khẩu đăng ký. + + + + Đăng ký tài khoản mới bằng số điện thoại qua Firebase Auth. + + + - Màn hình sử dụng: Màn hình đăng ký / xác thực OTP số điện thoại. + - Luồng xử lý: Xác thực idToken từ Firebase, lấy FirebaseUid & PhoneNumber chính chủ từ Firebase server, tạo tài khoản mới trong CSDL. + - Lưu ý cho FE: FE cần hoàn tất xác thực OTP qua Firebase Client SDK trước để lấy idToken, sau đó gửi idToken trong body. Không cần Bearer Token. + + FirebasePhoneAuthRequest: IdToken từ Firebase SDK và thông tin bổ sung (FullName, TargetLevel...). + Token hủy request (Optional). + Thành công: Tạo tài khoản thành công và trả về thông tin user/token. + Dữ liệu không hợp lệ: Firebase idToken hết hạn/không hợp lệ hoặc số điện thoại đã được đăng ký. + Lỗi server khi xác thực với Firebase hoặc tạo tài khoản. + + + + Xác thực email bằng token gửi qua email. + + + - Màn hình sử dụng: Màn hình xác thực email (Verify Email) hoặc link từ email. + - Luồng xử lý: Kiểm tra token, cập nhật trạng thái emailVerified trong CSDL; có thể ghi log xác thực. + - Lưu ý cho FE: Gửi token và email trong body; không cần Bearer Token. Response nhanh (<500ms). + + VerifyEmailRequest: Email (Required), Token (Required). + Token hủy request (Optional). + Thành công: Email được xác thực. + Token không hợp lệ hoặc đã hết hạn. + Không tìm thấy user với email này. + Lỗi server khi cập nhật trạng thái. + + + + Xác thực email một chạm bằng liên kết ký riêng đã gửi tới hộp thư. + + + + + Đăng nhập và lấy JWT token. + + + - Màn hình sử dụng: Màn hình Login của ứng dụng. + - Luồng xử lý: Kiểm tra credentials, trả về JWT + thông tin user; có thể ghi log đăng nhập. + - Lưu ý cho FE: Gửi Email và Password trong body. Trả về Bearer token dùng cho các request yêu cầu xác thực. Lưu token an toàn (Secure storage). + + LoginRequest: Email (Required), Password (Required). + Token hủy request (Optional). + Thành công: Trả về JWT token và thông tin user. + Dữ liệu không hợp lệ. + Email hoặc mật khẩu sai. + Lỗi server khi xác thực. + + + + Đăng nhập bằng số điện thoại qua Firebase Auth và nhận JWT token hệ thống. + + + - Màn hình sử dụng: Màn hình đăng nhập bằng SĐT / OTP. + - Luồng xử lý: Xác thực idToken từ Firebase, đối chiếu FirebaseUid/SĐT trong CSDL, phát hành JWT Bearer Token của hệ thống. + - Lưu ý cho FE: FE xác thực OTP qua Firebase Client SDK trước để lấy idToken. Nếu tài khoản chưa tồn tại, API sẽ báo lỗi 404 để FE chuyển sang luồng Đăng ký. + + FirebasePhoneAuthRequest: IdToken nhận từ Firebase SDK. + Token hủy request (Optional). + Thành công: Trả về JWT token hệ thống và thông tin user. + Dữ liệu không hợp lệ: Firebase idToken hết hạn hoặc không hợp lệ. + Không tìm thấy tài khoản liên kết với số điện thoại này trong hệ thống. + Lỗi server khi xác thực với Firebase. + + + + Cập nhật địa chỉ email cho user (chính chủ hoặc Admin). + + + - Màn hình sử dụng: Trang quản lý tài khoản hoặc Profile Settings. + - Luồng xử lý: Cập nhật email trong CSDL, gửi email xác thực mới, có thể yêu cầu xác thực lại. + - Lưu ý cho FE: Yêu cầu Bearer Token. User thường chỉ được cập nhật email của chính mình; + Admin được phép cập nhật email của tài khoản khác. + + ID user cần cập nhật (Required). + UpdateEmailRequest: NewEmail (Required). + Token hủy request (Optional). + Thành công: Email được cập nhật và email xác thực gửi đến địa chỉ mới. + Dữ liệu không hợp lệ: email format sai hoặc đã tồn tại. + Chưa xác thực: Thiếu Bearer Token. + + Không có quyền: User thường không được phép cập nhật email của tài khoản khác. + + Lỗi server khi cập nhật hoặc gửi mail. + + + + Đổi mật khẩu cho chính chủ tài khoản. + + + - Yêu cầu Bearer Token. + - User chỉ được phép đổi mật khẩu của chính mình. + - Admin không được phép đổi mật khẩu của tài khoản khác qua API này. + + ID user cần đổi mật khẩu (Required). + ChangePasswordRequest: CurrentPassword (Required if user tự đổi), NewPassword (Required). + Token hủy request (Optional). + Thành công: Mật khẩu được đổi. + Dữ liệu không hợp lệ: mật khẩu yếu hoặc current password sai. + Chưa xác thực: Thiếu Bearer Token. + + Không có quyền: Không được phép đổi mật khẩu của tài khoản khác. + + Lỗi server khi cập nhật mật khẩu. + + + + Lấy danh mục cấp độ JLPT khả dụng cho Learner. + + + - Màn hình sử dụng: Onboarding, chọn mục tiêu JLPT và các bộ lọc cần ID cấp độ. + - Luồng xử lý: Chỉ trả cấp độ thuộc loại JLPT đang hoạt động, không bị xóa mềm. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Dùng Id từ response cho các API cần level ID. + - Thứ tự: SortOrder tăng dần, sau đó Id tăng dần để kết quả luôn ổn định. + + Token hủy request (Optional). + Thành công, kể cả khi catalog rỗng. + Chưa xác thực hoặc thiếu Bearer Token. + Tài khoản không có role Learner. + Không thể truy vấn catalog. + + + + Lấy danh sách cấp độ theo chứng chỉ (dùng cho learner chọn cấp độ sau khi chọn chứng chỉ). + + + - Màn hình sử dụng: Chọn cấp độ muốn thi/học sau khi đã chọn loại chứng chỉ. + - Luồng xử lý: Nhận certificateTypeId, trả về các cấp độ thuộc chứng chỉ đó, sắp xếp theo SortOrder. + - Lưu ý cho FE: Gọi API lấy danh sách chứng chỉ trước để có certificateTypeId. + + Id của chứng chỉ (CertificateType). + Token hủy request (Optional). + Thành công. + certificateTypeId không hợp lệ. + Không tìm thấy chứng chỉ. + Lỗi hệ thống. + + + + Lấy danh sách các chứng chỉ đang hoạt động (dùng cho learner chọn chứng chỉ). + + + - Màn hình sử dụng: Chọn chứng chỉ muốn thi/học (JLPT, TOEIC...) trước khi chọn cấp độ. + - Luồng xử lý: Trả về các chứng chỉ có IsActive = true, sắp xếp theo SortOrder. + - Lưu ý cho FE: Dùng Id của chứng chỉ để gọi API lấy danh sách cấp độ theo chứng chỉ. + + Token hủy request (Optional). + Thành công. + Lỗi hệ thống. + + + In-class skill quizzes — Mentor side (Admin read-only). + + + In-class skill quizzes — Mentor side (Admin read-only). + + + Danh sách bài kiểm tra của Giáo viên (lọc theo lớp nếu có). + + + Chi tiết bài kiểm tra: cấu trúc đề (kèm đáp án), học viên được giao và kết quả. + + + Kho câu hỏi được phép dùng cho lớp (đúng cấp độ lớp, không gồm bộ đề đánh giá được bảo vệ). + + + Tạo và giao bài kiểm tra cho lớp (đề được chốt phiên bản khi giao). + + + Kết quả và bài làm của một học viên. + + + In-class skill quizzes — Learner side. Answers/submit reuse /api/PlacementTest/attempts/{attemptId}. + + + In-class skill quizzes — Learner side. Answers/submit reuse /api/PlacementTest/attempts/{attemptId}. + + + Bài kiểm tra được giao cho học viên (lọc theo lớp nếu có). + + + Bắt đầu hoặc tiếp tục bài kiểm tra (không cho bắt đầu sau hạn, một lượt làm). + + + Kết quả bài kiểm tra; đáp án chỉ công bố khi cả lớp đã làm xong hoặc đã hết hạn. + + + API AI hỗ trợ content author soạn và kiểm tra toàn bộ nội dung JLPT. + + + API AI hỗ trợ content author soạn và kiểm tra toàn bộ nội dung JLPT. + + + + Content author gõ yêu cầu tự do, AI đề xuất danh sách Kanji phù hợp và hệ thống tự dò trùng + với Kanji đã có trong DB. CHƯA lưu gì — chỉ trả về để preview/chỉnh sửa trước khi xác nhận. + + Trả về danh sách Kanji AI đề xuất, kèm đánh dấu trùng (nếu có). + Thiếu prompt hoặc AI trả về kết quả không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + Không tìm thấy Lesson (nếu có truyền LessonId). + AI tạm thời bị giới hạn hạn mức. + Không thể tạo đề xuất lúc này. + + + + Content author xác nhận danh sách Kanji (có thể đã chỉnh sửa tay sau khi preview). Hệ thống + ghi vào ContentApprovalRequest với trạng thái Draft để Admin duyệt theo đúng luồng hiện có. + + Đã gửi duyệt thành công. + Danh sách gửi lên trống hoặc thiếu dữ liệu bắt buộc. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + Không thể gửi duyệt lúc này. + + + + Quét lại nội dung content author hiện tại đã gửi, đang ở trạng thái Draft (chưa Admin duyệt), + nhờ AI đối chiếu với kiến thức chuẩn và chỉ rõ từng chỗ sai (nếu có) để tự sửa trước khi Admin + xem. Truyền batchId để chỉ quét 1 lần gửi cụ thể, bỏ trống để quét toàn bộ Draft hiện có. + + Trả về báo cáo kiểm tra từng dòng nội dung. + Không có nội dung Draft nào để kiểm tra. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + Không thể kiểm tra nội dung lúc này. + + + + API lập kế hoạch nội dung bằng AI cho content author, theo 3 bước: + Plan (AI chuyển yêu cầu tự do thành danh sách công việc) → Execute (sinh nội dung từng việc, chưa lưu DB) + → Confirm (ghi cả gói vào ContentApprovalRequest, trạng thái Draft, cùng một BatchId). + + + + + API lập kế hoạch nội dung bằng AI cho content author, theo 3 bước: + Plan (AI chuyển yêu cầu tự do thành danh sách công việc) → Execute (sinh nội dung từng việc, chưa lưu DB) + → Confirm (ghi cả gói vào ContentApprovalRequest, trạng thái Draft, cùng một BatchId). + + + + + Bước 1: content author gõ yêu cầu tự do, AI chỉ lập kế hoạch (danh sách công việc), CHƯA sinh nội dung. + Nếu thiếu thông tin bắt buộc, kết quả có ClarifyingQuestion và Tasks rỗng — author trả lời rồi gửi lại. + + Trả về kế hoạch (hoặc câu hỏi làm rõ). + Thiếu prompt. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + AI tạm thời bị giới hạn hạn mức. + Không thể lập kế hoạch lúc này. + AI trả về kế hoạch không hợp lệ. + + + + Bước 2: chạy kế hoạch (author có thể đã sửa/xóa/thêm công việc) để AI sinh nội dung từng việc theo thứ tự + Kanji → Vocabulary → Grammar → Lesson → PracticeExercise → MockTest. CHƯA lưu gì vào DB. + Mỗi công việc có trạng thái riêng (Succeeded/Failed/Skipped); một việc lỗi không làm hỏng cả gói. + + Trả về kết quả từng công việc. + Kế hoạch trống hoặc không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + Không thể chạy kế hoạch lúc này. + + + + Bước 3: author xác nhận bản cuối (có thể đã chỉnh tay sau khi xem kết quả). Hệ thống ghi toàn bộ gói vào + ContentApprovalRequest với trạng thái Draft cùng một BatchId để Admin duyệt. + + Đã gửi duyệt thành công, trả về BatchId và số dòng đã ghi. + Gói trống hoặc dữ liệu/liên kết không hợp lệ. + Thiếu hoặc sai Bearer Token. + Token không có role ContentAuthor. + Không thể gửi duyệt lúc này. + + + + Registers or updates an FCM device token for the currently authenticated user. + Handles token rotation, multi-device fan-out, and cross-user isolation. + + + + + Refreshes an existing device token for the currently authenticated user. + + + + + Revokes/deactivates a device token upon logout. + + + + + Revokes/deactivates a device token upon logout (DELETE verb). + + + + + Returns all active registered devices for the current user. + + + + + Upload một file lên storage (kiểm soát kích thước, phần mở rộng và đường dẫn an toàn). + + + + + Đọc tệp media cục bộ chỉ trong chế độ Development LocalDevMediaStorage. + + + + + Xoá file đã lưu trên storage (chỉ Admin hoặc ContentAuthor để ngăn IDOR/xóa file chéo người dùng). + + + + API luyện viết Hiragana và Katakana dành cho người học. + + + API luyện viết Hiragana và Katakana dành cho người học. + + + Lấy toàn bộ ký tự trong bảng Hiragana hoặc Katakana. + + + Lấy Kana đến hạn ôn trước, sau đó bổ sung ký tự mới đã được Admin duyệt. + Số ký tự muốn lấy, từ 1 đến 100. + Lọc bảng chữ Hiragana hoặc Katakana; bỏ trống để lấy cả hai. + Token hủy request. + + + Lưu kết quả luyện viết Kana và cập nhật lịch ôn SM-2 của người học. + + + + Danh sách Kanji cần luyện viết hôm nay (ưu tiên chữ đến hạn ôn, bổ sung chữ mới nếu thiếu). + + + - Màn hình sử dụng: Trang "Luyện viết Kanji". + - Luồng xử lý: FE dùng field Character để khởi tạo HanziWriter cho từng chữ; nếu IsNew = + true, nên phát animation stroke-order mẫu (HanziWriter.animateCharacter()) trước khi cho + learner tự vẽ (quiz()), thay vì bắt vẽ ngay. + + + + Nhận dạng một chữ Kanji vẽ tay, không lưu ảnh hoặc bài viết. + + + + Ghi nhận kết quả 1 lượt luyện viết 1 chữ Kanji, tính lại lịch ôn theo SM-2. + + + - Luồng xử lý: Gọi ngay sau khi HanziWriter.quiz()'s onComplete callback trả về, truyền + thẳng summaryData.totalMistakes vào TotalMistakes. + + + + + Learner view of the class competency profile and the end-of-course assessment (Stage 5). + enrollmentId is the learner's own class enrollment (the id in /my-courses/{id}). + Answers, submit and result of a started attempt reuse /api/PlacementTest/attempts/{attemptId}. + + + + + Learner view of the class competency profile and the end-of-course assessment (Stage 5). + enrollmentId is the learner's own class enrollment (the id in /my-courses/{id}). + Answers, submit and result of a started attempt reuse /api/PlacementTest/attempts/{attemptId}. + + + + Hồ sơ năng lực của chính học viên trong lớp: đầu vào, quá trình học và mức tiến bộ. + + + Trạng thái bài đánh giá cuối khóa của lớp (chưa mở, có thể làm, đang làm, đã hoàn thành). + + + Bắt đầu hoặc tiếp tục bài đánh giá cuối khóa; chỉ mở sau khi lớp học hoàn thành. + + + + Chấm bản chép đã được người học kiểm tra. FE gọi scan, hiển thị và cho sửa Text, + lưu ContentText bằng POST/PUT draft, rồi gửi chính ContentText đó vào đây. + Chỉ bản chép đã xác nhận được gửi tới AI, không gửi lại ảnh hay văn bản OCR gốc. + + + + Nội dung sau khi người học kiểm tra và lưu vào bài viết. + + + + Learning Moments & Achievements for the signed-in learner. Moments are derived server-side from verified + learning data; the learner can only claim (acknowledge) a moment that is currently eligible for them. + + + + + Learning Moments & Achievements for the signed-in learner. Moments are derived server-side from verified + learning data; the learner can only claim (acknowledge) a moment that is currently eligible for them. + + + + Recent, not-yet-shown celebration moments, ordered by priority. + + + Atomically claims one moment right before it is shown (other tabs/devices receive claimed = false). + + + Achievements already earned (from real data) and the nearest next goals. + + + Lấy lộ trình học gần nhất đã được tạo cho Learner hiện tại. + Không tự gọi AI. Result là null khi người học chưa từng tạo lộ trình. + + + Lấy lộ trình ACTIVE; tương đương GET /latest. + + + Bắt đầu hoặc tiếp tục một ngày đang được mở trong lộ trình ACTIVE. + + + Đánh dấu ngày học hoàn thành để mở ngày tiếp theo. + + + Lịch sử lộ trình của Learner, gồm ACTIVE và SUPERSEDED. + + + Xem trước thay đổi cấp độ mà không thay thế lộ trình đang ACTIVE. + + + Xác nhận preview và kích hoạt atomically; retry cùng ID trả lại bản ACTIVE. + + + Hủy preview; không thay đổi lộ trình hiện tại. + + + + Tạo đề xuất lộ trình học cá nhân hóa bằng AI cho người dùng. + + + Màn hình sử dụng: Màn hình tạo lộ trình học cá nhân (Learning Path) trên app Learner. + + Luồng xử lý: API gọi dịch vụ AI ngầm để sinh đề xuất dựa trên trình độ/mục tiêu của người học (theo ngày, tích hợp tùy chọn từ vựng, kanji, ngữ pháp), lưu vào CSDL và trả về kết quả. + + Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). AI lập một chặng ôn tối đa 7 ngày; FE cần hiển thị trạng thái đang tạo. + + Loại chứng chỉ/cấp độ, ngày thi, số phút cố định hoặc min/max và horizon; trường bỏ trống dùng hồ sơ hiện tại. + Token hủy request (Optional). + Thành công: Trả về lộ trình học tập được thiết kế bởi AI. + Yêu cầu không hợp lệ: Thiếu thông tin profile hoặc định dạng JSON không đúng. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Bị từ chối do vượt quá hạn ngạch gọi AI (Too Many Requests / Quota Exceeded). + Lỗi server hoặc dịch vụ AI không phản hồi. + + + Tìm chủ đề có bài học đã công bố để luyện nói hoặc viết, không cần chọn cấp JLPT. + + + Lấy bài học và Kanji, ngữ pháp, từ vựng thuộc chủ đề. + + + + Lấy danh sách bài học khả dụng và tiến độ của Learner theo cấp độ JLPT. + + + Dùng ID cấp độ thật từ catalog Backend. Kết quả được sắp xếp theo SortOrder rồi Id. + Catalog bài học rỗng vẫn trả 200 với danh sách rỗng; không thay bằng dữ liệu mẫu. + + ID CertificateLevel JLPT (Required). + Token hủy request (Optional). + Danh sách bài học và tiến độ hiện tại của Learner. + ID cấp độ không hợp lệ. + Thiếu Bearer Token. + Token không có role Learner. + Cấp độ JLPT không khả dụng. + Không thể truy vấn nội dung học. + + + + Lấy chi tiết tiến độ và nội dung bài học cho user tại lessonId. + + + - Màn hình sử dụng: Trang lesson detail trong app Learner (video, transcript, exercises). + - Luồng xử lý: Truy vấn tiến độ, playback position, điểm hoàn thành; không gọi AI. Có thể cập nhật xem lần cuối. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Trả về thông tin playback, completed, resources; FE nên lazy-load media URL. + + ID bài học (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết bài học và trạng thái tiến độ của user. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Không tìm thấy lesson này. + Lỗi server khi truy vấn dữ liệu. + + + + Cập nhật vị trí phát (playback position) của user trong lesson. + + + - Màn hình sử dụng: Khi người dùng xem video/lesson, FE gọi để lưu checkpoint. + - Luồng xử lý: Cập nhật vị trí phát vào CSDL/Cache để resume sau; không gây tác động lớn khác. + - Lưu ý cho FE: Yêu cầu Bearer Token. Gọi thường xuyên (throttling) nên FE nên gửi không quá tần suất cao (ví dụ mỗi vài giây tối thiểu). + + ID lesson (Required). + UpdatePlaybackPositionRequest: PositionInSeconds (Required), Duration (Optional). + Token hủy request (Optional). + Thành công: Vị trí phát đã được lưu. + Dữ liệu không hợp lệ: position âm hoặc vượt quá duration. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Không tìm thấy lesson. + Lỗi server khi lưu tiến độ. + + + + Đánh dấu bài học đã hoàn thành cho Learner hiện tại. + + + Identity lấy từ JWT, request không nhận userId. Gọi lại cùng lesson là idempotent + và không tạo thêm LessonProgress trùng. + + ID bài học khả dụng (Required). + Token hủy request (Optional). + Đã hoàn thành hoặc bài học đã được hoàn thành trước đó. + Thiếu Bearer Token. + Token không có role Learner. + Bài học không tồn tại hoặc không khả dụng. + Không thể lưu trạng thái hoàn thành. + + + + API Chấm công, thời lượng giảng dạy và KPI của Cố vấn (không chứa dữ liệu lương/thù lao). + + + + + API Chấm công, thời lượng giảng dạy và KPI của Cố vấn (không chứa dữ liệu lương/thù lao). + + + + + Chấm công & KPI Giáo viên theo tháng (Mentor cá nhân, Admin toàn trung tâm/từng Giáo viên) và Chính sách chấm công & KPI. + Mọi kiểm tra quyền được thực thi lại trong service (không dựa vào việc ẩn nút ở giao diện). + + + + + Chấm công & KPI Giáo viên theo tháng (Mentor cá nhân, Admin toàn trung tâm/từng Giáo viên) và Chính sách chấm công & KPI. + Mọi kiểm tra quyền được thực thi lại trong service (không dựa vào việc ẩn nút ở giao diện). + + + + Tải chứng chỉ vào kho riêng tư cho hồ sơ ứng tuyển của chính mình. + + + Lấy liên kết ngắn hạn để xem chứng chỉ thuộc tài khoản hiện tại. + + + Đọc chứng chỉ của chính mình qua phiên xác thực hiện tại. + + + + Mentor xem trước xung đột lịch dạy của chính mình (trùng giờ, thời gian nghỉ, giới hạn buổi/ngày và buổi/tuần) + cho các khung giờ dự kiến. Chỉ mang tính tham khảo; hệ thống vẫn kiểm tra lại khi ghi lịch. + + + + + Lấy trạng thái bài đánh giá năng lực (placement) của học viên. + + + - Màn hình sử dụng: Màn hình chính / onboarding, để quyết định có hiển thị bài placement hay không. + - Luồng xử lý: Truy vấn trạng thái placement hiện tại của user; không gọi AI. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). + + Token hủy request (Optional). + Thành công: Trả về trạng thái placement. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi truy vấn dữ liệu. + + + + Bỏ qua bài đánh giá năng lực (skip placement). + + + - Màn hình sử dụng: Nút "Bỏ qua" ở màn hình giới thiệu bài placement. + - Luồng xử lý: Cập nhật trạng thái placement của user thành đã bỏ qua. + - Lưu ý cho FE: Yêu cầu Bearer Token. Response trả về trạng thái placement mới. + + Token hủy request (Optional). + Thành công: Trả về trạng thái placement sau khi bỏ qua. + Không thể bỏ qua (ví dụ đã hoàn thành placement). + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi cập nhật trạng thái. + + + + Lấy bài đánh giá năng lực (mock test) theo cấp độ chứng chỉ, kèm toàn bộ thông tin: sections, câu hỏi và các option. + + + - Màn hình sử dụng: Sau khi học viên chọn chứng chỉ và cấp độ, hiển thị bài đánh giá năng lực của cấp độ đó. + - Luồng xử lý: Nhận certificateLevelId, trả về 1 đề thuộc cấp độ đó cùng các section, câu hỏi và option; không trả đáp án đúng; không gọi AI. + - Lưu ý cho FE: Gọi API chứng chỉ và API cấp độ theo chứng chỉ trước để có certificateLevelId. Để làm bài và lưu đáp án, gọi placement/start rồi dùng attemptId trả về. + + Id của cấp độ chứng chỉ (CertificateLevel) (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết bài đánh giá năng lực. + certificateLevelId không hợp lệ. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Không tìm thấy cấp độ chứng chỉ hoặc chưa có bài đánh giá cho cấp độ này. + Lỗi hệ thống. + + + + Lấy attempt placement đang làm dở (nếu có) để học viên làm tiếp. + + + - Màn hình sử dụng: Khi vào lại trang làm bài sau khi tắt web / mất điện giữa chừng. + - Luồng xử lý: Truy vấn attempt chưa nộp của user, kèm snapshot câu hỏi và các đáp án đã autosave. + - Lưu ý cho FE: Yêu cầu Bearer Token. Data = null nghĩa là không có attempt đang làm dở. + + Token hủy request (Optional). + Thành công: Trả về snapshot attempt đang làm hoặc null. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi truy vấn dữ liệu. + + + + Bắt đầu một lần làm bài đánh giá năng lực (placement). + + + - Màn hình sử dụng: Màn hình Start Placement Test. + - Luồng xử lý: Tạo attempt và snapshot bộ câu hỏi; không gọi AI. + - Lưu ý cho FE: Yêu cầu Bearer Token. Body là tùy chọn (có thể bỏ trống). QuestionId/OptionId trong response là ID Backend phải dùng khi lưu đáp án và submit. + + StartPlacementTestRequest (Optional). + Token hủy request (Optional). + Thành công: Trả về attemptId, thời gian và bộ câu hỏi/options. + Dữ liệu không hợp lệ hoặc không thể bắt đầu bài placement. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Token không có role Learner. + Lỗi server khi tạo attempt. + + + + Autosave một câu trả lời ngay khi học viên chọn đáp án. + + + - Màn hình sử dụng: Trang làm bài placement, gọi mỗi khi học viên chọn/đổi đáp án. + - Luồng xử lý: Lưu đáp án của một câu để nếu mất điện/tắt web thì quay lại vẫn còn tiến độ. + - Lưu ý cho FE: Yêu cầu Bearer Token. Nên debounce và không chặn UI khi gọi. + + ID attempt (Required). + SavePlacementAnswerRequest: câu hỏi và đáp án đã chọn (Required). + Token hủy request (Optional). + Thành công: Trả về xác nhận đã lưu. + Dữ liệu không hợp lệ hoặc attempt đã kết thúc. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: attempt không thuộc user. + Không tìm thấy attempt. + Lỗi server khi lưu đáp án. + + + + Lưu hàng loạt đáp án của attempt (không nộp bài). + + + - Màn hình sử dụng: Trang làm bài placement, dùng khi cần đồng bộ nhiều đáp án một lần (ví dụ khi có mạng trở lại). + - Luồng xử lý: Lưu danh sách đáp án; chưa tính điểm và không kết thúc attempt. + - Lưu ý cho FE: Yêu cầu Bearer Token. Để kết thúc bài, gọi API submit. + + ID attempt (Required). + SubmitPlacementTestRequest: danh sách đáp án (Required). + Token hủy request (Optional). + Thành công: Trả về xác nhận đã lưu. + Dữ liệu không hợp lệ hoặc attempt đã kết thúc. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: attempt không thuộc user. + Không tìm thấy attempt. + Lỗi server khi lưu đáp án. + + + + Nộp bài đánh giá năng lực (submit placement). + + + - Màn hình sử dụng: Nút Submit trên trang làm bài placement. + - Luồng xử lý: Tính điểm, xác định trình độ và lưu kết quả; có thể mất thêm thời gian nếu có bước chấm tự động. + - Lưu ý cho FE: Yêu cầu Bearer Token. Nên hiển thị loading khi chờ response. + + ID attempt (Required). + SubmitPlacementTestRequest: danh sách đáp án (Required). + Token hủy request (Optional). + Thành công: Trả về kết quả placement. + Dữ liệu không hợp lệ: answers thiếu hoặc sai format. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: attempt không thuộc user. + Không tìm thấy attempt. + Attempt đã được nộp trước đó hoặc không hợp lệ. + Lỗi server khi tính điểm. + + + + Lấy kết quả bài đánh giá năng lực của một attempt. + + + - Màn hình sử dụng: Trang kết quả placement. + - Luồng xử lý: Truy vấn kết quả đã lưu; không gọi AI. + - Lưu ý cho FE: Yêu cầu Bearer Token. + + ID attempt (Required). + Token hủy request (Optional). + Thành công: Trả về kết quả placement. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: attempt không thuộc user. + Không tìm thấy attempt. + Lỗi server khi truy vấn dữ liệu. + + + + Bắt đầu một lần làm bài kiểm tra (practice test / mock test) cho user. + + ID practice test (Required). + Token hủy request (Optional). + + + + Khôi phục lượt thi thử đang làm của học viên cho đề đã chọn. + + + + Nộp kết quả một lần làm bài (submit attempt). + + ID attempt (Required). + SubmitAttemptRequest: Answers (Required). + Token hủy request (Optional). + + + Lưu đáp án của một câu trong lượt thi thử đang làm. + + + Kết thúc lượt thi thử hết giờ bằng các đáp án đã lưu trên máy chủ. + + + + Lấy kết quả tóm tắt của một attempt. + + ID attempt (Required). + Token hủy request (Optional). + + + + Lấy danh sách practice tests theo JLPT level. + + JLPT level ID (Required). + Token hủy request (Optional). + + + + Lấy bài đánh giá năng lực theo cấp độ chứng chỉ. + + Id của cấp độ chứng chỉ (CertificateLevel). + Token hủy request (Optional). + + + + Lấy kết quả chi tiết của một attempt (per-question breakdown, feedback). + + ID attempt (Required). + Token hủy request (Optional). + + + + Lấy danh sách câu hỏi sai để ôn tập lại (Quizlet Review Mode). + + ID đề thi tùy chọn để lọc câu hỏi sai. + Token hủy request (Optional). + + + Lấy toàn bộ cây điều hướng Sổ tay cá nhân (Folder -> File -> Page) kèm thống kê tổng quan. + + + Lấy danh sách Thư mục của học viên hiện tại. + + + Tạo Thư mục ghi chú mới. + + + Đổi tên Thư mục ghi chú (có kiểm tra ExpectedRevision khi cung cấp). + + + Xóa mềm Thư mục (yêu cầu cascade=true nếu bên trong còn tệp ghi chú; luôn giữ nguyên thẻ SRS). + + + Lấy chi tiết một Tệp ghi chú cùng danh sách các Trang bên trong. + + + Tạo Tệp ghi chú mới bên trong một Thư mục (không yêu cầu upload tệp vật lý). + + + Đổi tên hoặc di chuyển Tệp ghi chú sang Thư mục khác. + + + Xóa mềm Tệp ghi chú (yêu cầu cascade=true nếu còn trang; không xóa thẻ SRS). + + + Lấy chi tiết Trang ghi chú (nội dung soạn thảo + mục đã lưu thuộc trang). + + + Tạo Trang ghi chú mới trong Tệp ghi chú. + + + Cập nhật tiêu đề, nội dung rich text (autosave), di chuyển tệp cha hoặc đồng bộ yêu thích với kiểm soát xung đột Revision. + + + Bật/tắt đánh dấu yêu thích cho Trang ghi chú. + + + Xóa mềm Trang ghi chú (ẩn các mục đã lưu thuộc trang nhưng giữ nguyên mọi thẻ SRS đã tạo). + + + Smart View: danh sách Trang yêu thích (không nhân bản dữ liệu). + + + Smart View: danh sách toàn bộ Mục đã lưu (hỗ trợ tìm kiếm, lọc loại, sắp xếp và phân trang phía server). + + + Tìm kiếm thống nhất trên Thư mục, Tệp ghi chú, Trang và Mục đã lưu. + + + Lưu nhanh đoạn văn bản/từ vựng từ Smart Text Selection vào một Trang (mặc định Sổ tay chung nếu chưa chọn). + + + Tạo Tệp ghi chú mới (tên endpoint legacy /lists). + + + Lấy danh sách Tệp ghi chú của học viên. + + + Cập nhật Tệp ghi chú. + + + Xóa mềm Tệp ghi chú. + + + Lấy các mục đã lưu thuộc một Tệp ghi chú. + + + Lưu Từ vựng từ ngân hàng chung vào Sổ tay (chỉ thêm SRS khi EnrollSrs=true). + + + Lưu Kanji từ ngân hàng chung vào Sổ tay (chỉ thêm SRS khi EnrollSrs=true). + + + Thêm trực tiếp một điểm ngữ pháp vào hàng chờ ôn tập SRS. + + + Thêm mục đã lưu vào Tệp / Trang ghi chú. + + + Cập nhật nội dung mục đã lưu hoặc di chuyển mục sang trang ghi chú khác. + + + Chủ động đưa một mục đã lưu từ Sổ tay vào hàng chờ ôn tập SRS. + + + Xóa mềm mục đã lưu khỏi Sổ tay (không tự xóa thẻ SRS đã tạo). + + + + Webhook endpoint PayOS gọi về sau khi giao dịch có update (thanh toán thành công/failed/...) + + + - Màn hình sử dụng: N/A (webhook). + - Luồng xử lý: đọc body gốc, verify chữ ký trên đúng object data PayOS gửi (mọi field, sắp xếp alphabet), + đối chiếu đơn hàng (mã liên kết, số tiền, tiền tệ) rồi kích hoạt quyền lợi đúng một lần. + - Lưu ý cho FE/PayOS: Đây là endpoint công khai; PayOS sẽ gửi POST. Webhook giả mạo bị từ chối (400); + lỗi tạm thời trả 5xx để PayOS gửi lại. + + Token hủy request (Optional). + Đã nhận webhook (có hoặc không có thay đổi đơn hàng). + Payload không hợp lệ hoặc chữ ký sai. + Lỗi tạm thời khi xử lý webhook — PayOS sẽ gửi lại. + + + + Kiểm tra trạng thái hoàn thành bài kiểm tra đánh giá năng lực đầu vào (Placement Test), quota và mức độ sẵn sàng tạo lộ trình. + + + + Ghi nhận Learner bỏ qua Placement lúc này; không tạo lượt thi hoặc điểm giả. + Có thể làm Placement sau khi bỏ qua. Kết quả thật mới chuyển quyết định thành COMPLETED. + + + + Khôi phục lượt làm bài kiểm tra đánh giá năng lực đầu vào đang diễn ra (chưa hết hạn). + + + + Lưu tự động các lựa chọn mới nhất trong lượt Placement đang làm. + + + + Bắt đầu hoặc khôi phục bài đánh giá theo mục tiêu JLPT và ngày thi đã lưu. + + Tối đa hai lượt bắt đầu cho mỗi cấp. Gửi RetakeTargetAssessment = true để làm lượt thứ hai sau khi đã có kết quả. + + + + Nộp bài kiểm tra đánh giá năng lực đầu vào, tính điểm theo cấp độ JLPT từ snapshot bất biến và đề xuất cấp độ mục tiêu. + + + + + Xem kết quả bài kiểm tra đánh giá năng lực đầu vào đã hoàn thành. + + + + + Nộp bài luyện tập (bài tự luận hoặc ảnh) để lưu và (nếu có) yêu cầu chấm tự động. + + + - Màn hình sử dụng: Màn hình nộp bài luyện tập (Practice / Submission) trong ứng dụng Learner. + - Luồng nghiệp vụ: API lưu bản ghi nộp bài vào CSDL, sau đó có thể gọi ngầm dịch vụ chấm (AI grading) để trả về điểm và phản hồi. Có thể cập nhật tiến trình học hoặc lịch sử làm bài của người dùng. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Gọi có thể mất 1-5s nếu có chấm AI; hiển thị spinner/đang xử lý. Body là JSON, trường bắt buộc tối thiểu: PracticeId và (TextContent hoặc ImageUrl). Các enum/định dạng file phải theo tài liệu schema của SubmitPracticeRequest. + + Yêu cầu nộp bài. Required: PracticeId (int), ít nhất phải có TextContent (string) hoặc ImageUrl (string). Optional: Attachment, Metadata. + Token hủy request (Optional). + Thành công: Trả về kết quả nộp bài và (nếu có) kết quả chấm/feedback. + Dữ liệu không hợp lệ: Thiếu PracticeId hoặc không có nội dung nộp. + Chưa xác thực: Thiếu hoặc sai Bearer Token. + Không có quyền: Tài khoản không có role Learner. + Bị từ chối do giới hạn (ví dụ hết quota AI cho ngày hôm nay). + Lỗi server hoặc lỗi dịch vụ chấm (AI) bên thứ ba. + + + + Lấy chi tiết một bài nộp theo ID. + + + - Màn hình sử dụng: Màn hình xem chi tiết nộp bài hoặc modal chi tiết kết quả chấm. + - Luồng nghiệp vụ: Trả về thông tin nộp bài, điểm chấm, feedback, trạng thái chấm, và metadata liên quan. Không gọi AI nữa — chỉ đọc từ CSDL. + - Lưu ý cho FE: Yêu cầu Bearer Token. Nếu bài không thuộc người dùng và user không phải admin, trả 403/404 tuỳ chính sách. + + ID của bài nộp (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết bài nộp (including grading, feedback). + Chưa xác thực: Thiếu Bearer Token. + Không có quyền truy cập bài này (nếu bài thuộc user khác). + Không tìm thấy bài nộp với submissionId này. + Lỗi server khi đọc dữ liệu. + + + + Lấy lịch sử nộp bài của người dùng hiện tại. + + + - Màn hình sử dụng: Màn hình Lịch sử luyện tập / My Submissions. + - Luồng nghiệp vụ: Truy vấn danh sách các nộp bài của user, có phân trang/lọc nếu cần (FE nên gọi kèm tham số phân trang nếu endpoint hỗ trợ). + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Kết quả có thể lớn, nên FE cần hỗ trợ lazy-loading/pagination; response thường trả nhanh (<200ms) nếu có index trên DB. + + Token hủy request (Optional). + Thành công: Trả về danh sách nộp bài (có thể kèm metadata phân trang). + Chưa xác thực: Thiếu Bearer Token. + Lỗi server khi truy vấn lịch sử. + + + + Yêu cầu chấm lại một nộp bài (regrade) bởi hệ thống/AI. + + + - Màn hình sử dụng: Tính năng Regrade trên chi tiết nộp bài (Learner). + - Luồng nghiệp vụ: Gửi yêu cầu chấm lại; API có thể enqueue job hoặc gọi trực tiếp dịch vụ chấm AI. Có thể cập nhật trạng thái chấm và gửi thông báo khi xong. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Thao tác có thể mất vài giây (nếu chấm đồng bộ) hoặc trả nhanh + gửi thông báo khi hoàn tất (nếu chấm bất đồng bộ). FE nên hiển thị trạng thái "Đang chấm lại" sau khi gọi. + + ID của bài nộp cần chấm lại (Required). + Token hủy request (Optional). + Yêu cầu chấm lại đã được nhận/hoàn tất: Trả về trạng thái mới hoặc kết quả. + Dữ liệu không hợp lệ: submissionId không hợp lệ hoặc bài chưa trong trạng thái cho phép regrade. + Chưa xác thực: Thiếu Bearer Token. + Không có quyền: Người dùng không sở hữu bài hoặc không được phép regrade. + Không tìm thấy bài nộp tương ứng. + Bị giới hạn: Regrade bị chặn do quota hoặc giới hạn tốc độ. + Lỗi server hoặc lỗi dịch vụ chấm (AI) bên thứ ba. + + + + Tìm kiếm từ vựng trong shared bank theo bộ lọc. + + + - Màn hình sử dụng: Search / Lookup từ vựng trong app (FE có thể gọi khi user tra cứu từ). + - Luồng xử lý: Truy vấn chỉ mục/DB theo filter (text, jlpt level, tags); không gọi AI. + - Lưu ý cho FE: Thường không cần Bearer Token (tùy policy). Gửi filter trong body; FE nên debounce input để tránh spam API. + + VocabularySearchFilter: Query (Optional), JlptLevel (Optional), Page (Optional). + Token hủy request (Optional). + Thành công: Trả về danh sách từ vựng phù hợp với filter. + Dữ liệu không hợp lệ: filter sai định dạng. + Lỗi server khi truy vấn chỉ mục/DB. + + + + Lấy chi tiết một từ vựng theo ID. + + + - Màn hình sử dụng: Detail panel hoặc modal khi user click vào từ. + - Luồng xử lý: Truy vấn DB/ELK để lấy định nghĩa, ví dụ, JLPT level. + - Lưu ý cho FE: Thường không cần Bearer Token. Xử lý trường hợp 404 nếu không tìm thấy. + + ID của từ vựng (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết từ vựng. + Không tìm thấy từ vựng với ID này. + Lỗi server khi truy vấn dữ liệu. + + + + Tìm kiếm Kanji theo bộ lọc. + + + - Màn hình sử dụng: Tra cứu Kanji / Search Kanji. + - Luồng xử lý: Truy vấn DB theo filter (character, strokes, jlpt level). + - Lưu ý cho FE: Thường không cần Bearer Token. FE nên debounce input và hỗ trợ pagination. + + KanjiSearchFilter: Query (Optional), Strokes (Optional), Page (Optional). + Token hủy request (Optional). + Thành công: Trả về danh sách Kanji khớp filter. + Filter sai định dạng. + Lỗi server khi truy vấn dữ liệu. + + + + Lấy chi tiết Kanji theo ID. + + + - Màn hình sử dụng: Detail Kanji view. + - Luồng xử lý: Truy vấn DB/ELK để lấy onyomi, kunyomi, meanings, examples. + - Lưu ý cho FE: Thường không cần Bearer Token. Xử lý trường hợp 404. + + ID Kanji (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết Kanji. + Không tìm thấy Kanji. + Lỗi server khi truy vấn dữ liệu. + + + + Tìm kiếm điểm ngữ pháp theo bộ lọc. + + + - Màn hình sử dụng: Tra cứu grammar trong app. + - Luồng xử lý: Truy vấn DB theo keyword, JLPT level hoặc tags. + - Lưu ý cho FE: Thường không cần Bearer Token. FE nên debounce input và xử lý pagination. + + GrammarSearchFilter: Query (Optional), JlptLevel (Optional), Page (Optional). + Token hủy request (Optional). + Thành công: Trả về danh sách grammar khớp filter. + Filter sai định dạng. + Lỗi server khi truy vấn dữ liệu. + + + + Lấy chi tiết điểm ngữ pháp theo ID. + + + - Màn hình sử dụng: Detail grammar view. + - Luồng xử lý: Truy vấn DB để trả về định nghĩa, ví dụ, tầm dùng. + - Lưu ý cho FE: Thường không cần Bearer Token. Xử lý 404 nếu không tìm thấy. + + ID grammar (Required). + Token hủy request (Optional). + Thành công: Trả về chi tiết grammar. + Không tìm thấy grammar. + Lỗi server khi truy vấn dữ liệu. + + + Issues a temporary Azure token for compatible streaming clients. + + + Save audio to S3 and transcribe Japanese with the dedicated AwsAudio configuration. + + + Creates a short-lived Japanese PCM streaming session for Amazon Transcribe. + + + Lộ trình JLPT tiêu chuẩn từ cấp độ Learner tự chọn; không gọi AI và không yêu cầu Placement. + Danh sách rỗng là trạng thái nội dung hợp lệ. Tiến độ lấy từ LessonProgress của JWT owner. + + + Lộ trình tự học thích ứng theo mục tiêu, điểm mạnh/yếu từng kỹ năng và tiến độ học tập. + + + Khởi tạo / kích hoạt Lộ trình tiêu chuẩn một cách idempotent sau khi đã đủ điều kiện tiên quyết. + + + Lưu điểm danh (một phần hoặc toàn bộ) cho buổi học của lớp. Buổi đang diễn ra: lưu/cập nhật nhiều lần; + buổi đã hoàn thành: chỉ bổ sung học viên chưa có kết quả và khóa ngay. + + + Danh sách lớp nhóm; lọc tùy chọn theo Mentor, cấp độ, tần suất học (số buổi/tuần hoặc cường độ), + thứ (0=Chủ nhật..6) và giờ bắt đầu buổi học "HH:mm" (giờ Việt Nam). + + + + Admin xem trước xung đột lịch dạy của Mentor (trùng giờ, thời gian nghỉ, giới hạn ngày/tuần) cho các khung giờ đã chọn. + Chỉ mang tính tham khảo; khi lưu/công bố lớp hệ thống vẫn kiểm tra lại trong giao dịch. + + + + Đối soát trạng thái thanh toán đơn khóa học với PayOS (truy vấn server-to-server; redirect phía client không phải bằng chứng). Học viên: đơn của mình; Admin: mọi đơn. + + + Tải hoặc xem tài liệu giới thiệu / đề cương gắn với lớp nhóm (đã kiểm tra quyền theo vai trò). + + + Xem trước cấu trúc tài liệu giới thiệu / đề cương gắn với lớp nhóm. + + + Xem trước điều kiện thay mentor cho các buổi còn lại của lớp. + + + Admin gửi lời mời mentor mới; mentor xác nhận trước khi thay các buổi còn lại. + + + Lịch sử phân công cố vấn chính của lớp. + + + + Mentor chính của lớp (hoặc Admin) gửi yêu cầu dời toàn bộ lịch lớp chưa có học viên thêm N tuần (giữ nguyên thứ/giờ và số buổi) + hoặc hủy lớp trống. Gửi lại cùng mã chống trùng trả về đúng yêu cầu cũ; mỗi lớp chỉ có một yêu cầu đang chờ. + + + + Lịch sử yêu cầu dời/hủy của một lớp kèm xem trước hiện tại (Admin hoặc Mentor chính của lớp). + + + Hàng đợi yêu cầu dời/hủy lớp cho Admin, lọc theo trạng thái (Pending/Approved/Rejected/Withdrawn). + + + + Xem trước việc dời toàn bộ lớp thêm N tuần: điều kiện (mã lỗi), giao dịch chặn, giờ mới của từng buổi, + báo cáo trùng lịch dạy chuẩn của Mentor và hạn đăng ký mới. Không ghi dữ liệu. + + + + Admin duyệt yêu cầu dời/hủy lớp; kiểm tra lại toàn bộ điều kiện và trùng lịch trong một giao dịch. + + + Admin từ chối yêu cầu dời/hủy lớp (bắt buộc nhập lý do). + + + Người gửi rút yêu cầu dời/hủy lớp đang chờ. + + + Giáo viên tự hủy lớp đang tuyển sinh khi chưa có học viên xác nhận và không có giữ chỗ thanh toán đang hoạt động. + + + Học viên đánh giá cố vấn của khóa học sau khi đã có ít nhất một buổi học được ghi nhận có mặt. + + + Học viên cập nhật đánh giá cố vấn của chính mình trong khóa học. + + + Danh sách đánh giá cố vấn của một khóa học (Học viên sở hữu, Admin hoặc Cố vấn tham gia giảng dạy). + Lớp đã hoàn thành mà Học viên còn có thể đánh giá Giáo viên (CTA tùy chọn ở "Lớp của tôi"). + + + Tổng hợp điểm trung bình, số lượt đánh giá và tối đa 20 nhận xét công khai gần nhất của cố vấn (ẩn danh tính học viên). + + + Học viên gửi khiếu nại kèm minh chứng tùy chọn cho khóa học hoặc đơn thanh toán cần xem xét. + + + Danh sách khiếu nại khóa học theo phạm vi người dùng (Admin: toàn bộ; Học viên: của mình; Cố vấn: nhắm tới mình, ẩn thông tin thanh toán). + + + Chi tiết khiếu nại khóa học theo phạm vi người dùng (trả về 404 nếu ngoài phạm vi). + + + Cố vấn được nêu trong khiếu nại gửi phản hồi (không áp dụng cho khiếu nại thanh toán/ghi danh). + + + Admin ra quyết định giải quyết hoặc từ chối khiếu nại (bắt buộc nhập nội dung quyết định). + + + Tải tệp minh chứng riêng tư của khiếu nại khóa học (Admin hoặc Học viên sở hữu; không lưu cache). + + + Báo cáo tổng kết quá trình học và hoàn thành khóa học nội bộ (không phải chứng chỉ JLPT chính thức). + + + + Trạng thái thiết lập mục tiêu JLPT, đánh giá năng lực và quyền mở lộ trình chuẩn/AI của học viên. + + + + + Lấy thông tin hồ sơ (profile) của người dùng hiện tại. + + + - Màn hình sử dụng: Trang Profile / Settings của Learner. + - Luồng xử lý: Truy vấn hồ sơ từ CSDL, bao gồm tên, email, avatar, progress, JLPT goal. + - Lưu ý cho FE: Yêu cầu Bearer Token (Role = Learner). Response nhanh; FE nên hiển thị skeleton khi chờ. + + Token hủy request (Optional). + Thành công: Trả về thông tin profile của user. + Chưa xác thực: Thiếu Bearer Token. + Không tìm thấy profile (hiếm). + Lỗi server khi truy vấn dữ liệu. + + + + Cập nhật thông tin hồ sơ của user (name, bio, locale,...). + + + - Màn hình sử dụng: Profile edit form. + - Luồng xử lý: Validate và cập nhật các trường trong CSDL. + - Lưu ý cho FE: Yêu cầu Bearer Token. Trường email nếu thay đổi có thể cần xác thực lại. + + UpdateProfileRequest: FullName (Required). + Token hủy request (Optional). + Thành công: Profile đã được cập nhật. + Dữ liệu không hợp lệ. + Chưa xác thực: Thiếu Bearer Token. + Lỗi server khi cập nhật profile. + + + + Cập nhật avatar của người dùng (upload file hình ảnh). + + + - Màn hình sử dụng: Profile -> Change Avatar. + - Luồng xử lý: Upload file (FileStorage) và cập nhật URL avatar trong profile. + - Lưu ý cho FE: Yêu cầu Bearer Token. Gửi multipart/form-data với key `avatarFile`. File size/format nên tuân theo giới hạn server. + + File ảnh avatar (Required) — multipart/form-data. + Token hủy request (Optional). + Thành công: Trả về URL avatar mới. + Dữ liệu không hợp lệ: file không phải ảnh hoặc quá lớn. + Chưa xác thực: Thiếu Bearer Token. + Lỗi server khi upload hoặc cập nhật profile. + + + + Thiết lập mục tiêu JLPT cho người dùng. + + + - Màn hình sử dụng: Profile -> JLPT Goal setting. + - Luồng xử lý: Lưu mục tiêu vào profile cho lần lập lộ trình tiếp theo; không thay đổi lộ trình đang hoạt động. + - Lưu ý cho FE: Yêu cầu Bearer Token. Gửi TargetCertificateLevelId (hoặc TargetJlptLevelId cũ), CertificateTypeId và thời gian cố định hoặc khoảng 15–480 phút. + + SetJlptGoalRequest: CertificateTypeId, TargetCertificateLevelId; DailyStudyMinutes hoặc DailyStudyMinutesMin/Max; TargetExamDate (tùy chọn, sau hôm nay). ClearTargetExamDate để xóa ngày thi. + Token hủy request (Optional). + Thành công: Mục tiêu JLPT được lưu. + Dữ liệu không hợp lệ. + Chưa xác thực: Thiếu Bearer Token. + Lỗi server khi cập nhật mục tiêu. + + + Xác nhận cấp độ đang học cho Standard Roadmap, độc lập mục tiêu JLPT. + Chuyển mode về STANDARD; không xóa lộ trình AI, ngày thi hoặc tiến độ cũ. + + + Chuyển chế độ hiển thị lộ trình giữa STANDARD và AI_PERSONALIZED, giữ nguyên toàn bộ tiến độ. + + + Atomically saves the complete learner goal, including the self-declared JLPT certificate. + + + + Cập nhật cài đặt thông báo (notification settings) cho user. + + + - Màn hình sử dụng: Profile -> Notification Settings. + - Luồng xử lý: Lưu các tuỳ chọn thông báo (email/push/in-app) vào CSDL. + - Lưu ý cho FE: Yêu cầu Bearer Token. Thao tác nhanh; FE nên cập nhật UI ngay sau khi nhận 200. + + UpdateNotificationSettingsRequest: EmailEnabled (Optional), PushEnabled (Optional), InAppEnabled (Optional). + Token hủy request (Optional). + Thành công: Cài đặt đã được cập nhật. + Dữ liệu không hợp lệ. + Chưa xác thực: Thiếu Bearer Token. + Lỗi server khi lưu cài đặt. + + + SignalR group of a meeting room (used by the API to close a room after "Kết thúc buổi học"). + + + Which route value identifies the class whose learning records an action writes. + + + + Refuses learning-record writes (homework, quiz, attendance, schedule) for a completed class, for every role, + whatever client sent the request. Critical write paths also re-check under the class lock in their transaction. + + + + + Refuses learning-record writes (homework, quiz, attendance, schedule) for a completed class, for every role, + whatever client sent the request. Critical write paths also re-check under the class lock in their transaction. + + + + + Logs slow EF Core SQL queries (> 500 ms) safely without logging parameter values or sensitive data. + + + + + Logs slow EF Core SQL queries (> 500 ms) safely without logging parameter values or sensitive data. + + + + + Chuyển mọi exception chưa xử lý thành JSON chuẩn. + Không bao giờ trả về nội dung exception, stack trace hoặc câu lệnh SQL cho client. + + + + + Chuyển mọi exception chưa xử lý thành JSON chuẩn. + Không bao giờ trả về nội dung exception, stack trace hoặc câu lệnh SQL cho client. + + + + + Attaches correlation ID, hardens HTTP security headers, monitors request duration, + and logs security/error status codes (401/403/429/5xx) without ever logging tokens, query secrets, or passwords. + + + + + Attaches correlation ID, hardens HTTP security headers, monitors request duration, + and logs security/error status codes (401/403/429/5xx) without ever logging tokens, query secrets, or passwords. + + + + + Strict read-only runtime readiness verifier for `/health/ready`. + Verifies database connectivity and critical table/migration parity WITHOUT ever executing DDL, + calling Database.Migrate(), or leaking connection strings / raw exceptions. + + + + + Strict read-only runtime readiness verifier for `/health/ready`. + Verifies database connectivity and critical table/migration parity WITHOUT ever executing DDL, + calling Database.Migrate(), or leaking connection strings / raw exceptions. + + + + Kho media cô lập chỉ dành cho Development/QA để không chạm Shared Supabase hoặc S3 dùng chung. + + + Kho chứng chỉ riêng tư chỉ dành cho môi trường MentorQA cô lập. + + + Mentor-only AI drafts for one assigned class; nothing is published by generation. + + + Mentor-only AI drafts for one assigned class; nothing is published by generation. + + + + Đọc, kiểm tra nội dung thực tế, tạo bản xem trước chỉ đọc và stream tài liệu đính kèm có phân quyền, + tuyệt đối bảo toàn tệp gốc và tên tệp Unicode (tiếng Việt, tiếng Nhật...). + + + + ZIP-only adapter. The existing Excel preview/confirm services are left untouched. + + + ZIP-only adapter. The existing Excel preview/confirm services are left untouched. + + + + Đồng bộ và loại bỏ các nhóm tag mồ côi khỏi tài liệu OpenAPI sau khi gộp operation theo nhóm nghiệp vụ. + + + + + Chuẩn hóa operationId, nhóm tag nghiệp vụ và bảo mật Swagger từ metadata Controller/OpenAPI. + + + + + Gửi danh sách dòng dữ liệu đã xem trước vào hàng chờ phê duyệt (Biên tập viên / Admin). + + + + + Lấy danh sách các yêu cầu đang chờ phê duyệt kèm thông tin Diff chi tiết (Dành cho Admin). + + + + + Admin thực hiện Phê duyệt (Approve) hoặc Từ chối (Reject) một yêu cầu cụ thể. + + + + + Admin thực hiện Phê duyệt hoặc Từ chối hàng loạt yêu cầu cùng lúc. + + + + + Upload file Excel để xem trước (Preview) sự thay đổi và kiểm tra lỗi trước khi nhập chính thức. + + File Excel (.xlsx, .xls) + Tùy chọn: Chọn loại nội dung cụ thể nếu chỉ muốn đọc 1 sheet duy nhất + Không sử dụng trong Preview; tải media bằng endpoint riêng trước. + Không sử dụng trong Preview; tải media bằng endpoint riêng trước. + + + + + Lưu các dòng hợp lệ từ bản xem trước thành bản nháp của tác giả. Với file lớn, + gửi các nhóm dòng tuần tự cùng BatchId; chỉ gửi duyệt khi mọi nhóm đã lưu xong. + + Danh sách dòng New/Modified do Frontend gửi lên + + + + + Trích xuất UserId của người dùng hiện tại từ Claims/Token JWT + + + + diff --git a/_codex-verify/Debug/net8.0/Scrutor.dll b/_codex-verify/Debug/net8.0/Scrutor.dll new file mode 100644 index 00000000..06eb31ed Binary files /dev/null and b/_codex-verify/Debug/net8.0/Scrutor.dll differ diff --git a/_codex-verify/Debug/net8.0/SixLabors.Fonts.dll b/_codex-verify/Debug/net8.0/SixLabors.Fonts.dll new file mode 100644 index 00000000..281d8a71 Binary files /dev/null and b/_codex-verify/Debug/net8.0/SixLabors.Fonts.dll differ diff --git a/_codex-verify/Debug/net8.0/SkiaSharp.dll b/_codex-verify/Debug/net8.0/SkiaSharp.dll new file mode 100644 index 00000000..db2fdc4e Binary files /dev/null and b/_codex-verify/Debug/net8.0/SkiaSharp.dll differ diff --git a/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.Abstractions.dll b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.Abstractions.dll new file mode 100644 index 00000000..95310c7e Binary files /dev/null and b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.Abstractions.dll differ diff --git a/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.dll b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.dll new file mode 100644 index 00000000..5a340cbb Binary files /dev/null and b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Filters.dll differ diff --git a/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Swagger.dll b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Swagger.dll new file mode 100644 index 00000000..41e2fc2f Binary files /dev/null and b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.Swagger.dll differ diff --git a/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll new file mode 100644 index 00000000..de7f45da Binary files /dev/null and b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll differ diff --git a/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll new file mode 100644 index 00000000..117b9f3c Binary files /dev/null and b/_codex-verify/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll differ diff --git a/_codex-verify/Debug/net8.0/System.CodeDom.dll b/_codex-verify/Debug/net8.0/System.CodeDom.dll new file mode 100644 index 00000000..55f7b4bd Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.CodeDom.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Composition.AttributedModel.dll b/_codex-verify/Debug/net8.0/System.Composition.AttributedModel.dll new file mode 100644 index 00000000..d37283b1 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Composition.AttributedModel.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Composition.Convention.dll b/_codex-verify/Debug/net8.0/System.Composition.Convention.dll new file mode 100644 index 00000000..b6fa4ab0 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Composition.Convention.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Composition.Hosting.dll b/_codex-verify/Debug/net8.0/System.Composition.Hosting.dll new file mode 100644 index 00000000..c67f1c02 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Composition.Hosting.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Composition.Runtime.dll b/_codex-verify/Debug/net8.0/System.Composition.Runtime.dll new file mode 100644 index 00000000..2a4b38c9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Composition.Runtime.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Composition.TypedParts.dll b/_codex-verify/Debug/net8.0/System.Composition.TypedParts.dll new file mode 100644 index 00000000..7c0c780d Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Composition.TypedParts.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Configuration.ConfigurationManager.dll b/_codex-verify/Debug/net8.0/System.Configuration.ConfigurationManager.dll new file mode 100644 index 00000000..14f8ef6c Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Configuration.ConfigurationManager.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Data.SqlClient.dll b/_codex-verify/Debug/net8.0/System.Data.SqlClient.dll new file mode 100644 index 00000000..8b1c1af3 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Data.SqlClient.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Diagnostics.DiagnosticSource.dll b/_codex-verify/Debug/net8.0/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 00000000..9e3478ab Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Diagnostics.DiagnosticSource.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Drawing.Common.dll b/_codex-verify/Debug/net8.0/System.Drawing.Common.dll new file mode 100644 index 00000000..be6915e5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Drawing.Common.dll differ diff --git a/_codex-verify/Debug/net8.0/System.IO.Packaging.dll b/_codex-verify/Debug/net8.0/System.IO.Packaging.dll new file mode 100644 index 00000000..eb95db7c Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.IO.Packaging.dll differ diff --git a/_codex-verify/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll b/_codex-verify/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll new file mode 100644 index 00000000..54c315d0 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Management.dll b/_codex-verify/Debug/net8.0/System.Management.dll new file mode 100644 index 00000000..1e7d4599 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Management.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll b/_codex-verify/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll new file mode 100644 index 00000000..1ba87704 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Security.Permissions.dll b/_codex-verify/Debug/net8.0/System.Security.Permissions.dll new file mode 100644 index 00000000..39dd4df9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Security.Permissions.dll differ diff --git a/_codex-verify/Debug/net8.0/System.Windows.Extensions.dll b/_codex-verify/Debug/net8.0/System.Windows.Extensions.dll new file mode 100644 index 00000000..c3e8844f Binary files /dev/null and b/_codex-verify/Debug/net8.0/System.Windows.Extensions.dll differ diff --git a/_codex-verify/Debug/net8.0/Tesseract.dll b/_codex-verify/Debug/net8.0/Tesseract.dll new file mode 100644 index 00000000..0c3bd8a3 Binary files /dev/null and b/_codex-verify/Debug/net8.0/Tesseract.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Core.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Core.dll new file mode 100644 index 00000000..493720b5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Core.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll new file mode 100644 index 00000000..10febf0a Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.DocumentLayoutAnalysis.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Fonts.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Fonts.dll new file mode 100644 index 00000000..8a3bd411 Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Fonts.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Package.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Package.dll new file mode 100644 index 00000000..417c4d1e Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Package.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokenization.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokenization.dll new file mode 100644 index 00000000..8980db37 Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokenization.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokens.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokens.dll new file mode 100644 index 00000000..ed8295e3 Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.Tokens.dll differ diff --git a/_codex-verify/Debug/net8.0/UglyToad.PdfPig.dll b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.dll new file mode 100644 index 00000000..a63f5848 Binary files /dev/null and b/_codex-verify/Debug/net8.0/UglyToad.PdfPig.dll differ diff --git a/_codex-verify/Debug/net8.0/aws-audio.config.example.json b/_codex-verify/Debug/net8.0/aws-audio.config.example.json new file mode 100644 index 00000000..461922b2 --- /dev/null +++ b/_codex-verify/Debug/net8.0/aws-audio.config.example.json @@ -0,0 +1,14 @@ +{ + "AwsAudio": { + "AccessKeyId": "", + "SecretAccessKey": "", + "SessionToken": "", + "Region": "ap-southeast-1", + "Bucket": "rikipath-audio", + "PublicBaseUrl": "https://localhost:7237", + "ContentPrefix": "rikipath-audio/content", + "RecordingPrefix": "rikipath-audio/recordings", + "TemporaryPrefix": "rikipath-audio/processing", + "JobTimeoutSeconds": 900 + } +} diff --git a/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..b08ba216 Binary files /dev/null and b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..eba2a5a4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..ff203e1f Binary files /dev/null and b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..fe890362 Binary files /dev/null and b/_codex-verify/Debug/net8.0/cs/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..3dda417b Binary files /dev/null and b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..4d3bd0ab Binary files /dev/null and b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..c41bb1f5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..05845f2e Binary files /dev/null and b/_codex-verify/Debug/net8.0/de/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..1e5038dc Binary files /dev/null and b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..456ac85d Binary files /dev/null and b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..7bb3187c Binary files /dev/null and b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..01edef33 Binary files /dev/null and b/_codex-verify/Debug/net8.0/es/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..de36d313 Binary files /dev/null and b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..71d64437 Binary files /dev/null and b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..23107b98 Binary files /dev/null and b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..291cf9b0 Binary files /dev/null and b/_codex-verify/Debug/net8.0/fr/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..ef0d337c Binary files /dev/null and b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..f2663308 Binary files /dev/null and b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..6affe5c9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..263bd049 Binary files /dev/null and b/_codex-verify/Debug/net8.0/it/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..a94da356 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..c94e8e6f Binary files /dev/null and b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..6e0e8377 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..212267ad Binary files /dev/null and b/_codex-verify/Debug/net8.0/ja/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..1fae94dd Binary files /dev/null and b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..b2e573c9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..fdbe6ffd Binary files /dev/null and b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..5fee24cc Binary files /dev/null and b/_codex-verify/Debug/net8.0/ko/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..9533b36d Binary files /dev/null and b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..fa252981 Binary files /dev/null and b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..1297d58e Binary files /dev/null and b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..8af36a32 Binary files /dev/null and b/_codex-verify/Debug/net8.0/pl/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..197797ba Binary files /dev/null and b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..0fd342cd Binary files /dev/null and b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..c09c2abc Binary files /dev/null and b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..d6eaab61 Binary files /dev/null and b/_codex-verify/Debug/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/questpdf_fonts_lato.br b/_codex-verify/Debug/net8.0/questpdf_fonts_lato.br new file mode 100644 index 00000000..81a75936 Binary files /dev/null and b/_codex-verify/Debug/net8.0/questpdf_fonts_lato.br differ diff --git a/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..ecfe4835 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..e9133a58 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..baa77764 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..74714d84 Binary files /dev/null and b/_codex-verify/Debug/net8.0/ru/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-arm/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-arm/native/libSkiaSharp.so new file mode 100644 index 00000000..c44a57f1 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-arm/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libSkiaSharp.so new file mode 100644 index 00000000..f21679a2 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_qpdf.so b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_qpdf.so new file mode 100644 index 00000000..d03e622f Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_qpdf.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_skia.so b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_skia.so new file mode 100644 index 00000000..72a13d8a Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-arm64/native/libquestpdf_skia.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-loongarch64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-loongarch64/native/libSkiaSharp.so new file mode 100644 index 00000000..ee993353 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-loongarch64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm/native/libSkiaSharp.so new file mode 100644 index 00000000..3558b7dc Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm64/native/libSkiaSharp.so new file mode 100644 index 00000000..2ca5288b Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-arm64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-loongarch64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-loongarch64/native/libSkiaSharp.so new file mode 100644 index 00000000..86f7b9d5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-loongarch64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-riscv64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-riscv64/native/libSkiaSharp.so new file mode 100644 index 00000000..6de526ef Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-riscv64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libSkiaSharp.so new file mode 100644 index 00000000..71b395cc Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_qpdf.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_qpdf.so new file mode 100644 index 00000000..4b83f2ba Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_qpdf.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_skia.so b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_skia.so new file mode 100644 index 00000000..966c35f4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-musl-x64/native/libquestpdf_skia.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-riscv64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-riscv64/native/libSkiaSharp.so new file mode 100644 index 00000000..4dbcb429 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-riscv64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libSkiaSharp.so new file mode 100644 index 00000000..9b3472b4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_qpdf.so b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_qpdf.so new file mode 100644 index 00000000..bfa29f38 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_qpdf.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_skia.so b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_skia.so new file mode 100644 index 00000000..0c72ac2c Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-x64/native/libquestpdf_skia.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/linux-x86/native/libSkiaSharp.so b/_codex-verify/Debug/net8.0/runtimes/linux-x86/native/libSkiaSharp.so new file mode 100644 index 00000000..35b6e4d5 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/linux-x86/native/libSkiaSharp.so differ diff --git a/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_qpdf.dylib b/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_qpdf.dylib new file mode 100644 index 00000000..df63cce4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_qpdf.dylib differ diff --git a/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_skia.dylib b/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_skia.dylib new file mode 100644 index 00000000..5a92f31b Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/osx-arm64/native/libquestpdf_skia.dylib differ diff --git a/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_qpdf.dylib b/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_qpdf.dylib new file mode 100644 index 00000000..f74501eb Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_qpdf.dylib differ diff --git a/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_skia.dylib b/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_skia.dylib new file mode 100644 index 00000000..8b58534d Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/osx-x64/native/libquestpdf_skia.dylib differ diff --git a/_codex-verify/Debug/net8.0/runtimes/osx/native/libSkiaSharp.dylib b/_codex-verify/Debug/net8.0/runtimes/osx/native/libSkiaSharp.dylib new file mode 100644 index 00000000..6cf4d358 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/osx/native/libSkiaSharp.dylib differ diff --git a/_codex-verify/Debug/net8.0/runtimes/unix/lib/net6.0/System.Drawing.Common.dll b/_codex-verify/Debug/net8.0/runtimes/unix/lib/net6.0/System.Drawing.Common.dll new file mode 100644 index 00000000..9e26473d Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/unix/lib/net6.0/System.Drawing.Common.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll b/_codex-verify/Debug/net8.0/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll new file mode 100644 index 00000000..3da53a56 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.dll b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.dll new file mode 100644 index 00000000..991cde05 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.pdb b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.pdb new file mode 100644 index 00000000..68ea0dd9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/libSkiaSharp.pdb differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_qpdf.dll b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_qpdf.dll new file mode 100644 index 00000000..05b76abc Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_qpdf.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_skia.dll b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_skia.dll new file mode 100644 index 00000000..237ee681 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/questpdf_skia.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/sni.dll b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/sni.dll new file mode 100644 index 00000000..7b8f9d86 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-arm64/native/sni.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.dll b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.dll new file mode 100644 index 00000000..cd300be1 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.pdb b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.pdb new file mode 100644 index 00000000..ae3a5e8b Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/libSkiaSharp.pdb differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_qpdf.dll b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_qpdf.dll new file mode 100644 index 00000000..c53ad2e1 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_qpdf.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_skia.dll b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_skia.dll new file mode 100644 index 00000000..3a19a638 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/questpdf_skia.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x64/native/sni.dll b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/sni.dll new file mode 100644 index 00000000..c1a05a5b Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x64/native/sni.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.dll b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.dll new file mode 100644 index 00000000..a0963c48 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.pdb b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.pdb new file mode 100644 index 00000000..ae28643a Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/libSkiaSharp.pdb differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_qpdf.dll b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_qpdf.dll new file mode 100644 index 00000000..afd127a6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_qpdf.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_skia.dll b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_skia.dll new file mode 100644 index 00000000..9f244e65 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/questpdf_skia.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win-x86/native/sni.dll b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/sni.dll new file mode 100644 index 00000000..5fc21acb Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win-x86/native/sni.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 00000000..66af1982 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Drawing.Common.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Drawing.Common.dll new file mode 100644 index 00000000..7c9e87b4 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Drawing.Common.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll new file mode 100644 index 00000000..332dbfa9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Windows.Extensions.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Windows.Extensions.dll new file mode 100644 index 00000000..69f0d1b7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/net6.0/System.Windows.Extensions.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/net7.0/System.Management.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/net7.0/System.Management.dll new file mode 100644 index 00000000..e2e909ed Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/net7.0/System.Management.dll differ diff --git a/_codex-verify/Debug/net8.0/runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll b/_codex-verify/Debug/net8.0/runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll new file mode 100644 index 00000000..c67f8661 Binary files /dev/null and b/_codex-verify/Debug/net8.0/runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll differ diff --git a/_codex-verify/Debug/net8.0/tessdata/jpn.traineddata b/_codex-verify/Debug/net8.0/tessdata/jpn.traineddata new file mode 100644 index 00000000..c4178f89 Binary files /dev/null and b/_codex-verify/Debug/net8.0/tessdata/jpn.traineddata differ diff --git a/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..2fbf86e7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..4c57b04c Binary files /dev/null and b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..b551e371 Binary files /dev/null and b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..8758fff6 Binary files /dev/null and b/_codex-verify/Debug/net8.0/tr/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/x64/leptonica-1.82.0.dll b/_codex-verify/Debug/net8.0/x64/leptonica-1.82.0.dll new file mode 100644 index 00000000..64f449cd Binary files /dev/null and b/_codex-verify/Debug/net8.0/x64/leptonica-1.82.0.dll differ diff --git a/_codex-verify/Debug/net8.0/x64/tesseract50.dll b/_codex-verify/Debug/net8.0/x64/tesseract50.dll new file mode 100644 index 00000000..92a0dd31 Binary files /dev/null and b/_codex-verify/Debug/net8.0/x64/tesseract50.dll differ diff --git a/_codex-verify/Debug/net8.0/x86/leptonica-1.82.0.dll b/_codex-verify/Debug/net8.0/x86/leptonica-1.82.0.dll new file mode 100644 index 00000000..d244fa29 Binary files /dev/null and b/_codex-verify/Debug/net8.0/x86/leptonica-1.82.0.dll differ diff --git a/_codex-verify/Debug/net8.0/x86/tesseract50.dll b/_codex-verify/Debug/net8.0/x86/tesseract50.dll new file mode 100644 index 00000000..3a336415 Binary files /dev/null and b/_codex-verify/Debug/net8.0/x86/tesseract50.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..de4fe51f Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..67b261c8 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..c6b8d866 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..a14ec60c Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll new file mode 100644 index 00000000..2d397915 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll new file mode 100644 index 00000000..86802cf7 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll new file mode 100644 index 00000000..691a8fa9 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll differ diff --git a/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll new file mode 100644 index 00000000..e8e4ee04 Binary files /dev/null and b/_codex-verify/Debug/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll differ diff --git a/_codex-verify/ExcelCheck/ExcelCheck.csproj b/_codex-verify/ExcelCheck/ExcelCheck.csproj new file mode 100644 index 00000000..bdcd578a --- /dev/null +++ b/_codex-verify/ExcelCheck/ExcelCheck.csproj @@ -0,0 +1,11 @@ + + + Exe + net10.0 + enable + enable + + + + + diff --git a/_codex-verify/ExcelCheck/Program.cs b/_codex-verify/ExcelCheck/Program.cs new file mode 100644 index 00000000..1eb56cb9 --- /dev/null +++ b/_codex-verify/ExcelCheck/Program.cs @@ -0,0 +1,63 @@ +using ClosedXML.Excel; +using RikiPath.Application.Handlers; +using RikiPath.Application.Helpers; +using RikiPath.Application.Responses.Content; +using RikiPath.Domain.Enums; + +var root = args[0]; +var names = new[] { "Certificate Lesson.xlsx", "Topic Lesson.xlsx", "PracticeExercise.xlsx", "MockTest.xlsx", "Placement.xlsx" }; +var handlers = new[] { "Lesson", "Kanji", "Grammar Pattern", "Vocabulary", "Practice Exercise", "Mock Test" } + .Select(name => (ISheetImportHandler)new Stub(name)).ToArray(); +foreach (var name in names) +{ + using var source = new XLWorkbook(Path.Combine(root, name)); + if (!ZipExcelWorkbookNormalizer.NeedsNormalization(source)) throw new Exception($"Not detected: {name}"); + using var output = ZipExcelWorkbookNormalizer.Combine([(name, source)], handlers, null, null, requireContent: false); + Console.WriteLine($"{name}: {string.Join(", ", output.Worksheets.Select(sheet => sheet.Name + "=" + ExcelSheetReader.ReadRows(sheet).Count))}"); + var expected = name switch + { + "MockTest.xlsx" => "Mock Test", + "Placement.xlsx" => "Placement Test", + "PracticeExercise.xlsx" => "Practice Exercise", + _ => "Lesson", + }; + if (output.Worksheets.All(sheet => sheet.Name != expected)) throw new Exception($"Missing {expected}"); + if (name == "PracticeExercise.xlsx" && ExcelSheetReader.ReadRows(output.Worksheet("Practice Exercise")).Count != 5) + throw new Exception("Practice exercise rows lost"); +} + +using var mock = new XLWorkbook(Path.Combine(root, "MockTest.xlsx")); +using var placement = new XLWorkbook(Path.Combine(root, "Placement.xlsx")); +void Set(IXLWorksheet sheet, int row, string heading, string value) +{ + var column = sheet.Row(1).CellsUsed().Single(cell => ExcelSheetReader.Normalize(cell.GetString()) == ExcelSheetReader.Normalize(heading)) + .Address.ColumnNumber; + sheet.Cell(row, column).Value = value; +} +Set(mock.Worksheet("MockTest"), 2, "MockTestTitle", "Same title"); +Set(mock.Worksheet("MockTest"), 2, "TimeLimitMinutes", "45"); +Set(mock.Worksheet("MockTest"), 2, "CertificateLevelCode", "N5"); +Set(mock.Worksheet("Mock Test Section"), 2, "Mock Test Title", "Same title"); +Set(mock.Worksheet("Mock Test Section"), 2, "Section Code", "N5_VOCABULARY"); +Set(mock.Worksheet("Mock Question"), 2, "Section Code", "N5_VOCABULARY"); +Set(mock.Worksheet("Mock Question"), 2, "Question Text", "Test question"); +Set(placement.Worksheet("Placement Test"), 2, "Title", "Same title"); +Set(placement.Worksheet("Placement Test"), 2, "Time Limit Minutes", "30"); +Set(placement.Worksheet("Placement Test"), 2, "Certificate Level Code", "N5"); +Set(placement.Worksheet("Placement Section"), 2, "Placement Title", "Same title"); +Set(placement.Worksheet("Placement Section"), 2, "Section Code", "N5_READING"); +Set(placement.Worksheet("Placement Question"), 2, "Section Code", "N5_READING"); +Set(placement.Worksheet("Placement Question"), 2, "Question Text", "Placement question"); +using var combined = ZipExcelWorkbookNormalizer.Combine([("mock", mock), ("placement", placement)], handlers, null, null); +if (ExcelSheetReader.ReadRows(combined.Worksheet("Mock Test")).Single().Get("IsPlacementAssessment") != "false" || + ExcelSheetReader.ReadRows(combined.Worksheet("Placement Test")).Single().Get("IsPlacementAssessment") != "true") + throw new Exception("Mock and placement mixed"); +Console.WriteLine("Mock and Placement remain separate with identical titles and levels."); + +sealed class Stub(string name) : ISheetImportHandler +{ + public ImportEntityType EntityType => default; + public string SheetName => name; + public Task BuildDiffAsync(IReadOnlyList rows, CancellationToken cancellationToken) + => throw new NotSupportedException(); +}