Charge the C6 half heat-network standing charge on a water-only dwelling's off-peak fuel bill 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-15 13:43:46 +00:00
parent 4472e47ed4
commit b14fa31dde

View file

@ -9189,6 +9189,45 @@ def test_water_only_heat_network_half_charge_reaches_the_fuel_cost_worksheet() -
assert abs(fc.additional_standing_charges_gbp - 180.0) <= 1e-9
def test_water_only_heat_network_half_charge_reaches_the_off_peak_standing_scalar() -> None:
# Arrange — cert 22032926 (22 Gwydyr Mansions) in shape: electric storage
# main (SAP 401) on a Dual meter + WHC 950. Off-peak certs take the zero
# `FuelCostResult` sentinel from `_fuel_cost` and cost via the scalar
# `standing_charges_gbp` instead, so the §C6 half must reach BOTH paths —
# this is the one the corpus cert actually bills through.
#
# The lodged `water_heating_fuel` 20 ("mains gas (community)") is NOT a
# Table 32 gas code, so note (a) draws no gas standing — the dwelling has
# no gas meter, only the Economy-7 electric one. Hence £24 today.
from dataclasses import replace
base = _typical_semi_detached_epc()
storage_main = MainHeatingDetail(
has_fghrs=False,
main_fuel_type=29, # electricity
heat_emitter_type=0,
emitter_temperature=1,
main_heating_control=2401,
main_heating_category=7, # electric storage heaters
sap_main_heating_code=401,
)
epc = replace(
base,
sap_energy_source=replace(base.sap_energy_source, meter_type="1"), # Dual
sap_heating=make_sap_heating(
main_heating_details=[storage_main],
water_heating_code=950, # DHW-only heat network (boilers)
water_heating_fuel=20, # EPC "mains gas (community)", as lodged
),
)
# Act
standing: float = cert_to_inputs(epc).standing_charges_gbp
# Assert — £24 off-peak electric (Table 12 note (a)) + £60 half (C6).
assert abs(standing - 84.0) <= 1e-9
def test_mev_default_data_iuf_is_table_329_system_type_10_value() -> None:
# Arrange / Act — SAP 10.2 Table 4g note 3 (PDF p.176) directs the
# default SFP to "the appropriate in-use factor for default data from