Schülerdokumentation: Einträge, Fehlzeitenbilanz, Datenschutz (Kapitel 5)

Dokumentationseinträge mit Typwahl (Gespräch, Vorkommnis, Förderplan,
Fehlzeit, Elternanruf, Elternbrief), vertrauliche Einträge nur nach
Bestätigung sichtbar, weiche Löschung mit Nachvollziehbarkeit. Fehlzeiten
als Auswertung des bestehenden Anwesenheits-Trackings statt zweiter
Erfassung, mit Schwellenwert-Warnung im Schülerdetail und Dashboard.
Förderplan-Wiedervorlage als Dashboard-Karte. Datenschutz: Löschfristen
mit manueller Bereinigung und DSGVO-Art.-15-Datenauskunft als Export.

Auf Nutzer-Feedback hin ergänzt: Elternanruf mit begleitendem
Gesprächsprotokoll-Dialog (Punkte abhaken, Eindrücke festhalten),
Elternbrief mit Versand-/Rückmeldungs-Tracking, Datei-Anhänge über
LiteDBs Dateispeicher, frei vergebbare Labels zur Nachverfolgung mit
Dringlichkeits-Farbcodierung, sowie eine sichtbare Farblegende für das
bestehende Notenentwicklungs-Diagramm. Dabei einen Absturz behoben:
leere Textfelder lieferten über das Binding null statt "", was beim
Speichern eine NullReferenceException auslöste.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 17:49:03 +02:00
co-authored by Claude Sonnet 5
parent 629b8d1bf0
commit d987b93315
36 changed files with 2395 additions and 62 deletions
+69
View File
@@ -331,4 +331,73 @@ public sealed class RepositoryTests
Assert.Throws<LiteDB.LiteException>(() =>
db.ParticipationEntries.Insert(new ParticipationEntry { SessionId = sessionId, StudentId = studentId }));
}
// ── DocumentationRepository ───────────────────────────────────────────────
[Fact]
public void DocumentationRepository_Delete_MarkiertNurAlsGeloescht()
{
using var db = NewInMemoryContext();
var repo = new DocumentationRepository(db);
var doc = new Documentation { StudentId = Guid.NewGuid(), Title = "Gespräch" };
repo.Save(doc);
repo.Delete(doc.Id);
Assert.Empty(repo.GetByStudent(doc.StudentId));
var raw = db.Documentation.FindById(doc.Id);
Assert.NotNull(raw);
Assert.True(raw.IsDeleted);
Assert.NotNull(raw.DeletedAt);
}
[Fact]
public void DocumentationRepository_HardDelete_EntferntDenEintragEndgueltig()
{
using var db = NewInMemoryContext();
var repo = new DocumentationRepository(db);
var doc = new Documentation { StudentId = Guid.NewGuid(), Title = "Vorkommnis" };
repo.Save(doc);
repo.HardDelete(doc.Id);
Assert.Null(db.Documentation.FindById(doc.Id));
}
[Fact]
public void DocumentationRepository_GetAll_FiltertGeloeschteEintraegeUndUmfasstAlleSchueler()
{
using var db = NewInMemoryContext();
var repo = new DocumentationRepository(db);
var visible = new Documentation { StudentId = Guid.NewGuid(), Title = "Sichtbar" };
var deleted = new Documentation { StudentId = Guid.NewGuid(), Title = "Gelöscht" };
repo.Save(visible);
repo.Save(deleted);
repo.Delete(deleted.Id);
var all = repo.GetAll();
Assert.Single(all);
Assert.Equal(visible.Id, all[0].Id);
}
[Fact]
public void DocumentationRepository_HardDelete_EntferntAuchDieAnhaenge()
{
using var db = NewInMemoryContext();
var repo = new DocumentationRepository(db);
var storage = new LiteAttachmentStorage(db);
string attachmentId;
using (var ms = new MemoryStream([1, 2, 3]))
attachmentId = storage.Upload("brief.pdf", ms);
var doc = new Documentation { StudentId = Guid.NewGuid(), Title = "Elternbrief" };
doc.Attachments.Add(new DocumentAttachment { StorageId = attachmentId, FileName = "brief.pdf", SizeBytes = 3 });
repo.Save(doc);
repo.HardDelete(doc.Id);
Assert.Null(db.Documentation.FindById(doc.Id));
Assert.Null(storage.OpenRead(attachmentId));
}
}