This commit is contained in:
2026-03-29 23:47:31 +02:00
commit 216d5d2280
75 changed files with 5702 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
namespace LehrerApp.Core.Models;
public class Exam
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid GroupId { get; set; }
public string Title { get; set; } = ""; // "Arbeit Nr. 2 Redox"
public DateOnly Date { get; set; }
public string Subject { get; set; } = "";
public int? ExamNumber { get; set; }
public List<ExamTask> Tasks { get; set; } = []; // nested kein JOIN
public List<GradingKeyEntry> GradingKey { get; set; } = [];
public ExamStatus Status { get; set; } = ExamStatus.Planned;
public string? Notes { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class ExamTask
{
public int Nr { get; set; }
public string? Title { get; set; }
public double MaxPoints { get; set; }
public double Weight { get; set; } = 1.0;
}
public class GradingKeyEntry
{
public string Grade { get; set; } = ""; // "1","2"... oder "15","14"...
public double MinPercent { get; set; }
}
// Ergebnisse separat für Notenspiegel ohne Aufgabentext laden
public class ExamResult
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid ExamId { get; set; }
public Guid StudentId { get; set; }
public List<double> Points { get; set; } = []; // Index = Aufgabe Nr - 1
public double TotalPoints { get; set; }
public string? Grade { get; set; }
public bool Absent { get; set; }
public string? Comment { get; set; }
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public enum ExamStatus { Planned, Conducted, Graded, Returned }

View File

@@ -0,0 +1,33 @@
namespace LehrerApp.Core.Models;
public class LearningGroup
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = ""; // "10E", "Q1 Chemie"
public GroupType Type { get; set; }
public string? Subject { get; set; } // "Chemie", "Mathematik"
public string SchoolYear { get; set; } = ""; // "2024/25"
public int GradeLevel { get; set; } // 5, 10, 11, 12 ...
public GradingSystem GradingSystem { get; set; }
public int? HoursPerWeek { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class Enrollment
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid StudentId { get; set; }
public Guid GroupId { get; set; }
public string SchoolYear { get; set; } = "";
public DateOnly EnrolledAt { get; set; } = DateOnly.FromDateTime(DateTime.Today);
public DateOnly? LeftAt { get; set; } // bei Wechsel mid-year
}
public enum GroupType { Class, Course }
public enum GradingSystem
{
Grades1To6, // Noten 16 (Sek I)
Points0To15, // Punkte 015 (Oberstufe)
}

View File

@@ -0,0 +1,57 @@
namespace LehrerApp.Core.Models;
// ── Sonstige Noten ────────────────────────────────────────────────────────────
public class Grade
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid StudentId { get; set; }
public Guid GroupId { get; set; }
public string SchoolYear { get; set; } = "";
public GradeCategory Category { get; set; }
public string Value { get; set; } = ""; // "2", "11", "+" je nach System
public DateOnly Date { get; set; }
public double Weight { get; set; } = 1.0;
public string? Note { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public enum GradeCategory { Oral, Homework, Participation, Project, Other }
// ── Unterrichtsplanung ────────────────────────────────────────────────────────
public class Unit // Unterrichtseinheit / Reihe
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid GroupId { get; set; }
public string Title { get; set; } = ""; // "Ionenbindung"
public string Subject { get; set; } = "";
public string SchoolYear { get; set; } = "";
public DateOnly? StartDate { get; set; }
public DateOnly? EndDate { get; set; }
public List<string> Competencies { get; set; } = [];
public UnitStatus Status { get; set; } = UnitStatus.Planned;
public string? Notes { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class Lesson // Einzelstunde
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid UnitId { get; set; }
public Guid GroupId { get; set; } // Redundanz für schnelle Abfragen
public DateOnly Date { get; set; }
public int? LessonNumber { get; set; }
public string Topic { get; set; } = "";
public string? Phase { get; set; } // "Einstieg", "Erarbeitung" ...
public List<string> Methods { get; set; } = [];
public List<string> Materials { get; set; } = [];
public string? Homework { get; set; }
public string? Reflection { get; set; }
public LessonStatus Status { get; set; } = LessonStatus.Planned;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public enum UnitStatus { Planned, Active, Completed }
public enum LessonStatus { Planned, Conducted }

View File

@@ -0,0 +1,52 @@
using LehrerApp.Core.Models;
namespace LehrerApp.Core.Models;
/// <summary>
/// Lesbarer Snapshot der lokalen Datenbank für die WebApp.
/// Wird periodisch vom Desktop exportiert und auf dem Server hinterlegt.
///
/// Bewusst NICHT enthalten:
/// - Documentation (vertraulich, bleibt lokal)
/// - Vollständige Notizen (nur Noten-Übersichten)
/// - Sync-interne Daten
/// </summary>
public class ReadableSnapshot
{
public DateTime ExportedAt { get; set; } = DateTime.UtcNow;
public string SchoolYear { get; set; } = "";
public List<Student> Students { get; set; } = [];
public List<LearningGroup> Groups { get; set; } = [];
public List<Enrollment> Enrollments { get; set; } = [];
// Klausuren mit Aufgaben aber ohne Ergebnisse
public List<Exam> Exams { get; set; } = [];
// Ergebnisse separat kann bei Bedarf weggelassen werden
public List<ExamResult> ExamResults { get; set; } = [];
// Sonstige Noten
public List<Grade> Grades { get; set; } = [];
// Unterrichtsplanung
public List<Unit> Units { get; set; } = [];
public List<Lesson> Lessons { get; set; } = [];
// Aufgaben (kein Zeiterfassungs-Detail)
public List<WorkTask> Tasks { get; set; } = [];
/// <summary>
/// Metadaten für die WebApp wie alt ist der Snapshot?
/// </summary>
public SnapshotMeta Meta { get; set; } = new();
}
public class SnapshotMeta
{
public int StudentCount { get; set; }
public int GroupCount { get; set; }
public int ExamCount { get; set; }
public DateTime OldestData { get; set; }
public string ExportedByDevice { get; set; } = "";
}

View File

@@ -0,0 +1,26 @@
namespace LehrerApp.Core.Models;
public class Student
{
public Guid Id { get; set; } = Guid.NewGuid();
public string FirstName { get; set; } = "";
public string LastName { get; set; } = "";
public string FullName => $"{LastName}, {FirstName}";
public DateOnly? DateOfBirth { get; set; }
public Gender? Gender { get; set; }
public List<Contact> Contacts { get; set; } = [];
public string? Notes { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class Contact
{
public string Name { get; set; } = "";
public string Relation { get; set; } = ""; // "Mutter", "Vater", "Vormund"
public string? Phone { get; set; }
public string? Email { get; set; }
}
public enum Gender { M, W, D }

View File

@@ -0,0 +1,70 @@
namespace LehrerApp.Core.Models;
// ── Schülerdokumentation ──────────────────────────────────────────────────────
public class Documentation
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid StudentId { get; set; }
public Guid? GroupId { get; set; } // optional nicht immer kursbezogen
public DocumentationType Type { get; set; }
public DateOnly Date { get; set; }
public string Title { get; set; } = "";
public string Content { get; set; } = "";
public List<string> Participants { get; set; } = []; // für Gesprächsnotizen
public AbsenceData? AbsenceData { get; set; }
public SupportData? SupportData { get; set; }
public bool IsConfidential { get; set; } // DSGVO: besonders schützenswert
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class AbsenceData
{
public int LessonCount { get; set; }
public bool Excused { get; set; }
public string? Reason { get; set; }
}
public class SupportData
{
public List<string> Measures { get; set; } = [];
public DateOnly? ReviewDate { get; set; }
public SupportStatus Status { get; set; } = SupportStatus.Active;
}
public enum DocumentationType { Conversation, Incident, SupportPlan, Absence }
public enum SupportStatus { Active, Completed, Paused }
// ── Arbeitszeit & Aufgaben ────────────────────────────────────────────────────
public class WorkTask
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Title { get; set; } = "";
public TaskCategory Category { get; set; }
public Guid? GroupId { get; set; }
public DateOnly? DueDate { get; set; }
public int? EstimatedMinutes { get; set; }
public WorkTaskStatus Status { get; set; } = WorkTaskStatus.Open;
public string? Notes { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
public class TimeEntry
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid? TaskId { get; set; }
public string Category { get; set; } = "";
public Guid? GroupId { get; set; }
public DateOnly Date { get; set; }
public TimeOnly? StartTime { get; set; }
public TimeOnly? EndTime { get; set; }
public int DurationMinutes { get; set; }
public string? Description { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public enum TaskCategory { Correction, Preparation, Admin, Meeting, Other }
public enum WorkTaskStatus { Open, InProgress, Done }