Dispatch and map RdSAP-Schema-18.0 certs end-to-end 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-11 11:18:15 +00:00
parent cfc337f04a
commit 4fca5d7fed
2 changed files with 12 additions and 4 deletions

View file

@ -2063,6 +2063,14 @@ class EpcPropertyDataMapper:
from_dict(RdSapSchema20_0_0, data)
)
)
if schema == "RdSAP-Schema-18.0":
from datatypes.epc.schema.rdsap_schema_18_0 import RdSapSchema18_0
return _clear_basement_flag_when_system_built(
EpcPropertyDataMapper.from_rdsap_schema_18_0(
from_dict(RdSapSchema18_0, data)
)
)
raise ValueError(f"Unsupported EPC schema: {schema!r}")

View file

@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import List, Optional, Union
from .common import CostAmount, DescriptionV1, Measurement
@ -159,7 +159,7 @@ class RenewableHeatIncentive:
impact_of_solid_wall_insulation: Optional[int] = None
@dataclass
@dataclass(kw_only=True)
class RdSapSchema18_0:
uprn: int
roofs: List[EnergyElement]
@ -202,7 +202,7 @@ class RdSapSchema18_0:
registration_date: str
sap_energy_source: SapEnergySource
secondary_heating: EnergyElement
lzc_energy_sources: List[int]
lzc_energy_sources: List[int] = field(default_factory=list)
sap_building_parts: List[SapBuildingPart]
low_energy_lighting: int
solar_water_heating: str
@ -221,7 +221,7 @@ class RdSapSchema18_0:
hot_water_cost_current: CostAmount
mechanical_ventilation: int
percent_draughtproofed: int
suggested_improvements: List[SuggestedImprovement]
suggested_improvements: List[SuggestedImprovement] = field(default_factory=list)
co2_emissions_potential: float
energy_rating_potential: int
lighting_cost_potential: CostAmount