Model/repositories/property
Daniel Roth f7328f54c5 Fetch a property's lodged EPC by UPRN, not property_id
An epc_property row can carry a null property_id (FE/historic ingestion
persists EPC rows never linked to a property row), so a property_id-keyed
read silently misses them. UPRN is the durable key both the property row
and the epc_property row share. Repoint the lodged reads (get_for_property
+ get_for_properties) onto UPRN; the predicted reads stay on property_id
because a predicted EPC deep-copies a neighbour's UPRN, so its UPRN column
is never the property's own.

UPRN is not unique on epc_property, so the read tie-break is now load-
bearing (it was dormant under property_id, where the write path guarantees
one lodged row per property): the most recently ingested (highest-id) row
wins. Write path stays keyed on (property_id, source).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 10:35:51 +00:00
..
__init__.py feat(property): Property aggregate + PropertyRepository (#1132) 2026-05-30 19:39:54 +00:00
in_memory_property_overrides_reader.py Hold one DB connection per modelling_e2e invocation 2026-06-24 16:58:21 +00:00
landlord_address_resolver.py Bulk download: readable email, deal-name folders, visible worker logs 2026-07-08 15:02:38 +00:00
landlord_override_overlays.py Treat a same-family fuel refinement as consistent, not a mismatch 🟩 2026-06-30 17:18:51 +00:00
override_backed_prediction_attributes_reader.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
prediction_target_attributes_reader.py feat(epc-prediction): slice-5d target assembly + eligibility gate 2026-06-16 03:56:57 +00:00
property_override_postgres_repository.py feat(address2uprn): withhold ambiguous cross-row UPRN matches (ADR-0057) 2026-07-07 15:15:59 +00:00
property_override_repository.py feat(address2uprn): withhold ambiguous cross-row UPRN matches (ADR-0057) 2026-07-07 15:15:59 +00:00
property_overrides_postgres_reader.py perf(modelling_e2e): bulk reads and batch writes to cut RDS load 2026-06-24 18:43:42 +00:00
property_overrides_reader.py Read a Property's resolved landlord overrides as a faithful value-space snapshot 🟩 2026-06-16 15:14:53 +00:00
property_postgres_repository.py Fetch a property's lodged EPC by UPRN, not property_id 2026-07-14 10:35:51 +00:00
property_repository.py feat(modelling): mark a Property as run via has_recommendations + updated_at 2026-06-16 23:34:33 +00:00