mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
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:
parent
4e291e4184
commit
57b0a080f4
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue