Files
Schemas/irrigation_list.py
T

40 lines
955 B
Python
Raw Normal View History

2026-04-27 03:12:33 +03:30
from __future__ import annotations
2026-04-27 16:40:50 +03:30
from pydantic import Field
2026-04-27 03:12:33 +03:30
2026-04-27 16:40:50 +03:30
from .common import ApiEnvelope, EmptyRequest, RouteContract, SchemaModel
2026-04-27 03:12:33 +03:30
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
2026-04-27 16:40:50 +03:30
class IrrigationListResponse(ApiEnvelope[list[IrrigationMethodSchema]]):
2026-04-27 03:12:33 +03:30
pass
CONTRACT = RouteContract(
method=HTTP_METHOD,
path=ROUTE_PATH,
request_model=IrrigationListRequest.__name__,
response_model=IrrigationListResponse.__name__,
)