Expand description
Input/output types for the settlement calculation engine.
§Architecture
The preferred calculation flow is:
Input → Validation → Settlement Engine → SettlementResult → InvoiceDocument → BO4E → EDIFACTSettlementResult is the canonical output. It carries every position
alongside its CalculationTrace, applicable LegalReferences, the
TariffSource that justified each rate, and any SettlementWarnings.
The service layer (netzbilanzd, invoicd) adapts SettlementResult into
rubo4e::current::Rechnung via a local into_rechnung() helper — keeping
BO4E as a purely rendering concern outside this crate.
§No float money
All monetary amounts use rust_decimal::Decimal. The crate::EuroAmount
newtype provides overflow-safe EUR arithmetic. No f32/f64 appears anywhere
in settlement calculations.
Structs§
- Abschlag
Input - Input for an Abschlagsrechnung Netznutzung (PID 31001).
- Abschlagsverrechnung
- An Abschlagsrechnung a later invoice deducts.
- AwhPosition
Input - One AWH action line item for
GasAwhInput. - Blindarbeit
- Reactive energy and the terms on which its excess is charged.
- Calculation
Trace - Full audit record for how one
SettlementPositionwas computed. - GasAwh
Input - Input for GeLi Gas AWH Sperrprozesse settlement (PID 31011).
- Grundpreis
- A Gas NNE Grundpreis — monthly rate and the months billed.
- Invoice
Document - A settlement presented as an invoice.
- Konzessionsabgabe
- A Konzessionsabgabe — the rate together with the customer group it applies to.
- Leistungspreis
- An RLM demand charge — peak demand and its rate.
- Menge
Preis - A metered quantity priced at a rate.
- MmmInput
- Input for Mehr-/Mindermengen (MMM) settlement invoice calculation.
- MsbInput
- Input for MSB (Messstellenbetreiber) invoice calculation.
- MsbRechnungsempfaenger
- Recipient of a MSB-Rechnung (PID 31009).
- NneInput
- Input for NNE (Netznutzungsentgelt) invoice calculation.
- Price
Step - One step of a rate schedule.
- Reduktionsfaktor
- A §14a Modul 2 reduction factor — the fraction of the published Arbeitspreis actually paid.
- Settlement
Period - The delivery period a settlement covers.
- Settlement
Position - One line of a settlement.
- Settlement
Result - What a settlement calculation produced.
- Settlement
Warning - A non-blocking validation issue found during settlement calculation.
- Spot
Price Formula - One line item in a grid settlement.
- Spotpreis
Interval - One dispatch interval for a spot-linked Netzentgelt (not a §14a module).
- Validation
Result - Result of pre-calculation input validation.
Enums§
- Abschlag
Grundlage - How an Abschlag’s amount was arrived at.
- Arbeitspreis
Modell - How the Arbeitspreis is structured, and whether §14a applies.
- Billing
Position Kind - Semantic kind of a billing position — used by the service layer to derive
the correct
BdewArtikelnummerfor the BO4ERechnungsposition. - Gemeinde
Groesse - Municipality size band for Konzessionsabgabe, per KAV §2 Abs. 2.
- KaKundengruppe
- Konzessionsabgabe customer group per KAV §2.
- Korrektur
Grund - Why a settlement was recalculated.
- Legal
Reference - Regulatory citation that justifies a billing position or rate.
- MsbEmpfaenger
Rolle - Market role a MSB-Rechnung (PID 31009) may be addressed to.
- Price
Reference - What a price refers to.
- Quantity
Unit - Unit of measure for a settlement position quantity.
- Rechnungscharakter
- The billing cadence of a Netznutzungsrechnung —
IMD+7081. - Sect14a
Module - §14a EnWG module for steuerbare Verbrauchseinrichtungen (controllable loads).
- Settlement
Status - Lifecycle status of a settlement result.
- Settlement
Type - Which regulated settlement process produced this result.
- Sparte
- Commodity — Strom (electricity) or Gas.
- Tariff
Calculation Method - How a rate was derived.
- Tariff
Source - Origin of the tariff rate applied in a settlement position.
- Warning
Severity - Severity level for
SettlementWarning.
Functions§
- validate_
gas_ awh_ input - Validate a
GasAwhInputbefore callingcrate::settle_gas_awh. - validate_
mmm_ input - Validate a
MmmInputbefore callingcrate::settle_mmm. - validate_
msb_ input - Validate a
MsbInputbefore callingcrate::settle_msb.