Files
breakpilot-lehrer/backend-lehrer/unit_api.py
Benjamin Admin 6811264756 [split-required] Split final batch of monoliths >1000 LOC
Python (6 files in klausur-service):
- rbac.py (1,132 → 4), admin_api.py (1,012 → 4)
- routes/eh.py (1,111 → 4), ocr_pipeline_geometry.py (1,105 → 5)

Python (2 files in backend-lehrer):
- unit_api.py (1,226 → 6), game_api.py (1,129 → 5)

Website (6 page files):
- 4x klausur-korrektur pages (1,249-1,328 LOC each) → shared components
  in website/components/klausur-korrektur/ (17 shared files)
- companion (1,057 → 10), magic-help (1,017 → 8)

All re-export barrels preserve backward compatibility.
Zero import errors verified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 23:17:30 +02:00

58 lines
1.8 KiB
Python

# ==============================================
# Breakpilot Drive - Unit API (barrel re-export)
# ==============================================
# This module was split into:
# - unit_models.py (Pydantic models)
# - unit_helpers.py (Auth, DB, token, validation helpers)
# - unit_routes.py (Definition, session, analytics routes)
# - unit_content_routes.py (H5P, worksheet, PDF routes)
#
# The `router` object is assembled here by including all sub-routers.
# Importers that did `from unit_api import router` continue to work.
from fastapi import APIRouter
from unit_routes import router as _routes_router
from unit_definition_routes import router as _definition_router
from unit_content_routes import router as _content_router
# Re-export models for any direct importers
from unit_models import ( # noqa: F401
UnitDefinitionResponse,
CreateSessionRequest,
SessionResponse,
TelemetryEvent,
TelemetryPayload,
TelemetryResponse,
PostcheckAnswer,
CompleteSessionRequest,
SessionSummaryResponse,
UnitListItem,
RecommendedUnit,
CreateUnitRequest,
UpdateUnitRequest,
ValidationError,
ValidationResult,
)
# Re-export helpers for any direct importers
from unit_helpers import ( # noqa: F401
get_optional_current_user,
get_unit_database,
create_session_token,
verify_session_token,
get_session_from_token,
validate_unit_definition,
USE_DATABASE,
REQUIRE_AUTH,
SECRET_KEY,
)
# Assemble the combined router.
# _routes_router and _content_router both use prefix="/api/units",
# so we create a plain router and include them without extra prefix.
router = APIRouter()
router.include_router(_routes_router)
router.include_router(_definition_router)
router.include_router(_content_router)