mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Report landlord references whose portfolio UPRN is null 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
57b0a080f4
commit
43a0977fce
2 changed files with 23 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Dict
|
||||
from typing import Dict, List
|
||||
|
||||
from repositories.condition.property_reference_reader import PropertyReferenceReader
|
||||
from repositories.condition.uprn_lookup import UprnLookup
|
||||
|
|
@ -21,3 +21,8 @@ class PropertyUprnLookup(UprnLookup):
|
|||
for ref in references
|
||||
if ref.landlord_property_id is not None and ref.uprn is not None
|
||||
}
|
||||
|
||||
def null_uprn_references(self) -> List[str]:
|
||||
"""Landlord references present in the portfolio whose UPRN is null —
|
||||
surfaced so a load can report them (none expected; ADR-0064)."""
|
||||
raise NotImplementedError
|
||||
|
|
|
|||
|
|
@ -30,3 +30,20 @@ def test_property_uprn_lookup_excludes_rows_with_no_uprn():
|
|||
|
||||
# Assert
|
||||
assert mapping == {"443": 100093305101}
|
||||
|
||||
|
||||
def test_property_uprn_lookup_reports_references_with_null_uprn():
|
||||
# Arrange
|
||||
reader = FakePropertyReferenceReader(
|
||||
[
|
||||
PropertyReference(landlord_property_id="443", uprn=100093305101),
|
||||
PropertyReference(landlord_property_id="999", uprn=None),
|
||||
]
|
||||
)
|
||||
lookup = PropertyUprnLookup(reader, portfolio_id=824)
|
||||
|
||||
# Act
|
||||
null_references = lookup.null_uprn_references()
|
||||
|
||||
# Assert
|
||||
assert null_references == ["999"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue