from __future__ import annotations from enum import Enum class Fuel(Enum): """A canonical billing fuel — the join key between the calculator's per-end-use fuel (mapped from SAP fuel codes) and the Fuel Rates snapshot (ADR-0014). Member names match the snapshot's keys. ``COAL`` (traditional house coal) and ``HEAT_NETWORK`` are carried as members so a cert lodging them maps to a Fuel, but they have no national rate — pricing them raises ``UnpricedFuel`` (house coal's domestic sale is illegal in England; heat networks are scheme-specific). """ MAINS_GAS = "MAINS_GAS" ELECTRICITY = "ELECTRICITY" ELECTRICITY_OFF_PEAK = "ELECTRICITY_OFF_PEAK" OIL = "OIL" LPG = "LPG" COAL = "COAL" SMOKELESS = "SMOKELESS" WOOD_LOGS = "WOOD_LOGS" WOOD_PELLETS = "WOOD_PELLETS" HEAT_NETWORK = "HEAT_NETWORK" class UnpricedFuel(ValueError): """Bill Derivation was asked for a rate on a fuel the current Fuel Rates snapshot does not price (ADR-0014). Raised rather than billing at a wrong default so the gap surfaces immediately — house coal and heat networks have no national rate, and off-peak electricity needs the day/night split that a later slice adds. """ def __init__(self, fuel: Fuel) -> None: super().__init__( f"no rate for fuel {fuel.name} in the current Fuel Rates snapshot; " f"add it to the snapshot or map this end use to a priced fuel" ) self.fuel = fuel