// 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;

/// ebdReferenz for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdReferenz {
    /// EBD Nr. E_0210
    #[serde(rename = "E_0210")]
    EbdNrE0210,
    /// EBD Nr. E_0259
    #[serde(rename = "E_0259")]
    EbdNrE0259,
    /// EBD Nr. E_0264
    #[serde(rename = "E_0264")]
    EbdNrE0264,
    /// EBD Nr. E_0266
    #[serde(rename = "E_0266")]
    EbdNrE0266,
    /// EBD Nr. E_0406
    #[serde(rename = "E_0406")]
    EbdNrE0406,
    /// EBD Nr. E_0270
    #[serde(rename = "E_0270")]
    EbdNrE0270,
    /// EBD Nr. E_0273
    #[serde(rename = "E_0273")]
    EbdNrE0273,
    /// EBD Nr. E_0276
    #[serde(rename = "E_0276")]
    EbdNrE0276,
    /// EBD Nr. E_0277
    #[serde(rename = "E_0277")]
    EbdNrE0277,
    /// EBD Nr. E_0407
    #[serde(rename = "E_0407")]
    EbdNrE0407,
    /// EBD Nr. E_0515
    #[serde(rename = "E_0515")]
    EbdNrE0515,
    /// EBD Nr. E_0517
    #[serde(rename = "E_0517")]
    EbdNrE0517,
    /// EBD Nr. E_0519
    #[serde(rename = "E_0519")]
    EbdNrE0519,
    /// EBD Nr. E_0521
    #[serde(rename = "E_0521")]
    EbdNrE0521,
    /// EBD Nr. E_0566
    #[serde(rename = "E_0566")]
    EbdNrE0566,
    /// EBD Nr. E_0568
    #[serde(rename = "E_0568")]
    EbdNrE0568,
}

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

/// kommunikationstyp for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kommunikationstyp {
    /// E-Mail
    #[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,
}

/// dokumenttyp for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DokumentDokumenttyp {
    /// Handelsrechnung
    #[serde(rename = "380")]
    Handelsrechnung,
    /// Selbst ausgestellte Rechnung (engl.: "Self-billed invoice")
    #[serde(rename = "389")]
    SelbstAusgestellteRechnungEnglSelfBilledInvoice,
    /// Storno für Belastung
    #[serde(rename = "457")]
    StornoBelastung,
    /// Storno für selbst ausgestellte Rechnung (Gutschrift im Gutschriftsverfahren)
    #[serde(rename = "Z25")]
    StornoSelbstAusgestellteRechnungGutschriftGutschriftsverfahren,
}

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

/// rollencodetyp for PID 33003
#[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 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum NachrichtDokumenttyp {
    /// Abgelehnte Forderung (Nicht-Zahlungsavis)
    #[serde(rename = "239")]
    AbgelehnteForderungNichtZahlungsavis,
    /// Zahlungsavis
    #[serde(rename = "481")]
    Zahlungsavis,
}

/// pruefidentifikator for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// Prüfidentifikator
    #[serde(rename = "33001")]
    Bestaetigung,
    /// Prüfidentifikator
    #[serde(rename = "33002")]
    Abweisung,
    /// Prüfidentifikator
    #[serde(rename = "33003")]
    AbweisungKopfSumme,
    /// Prüfidentifikator
    #[serde(rename = "33004")]
    AbweisungPosition,
}

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

/// waehrungCode for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungCode {
    /// ISO 4217 3-Alpha Code
    #[serde(rename = "EUR")]
    Euro,
}

/// waehrungQualifier for PID 33003
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungQualifier {
    /// Zahlungswährung
    #[serde(rename = "11")]
    Zahlungswaehrung,
}

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

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AbweichungReferenz {
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub typ: Option<String>,
}

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

/// Abweichung for PID 33003 — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Abweichung {
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub abweichungsreferenz: Option<String>,
    /// Required (X). (an..6)
    pub ebd_referenz: Option<EbdReferenz>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub freitext1: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub freitext2: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub freitext3: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub freitext4: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub freitext5: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub hinweisfreitext1: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub hinweisfreitext2: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub hinweisfreitext3: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub hinweisfreitext4: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub hinweisfreitext5: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub korrekturfreitext1: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub korrekturfreitext2: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub korrekturfreitext3: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub korrekturfreitext4: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub korrekturfreitext5: Option<String>,
    /// Required (X ([14] ⊻ [16]) ∧ ([11] ⊻ [12] ⊻ [47] ⊻ [48] ⊻ [75] ⊻ [76] ⊻ [77] ⊻ [78] ⊻ [79] ⊻ [80] ⊻ [91] ⊻ [92 ]⊻ [105] ⊻ [106] ⊻ [107] ⊻ [108])). (an..3)
    pub pruefschritt_code: Option<String>,
    pub referenz: Option<AbweichungReferenz>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_funktion_abo: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_funktion_z14: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_funktion_z16: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_qualifier_abo: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_qualifier_z14: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_qualifier_z16: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_referenz_abo: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_referenz_z14: Option<String>,
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]). ()
    pub text_referenz_z16: Option<String>,
}

/// Ansprechpartner for PID 33003 — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Ansprechpartner {
    /// Required (X (([939][89]) ∨ ([940][90])) ∧ [549]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<AnsprechpartnerKontakt>,
    /// Required (Kann [503]). ()
    pub name: Option<String>,
    /// Required (X). (an..35)
    pub telefonnummer: Option<String>,
}

/// Dokument for PID 33003 — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Dokument {
    /// Required (X [512]). (an..70)
    pub abrechnungsreferenz: Option<String>,
    /// Required (X [931]). (an..35)
    pub dokumentdatum: Option<String>,
    /// Required (X [511]). (an..35)
    pub dokumentennummer: Option<String>,
    /// Required (X). (an..3)
    pub dokumenttyp: Option<DokumentDokumenttyp>,
    /// Required (X [930] [501]). (n..35)
    pub faelliger_betrag: Option<String>,
    /// Required (X [930] [501]). (n..35)
    pub ueberweisungsbetrag: Option<String>,
}

/// Marktteilnehmer for PID 33003 — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [45]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
    pub ansprechpartner: Option<Ansprechpartner>,
}

/// Nachricht for PID 33003 — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Optional. (an..35)
    pub dokumentennummer: Option<String>,
    /// Optional. (an..3)
    pub dokumenttyp: Option<NachrichtDokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
    /// Optional. (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Optional. (n..35)
    pub ueberweisungsbetrag: Option<String>,
    /// Optional. (a1)
    pub uns_kennung: Option<UnsKennung>,
}

/// Waehrung for PID 33003 — Strom Abweisung Kopf und Summe.
#[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 waehrungsverwendung: Option<Waehrungsverwendung>,
}

/// PID 33003 transaction — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    /// Required (Muss [517] ⊻ [518] ⊻ [519] ⊻ [520] ⊻ [521] ⊻ [535] ⊻ [537]).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub abweichung: Option<Vec<Abweichung>>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub dokument: Option<Vec<Dokument>>,
}

/// PID 33003 message-level — Strom Abweisung Kopf und Summe.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub marktteilnehmer: Option<Vec<Marktteilnehmer>>,
    pub nachricht: Option<Nachricht>,
    pub waehrung: Option<Waehrung>,
}

/// Complete interchange for PID 33003 — Strom Abweisung Kopf und Summe.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
