Model/tests/domain/billing
Jun-te Kim 782c686969 Map fuel code 39 (electricity, any tariff) to standard electricity
modelling_e2e properties with main fuel 39 failed at the price boundary
(UnpricedFuelCode since #44fff767; previously mis-rated as non-electric →
the ~14-SAP over-rating flagged in earlier review).

Code 39 is SAP Table 12 "electricity, any tariff" (epc_codes.csv main_fuel 39 =
"electricity, unspecified tariff"; spec footnote (j): defines an electric system,
cost/CO2/PE = standard electricity). It was absent from API_FUEL_TO_TABLE_32, so
to_table_32_code(39) was None → is_electric_fuel_code(39) False and pricing
raised.

Fix: map API_FUEL_TO_TABLE_32[39] = 30 (standard electricity) — the canonical
place Khalim's fuel work added codes. One line makes classification, pricing,
CO2/PE and the billing carrier all agree (39 → 30 → ELECTRICITY).

Tests: to_table_32_code(39)==30, is_electric_fuel_code(39) True, price == standard
electricity, and the billing carrier resolves to ELECTRICITY. 0 corpus impact
(no lodged corpus cert uses 39); accuracy + mapper-corpus gates green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:20:32 +00:00
..
__init__.py refactor(billing): relocate Bill Derivation to domain/billing/ (cross-stage) 2026-06-03 17:19:23 +00:00
test_bill_derivation.py refactor(billing): relocate Bill Derivation to domain/billing/ (cross-stage) 2026-06-03 17:19:23 +00:00
test_energy_breakdown.py refactor(billing): relocate Bill Derivation to domain/billing/ (cross-stage) 2026-06-03 17:19:23 +00:00
test_sap_fuel.py Map fuel code 39 (electricity, any tariff) to standard electricity 2026-06-24 11:20:32 +00:00