Map property_type on full-SAP certs for correct heat-transmission 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-25 20:37:34 +00:00
parent 951bee3115
commit 5c0460cee2
2 changed files with 11 additions and 0 deletions

View file

@ -738,6 +738,13 @@ class EpcPropertyDataMapper:
# fires trigger (a) (sap_version < 10.2 → Effective = the SAP-10.2
# calc) instead of keeping the lodged SAP-2012 score (ADR-0037).
sap_version=schema.sap_version,
# gov property_type code → str, mirroring from_rdsap_schema_17_1.
# Feeds the calculator's house/flat heat-transmission split.
property_type=(
str(schema.property_type)
if schema.property_type is not None
else None
),
dwelling_type=(
schema.dwelling_type
if isinstance(schema.dwelling_type, str)

View file

@ -202,6 +202,10 @@ class SapSchema17_1:
# Drives Rebaselining trigger (a): sap_version < 10.2 → Effective = the
# SAP-10.2 calc, not the lodged figure (ADR-0037). Optional defensively.
sap_version: Optional[float] = None
# gov property_type code (0 house, 1 bungalow, 2 flat, 3 maisonette, 4 park
# home). Feeds the calculator's house/flat heat-transmission split; left
# absent the dwelling is classified as neither → mis-scored (ADR-0037).
property_type: Optional[int] = None
# measured living-room area (m²); the engine consumes it via a back-solved
# habitable_rooms_count (Table 27). Optional — 100% present in the corpus.
living_area: Optional[Union[int, float]] = None