Unterrichtsplanung: Einheiten, Verlaufsplan-Editor, Kürzel-Katalog (Kapitel 4.1/4.2)
Neuer Tab "Planung" in GroupDetailView ersetzt den Platzhalter: Einheiten anlegen/bearbeiten/ als Vorlage in andere Gruppe kopieren, Stunden je Einheit mit Verschieben (inkl. Nachrücken der Folgestunden). Stundeneditor als tabellarischer Verlaufsplan (Phase/Dauer/Tätigkeit/ Material/Kurzsymbol je Zeile, Uhrzeit aus optionalem Stundenbeginn abgeleitet) statt eines einzelnen Phase-Felds mit Methoden-/Materialien-Chips — Kurzsymbol als Freitext mit Vorschlägen aus neuem Kürzel-Katalog (Einstellungen) plus bisher verwendeten Werten. Schema-Migrationen v1-v3 überführen bestehende Daten verlustfrei. 4.2.5 bewusst offen gelassen (hängt an Stundenplan, Kapitel 4.3). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@ public class UnitRepository(LiteDbContext db) : IUnitRepository
|
||||
public class LessonRepository(LiteDbContext db) : ILessonRepository
|
||||
{
|
||||
public List<Lesson> GetByUnit(Guid id) =>
|
||||
db.Lessons.Find(l => l.UnitId == id).OrderBy(l => l.Date).ToList();
|
||||
db.Lessons.Find(l => l.UnitId == id).OrderBy(l => l.Date).ThenBy(l => l.LessonNumber).ToList();
|
||||
public List<Lesson> GetByGroupAndDate(Guid gid, DateOnly date) =>
|
||||
db.Lessons.Find(l => l.GroupId == gid && l.Date == date).ToList();
|
||||
public List<Lesson> GetByGroupAndRange(Guid gid, DateOnly from, DateOnly to) =>
|
||||
@@ -349,6 +349,24 @@ public class SubjectRepository(LiteDbContext db) : ISubjectRepository
|
||||
}
|
||||
}
|
||||
|
||||
public class ShorthandCodeRepository(LiteDbContext db) : IShorthandCodeRepository
|
||||
{
|
||||
public List<ShorthandCode> GetAll() => db.ShorthandCodes.FindAll().OrderBy(c => c.Code).ToList();
|
||||
public void Save(ShorthandCode c)
|
||||
{
|
||||
c.Code = c.Code.Trim();
|
||||
c.Label = c.Label.Trim();
|
||||
if (c.Code.Length == 0) throw new ArgumentException("Das Kürzel darf nicht leer sein.");
|
||||
var duplicate = db.ShorthandCodes.FindAll()
|
||||
.FirstOrDefault(x => string.Equals(x.Code, c.Code, StringComparison.OrdinalIgnoreCase));
|
||||
if (duplicate is not null && duplicate.Id != c.Id)
|
||||
throw new InvalidOperationException("Ein Kürzel mit diesem Code existiert bereits.");
|
||||
c.UpdatedAt = DateTime.UtcNow;
|
||||
db.ShorthandCodes.Upsert(c);
|
||||
}
|
||||
public void Delete(Guid id) => db.ShorthandCodes.Delete(id);
|
||||
}
|
||||
|
||||
public class CompetencyDomainRepository(LiteDbContext db) : ICompetencyDomainRepository
|
||||
{
|
||||
public List<CompetencyDomain> GetBySubjectAndGrade(Guid subjectId, int gradeLevel) =>
|
||||
|
||||
Reference in New Issue
Block a user