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,35 @@
from __future__ import annotations
from typing import Literal
from uuid import UUID
from pydantic import Field
from .common import ApiEnvelope, JsonObject, RouteContract, SchemaModel
HTTP_METHOD = 'POST'
ROUTE_PATH = '/api/irrigation/water-stress/'
class IrrigationWaterStressRequest(SchemaModel):
farm_uuid: UUID
sensor_uuid: UUID | None = None
class IrrigationWaterStressResponseData(SchemaModel):
farm_uuid: str
waterStressIndex: int | float
level: Literal['low', 'medium', 'high'] | str
sourceMetric: JsonObject = Field(default_factory=dict)
class IrrigationWaterStressResponse(ApiEnvelope[IrrigationWaterStressResponseData]):
pass
CONTRACT = RouteContract(
method=HTTP_METHOD,
path=ROUTE_PATH,
request_model=IrrigationWaterStressRequest.__name__,
response_model=IrrigationWaterStressResponse.__name__,
)