diff --git a/risk/src/compliance.rs b/risk/src/compliance.rs index 62a774395..8859db9f0 100644 --- a/risk/src/compliance.rs +++ b/risk/src/compliance.rs @@ -2010,6 +2010,7 @@ mod tests { order_type: Some(OrderType::Limit), portfolio_id: Some("test_portfolio".to_string()), strategy_id: Some("test_strategy".to_string()), + account_id: Some("test_account".to_string()), }) } diff --git a/risk/src/risk_types.rs b/risk/src/risk_types.rs index 01e5117da..8f7d4b361 100644 --- a/risk/src/risk_types.rs +++ b/risk/src/risk_types.rs @@ -183,6 +183,8 @@ pub struct OrderInfo { pub portfolio_id: Option, /// Trading strategy generating this order (if applicable) pub strategy_id: Option, + /// Account ID for per-account risk tracking (None falls back to "default" with warning) + pub account_id: Option, } /// Comprehensive Profit and Loss metrics for portfolio tracking diff --git a/tests/risk_validation_tests.rs b/tests/risk_validation_tests.rs index 8fe84d8a0..66454e6e5 100644 --- a/tests/risk_validation_tests.rs +++ b/tests/risk_validation_tests.rs @@ -49,6 +49,7 @@ fn create_test_order(symbol: &str, quantity: f64, price: f64) -> OrderInfo { order_type: Some(OrderType::Market), portfolio_id: Some(TEST_PORTFOLIO_ID.to_string()), strategy_id: None, + account_id: None, } } @@ -319,6 +320,7 @@ fn test_order_info_type_conversions() { order_type: Some(OrderType::Market), portfolio_id: Some(TEST_PORTFOLIO_ID.to_string()), strategy_id: None, + account_id: None, }; assert_eq!(order.quantity, quantity);