Model/tests/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
test_in_memory_property_overrides_reader.py Hold one DB connection per modelling_e2e invocation 2026-06-24 16:58:21 +00:00
test_landlord_address_resolver.py Bulk download: readable email, deal-name folders, visible worker logs 2026-07-08 15:02:38 +00:00
test_landlord_override_overlays.py Treat a same-family fuel refinement as consistent, not a mismatch 🟥 2026-06-30 17:17:04 +00:00
test_override_backed_prediction_attributes_reader.py Resolve a Property's prediction attributes from landlord overrides in gov-code space 🟩 2026-06-16 15:18:44 +00:00
test_override_component_consistency.py Silence untyped SAEnum.enums access in the consistency guard 🟪 2026-06-19 18:19:32 +00:00
test_property_override_postgres_repository.py test(address2uprn): cover ambiguity withholding + override dedup; add ADR-0057 2026-07-07 15:21:04 +00:00
test_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
test_property_postgres_overlay_hydration.py Fetch a property's lodged EPC by UPRN, not property_id 2026-07-14 10:35:51 +00:00
test_property_repository.py Fetch a property's lodged EPC by UPRN, not property_id 2026-07-14 10:35:51 +00:00