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

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

/// rollencodetyp for PID 21029
#[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 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// WiM Meldung(en)
    #[serde(rename = "Z09")]
    WimMeldungEn,
}

/// aveQualifier for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AveQualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt,
    /// Preisschlüsselstamm
    #[serde(rename = "Z17")]
    Preisschluesselstamm,
    /// Referenz auf die Artikel-ID
    #[serde(rename = "Z45")]
    ReferenzArtikelId,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt2,
}

/// ebdNummer for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdNummer {
    /// EBD Nr. E_0233
    #[serde(rename = "E_0233")]
    EbdNrE0233,
}

/// pruefidentifikator for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// WiM / Vorabinformation
    #[serde(rename = "21029")]
    WimVorabinformation,
}

/// referenz for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Referenz {
    /// WiM / Vorabinformation
    #[serde(rename = "21029")]
    WimVorabinformation,
}

/// statusCode for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusCode {
    /// geplant
    #[serde(rename = "Z17")]
    Geplant,
}

/// statusKategorie for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusKategorie {
    /// Ersteinbau iMS
    #[serde(rename = "Z19")]
    ErsteinbauIms,
    /// Ersteinbau mME
    #[serde(rename = "Z24")]
    ErsteinbauMme,
}

/// z17Qualifier for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Z17Qualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt,
    /// Preisschlüsselstamm
    #[serde(rename = "Z17")]
    Preisschluesselstamm,
    /// Referenz auf die Artikel-ID
    #[serde(rename = "Z45")]
    ReferenzArtikelId,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt2,
}

/// z45Qualifier for PID 21029
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Z45Qualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt,
    /// Preisschlüsselstamm
    #[serde(rename = "Z17")]
    Preisschluesselstamm,
    /// Referenz auf die Artikel-ID
    #[serde(rename = "Z45")]
    ReferenzArtikelId,
    /// Meldepunkt
    #[serde(rename = "AVE")]
    Meldepunkt2,
}

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

/// Marktteilnehmer for PID 21029 — Vorabinfor-mation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [27]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
}

/// Nachricht for PID 21029 — Vorabinfor-mation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Required (X). (an..70)
    pub dokumentennummer: Option<String>,
    /// Required (X). (an..3)
    pub dokumenttyp: Option<Dokumenttyp>,
    /// Required (X [931] [494]). (an..35)
    pub erstellungsdatum: Option<String>,
}

/// Status for PID 21029 — Vorabinfor-mation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Status {
    /// Required (X). (an..3)
    pub ave_qualifier: Option<AveQualifier>,
    /// Optional. (an..17)
    pub ebd_nummer: Option<EbdNummer>,
    /// Required (X [496]). (an..35)
    pub entsperrtermin: Option<String>,
    /// Required (X [496]). (an..35)
    pub geplantes_lieferdatum: Option<String>,
    /// Required (X). (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Optional. (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (X). (an..70)
    pub referenz: Option<Referenz>,
    /// Required (X [496]). (an..35)
    pub sperrtermin: Option<String>,
    /// Required (X). (an..3)
    pub status_code: Option<StatusCode>,
    /// Required (X). (an..3)
    pub status_kategorie: Option<StatusKategorie>,
    /// Required (X). (an..3)
    pub z17_qualifier: Option<Z17Qualifier>,
    /// Required (X). (an..3)
    pub z45_qualifier: Option<Z45Qualifier>,
}

/// Vorgang for PID 21029 — Vorabinfor-mation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (X). (an..3)
    pub loc_qualifier: Option<LocQualifier>,
    /// Required (X [951] [505]). (an..35)
    pub meldepunkt_id: Option<String>,
    /// Required (X [911]). (n..5)
    pub vorgangsnummer: Option<String>,
}

/// PID 21029 transaction — Vorabinfor-mation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    /// Required (Muss [19]).
    pub status: Option<Status>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang: Option<Vec<Vorgang>>,
}

/// PID 21029 message-level — Vorabinfor-mation.
#[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>,
}

/// Complete interchange for PID 21029 — Vorabinfor-mation.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
