35 lines
741 B
Python
35 lines
741 B
Python
import uuid
|
|
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ZoneRead(BaseModel):
|
|
id: uuid.UUID
|
|
owner_id: uuid.UUID
|
|
activity_id: uuid.UUID
|
|
polygon_geojson: dict # GeoJSON Polygon
|
|
area_m2: float
|
|
defense_level: int
|
|
defense_runs: int
|
|
created_at: datetime
|
|
last_reinforced_at: datetime | None = None
|
|
|
|
|
|
class ZoneBrief(BaseModel):
|
|
"""Lightweight zone for map rendering."""
|
|
|
|
id: uuid.UUID
|
|
owner_id: uuid.UUID
|
|
polygon_geojson: dict
|
|
area_m2: float
|
|
defense_level: int
|
|
|
|
|
|
class CaptureEvent(BaseModel):
|
|
"""Returned when a zone capture occurs."""
|
|
|
|
attacker_zone_id: uuid.UUID
|
|
victim_zone_id: uuid.UUID
|
|
victim_owner_id: uuid.UUID
|
|
captured_area_m2: float
|