// 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 33001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AnsprechpartnerFunktionCode {
    /// Informationsstelle
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// kommunikationstyp for PID 33001
#[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 33001
#[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 einer Belastung.
    #[serde(rename = "457")]
    StornoBelastung,
    /// Storno für selbst ausgestellte Rechnung (Gutschrift im Gutschriftsverfahren)
    #[serde(rename = "Z25")]
    StornoSelbstAusgestellteRechnungGutschriftGutschriftsverfahren,
}

/// marktrolle for PID 33001
#[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 33001
#[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,
    /// DE, DVGW Service & Consult GmbH
    #[serde(rename = "332")]
    DeDvgwServiceConsultGmbh,
}

/// dokumenttyp for PID 33001
#[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 33001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// Bestätigung
    #[serde(rename = "33001")]
    Bestaetigung,
    /// Abweisung
    #[serde(rename = "33002")]
    Abweisung,
    /// Abweisung Kopf und Summe
    #[serde(rename = "33003")]
    AbweisungKopfSumme,
    /// Abweisung Position
    #[serde(rename = "33004")]
    AbweisungPosition,
}

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

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

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

/// waehrungsverwendung for PID 33001
#[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 AnsprechpartnerKontakt {
    /// Required (X). (an..3)
    pub funktion_code: Option<AnsprechpartnerFunktionCode>,
}

/// Ansprechpartner for PID 33001 — Bestätigung.
#[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 (X). ()
    pub name: Option<String>,
    /// Required (X). (an..35)
    pub telefonnummer: Option<String>,
}

/// Dokument for PID 33001 — Bestätigung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Dokument {
    /// Required (X [931]). (an..35)
    pub dokumentdatum: Option<String>,
    /// Required (X [515]). (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 33001 — Bestätigung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
    pub ansprechpartner: Option<Ansprechpartner>,
}

/// Nachricht for PID 33001 — Bestätigung.
#[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 33001 — Bestätigung.
#[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 33001 transaction — Bestätigung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub dokument: Option<Vec<Dokument>>,
}

/// PID 33001 message-level — Bestätigung.
#[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 33001 — Bestätigung.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
