feat: Bildungsplan-Versionierung für Kompetenzkataloge, vollständig über MCP exponiert

Neue Bildungspläne wachsen je Fach klassenstufenweise hoch, sodass Kurse abhängig vom
Einschulungsjahr entweder dem alten oder dem neuen Bildungsplan folgen. CompetencyCatalogVersion
(Fach + Name + IsDefault) macht das abbildbar: CompetencyDomain bekommt eine VersionId, Kurse
wählen über LearningGroup.CompetencyCatalogVersionId (null = Standardversion des Fachs) welche
Version gilt. Migration legt für bestehende Kataloge automatisch eine Standardversion an, damit
alte Datenbanken unverändert weiterlaufen.

MCP: neue Tools für Versions-CRUD (get/create/update/delete_competency_plan_version,
update_group_competency_version), get_competency_catalog/create_competency_domain um optionalen
versionId-Parameter erweitert.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Sonnet 5 committed 2026-09-19 00:07:29 +02:00
1 parent 4ffba35eff
commit f97edff2fe
45 files changed
+1020 -163

No files matched your search

@@ -19,6 +19,7 @@ public partial class ExamDialogViewModel : ObservableObject
private readonly Guid _groupId;
private readonly Guid? _subjectId;
private readonly int _gradeLevel;
private readonly Guid _competencyCatalogVersionId;
private readonly GradingSystem _gradingSystem;
private readonly Exam? _editingExam;
private readonly Exam? _duplicateSource;
@@ -63,11 +64,13 @@ public partial class ExamDialogViewModel : ObservableObject
public ExamDialogViewModel(IExamRepository exams, ICompetencyDomainRepository competencyDomains,
IGradingKeyTemplateRepository gradingKeyTemplates, GradingService grading,
Guid groupId, Guid? subjectId, int gradeLevel, GradingSystem gradingSystem,
string defaultSubjectName, bool isDifferentiated, Exam? editingExam, Exam? duplicateSource)
string defaultSubjectName, bool isDifferentiated, Exam? editingExam, Exam? duplicateSource,
Guid competencyCatalogVersionId = default)
{
_exams = exams; _competencyDomains = competencyDomains;
_gradingKeyTemplates = gradingKeyTemplates; _grading = grading;
_groupId = groupId; _subjectId = subjectId; _gradeLevel = gradeLevel;
_competencyCatalogVersionId = competencyCatalogVersionId;
_gradingSystem = gradingSystem;
_editingExam = editingExam;
_duplicateSource = duplicateSource;
@@ -75,7 +78,7 @@ public partial class ExamDialogViewModel : ObservableObject
IsDifferentiated = isDifferentiated;
HasCompetencyCatalog = subjectId.HasValue
&& _competencyDomains.GetBySubjectAndGrade(subjectId.Value, gradeLevel).Count > 0;
&& _competencyDomains.GetBySubjectAndGrade(subjectId.Value, gradeLevel, competencyCatalogVersionId).Count > 0;
foreach (var t in _gradingKeyTemplates.GetByGradingSystem(gradingSystem))
AvailableTemplates.Add(t);
@@ -164,7 +167,7 @@ public partial class ExamDialogViewModel : ObservableObject
var groups = new List<CompetencyTagGroup>();
if (!_subjectId.HasValue) return groups;
var selected = selectedCodes.ToHashSet();
foreach (var domain in _competencyDomains.GetBySubjectAndGrade(_subjectId.Value, _gradeLevel))
foreach (var domain in _competencyDomains.GetBySubjectAndGrade(_subjectId.Value, _gradeLevel, _competencyCatalogVersionId))
{
var group = new CompetencyTagGroup(domain.Name, domain.Code);
foreach (var item in domain.Items.OrderBy(i => i.SortOrder))