Gemeinsame Dokumentation für mehrere Beteiligte eines Vorgangs
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
Ein Dokumentationseintrag kann jetzt weitere Schüler*innen betreffen (Documentation.AdditionalStudentIds, StudentId bleibt Hauptperson). Der Eintrag existiert nur einmal, erscheint aber im Dokumentations-Tab jeder beteiligten Person. Der Dokumentations-Dialog bietet in beiden Vorgänge-Tabs "Betrifft außerdem" mit den Beteiligten des Vorgangs an. Klassenlehrer-Listen, WebUntis-Abgleich, Löschfristen und Referenzzählung berücksichtigen die weiteren Beteiligten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e091b5c8de
commit
9a84bbaa38
23 files changed
+396
-49
No files matched your search
@@ -1338,4 +1338,39 @@ public sealed class RepositoryTests
|
||||
|
||||
Assert.Null(repo.GetById(extra.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DocumentationRepository_GetByStudent_FindetGemeinsamenEintragBeiAllenBeteiligten()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var repo = new DocumentationRepository(db);
|
||||
Guid anna = Guid.NewGuid(), ben = Guid.NewGuid(), cem = Guid.NewGuid();
|
||||
var shared = new Documentation
|
||||
{
|
||||
StudentId = anna, AdditionalStudentIds = [ben], Title = "Konflikt", Type = DocumentationType.Incident,
|
||||
};
|
||||
repo.Save(shared);
|
||||
|
||||
Assert.Equal(shared.Id, Assert.Single(repo.GetByStudent(anna)).Id);
|
||||
Assert.Equal(shared.Id, Assert.Single(repo.GetByStudent(ben)).Id);
|
||||
Assert.Empty(repo.GetByStudent(cem));
|
||||
Assert.Single(repo.GetByStudentAndType(ben, DocumentationType.Incident));
|
||||
Assert.Empty(repo.GetByStudentAndType(ben, DocumentationType.Conversation));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StudentRepository_GetReferenceSummary_ZaehltAuchGemeinsameDokumentation()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var students = new StudentRepository(db);
|
||||
var ben = new Student { FirstName = "Ben", LastName = "Muster" };
|
||||
students.Save(ben);
|
||||
new DocumentationRepository(db).Save(new Documentation
|
||||
{
|
||||
StudentId = Guid.NewGuid(), AdditionalStudentIds = [ben.Id], Title = "Konflikt",
|
||||
});
|
||||
|
||||
Assert.Equal(1, students.GetReferenceSummary(ben.Id).DocumentationEntries);
|
||||
Assert.Throws<InvalidOperationException>(() => students.Delete(ben.Id));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user