pub enum ArbeitspreisModell {
Einheitlich(MengePreis),
Modul1Pauschal {
basis: MengePreis,
reduktion: Reduktionsfaktor,
},
Modul2ZeitVariabel {
ht: MengePreis,
nt: MengePreis,
},
Modul3Spotpreis {
intervalle: Vec<Sect14aModul3Interval>,
},
}Expand description
How the Arbeitspreis is structured, and whether §14a applies.
One enum rather than three independent field groups. The four variants are mutually exclusive by construction, which removes a whole class of defect:
- The four HT/NT fields were 2⁴ states of which two were valid. Setting three of them fell through to flat billing with no error — the invoice looked right and was billed on the wrong basis.
- Modul 1 and Modul 3 could both be set. The engine applied the flat reduction and the per-interval rates, double-billing the same energy.
- Modul 1 and Modul 2 could both be set; the engine silently preferred Modul 2 rather than rejecting the conflict.
Those were runtime warnings in a validator the engine never called. They are now unrepresentable.
Variants§
Einheitlich(MengePreis)
A single rate for all metered energy.
Modul1Pauschal
§14a Modul 1 — the published rate reduced by a flat factor.
BNetzA BK6-22-300 Anlage 2.
Fields
basis: MengePreisThe metered energy and its published rate, before reduction.
reduktion: ReduktionsfaktorThe fraction of that rate actually paid.
Modul2ZeitVariabel
§14a Modul 2 — time-variable rates in a Hoch-/Niedertarif split.
Both bands are required: a Modul 2 tariff has both, and permitting one would reintroduce the partial state this type exists to prevent.
Modul3Spotpreis
§14a Modul 3 — a spot-derived rate per dispatch interval.
BNetzA BK6-22-300 Anlage 2 §3. The rates arrive already derived; this crate never queries a spot market.
Fields
intervalle: Vec<Sect14aModul3Interval>The dispatch intervals, each with its own rate.
Implementations§
Source§impl ArbeitspreisModell
impl ArbeitspreisModell
Sourcepub fn menge_kwh(&self) -> Decimal
pub fn menge_kwh(&self) -> Decimal
Total metered energy across the model, in kWh.
This is the base the Konzessionsabgabe and the network levies are charged on, so it is derived here once rather than recomputed per levy.
Sourcepub const fn sect14a_modul(&self) -> Option<Sect14aModule>
pub const fn sect14a_modul(&self) -> Option<Sect14aModule>
The §14a module in play, if any.
Trait Implementations§
Source§impl Clone for ArbeitspreisModell
impl Clone for ArbeitspreisModell
Source§fn clone(&self) -> ArbeitspreisModell
fn clone(&self) -> ArbeitspreisModell
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more