mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
import correct PROPERTY_TYPE_LOOKUP
This commit is contained in:
parent
2dd9b9ce84
commit
9e43b9d16e
1 changed files with 5 additions and 3 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
from typing import Any, List, Optional, TypedDict
|
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 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
|
# This file should ultimately live somewhere different, probably
|
||||||
|
|
@ -76,7 +76,9 @@ def parse_rdsap(xml_string: str) -> SapPropertyDetails:
|
||||||
if addr_elem is None:
|
if addr_elem is None:
|
||||||
raise ValueError("Address element not found")
|
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)
|
postcode: str = addr_elem.findtext("r:Postcode", default="", namespaces=ns)
|
||||||
|
|
||||||
address_parts: List[str] = [
|
address_parts: List[str] = [
|
||||||
|
|
@ -91,7 +93,7 @@ def parse_rdsap(xml_string: str) -> SapPropertyDetails:
|
||||||
|
|
||||||
# --- Property Type ---
|
# --- Property Type ---
|
||||||
prop_type_text = root.findtext(".//r:Property-Type", namespaces=ns)
|
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]
|
property_type: str = PROPERTY_TYPE_LOOKUP[prop_type_code]
|
||||||
|
|
||||||
# --- Building Parts ---
|
# --- Building Parts ---
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue