This commit is contained in:
2026-05-11 03:27:21 +03:30
parent cf7cbb937c
commit d0e68a1a56
854 changed files with 102985 additions and 76 deletions
@@ -0,0 +1,41 @@
from __future__ import annotations
from uuid import UUID
from pydantic import Field
from .common import ApiEnvelope, RouteContract, SchemaModel
HTTP_METHOD = 'POST'
ROUTE_PATH = '/api/weather/farm-card/'
class WeatherFarmCardRequest(SchemaModel):
farm_uuid: UUID
class WeatherChartData(SchemaModel):
labels: list[str] = Field(default_factory=list)
series: list[list[float]] = Field(default_factory=list)
class WeatherFarmCardResponseData(SchemaModel):
condition: str
temperature: float | int
unit: str
humidity: float | int
windSpeed: float | int
windUnit: str
chartData: WeatherChartData = Field(default_factory=WeatherChartData)
class WeatherFarmCardResponse(ApiEnvelope[WeatherFarmCardResponseData]):
pass
CONTRACT = RouteContract(
method=HTTP_METHOD,
path=ROUTE_PATH,
request_model=WeatherFarmCardRequest.__name__,
response_model=WeatherFarmCardResponse.__name__,
)