Derive hot-water bath and mixer counts from room counts for 18.0 certs 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-11 12:02:16 +00:00
parent 6df307b49c
commit 744aa5482d

View file

@ -743,6 +743,8 @@ class EpcPropertyDataMapper:
@staticmethod
def from_rdsap_schema_18_0(schema: RdSapSchema18_0) -> EpcPropertyData:
es = schema.sap_energy_source
# ADR-0028: instantaneous_wwhrs holds bath/shower ROOM counts.
iw = schema.sap_heating.instantaneous_wwhrs
return EpcPropertyData(
uprn=schema.uprn,
assessment_type=schema.assessment_type,
@ -809,6 +811,20 @@ class EpcPropertyDataMapper:
),
sap_heating=SapHeating(
instantaneous_wwhrs=InstantaneousWwhrs(),
# ADR-0028: derive HW demand counts from the bath/shower
# ROOM counts (instantaneous_wwhrs is the false-friend container).
number_baths=(
iw.rooms_with_bath_and_or_shower
+ iw.rooms_with_bath_and_mixer_shower
if iw is not None
else None
),
mixer_shower_count=(
iw.rooms_with_mixer_shower_no_bath
+ iw.rooms_with_bath_and_mixer_shower
if iw is not None
else None
),
main_heating_details=[
MainHeatingDetail(
has_fghrs=d.has_fghrs == "Y",