41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from uuid import UUID
|
||
|
|
|
||
|
|
from pydantic import Field
|
||
|
|
|
||
|
|
from .common import ApiEnvelope, JsonObject, RouteContract, SchemaModel
|
||
|
|
|
||
|
|
HTTP_METHOD = 'GET'
|
||
|
|
ROUTE_PATH = '/api/crop-simulation/yield-harvest-summary/'
|
||
|
|
|
||
|
|
|
||
|
|
class CropSimulationYieldHarvestSummaryRequest(SchemaModel):
|
||
|
|
farm_uuid: UUID
|
||
|
|
season_year: int | None = None
|
||
|
|
crop_name: str | None = None
|
||
|
|
include_narrative: bool | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class CropSimulationYieldHarvestSummaryResponseData(SchemaModel):
|
||
|
|
farm_uuid: str
|
||
|
|
season_highlights_card: JsonObject = Field(default_factory=dict)
|
||
|
|
yield_prediction: JsonObject = Field(default_factory=dict)
|
||
|
|
harvest_prediction_card: JsonObject = Field(default_factory=dict)
|
||
|
|
harvest_readiness_zones: JsonObject = Field(default_factory=dict)
|
||
|
|
yield_quality_bands: JsonObject = Field(default_factory=dict)
|
||
|
|
harvest_operations_card: JsonObject = Field(default_factory=dict)
|
||
|
|
yield_prediction_chart: JsonObject = Field(default_factory=dict)
|
||
|
|
|
||
|
|
|
||
|
|
class CropSimulationYieldHarvestSummaryResponse(ApiEnvelope[CropSimulationYieldHarvestSummaryResponseData]):
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
CONTRACT = RouteContract(
|
||
|
|
method=HTTP_METHOD,
|
||
|
|
path=ROUTE_PATH,
|
||
|
|
request_model=CropSimulationYieldHarvestSummaryRequest.__name__,
|
||
|
|
response_model=CropSimulationYieldHarvestSummaryResponse.__name__,
|
||
|
|
)
|