Skip to main content

NneInput

Struct NneInput 

Source
pub struct NneInput {
Show 19 fields pub malo_id: String, pub nb_mp_id: String, pub lf_mp_id: String, pub period: SettlementPeriod, pub letztverbrauchergruppe: Letztverbrauchergruppe, pub sect19_umlage_ct_per_kwh: Option<Decimal>, pub offshore_umlage_ct_per_kwh: Option<Decimal>, pub kwkg_umlage_ct_per_kwh: Option<Decimal>, pub tariff_sheet_id: Option<String>, pub sparte: Sparte, pub arbeitspreis: ArbeitspreisModell, pub leistungspreis: Option<Leistungspreis>, pub grundpreis: Option<Grundpreis>, pub konzessionsabgabe: Option<Konzessionsabgabe>, pub netzebene: Option<Netzebene>, pub jahreshoechstleistung_kw: Option<Decimal>, pub jahresarbeit_kwh: Option<Decimal>, pub sect19: Option<Sect19Vereinbarung>, pub gas_kapazitaet: Option<GasKapazitaet>,
}
Expand description

Input for NNE (Netznutzungsentgelt) invoice calculation.

Covers:

  • PID 31002 (NN-Rechnung) — NNE Strom and Gas (NB → LF, monthly network usage billing). The Sparte is carried in the message content, not the PID.

For RLM (Leistungsmessung) meters:

  • Set spitzenleistung_kw to the peak demand in kW.
  • Set leistungspreis_eur_per_kw to the published tariff.

For SLP meters:

  • Leave both fields as None (Arbeitspreisanteil only).

For §14a Modul 2 time-variable NNE (BNetzA BK6-22-300):

  • Set arbeitsmenge_ht_kwh + arbeitspreis_ht_ct_per_kwh for Hochlast periods.
  • Set arbeitsmenge_nt_kwh + arbeitspreis_nt_ct_per_kwh for Niedertarif periods.
  • Leave arbeitsmenge_kwh / arbeitspreis_ct_per_kwh as the base fallback.

For Gas:

  • The arbeitsmenge_kwh should already be converted from m³ using brennwert × zustandszahl before being supplied here. (edmd’s MeterBillingPeriod.arbeitsmenge_kwh carries this converted value.)

Fields§

§malo_id: String

11-digit Marktlokations-ID.

§nb_mp_id: String

Invoice sender — Netzbetreiber or Gasnetzbetreiber MP-ID.

§lf_mp_id: String

Invoice recipient — Lieferant MP-ID.

§period: SettlementPeriod

The delivery period being settled.

§letztverbrauchergruppe: Letztverbrauchergruppe

Letztverbrauchergruppe for the network levies (EnFG §§21 ff.).

Determines which rate of the §19 StromNEV-, Offshore- and KWKG-Umlage applies at this Entnahmestelle.

§sect19_umlage_ct_per_kwh: Option<Decimal>

§19 StromNEV-Umlage in ct/kWh, overriding the tabled rate.

None uses the statutory rate for the delivery year and group. Set it where an EnFG decision grants a rate the published schedule does not express.

§offshore_umlage_ct_per_kwh: Option<Decimal>

Offshore-Netzumlage in ct/kWh, overriding the tabled rate.

§kwkg_umlage_ct_per_kwh: Option<Decimal>

KWKG-Umlage in ct/kWh, overriding the tabled rate.

§tariff_sheet_id: Option<String>

Optional tariff sheet identifier for audit tracing.

When set, each position’s trace.tariff_source references this sheet.

§sparte: Sparte

Commodity — drives legal references (StromNEV vs GasNEV) and SettlementType.

  • Sparte::Strom (default) → StromNEV §21 Arbeit, StromNEV §17 Leistung, SettlementType::NneStrom
  • Sparte::GasGasNEV §14, SettlementType::NneGas
§arbeitspreis: ArbeitspreisModell

§14a Modul 3 (BNetzA BK6-22-300 Anlage 2 §3) per-dispatch-interval positions.

Each entry represents one 15-min interval during which a spot-price-linked NNE rate applies. The caller fetches the EPEX Spot day-ahead price for each interval and applies the formula from PreisblattNetznutzung.lastvariablePreispositionen to derive nne_rate_ct_per_kwh. grid-billing receives pre-calculated rates — it never queries EPEX directly.

Empty (default) when §14a Modul 3 does not apply to this MaLo.

Cannot be combined with sect14a_modul1_reduction_factor — the validator returns InvalidInput when both are set.

Each interval generates one InvoicePosition with kind = NneArbeitModul3 and lastvariable_preisposition_json populated. §14a Modul 3 per-interval input data.

One value rather than twelve loose fields: the four shapes are mutually exclusive by construction.

§leistungspreis: Option<Leistungspreis>

RLM demand charge — peak demand and its rate, or neither.

§grundpreis: Option<Grundpreis>

Gas NNE Grundpreis. None for Strom, which has no separate Grundpreis.

§konzessionsabgabe: Option<Konzessionsabgabe>

Konzessionsabgabe — rate and customer group together, so the KAV §2 ceiling can always be checked.

§netzebene: Option<Netzebene>

The Netzebene this metering point takes supply from.

Netzentgelte are published per level, so the level is what makes a rate checkable against a price sheet. Recorded on the settlement and in the trace; it does not itself select a rate — this crate is given the rates.

§jahreshoechstleistung_kw: Option<Decimal>

Annual peak demand in kW, where the metering point has one.

Used with the annual energy to record the Benutzungsstundenzahl in the trace. This is the annual peak, which is not the same as the peak in the billing period — a monthly settlement carries the annual figure so the utilisation can be checked against the price sheet that priced it.

§jahresarbeit_kwh: Option<Decimal>

Annual energy in kWh, where known.

Pairs with jahreshoechstleistung_kw for the Benutzungsstundenzahl, and decides whether §17 Abs. 6 permits an Arbeitspreis-only tariff.

§sect19: Option<Sect19Vereinbarung>

An agreed §19 Abs. 2 StromNEV individual charge, where one exists.

Applied as a reduction over the Arbeits- and Leistungspreis positions, with the statutory Mindestentgelt floor checked against the utilisation data above. The Konzessionsabgabe and the network levies are unaffected — the Netzbetreiber’s lost revenue is compensated through the §19 StromNEV-Umlage, billed separately.

§gas_kapazitaet: Option<GasKapazitaet>

A booked gas capacity, billed alongside the commodity charge.

Gas only; §15 GasNEV. The annual rate is pro-rated over the settlement period by calendar days.

Trait Implementations§

Source§

impl Clone for NneInput

Source§

fn clone(&self) -> NneInput

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NneInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.