"""One UPRN's row of Ordnance Survey spatial reference data. Bundles the two things the geospatial partition co-locates against a UPRN — the coordinates (which drive the Solar fetch) and the planning protections (which gate wall insulation, ADR-0019/ADR-0020) — so Ingestion resolves them in a single reference lookup and persists them together as a write-through cache (`property_details_spatial`). Coordinates are Optional because the legacy nearest-UPRN proxy fallback yields the flags with the coordinates nulled. """ from __future__ import annotations from dataclasses import dataclass from typing import Optional from domain.geospatial.coordinates import Coordinates from domain.geospatial.planning_restrictions import PlanningRestrictions @dataclass(frozen=True) class SpatialReference: """A Property's resolved spatial reference data, keyed by UPRN.""" coordinates: Optional[Coordinates] restrictions: PlanningRestrictions