diff --git a/repositories/condition/property_uprn_lookup.py b/repositories/condition/property_uprn_lookup.py index 0c8082675..cf2b2a344 100644 --- a/repositories/condition/property_uprn_lookup.py +++ b/repositories/condition/property_uprn_lookup.py @@ -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 diff --git a/tests/condition/lookups/test_property_uprn_lookup.py b/tests/condition/lookups/test_property_uprn_lookup.py index f303b55f1..265957b59 100644 --- a/tests/condition/lookups/test_property_uprn_lookup.py +++ b/tests/condition/lookups/test_property_uprn_lookup.py @@ -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"]