use super::identifiers::AccountId;
use super::market::MarketDataStatus;
use super::money::Money;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct PnlSnapshot {
pub account_id: AccountId,
pub realized_pnl: Money,
pub unrealized_pnl: Money,
pub total_pnl: Money,
#[serde(with = "time::serde::rfc3339")]
#[schemars(with = "String")]
pub period_start: OffsetDateTime,
#[serde(with = "time::serde::rfc3339")]
#[schemars(with = "String")]
pub period_end: OffsetDateTime,
#[serde(with = "time::serde::rfc3339")]
#[schemars(with = "String")]
pub timestamp: OffsetDateTime,
pub data_status: MarketDataStatus,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct PnlRealtimeRow {
pub key: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub symbol: Option<String>,
pub pnl: Money,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct PnlRealtime {
pub account_id: AccountId,
pub rows: Vec<PnlRealtimeRow>,
pub total_pnl: Money,
#[serde(with = "time::serde::rfc3339")]
#[schemars(with = "String")]
pub timestamp: OffsetDateTime,
pub data_status: MarketDataStatus,
}