Files

40 lines
955 B
Python
Raw Permalink Normal View History

2026-05-11 03:27:21 +03:30
from __future__ import annotations
from pydantic import Field
from .common import ApiEnvelope, EmptyRequest, RouteContract, SchemaModel
HTTP_METHOD = 'GET'
ROUTE_PATH = '/api/irrigation/'
class IrrigationListRequest(EmptyRequest):
pass
class IrrigationMethodSchema(SchemaModel):
id: int
name: str
category: str | None = None
description: str | None = None
water_efficiency_percent: float | None = None
water_pressure_required: str | None = None
flow_rate: str | None = None
coverage_area: str | None = None
soil_type: str | None = None
climate_suitability: str | None = None
created_at: str | None = None
updated_at: str | None = None
class IrrigationListResponse(ApiEnvelope[list[IrrigationMethodSchema]]):
pass
CONTRACT = RouteContract(
method=HTTP_METHOD,
path=ROUTE_PATH,
request_model=IrrigationListRequest.__name__,
response_model=IrrigationListResponse.__name__,
)