diff --git a/backend/documents_parser/tests/test_extractor.py b/backend/documents_parser/tests/test_extractor.py index 444742b48..934488614 100644 --- a/backend/documents_parser/tests/test_extractor.py +++ b/backend/documents_parser/tests/test_extractor.py @@ -198,6 +198,29 @@ class TestBuildingConstruction: assert construction.extensions is not None assert construction.extensions[0].id == 1 + def test_wall_dry_lined_answers_are_captured(self) -> None: + # Arrange / Act — fixture 7 lodges "Wall Dry-Lined?" per building + # part: Main "No", Extension 1 "Yes", Extension 2 "Yes". Dropped, a + # dry-lined wall is billed at the full uninsulated Table 6 U instead + # of the RdSAP10 §5.8 / Table 14 dry-lining-adjusted value (19% of + # the Guinness accuracy cohort lodges a "Yes"). + construction = PasHubRdSapSiteNotesExtractor( + load_text_fixture_7() + ).extract_building_construction() + + # Assert + assert construction.main_building.dry_lined is False + assert construction.extensions is not None + assert [e.dry_lined for e in construction.extensions] == [True, True] + + def test_wall_dry_lined_not_asked_stays_unknown( + self, construction: BuildingConstruction + ) -> None: + # Fixture 1 never asks "Wall Dry-Lined?" — unknown, NOT a "No". + assert construction.main_building.dry_lined is None + assert construction.extensions is not None + assert construction.extensions[0].dry_lined is None + def test_full_building_construction( self, construction: BuildingConstruction ) -> None: diff --git a/datatypes/epc/surveys/pashub_rdsap_site_notes.py b/datatypes/epc/surveys/pashub_rdsap_site_notes.py index aa278425e..33c691e5a 100644 --- a/datatypes/epc/surveys/pashub_rdsap_site_notes.py +++ b/datatypes/epc/surveys/pashub_rdsap_site_notes.py @@ -47,6 +47,9 @@ class MainBuildingConstruction: wall_thickness_mm: Optional[int] party_wall_construction_type: str filled_cavity_indicators: Optional[str] = None + # "Wall Dry-Lined?" Yes/No; None when the survey doesn't ask (e.g. + # non-masonry system build). + dry_lined: Optional[bool] = None @dataclass @@ -62,6 +65,8 @@ class ExtensionConstruction: wall_thickness_mm: Optional[int] party_wall_construction_type: str filled_cavity_indicators: Optional[str] = None + # "Wall Dry-Lined?" Yes/No; None when the survey doesn't ask. + dry_lined: Optional[bool] = None @dataclass