use serde::{Deserialize, Serialize};
use crate::documents::activation::{ControlZoneRef, ResourceObjectRef};
use crate::documents::planned_resource_schedule::Product;
use crate::types::{
AttrV, AttrVWithScheme, Direction, DocumentId, DocumentVersion, MarketParticipantId,
MarketRoleType, Period, TimeInterval, UtcDateTime,
};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum KostenblattDocType {
#[serde(rename = "Z05")]
Kostenblatt,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum KostenblattProcessType {
#[serde(rename = "A14")]
Forecast,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum CostBusinessType {
#[serde(rename = "A01")]
ProductionEnergy,
#[serde(rename = "A04")]
ConsumptionEnergy,
#[serde(rename = "Z01")]
StartupCosts,
#[serde(rename = "Z02")]
ExtraOperatingHourCosts,
#[serde(rename = "Z03")]
AvoidedNetworkFees,
#[serde(rename = "Z06")]
AdditionalWrdvCosts,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CostTimeSeries {
#[serde(rename = "TimeSeriesIdentification")]
pub time_series_identification: AttrV<DocumentId>,
#[serde(rename = "BusinessType")]
pub business_type: AttrV<CostBusinessType>,
#[serde(rename = "Direction", default, skip_serializing_if = "Option::is_none")]
pub direction: Option<AttrV<Direction>>,
#[serde(rename = "Product")]
pub product: AttrV<Product>,
#[serde(
rename = "ConnectingArea",
default,
skip_serializing_if = "Option::is_none"
)]
pub connecting_area: Option<ControlZoneRef>,
#[serde(
rename = "ResourceObject",
default,
skip_serializing_if = "Option::is_none"
)]
pub resource_object: Option<ResourceObjectRef>,
#[serde(rename = "Period")]
pub period: Period,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename = "Kostenblatt")]
pub struct Kostenblatt {
#[serde(rename = "DocumentIdentification")]
pub document_identification: AttrV<DocumentId>,
#[serde(rename = "DocumentVersion")]
pub document_version: AttrV<DocumentVersion>,
#[serde(rename = "DocumentType")]
pub document_type: AttrV<KostenblattDocType>,
#[serde(rename = "ProcessType")]
pub process_type: AttrV<KostenblattProcessType>,
#[serde(rename = "SenderIdentification")]
pub sender_identification: AttrVWithScheme<MarketParticipantId>,
#[serde(rename = "SenderRole")]
pub sender_role: AttrV<MarketRoleType>,
#[serde(rename = "ReceiverIdentification")]
pub receiver_identification: AttrVWithScheme<MarketParticipantId>,
#[serde(rename = "ReceiverRole")]
pub receiver_role: AttrV<MarketRoleType>,
#[serde(rename = "DocumentDateTime")]
pub document_date_time: AttrV<UtcDateTime>,
#[serde(rename = "TimePeriodCovered")]
pub time_period_covered: AttrV<TimeInterval>,
#[serde(rename = "CostTimeSeries", default)]
pub time_series: Vec<CostTimeSeries>,
}