import correct PROPERTY_TYPE_LOOKUP

This commit is contained in:
Daniel Roth 2026-04-15 14:34:11 +00:00
parent 2dd9b9ce84
commit 9e43b9d16e

View file

@ -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 ---