diff --git a/infrastructure/postgres/epc_property_table.py b/infrastructure/postgres/epc_property_table.py index d2c2de654..512621d6c 100644 --- a/infrastructure/postgres/epc_property_table.py +++ b/infrastructure/postgres/epc_property_table.py @@ -168,6 +168,9 @@ class EpcPropertyModel(SQLModel, table=True): ) heating_cylinder_insulation_thickness_mm: Optional[int] = Field(default=None) heating_cylinder_volume_measured_l: Optional[int] = Field(default=None) + # #1665: read by cert_to_inputs (§4 cylinder loss); dropping it billed the + # cylinder at the Table 2b age-band default (worst case -15.53 SAP). + heating_cylinder_heat_loss: Optional[float] = Field(default=None) heating_wwhrs_index_number_1: Optional[int] = Field(default=None) heating_wwhrs_index_number_2: Optional[int] = Field(default=None) heating_shower_outlet_type: Optional[Union[int, str]] = Field( @@ -359,6 +362,7 @@ class EpcPropertyModel(SQLModel, table=True): heating_secondary_heating_type=h.secondary_heating_type, heating_cylinder_insulation_thickness_mm=h.cylinder_insulation_thickness_mm, heating_cylinder_volume_measured_l=h.cylinder_volume_measured_l, + heating_cylinder_heat_loss=h.cylinder_heat_loss, heating_wwhrs_index_number_1=h.instantaneous_wwhrs.wwhrs_index_number1, heating_wwhrs_index_number_2=h.instantaneous_wwhrs.wwhrs_index_number2, heating_shower_outlet_type=shower.shower_outlet_type if shower else None, diff --git a/repositories/epc/epc_postgres_repository.py b/repositories/epc/epc_postgres_repository.py index caa038e4e..81620b069 100644 --- a/repositories/epc/epc_postgres_repository.py +++ b/repositories/epc/epc_postgres_repository.py @@ -909,6 +909,7 @@ class EpcPostgresRepository(EpcRepository): secondary_heating_type=p.heating_secondary_heating_type, cylinder_insulation_thickness_mm=p.heating_cylinder_insulation_thickness_mm, cylinder_volume_measured_l=p.heating_cylinder_volume_measured_l, + cylinder_heat_loss=p.heating_cylinder_heat_loss, number_baths=p.heating_number_baths, number_baths_wwhrs=p.heating_number_baths_wwhrs, electric_shower_count=p.heating_electric_shower_count, diff --git a/tests/repositories/epc/test_epc_persistence_field_coverage.py b/tests/repositories/epc/test_epc_persistence_field_coverage.py index a3f12bb12..af416983a 100644 --- a/tests/repositories/epc/test_epc_persistence_field_coverage.py +++ b/tests/repositories/epc/test_epc_persistence_field_coverage.py @@ -60,7 +60,6 @@ _UNPERSISTED_ALLOWLIST: dict[str, str] = { "SapRoomInRoofSurface": "FE child table pending — room-in-roof surface detail", # --- Nested gaps the calculator does NOT read (dormant); no FE column. "SapAlternativeWall.is_basement": "dormant — not read by the calculator; no FE column", - "SapHeating.cylinder_heat_loss": "dormant — not read by the calculator; no FE column", # --- DELIBERATELY not persisted (#1656). These four ARE read by the # calculator (`heat_transmission.py:994` wall U, `:1068` roof U, `:1118` # floor U, `:955` basement wall) — do NOT re-label them "not read by the