klausur-service (11 files): - cv_gutter_repair, ocr_pipeline_regression, upload_api - ocr_pipeline_sessions, smart_spell, nru_worksheet_generator - ocr_pipeline_overlays, mail/aggregator, zeugnis_api - cv_syllable_detect, self_rag backend-lehrer (17 files): - classroom_engine/suggestions, generators/quiz_generator - worksheets_api, llm_gateway/comparison, state_engine_api - classroom/models (→ 4 submodules), services/file_processor - alerts_agent/api/wizard+digests+routes, content_generators/pdf - classroom/routes/sessions, llm_gateway/inference - classroom_engine/analytics, auth/keycloak_auth - alerts_agent/processing/rule_engine, ai_processor/print_versions agent-core (5 files): - brain/memory_store, brain/knowledge_graph, brain/context_manager - orchestrator/supervisor, sessions/session_manager admin-lehrer (5 components): - GridOverlay, StepGridReview, DevOpsPipelineSidebar - DataFlowDiagram, sbom/wizard/page website (2 files): - DependencyMap, lehrer/abitur-archiv Other: nibis_ingestion, grid_detection_service, export-doclayout-onnx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
129 lines
3.0 KiB
Python
129 lines
3.0 KiB
Python
"""
|
|
Classroom API - Context, Event, Routine Pydantic Models.
|
|
"""
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# === Context Models ===
|
|
|
|
class SchoolInfo(BaseModel):
|
|
"""Schul-Informationen."""
|
|
federal_state: str
|
|
federal_state_name: str = ""
|
|
school_type: str
|
|
school_type_name: str = ""
|
|
|
|
|
|
class SchoolYearInfo(BaseModel):
|
|
"""Schuljahr-Informationen."""
|
|
id: str
|
|
start: Optional[str] = None
|
|
current_week: int = 1
|
|
|
|
|
|
class MacroPhaseInfo(BaseModel):
|
|
"""Makro-Phase Informationen."""
|
|
id: str
|
|
label: str
|
|
confidence: float = 1.0
|
|
|
|
|
|
class CoreCounts(BaseModel):
|
|
"""Kern-Zaehler fuer den Kontext."""
|
|
classes: int = 0
|
|
exams_scheduled: int = 0
|
|
corrections_pending: int = 0
|
|
|
|
|
|
class ContextFlags(BaseModel):
|
|
"""Status-Flags des Kontexts."""
|
|
onboarding_completed: bool = False
|
|
has_classes: bool = False
|
|
has_schedule: bool = False
|
|
is_exam_period: bool = False
|
|
is_before_holidays: bool = False
|
|
|
|
|
|
class TeacherContextResponse(BaseModel):
|
|
"""Response fuer GET /v1/context."""
|
|
schema_version: str = "1.0"
|
|
teacher_id: str
|
|
school: SchoolInfo
|
|
school_year: SchoolYearInfo
|
|
macro_phase: MacroPhaseInfo
|
|
core_counts: CoreCounts
|
|
flags: ContextFlags
|
|
|
|
|
|
class UpdateContextRequest(BaseModel):
|
|
"""Request zum Aktualisieren des Kontexts."""
|
|
federal_state: Optional[str] = None
|
|
school_type: Optional[str] = None
|
|
schoolyear: Optional[str] = None
|
|
schoolyear_start: Optional[str] = None
|
|
macro_phase: Optional[str] = None
|
|
current_week: Optional[int] = None
|
|
|
|
|
|
# === Event Models ===
|
|
|
|
class CreateEventRequest(BaseModel):
|
|
"""Request zum Erstellen eines Events."""
|
|
title: str
|
|
event_type: str = "other"
|
|
start_date: str
|
|
end_date: Optional[str] = None
|
|
class_id: Optional[str] = None
|
|
subject: Optional[str] = None
|
|
description: str = ""
|
|
needs_preparation: bool = True
|
|
reminder_days_before: int = 7
|
|
|
|
|
|
class EventResponse(BaseModel):
|
|
"""Response fuer ein Event."""
|
|
id: str
|
|
teacher_id: str
|
|
event_type: str
|
|
title: str
|
|
description: str
|
|
start_date: str
|
|
end_date: Optional[str]
|
|
class_id: Optional[str]
|
|
subject: Optional[str]
|
|
status: str
|
|
needs_preparation: bool
|
|
preparation_done: bool
|
|
reminder_days_before: int
|
|
|
|
|
|
# === Routine Models ===
|
|
|
|
class CreateRoutineRequest(BaseModel):
|
|
"""Request zum Erstellen einer Routine."""
|
|
title: str
|
|
routine_type: str = "other"
|
|
recurrence_pattern: str = "weekly"
|
|
day_of_week: Optional[int] = None
|
|
day_of_month: Optional[int] = None
|
|
time_of_day: Optional[str] = None
|
|
duration_minutes: int = 60
|
|
description: str = ""
|
|
|
|
|
|
class RoutineResponse(BaseModel):
|
|
"""Response fuer eine Routine."""
|
|
id: str
|
|
teacher_id: str
|
|
routine_type: str
|
|
title: str
|
|
description: str
|
|
recurrence_pattern: str
|
|
day_of_week: Optional[int]
|
|
day_of_month: Optional[int]
|
|
time_of_day: Optional[str]
|
|
duration_minutes: int
|
|
is_active: bool
|