Neue CompetencyTools.cs: create/update/delete_subject, create/update/delete_competency_domain, add/update/remove_competency_item, get_subjects, get_competency_catalog. delete_subject und delete_competency_domain als weitere Destructive-Ausnahmen neben delete_lesson (kein Papierkorb). Lesson bekommt ein neues Competencies-Feld (analog zu Unit.Competencies) sowie add_lesson_competency/remove_lesson_competency in LessonPlanTools.cs. ICompetencyDomainRepository um GetBySubject() erweitert, um den Katalog eines Fachs ohne bekannte Klassenstufe abzufragen. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
72 lines
3.7 KiB
C#
72 lines
3.7 KiB
C#
using LehrerApp.Core.Models;
|
|
|
|
namespace LehrerApp.Desktop.Services.Mcp.Tools;
|
|
|
|
// Schlanke, bewusst nicht 1:1 zu den LiteDB-Entities gehaltene Rückgabetypen: verhindert, dass ein
|
|
// später zum Modell hinzugefügtes Feld (z.B. ein neues personenbezogenes Attribut) unbeabsichtigt
|
|
// über ein MCP-Tool nach außen dringt, nur weil es Teil der Entity-Klasse ist.
|
|
|
|
public record StudentDto(Guid Id, string FirstName, string LastName, bool IsActive);
|
|
|
|
public record ExamResultDto(Guid StudentId, double TotalPoints, string? Grade, bool Absent);
|
|
|
|
public record ExamDto(
|
|
Guid Id, Guid GroupId, string Title, DateOnly Date, ExamStatus Status, Niveau? Niveau,
|
|
List<ExamResultDto>? Results);
|
|
|
|
public record GradeDto(
|
|
Guid Id, Guid StudentId, Guid GroupId, GradeCategory Category, string Value, DateOnly Date,
|
|
double Weight, string? Note);
|
|
|
|
public record TimetableSlotDto(Guid Id, Guid GroupId, DayOfWeek Weekday, int PeriodNumber, string? Room);
|
|
|
|
public record TimeEntryDto(
|
|
Guid Id, Guid? TaskId, string Category, Guid? GroupId, DateOnly Date,
|
|
TimeOnly? StartTime, TimeOnly? EndTime, int DurationMinutes, string? Description);
|
|
|
|
public record LessonPhaseDto(Guid Id, string Name, int DurationMinutes, string Activity, string Material, string Shorthand);
|
|
|
|
public record LessonAttachmentDto(string StorageId, string FileName, long SizeBytes);
|
|
|
|
public record LessonDto(
|
|
Guid Id, Guid UnitId, Guid GroupId, DateOnly Date, int? LessonNumber, string Topic,
|
|
string? Homework, LessonStatus Status, List<string> Competencies, List<LessonPhaseDto> Phases,
|
|
List<LessonAttachmentDto> Attachments);
|
|
|
|
/// <summary>Ergebnis von "download_lesson_attachment": Inhalt Base64-kodiert, weil MCP-Tool-Antworten
|
|
/// als JSON/Text übertragen werden. Bewusst kein Ressourcen-URI-Mechanismus (siehe Planungsdokument) -
|
|
/// dafür müsste der Server MCP-Resources anbieten, was über den Rahmen dieses Tools hinausgeht;
|
|
/// stattdessen deckelt <see cref="LessonPlanTools.MaxInlineAttachmentBytes"/> die Größe.</summary>
|
|
public record AttachmentContentDto(string FileName, long SizeBytes, string Base64Content);
|
|
|
|
public record UnitDto(
|
|
Guid Id, Guid GroupId, string Title, DateOnly? StartDate, DateOnly? EndDate,
|
|
UnitStatus Status, List<string> Competencies);
|
|
|
|
public record LessonPlanResultDto(List<UnitDto> Units, List<LessonDto> Lessons);
|
|
|
|
public record SubjectDto(Guid Id, string Name, string ShortName);
|
|
|
|
public record CompetencyItemDto(Guid Id, string Code, string Description, int SortOrder);
|
|
|
|
public record CompetencyDomainDto(
|
|
Guid Id, Guid SubjectId, int GradeLevel, string Name, string Code, int SortOrder,
|
|
List<CompetencyItemDto> Items);
|
|
|
|
public record GroupMembershipDto(
|
|
Guid Id, Guid StudentId, Guid GroupId, MembershipPeriod Period,
|
|
DateOnly? JoinedAt, DateOnly? LeftAt, Niveau? Niveau);
|
|
|
|
/// <summary>Ergebnis eines Write-Tools (Phase 2, siehe Planungsdokument): <see cref="Applied"/> ist
|
|
/// nur dann true, wenn der Nutzer die Änderung im Bestätigungsdialog angenommen hat.</summary>
|
|
public record WriteResultDto(bool Applied, Guid? Id, string Message);
|
|
|
|
public record PlaceholderInfoDto(string Name, string Type, bool Required, bool IsConstant);
|
|
|
|
/// <summary>"Worksheets" aus der ursprünglichen Spec entsprechen im tatsächlichen Datenmodell den
|
|
/// importierten Elternbrief-Vorlagen (<c>.lavorlage</c>, <c>LehrerApp.Templating</c>) — es gibt kein
|
|
/// separates "Arbeitsblatt"-Konzept mit Fach/Klassenstufe-Metadaten. Siehe LetterTemplateTools.</summary>
|
|
public record LetterTemplateDto(string Id, string Name, string Description, List<PlaceholderInfoDto> Placeholders);
|
|
|
|
public record LetterRenderResultDto(bool Success, string Message, string? Base64Pdf, string? SuggestedFileName);
|