mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Add Coordinates value object + GeospatialRepository port + GeospatialS3Repository adapter. Resolves a Property's lon/lat from the partitioned Ordnance Survey Open-UPRN parquet (filename_meta -> partition -> UPRN row). A Repo, not a Fetcher (ADR-0011): no live OS API call. The parquet reader is injected, so it's unit-tested against fixture parquets with no S3/network; returns None when the UPRN is uncovered or absent. pyright strict clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
524 B
Python
17 lines
524 B
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from domain.geospatial.coordinates import Coordinates
|
|
|
|
|
|
class GeospatialRepository(ABC):
|
|
"""Resolves a Property's coordinates from hosted reference data by UPRN.
|
|
|
|
A Repo, not a Fetcher (ADR-0011): it reads stored Ordnance Survey Open-UPRN
|
|
data, with no live API call. Returns None when the UPRN is not covered.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def coordinates_for(self, uprn: int) -> Optional[Coordinates]: ...
|