use crate::model::trade::TradeExecution;
use pretty_simple_display::{DebugPretty, DisplaySimple};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
pub struct OrderResponse {
pub order: OrderInfoResponse,
pub trades: Vec<TradeExecution>,
}
#[derive(DebugPretty, DisplaySimple, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum LinkedOrderType {
OneTriggersOther,
OneCancelsOther,
OneTriggersOneCancelsOther,
}
#[skip_serializing_none]
#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
pub struct OrderInfoResponse {
pub amount: f64,
pub api: bool,
pub average_price: Option<f64>,
pub creation_timestamp: u64,
pub direction: String,
pub filled_amount: Option<f64>,
pub instrument_name: String,
pub is_liquidation: bool,
pub label: String,
pub last_update_timestamp: u64,
pub max_show: Option<f64>,
pub order_id: String,
pub order_state: String,
pub order_type: String,
pub original_order_type: Option<String>,
pub post_only: bool,
pub price: f64,
pub profit_loss: Option<f64>,
pub reduce_only: bool,
pub replaced: bool,
pub risk_reducing: bool,
pub time_in_force: String,
pub triggered: Option<bool>,
pub trigger: Option<String>,
pub usd: Option<f64>,
pub web: bool,
}