This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
BreakPilot Dev 19855efacc
Some checks failed
Tests / Go Tests (push) Has been cancelled
Tests / Python Tests (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / Go Lint (push) Has been cancelled
Tests / Python Lint (push) Has been cancelled
Tests / Security Scan (push) Has been cancelled
Tests / All Checks Passed (push) Has been cancelled
Security Scanning / Secret Scanning (push) Has been cancelled
Security Scanning / Dependency Vulnerability Scan (push) Has been cancelled
Security Scanning / Go Security Scan (push) Has been cancelled
Security Scanning / Python Security Scan (push) Has been cancelled
Security Scanning / Node.js Security Scan (push) Has been cancelled
Security Scanning / Docker Image Security (push) Has been cancelled
Security Scanning / Security Summary (push) Has been cancelled
CI/CD Pipeline / Go Tests (push) Has been cancelled
CI/CD Pipeline / Python Tests (push) Has been cancelled
CI/CD Pipeline / Website Tests (push) Has been cancelled
CI/CD Pipeline / Linting (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Docker Build & Push (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / CI Summary (push) Has been cancelled
ci/woodpecker/manual/build-ci-image Pipeline was successful
ci/woodpecker/manual/main Pipeline failed
feat: BreakPilot PWA - Full codebase (clean push without large binaries)
All services: admin-v2, studio-v2, website, ai-compliance-sdk,
consent-service, klausur-service, voice-service, and infrastructure.
Large PDFs and compiled binaries excluded via .gitignore.
2026-02-11 13:25:58 +01:00

163 lines
5.5 KiB
Python

"""
AOI (Area of Interest) Models
Pydantic models for AOI requests and responses
"""
from enum import Enum
from typing import Optional
from datetime import datetime
from pydantic import BaseModel, Field
class AOIStatus(str, Enum):
"""Status of an AOI processing job."""
QUEUED = "queued"
PROCESSING = "processing"
COMPLETED = "completed"
FAILED = "failed"
class AOIQuality(str, Enum):
"""Quality level for AOI bundle generation."""
LOW = "low"
MEDIUM = "medium"
HIGH = "high"
class AOITheme(str, Enum):
"""Learning theme for AOI."""
TOPOGRAPHIE = "topographie"
LANDNUTZUNG = "landnutzung"
ORIENTIERUNG = "orientierung"
GEOLOGIE = "geologie"
HYDROLOGIE = "hydrologie"
VEGETATION = "vegetation"
class GeoJSONPolygon(BaseModel):
"""GeoJSON Polygon geometry."""
type: str = Field("Polygon", const=True)
coordinates: list[list[list[float]]] = Field(
...,
description="Polygon coordinates as [[[lon, lat], ...]]",
)
class AOIRequest(BaseModel):
"""Request model for creating an AOI."""
polygon: dict = Field(
...,
description="GeoJSON Polygon geometry",
example={
"type": "Polygon",
"coordinates": [[[9.19, 47.71], [9.20, 47.71], [9.20, 47.70], [9.19, 47.70], [9.19, 47.71]]]
},
)
theme: str = Field(
"topographie",
description="Learning theme for the AOI",
)
quality: str = Field(
"medium",
pattern="^(low|medium|high)$",
description="Bundle quality level",
)
class Config:
json_schema_extra = {
"example": {
"polygon": {
"type": "Polygon",
"coordinates": [[[9.1875, 47.7055], [9.1975, 47.7055], [9.1975, 47.7115], [9.1875, 47.7115], [9.1875, 47.7055]]]
},
"theme": "topographie",
"quality": "medium",
}
}
class AOIResponse(BaseModel):
"""Response model for AOI operations."""
aoi_id: str = Field(..., description="Unique AOI identifier")
status: AOIStatus = Field(..., description="Current processing status")
area_km2: float = Field(0, description="Area in square kilometers")
estimated_size_mb: float = Field(0, description="Estimated bundle size in MB")
message: Optional[str] = Field(None, description="Status message")
download_url: Optional[str] = Field(None, description="Bundle download URL")
manifest_url: Optional[str] = Field(None, description="Manifest URL")
created_at: Optional[str] = Field(None, description="Creation timestamp")
completed_at: Optional[str] = Field(None, description="Completion timestamp")
class Config:
json_schema_extra = {
"example": {
"aoi_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"area_km2": 0.45,
"estimated_size_mb": 25.5,
"message": "AOI processing complete",
"download_url": "/api/v1/aoi/550e8400-e29b-41d4-a716-446655440000/bundle.zip",
"manifest_url": "/api/v1/aoi/550e8400-e29b-41d4-a716-446655440000/manifest.json",
}
}
class AOIBounds(BaseModel):
"""Geographic bounding box."""
west: float = Field(..., description="Western longitude")
south: float = Field(..., description="Southern latitude")
east: float = Field(..., description="Eastern longitude")
north: float = Field(..., description="Northern latitude")
class AOICenter(BaseModel):
"""Geographic center point."""
longitude: float
latitude: float
class AOIManifest(BaseModel):
"""Unity bundle manifest for an AOI."""
version: str = Field("1.0.0", description="Manifest version")
aoi_id: str = Field(..., description="AOI identifier")
created_at: str = Field(..., description="Creation timestamp")
bounds: AOIBounds = Field(..., description="Geographic bounds")
center: AOICenter = Field(..., description="Geographic center")
area_km2: float = Field(..., description="Area in km²")
theme: str = Field(..., description="Learning theme")
quality: str = Field(..., description="Quality level")
assets: dict = Field(..., description="Asset file references")
unity: dict = Field(..., description="Unity-specific configuration")
class Config:
json_schema_extra = {
"example": {
"version": "1.0.0",
"aoi_id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2024-01-15T12:00:00Z",
"bounds": {
"west": 9.1875,
"south": 47.7055,
"east": 9.1975,
"north": 47.7115,
},
"center": {
"longitude": 9.1925,
"latitude": 47.7085,
},
"area_km2": 0.45,
"theme": "topographie",
"quality": "medium",
"assets": {
"terrain": {"file": "terrain.heightmap.png", "config": "terrain.json"},
"osm_features": {"file": "osm_features.json"},
"learning_positions": {"file": "learning_positions.json"},
"attribution": {"file": "attribution.json"},
},
"unity": {
"coordinate_system": "Unity (Y-up, left-handed)",
"scale": 1.0,
"terrain_resolution": 256,
},
}
}