pub struct SettlePosition {
pub description: String,
pub legal_basis: String,
pub kwh: Decimal,
pub rate_ct_kwh: Decimal,
pub eur: Decimal,
}Expand description
A single billing component of a settlement calculation.
Each position represents one regulatory charge line:
net_eur = kwh × rate_ct_kwh / 100.
Convert to a billing::LineItem for invoice generation via .to_line_item().
Fields§
§description: StringHuman-readable description of this charge line.
legal_basis: StringLegal basis for audit trail (e.g. "§21 EEG 2023", "§23a EEG 2023 i.V.m. Anlage 1").
kwh: DecimalEnergy quantity this position applies to (kWh).
rate_ct_kwh: DecimalRate in ct/kWh. May be negative (e.g. PostEegSpot at negative EPEX).
eur: DecimalNet amount in EUR (kwh × rate_ct_kwh / 100, rounded to 5dp).
Positive = NB owes Anlagenbetreiber (typical). Negative = Anlagenbetreiber owes NB (post-EEG at negative EPEX).
Implementations§
Source§impl SettlePosition
impl SettlePosition
Sourcepub fn to_line_item(&self) -> LineItem
pub fn to_line_item(&self) -> LineItem
Convert this position to a billing::LineItem for use in
billing::BillingDocument generation (invoice, settlement receipt).
Uses billing::LineItem::for_usage() with the signed rate — negative
EPEX prices produce a negative net_amount on a Sign::Debit item,
correctly modelling the post-EEG scenario where the plant owes the NB.
Trait Implementations§
Source§impl Clone for SettlePosition
impl Clone for SettlePosition
Source§fn clone(&self) -> SettlePosition
fn clone(&self) -> SettlePosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more