Resolve landlord references to UPRNs, excluding unresolved rows 🟩

PropertyUprnLookup builds a landlord_property_id -> uprn map for a portfolio via
an injected PropertyReferenceReader, excluding rows whose UPRN (or reference) is
null so unresolved properties never receive condition rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 15:04:39 +00:00
parent 4e291e4184
commit 57b0a080f4

View file

@ -15,4 +15,9 @@ class PropertyUprnLookup(UprnLookup):
self._portfolio_id = portfolio_id
def get_property_ref_to_uprn_lookup(self) -> Dict[str, int]:
raise NotImplementedError
references = self._reader.references_for_portfolio(self._portfolio_id)
return {
ref.landlord_property_id: ref.uprn
for ref in references
if ref.landlord_property_id is not None and ref.uprn is not None
}