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

#![allow(unused_imports)]

use serde::{Deserialize, Serialize};
use super::entities::*;

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pid19011MessageStammdaten {
    pub ansprechpartner: Option<Ansprechpartner>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub antwortkategorie: Option<Vec<Antwortkategorie>>,
    pub marktteilnehmer: Option<MarktteilnehmerWrapped>,
    pub nachricht: Option<Nachricht>,
    pub referenz: Option<Referenz>,
    pub waehrung: Option<Waehrung>,
}

/// PID 19011: Bestäti-gung der Ab-/Bestellung von Werten
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pid19011TransaktionStammdaten {
    /// Required (Muss). Fields: freitextZ27_1, freitextZ28_1, positionsnummer, textQualifierZ27, textQualifierZ28
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub position: Option<Vec<Position>>,
}

impl Pid19011TransaktionStammdaten {
    /// Required entity fields for PID 19011 (Bestäti-gung der Ab-/Bestellung von Werten).
    ///
    /// Each entry is `(entity_field, required_bo4e_fields)`.
    pub fn required_fields() -> &'static [(&'static str, &'static [&'static str])] {
        &[
            ("position", &["freitextZ27_1", "freitextZ28_1", "positionsnummer", "textQualifierZ27", "textQualifierZ28"]),
        ]
    }
}

pub type Pid19011Interchange = crate::model::Interchange<
    Pid19011MessageStammdaten,
    Pid19011TransaktionStammdaten,
>;

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pid19116MessageStammdaten {
    pub ansprechpartner: Option<Ansprechpartner>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub antwortkategorie: Option<Vec<Antwortkategorie>>,
    pub marktteilnehmer: Option<MarktteilnehmerWrapped>,
    pub nachricht: Option<Nachricht>,
    pub referenz: Option<Referenz>,
    pub waehrung: Option<Waehrung>,
}

/// PID 19116: Bestätigung Sperr-/Entsperr- auftrag
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pid19116TransaktionStammdaten {
    /// Required (Muss). Fields: freitext1, positionsnummer, textQualifier
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub position: Option<Vec<Position>>,
}

impl Pid19116TransaktionStammdaten {
    /// Required entity fields for PID 19116 (Bestätigung Sperr-/Entsperr- auftrag).
    ///
    /// Each entry is `(entity_field, required_bo4e_fields)`.
    pub fn required_fields() -> &'static [(&'static str, &'static [&'static str])] {
        &[
            ("position", &["freitext1", "positionsnummer", "textQualifier"]),
        ]
    }
}

pub type Pid19116Interchange = crate::model::Interchange<
    Pid19116MessageStammdaten,
    Pid19116TransaktionStammdaten,
>;

