feat: Anhänge je Stunde, Klausur-Sitzplan mischen, Gefährdungsbeurteilungs-Assistent
Lesson bekommt dieselbe Anhang-Infrastruktur wie Documentation (Material, Arbeitsblätter, Experimentunterlagen), samt Fix einer Sync-Lücke, die Anhang- Dateibytes bisher nur für Documentation statt generisch übertragen hat (IHasAttachments). Sitzplan-Tab bekommt einen "Plätze mischen"-Button für Klausursitzpläne. Neu: mehrschrittiger Gefährdungsbeurteilungs-Assistent mit optionalem KI-Entwurf (ai-backend/gbu.php) und PDF-Export, Format bewusst als JSON-Anhang statt eigener Datenbank-Entität. Details und Architekturentscheidungen in TODO.md (4.2, 7.1.5, 10.1.8). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,3 +119,37 @@ public class AiExplainResponse
|
||||
{
|
||||
public string Explanation { get; set; } = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wire-Vertrag für den Gefährdungsbeurteilungs-Entwurf (ai-backend/gbu.php, Nutzerwunsch neben
|
||||
/// 4.2 "Anhänge je Stunde"): erkennt aus Thema/Verlaufsplan der Lesson das Experiment und liefert
|
||||
/// dafür einen strukturierten Entwurf. Eigener Endpunkt statt Zusatzfeld in plan.php/explain.php,
|
||||
/// da inhaltlich unabhängig von der Unterrichtsplanung selbst.
|
||||
/// </summary>
|
||||
public class AiHazardAssessmentRequest
|
||||
{
|
||||
public AiUnitContext Unit { get; set; } = new();
|
||||
public AiLesson Lesson { get; set; } = new();
|
||||
}
|
||||
|
||||
public class AiHazardAssessmentResponse
|
||||
{
|
||||
/// "Lehrerversuch" | "Schuelerversuch" | "Demonstrationsversuch" (siehe ExperimentKind).
|
||||
public string ExperimentKind { get; set; } = "";
|
||||
public string Procedure { get; set; } = "";
|
||||
public List<AiHazardSubstance> Substances { get; set; } = [];
|
||||
public List<string> Hazards { get; set; } = [];
|
||||
public List<string> ProtectiveMeasures { get; set; } = [];
|
||||
public string FirstAid { get; set; } = "";
|
||||
public string Disposal { get; set; } = "";
|
||||
}
|
||||
|
||||
public class AiHazardSubstance
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public string Amount { get; set; } = "";
|
||||
/// GHS-Piktogramm-Codes als Text, z.B. "GHS05" — siehe GhsPictogram für die Zuordnung.
|
||||
public List<string> GhsPictograms { get; set; } = [];
|
||||
public string HStatements { get; set; } = "";
|
||||
public string PStatements { get; set; } = "";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
namespace LehrerApp.Core.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Gefährdungsbeurteilung zu einem Experiment (fachspezifisch, v.a. Chemie/Naturwissenschaften).
|
||||
/// Lebt NICHT als eigene LiteDB-Collection/Repository, sondern wird als JSON serialisiert und
|
||||
/// über die bestehende <see cref="DocumentAttachment"/>-Infrastruktur an eine <see cref="Lesson"/>
|
||||
/// angehängt (Dateiname endet auf ".gbu.json", siehe TODO.md 4.2) — das reicht für Bearbeiten,
|
||||
/// Anzeigen und PDF-Export, ohne eine weitere synchronisierte Entität samt Repository/DI-Wiring
|
||||
/// einzuführen (bewusste Scope-Entscheidung, siehe TODO.md).
|
||||
/// </summary>
|
||||
public class HazardAssessment
|
||||
{
|
||||
public string Title { get; set; } = "";
|
||||
/// Klassenstufe/Kurs, z.B. "10c" — vorbelegt aus der zugehörigen Lerngruppe, frei änderbar.
|
||||
public string GroupLabel { get; set; } = "";
|
||||
public DateOnly? Date { get; set; }
|
||||
public ExperimentKind Kind { get; set; } = ExperimentKind.Lehrerversuch;
|
||||
/// Kurzbeschreibung der Durchführung.
|
||||
public string Procedure { get; set; } = "";
|
||||
public List<HazardSubstance> Substances { get; set; } = [];
|
||||
public List<string> Hazards { get; set; } = [];
|
||||
public List<string> ProtectiveMeasures { get; set; } = [];
|
||||
public string FirstAid { get; set; } = "";
|
||||
public string Disposal { get; set; } = "";
|
||||
public string Notes { get; set; } = "";
|
||||
/// Ob ein KI-Entwurf beteiligt war — steuert den Rechtssicherheits-Hinweis im PDF-Export.
|
||||
public bool IsAiAssisted { get; set; }
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class HazardSubstance
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
/// Typische Einsatzmenge, z.B. "ca. 2 g" — Freitext statt strukturierter Einheit, da der
|
||||
/// Rahmen (fest/Lösung/Gas, Konzentration ...) zu unterschiedlich für ein starres Feld ist.
|
||||
public string Amount { get; set; } = "";
|
||||
public List<GhsPictogram> GhsPictograms { get; set; } = [];
|
||||
/// H-Sätze (Gefahrenhinweise) als Freitext, z.B. "H314, H290" oder mit Kurztext — bewusst kein
|
||||
/// eingebauter Katalog amtlicher H-/P-Satz-Texte in der App (Fehlerrisiko bei
|
||||
/// sicherheitsrelevanten Angaben), die Lehrkraft prüft/ergänzt gegen das Sicherheitsdatenblatt.
|
||||
public string HStatements { get; set; } = "";
|
||||
public string PStatements { get; set; } = "";
|
||||
}
|
||||
|
||||
public enum ExperimentKind { Lehrerversuch, Schuelerversuch, Demonstrationsversuch }
|
||||
|
||||
/// Die neun GHS-Gefahrenpiktogramme (Global Harmonisiertes System).
|
||||
public enum GhsPictogram
|
||||
{
|
||||
Explosive, Flammable, Oxidizing, CompressedGas, Corrosive,
|
||||
Toxic, Harmful, HealthHazard, Environmental,
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class Unit
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
public class Lesson
|
||||
public class Lesson : IHasAttachments
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UnitId { get; set; }
|
||||
@@ -64,6 +64,10 @@ public class Lesson
|
||||
public bool HomeworkCheckDismissed { get; set; }
|
||||
public string? Reflection { get; set; }
|
||||
public LessonStatus Status { get; set; } = LessonStatus.Planned;
|
||||
/// Material/Arbeitsblätter sowie fachspezifische Anhänge (z.B. Experiment- und
|
||||
/// Gefährdungsbeurteilungs-Dokumente im Chemieunterricht) — dieselbe Anhang-Infrastruktur wie
|
||||
/// bei <see cref="Documentation"/>.
|
||||
public List<DocumentAttachment> Attachments { get; set; } = [];
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LehrerApp.Core.Models;
|
||||
|
||||
public class Documentation
|
||||
public class Documentation : IHasAttachments
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid StudentId { get; set; }
|
||||
@@ -77,6 +77,17 @@ public class DocumentAttachment
|
||||
public long SizeBytes { get; set; }
|
||||
public DateTime UploadedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
/// <summary>
|
||||
/// Implementiert von jedem Modell mit Datei-Anhängen (aktuell <see cref="Documentation"/> und
|
||||
/// <see cref="Lesson"/>). Anhang-Bytes reisen nicht im JSON-Sync-Ereignis mit, sondern als eigener
|
||||
/// Binärtransfer (siehe <c>SyncEventPublisher</c>/<c>EventApplier</c>/<c>AttachmentSyncer</c> in
|
||||
/// LehrerApp.Sync) — dieses Interface macht die Erkennung "hat dieses Modell Anhänge?" dort
|
||||
/// generisch statt hart auf einen einzelnen Modelltyp verdrahtet.
|
||||
/// </summary>
|
||||
public interface IHasAttachments
|
||||
{
|
||||
List<DocumentAttachment> Attachments { get; }
|
||||
}
|
||||
// Hinten angefügt, damit die numerischen Werte bereits gespeicherter LiteDB-Einträge stabil bleiben.
|
||||
public enum DocumentationType { Conversation, Incident, SupportPlan, Absence, ParentCall, ParentLetter }
|
||||
public enum SupportStatus { Active, Completed, Paused }
|
||||
|
||||
Reference in New Issue
Block a user