px_core/models/lineage.rs
1use serde::{Deserialize, Serialize};
2
3use super::{Event, Market, Series};
4
5/// A market plus its parent event and series.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
8pub struct MarketLineage {
9 /// The market itself.
10 pub market: Market,
11 /// Parent event; `null` if the market is standalone or the parent is missing upstream.
12 #[serde(default, skip_serializing_if = "Option::is_none")]
13 pub event: Option<Event>,
14 /// Parent series; `null` if the event is standalone or the parent is missing upstream.
15 #[serde(default, skip_serializing_if = "Option::is_none")]
16 pub series: Option<Series>,
17}