// Auto-generated by automapper-generator. Do not edit.

#![allow(dead_code, unused_imports, non_camel_case_types)]

use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

/// kontakt.funktion_code for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AnsprechpartnerFunktionCode {
    /// Informationskontakt
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// kommunikationstyp for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kommunikationstyp {
    /// Elektronische Post
    #[serde(rename = "EM")]
    ElektronischePost,
    /// Telefax
    #[serde(rename = "FX")]
    Telefax,
    /// Telefon
    #[serde(rename = "TE")]
    Telefon,
    /// weiteres Telefon
    #[serde(rename = "AJ")]
    WeiteresTelefon,
    /// Handy
    #[serde(rename = "AL")]
    Handy,
}

/// lokationsQualifier for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LokationsQualifier {
    /// Meldepunkt
    #[serde(rename = "172")]
    Meldepunkt,
}

/// marktrolle for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Marktrolle {
    /// Dokumenten-/Nachrichtenaussteller bzw. -absender
    #[serde(rename = "MS")]
    DokumentenNachrichtenausstellerAbsender,
}

/// rollencodetyp for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Rollencodetyp {
    /// GS1
    #[serde(rename = "9")]
    Gs1,
    /// DE, BDEW (Bundesverband der Energie- und Wasserwirtschaft e.V.)
    #[serde(rename = "293")]
    DeBdewBundesverbandEnergieWasserwirtschaftEV,
}

/// dokumenttyp for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// Angebot
    #[serde(rename = "310")]
    Angebot,
    /// Abrechnung des Messstellenbetriebs vom MSB an den LF
    #[serde(rename = "Z29")]
    AbrechnungMessstellenbetriebsMsbLf,
    /// Übermittlung von Werten an ESA
    #[serde(rename = "Z57")]
    UebermittlungWertenEsa,
    /// Bestellung eines Angebots einer Konfiguration
    #[serde(rename = "Z74")]
    BestellungAngebotsKonfiguration,
    /// Bestellung eines Angebots Änderung der Technik der Lokation
    #[serde(rename = "Z93")]
    BestellungAngebotsAenderungTechnikLokation,
}

/// freitextQualifier for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum FreitextQualifier {
    /// Zusätzliche Informationen (für allgemeine Hinweise)
    #[serde(rename = "ACB")]
    ZusaetzlicheInformationenAllgemeineHinweise,
}

/// unsKennung for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UnsKennung {
    /// Trennung von Positions- und Summenteil
    #[serde(rename = "S")]
    TrennungPositionsSummenteil,
}

/// massEinheit for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MassEinheit {
    /// Stück
    #[serde(rename = "H87")]
    Stueck,
    /// Tag
    #[serde(rename = "DAY")]
    Tag,
}

/// preisQualifier for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PreisQualifier {
    /// Berechnungspreis
    #[serde(rename = "CAL")]
    Berechnungspreis,
}

/// preisSpezifikation for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PreisSpezifikation {
    /// Einrichtungspreis
    #[serde(rename = "Z01")]
    Einrichtungspreis,
    /// Transaktionspreis
    #[serde(rename = "Z02")]
    Transaktionspreis,
    /// Betriebspreis
    #[serde(rename = "Z03")]
    Betriebspreis,
}

/// qualifier for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Qualifier {
    /// Nummer der Anfrage
    #[serde(rename = "AAV")]
    NummerAnfrage,
}

/// obisIdentifikation.typ for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum VorgangTyp {
    /// Produkt
    #[serde(rename = "Z11")]
    Produkt,
}

/// handlungCode for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum HandlungCode {
    /// Erforderliches Messprodukt für Werte nach Typ 2 aus Backend
    #[serde(rename = "Z67")]
    ErforderlichesMessproduktWerteTyp2Backend,
}

/// waehrungCode for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungCode {
    /// Euro
    #[serde(rename = "EUR")]
    Euro,
}

/// waehrungQualifier for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungQualifier {
    /// Referenzwährung
    #[serde(rename = "2")]
    Referenzwaehrung,
}

/// waehrungTyp for PID 15003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungTyp {
    /// Währung der Rechnung
    #[serde(rename = "4")]
    WaehrungRechnung,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnsprechpartnerKontakt {
    /// Required (X). (an..3)
    pub funktion_code: Option<AnsprechpartnerFunktionCode>,
    /// Required (X). (an..256)
    pub name: Option<String>,
    /// Required (X). ()
    pub nummer: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VorgangObisIdentifikation {
    /// Required (X [74]). (an..35)
    pub id: Option<String>,
    /// Required (X). (an..3)
    pub typ: Option<VorgangTyp>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VorgangProduktIdentifikation {
    /// Required (X [74]). (an..35)
    pub id: Option<String>,
    /// Required (X). (an..3)
    pub typ: Option<VorgangTyp>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VorgangZusatzProduktIdentifikation {
    /// Required (X [74]). (an..35)
    pub id: Option<String>,
    /// Required (X). (an..3)
    pub typ: Option<VorgangTyp>,
}

/// Ansprechpartner for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Ansprechpartner {
    /// Required (X (([939] [72]) ⊻ ([940] [73])) ∧ [516]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<AnsprechpartnerKontakt>,
}

/// Marktteilnehmer for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X ([950] [501]) ⊻ ([951] [502]) ⊻ ([950] [507]) ⊻ ([960] [512])). (an..35)
    pub lokations_code: Option<String>,
    /// Required (X). (an..3)
    pub lokations_qualifier: Option<LokationsQualifier>,
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [39]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
}

/// Nachricht for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Required (unknown). ()
    pub beschreibungsformat: Option<String>,
    /// Optional. (an..70)
    pub dokumentennummer: Option<String>,
    /// Optional. (an..3)
    pub dokumenttyp: Option<Dokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
    /// Optional. (an..512)
    pub freitext1: Option<String>,
    /// Optional. (an..512)
    pub freitext2: Option<String>,
    /// Optional. (an..512)
    pub freitext3: Option<String>,
    /// Optional. (an..512)
    pub freitext4: Option<String>,
    /// Optional. (an..512)
    pub freitext5: Option<String>,
    /// Required (unknown). ()
    pub freitext_code: Option<String>,
    /// Required (unknown). ()
    pub freitext_funktion: Option<String>,
    /// Optional. (an..3)
    pub freitext_qualifier: Option<FreitextQualifier>,
    /// Required (unknown). ()
    pub produkt_leistung_code: Option<String>,
    /// Optional. (an..35)
    pub sperrdatum: Option<String>,
    /// Optional. (a1)
    pub uns_kennung: Option<UnsKennung>,
    /// Optional. (an..35)
    pub vertragsenddatum: Option<String>,
}

/// Preis for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Preis {
    /// Required (X [903]). (n..9)
    pub einzelpreisbasis_menge: Option<String>,
    /// Required (X [86] ⊻ [87]). (an..8)
    pub mass_einheit: Option<MassEinheit>,
    /// Required (X [912]). (n..15)
    pub preis_betrag: Option<String>,
    /// Required (X). (an..3)
    pub preis_qualifier: Option<PreisQualifier>,
    /// Required (X [83]). (an..3)
    pub preis_spezifikation: Option<PreisSpezifikation>,
    /// Required (Muss [2071]). ()
    pub preis_typ: Option<String>,
}

/// Referenz for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Referenz {
    /// Required (X). (an..3)
    pub qualifier: Option<Qualifier>,
    /// Required (X). (an..70)
    pub referenz: Option<String>,
}

/// Vorgang for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (X). (an..3)
    pub handlung_code: Option<HandlungCode>,
    pub obis_identifikation: Option<VorgangObisIdentifikation>,
    /// Required (X [903]). (an..6)
    pub positionsnummer: Option<String>,
    pub produkt_identifikation: Option<VorgangProduktIdentifikation>,
    pub zusatz_produkt_identifikation: Option<VorgangZusatzProduktIdentifikation>,
}

/// Waehrung for PID 15003 — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Waehrung {
    /// Required (X). (an..3)
    pub waehrung_code: Option<WaehrungCode>,
    /// Required (X). (an..3)
    pub waehrung_qualifier: Option<WaehrungQualifier>,
    /// Required (X). (an..3)
    pub waehrung_typ: Option<WaehrungTyp>,
}

/// PID 15003 transaction — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    /// Required (Muss [2071]).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub preis: Option<Vec<Preis>>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang: Option<Vec<Vorgang>>,
}

/// PID 15003 message-level — Angebot zur Anfrage von Werten.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    pub ansprechpartner: Option<Ansprechpartner>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub marktteilnehmer: Option<Vec<Marktteilnehmer>>,
    pub nachricht: Option<Nachricht>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub referenz: Option<Vec<Referenz>>,
    pub waehrung: Option<Waehrung>,
}

/// Complete interchange for PID 15003 — Angebot zur Anfrage von Werten.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
