From 9e43b9d16eefe2407577eef444e2af1bc7e6c590 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 15 Apr 2026 14:34:11 +0000 Subject: [PATCH] import correct PROPERTY_TYPE_LOOKUP --- backend/ecmk_fetcher/xml_processor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/ecmk_fetcher/xml_processor.py b/backend/ecmk_fetcher/xml_processor.py index b6dabbbe..aff284ef 100644 --- a/backend/ecmk_fetcher/xml_processor.py +++ b/backend/ecmk_fetcher/xml_processor.py @@ -1,9 +1,9 @@ import xml.etree.ElementTree as ET from typing import Any, List, Optional, TypedDict -from etl.xml_survey_extraction.XmlParser import PROPERTY_TYPE_LOOKUP from backend.ecmk_fetcher.reports import build_property_id +from datatypes.epc.domain.field_mappings import PROPERTY_TYPE_LOOKUP # This file should ultimately live somewhere different, probably @@ -76,7 +76,9 @@ def parse_rdsap(xml_string: str) -> SapPropertyDetails: if addr_elem is None: raise ValueError("Address element not found") - address_line_1: str = addr_elem.findtext("r:Address-Line-1", default="", namespaces=ns) + address_line_1: str = addr_elem.findtext( + "r:Address-Line-1", default="", namespaces=ns + ) postcode: str = addr_elem.findtext("r:Postcode", default="", namespaces=ns) address_parts: List[str] = [ @@ -91,7 +93,7 @@ def parse_rdsap(xml_string: str) -> SapPropertyDetails: # --- Property Type --- prop_type_text = root.findtext(".//r:Property-Type", namespaces=ns) - prop_type_code: str = str(_parse_int(prop_type_text, "Property-Type")) + prop_type_code: int = _parse_int(prop_type_text, "Property-Type") property_type: str = PROPERTY_TYPE_LOOKUP[prop_type_code] # --- Building Parts ---