#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum RedispatchXmlError {
#[error("XML error: {0}")]
Xml(#[from] quick_xml::Error),
#[error("deserialization error: {0}")]
Deserialize(#[from] quick_xml::de::DeError),
#[error("serialization error: {0}")]
Serialize(String),
#[error("invalid document id {0:?}: must be 1–35 characters")]
InvalidDocumentId(String),
#[error("invalid document version {0}: must be 1–999")]
InvalidDocumentVersion(u32),
#[error("invalid UTC timestamp {0:?}: must match yyyy-mm-ddThh:mm:ssZ")]
InvalidTimestamp(String),
#[error("invalid market participant id {0:?}: must be exactly 13 decimal digits")]
InvalidMarketParticipantId(String),
#[error("invalid time interval {0:?}: must be yyyy-mm-ddThh:mmZ/yyyy-mm-ddThh:mmZ")]
InvalidTimeInterval(String),
#[error("unknown document root element {0:?}: not a supported Redispatch 2.0 document")]
UnknownDocumentType(String),
#[error("namespace mismatch: expected {expected}, found {found}")]
NamespaceMismatch {
expected: &'static str,
found: String,
},
#[error("structural validation: {0}")]
StructuralError(String),
}