feat: MCP-Tools für Mitarbeit-Sitzungen (ParticipationTools)
Mitarbeit-Sitzungen waren bisher komplett MCP-unerreichbar. Neue ParticipationTools-Klasse exponiert get_participation_sessions (Datum, Kommentar, zugeordnete Kompetenzen) sowie add_session_competency/remove_session_competency, nach demselben Einzel-Zuordnung-Muster wie LessonPlanTools. Bewusst ohne die einzelnen Schülerbewertungen (ParticipationEntry) - die bleiben personenbezogen und MCP-unerreichbar. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
845cc5fc4c
commit
51e55e1464
7 files changed
+195
-6
No files matched your search
@@ -17,7 +17,8 @@ public sealed class McpToolsTests
|
||||
{
|
||||
"download_lesson_attachment", "get_competency_catalog", "get_competency_plan_versions",
|
||||
"get_exams", "get_grades",
|
||||
"get_groups", "get_lesson_plans", "get_named_untis_absence_pattern", "get_schedule",
|
||||
"get_groups", "get_lesson_plans", "get_named_untis_absence_pattern",
|
||||
"get_participation_sessions", "get_schedule",
|
||||
"get_students", "get_subjects", "get_time_entries", "get_untis_absence_rows",
|
||||
"get_untis_hub_status", "list_letter_templates", "render_letter",
|
||||
},
|
||||
@@ -31,10 +32,12 @@ public sealed class McpToolsTests
|
||||
new[]
|
||||
{
|
||||
"add_competency_item", "add_lesson_attachment", "add_lesson_competency", "add_lesson_phase",
|
||||
"add_session_competency",
|
||||
"apply_untis_absence_status", "create_competency_domain", "create_competency_plan_version",
|
||||
"create_grade_entry", "create_lesson",
|
||||
"create_subject", "create_time_entry", "create_unit", "move_lesson", "remove_competency_item",
|
||||
"remove_lesson_competency", "remove_lesson_phase", "update_competency_domain",
|
||||
"remove_lesson_competency", "remove_lesson_phase", "remove_session_competency",
|
||||
"update_competency_domain",
|
||||
"update_competency_item", "update_competency_plan_version", "update_group_competency_version",
|
||||
"update_lesson", "update_lesson_phase", "update_student_group_assignment",
|
||||
"update_subject", "update_unit",
|
||||
@@ -1026,4 +1029,91 @@ public sealed class McpToolsTests
|
||||
Assert.False(result.Applied);
|
||||
Assert.Equal(0, confirmation.CallCount);
|
||||
}
|
||||
|
||||
// ── ParticipationTools ───────────────────────────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void GetParticipationSessions_LiefertDatumKommentarUndKompetenzenDerGruppe()
|
||||
{
|
||||
var groupId = Guid.NewGuid();
|
||||
var item = new CompetencyItem { Code = "K1", Description = "Kompetenz" };
|
||||
var session = new ParticipationSession
|
||||
{
|
||||
GroupId = groupId, Date = new DateOnly(2026, 1, 12), Comment = "Sitzplan",
|
||||
Competencies = [new CompetencyReference { ItemId = item.Id, Code = item.Code, Description = item.Description }],
|
||||
};
|
||||
var sessions = new FakeSessions([session]);
|
||||
var tool = new ParticipationTools(sessions, new FakeCompetencyDomains(), new FakeMcpConfirmation());
|
||||
|
||||
var result = Assert.Single(tool.GetParticipationSessions(groupId));
|
||||
|
||||
Assert.Equal(session.Id, result.Id);
|
||||
Assert.Equal("Sitzplan", result.Comment);
|
||||
var competency = Assert.Single(result.Competencies);
|
||||
Assert.Equal(item.Id, competency.ItemId);
|
||||
Assert.Equal("K1", competency.Code);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AddSessionCompetency_NutzerBestaetigt_OrdnetKompetenzZu()
|
||||
{
|
||||
var session = new ParticipationSession { Date = new DateOnly(2026, 1, 12) };
|
||||
var sessions = new FakeSessions([session]);
|
||||
var domains = new FakeCompetencyDomains();
|
||||
var item = new CompetencyItem { Code = "K1", Description = "Kompetenz" };
|
||||
domains.Add(new CompetencyDomain { Name = "Bereich", Items = [item] });
|
||||
var tool = new ParticipationTools(sessions, domains, new FakeMcpConfirmation());
|
||||
|
||||
var result = await tool.AddSessionCompetency(session.Id, item.Id);
|
||||
|
||||
Assert.True(result.Applied);
|
||||
var stored = Assert.Single(sessions.GetById(session.Id)!.Competencies);
|
||||
Assert.Equal(item.Id, stored.ItemId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AddSessionCompetency_UnbekannteId_LiefertFehlerOhneNachfrage()
|
||||
{
|
||||
var session = new ParticipationSession { Date = new DateOnly(2026, 1, 12) };
|
||||
var sessions = new FakeSessions([session]);
|
||||
var confirmation = new FakeMcpConfirmation();
|
||||
var tool = new ParticipationTools(sessions, new FakeCompetencyDomains(), confirmation);
|
||||
|
||||
var result = await tool.AddSessionCompetency(session.Id, Guid.NewGuid());
|
||||
|
||||
Assert.False(result.Applied);
|
||||
Assert.Equal(0, confirmation.CallCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RemoveSessionCompetency_NutzerBestaetigt_EntferntKompetenz()
|
||||
{
|
||||
var item = new CompetencyItem { Code = "K1", Description = "Kompetenz" };
|
||||
var session = new ParticipationSession
|
||||
{
|
||||
Date = new DateOnly(2026, 1, 12),
|
||||
Competencies = [new CompetencyReference { ItemId = item.Id, Code = item.Code, Description = item.Description }],
|
||||
};
|
||||
var sessions = new FakeSessions([session]);
|
||||
var tool = new ParticipationTools(sessions, new FakeCompetencyDomains(), new FakeMcpConfirmation());
|
||||
|
||||
var result = await tool.RemoveSessionCompetency(session.Id, item.Id);
|
||||
|
||||
Assert.True(result.Applied);
|
||||
Assert.Empty(sessions.GetById(session.Id)!.Competencies);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RemoveSessionCompetency_NichtZugeordnet_LiefertFehlerOhneNachfrage()
|
||||
{
|
||||
var session = new ParticipationSession { Date = new DateOnly(2026, 1, 12) };
|
||||
var sessions = new FakeSessions([session]);
|
||||
var confirmation = new FakeMcpConfirmation();
|
||||
var tool = new ParticipationTools(sessions, new FakeCompetencyDomains(), confirmation);
|
||||
|
||||
var result = await tool.RemoveSessionCompetency(session.Id, Guid.NewGuid());
|
||||
|
||||
Assert.False(result.Applied);
|
||||
Assert.Equal(0, confirmation.CallCount);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user