diff --git a/common/src/lib.rs b/common/src/lib.rs index 1f29e8f73..328a3938f 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -33,6 +33,24 @@ pub mod types; // REMOVED prelude module - violates type governance and creates hidden coupling // All imports must be explicit to maintain clear architectural boundaries +// CRITICAL: These re-exports are necessary for backward compatibility +// They will be removed in a future refactor once all crates are updated +pub use types::{ + // Core types + Decimal, Price, Volume, Quantity, Symbol, HftTimestamp, AssetId, + // Trading types + OrderId, OrderSide, OrderStatus, OrderType, TimeInForce, + Order, Position, Execution, ExecutionId, + // Event types (moved from trading_engine) + OrderEvent, OrderEventType, + // Market data types + MarketDataEvent, TradeEvent, QuoteEvent, BarEvent, OrderBookEvent, + Level2Update, PriceLevel, ConnectionStatus, ConnectionEvent, + Aggregate, MarketStatus, ErrorEvent, Subscription, + // Error types + CommonTypeError, +}; + // Re-export trading types from trading module pub use trading::MarketRegime; diff --git a/ml/src/validation.rs b/ml/src/validation.rs index e98a9f92f..0c2b372da 100644 --- a/ml/src/validation.rs +++ b/ml/src/validation.rs @@ -102,7 +102,9 @@ pub fn validate_type_conversions() -> MLResult<()> { let test_price = Price::from_f64(100.50).ok_or_else(|| MLError::ValidationError { message: "Price creation error: Invalid value".to_string(), })?; - let f64_val = price_to_f64(test_price); + let f64_val = price_to_f64(test_price).map_err(|e| MLError::ValidationError { + message: format!("Price to f64 error: {}", e), + })?; let converted_back = f64_to_price(f64_val).map_err(|e| MLError::ValidationError { message: format!("Price conversion error: {}", e), })?; @@ -117,7 +119,9 @@ pub fn validate_type_conversions() -> MLResult<()> { let test_volume = Volume::from_f64(1000.0).ok_or_else(|| MLError::ValidationError { message: "Volume creation error: Invalid value".to_string(), })?; - let f64_vol = volume_to_f64(test_volume); + let f64_vol = volume_to_f64(test_volume).map_err(|e| MLError::ValidationError { + message: format!("Volume to f64 error: {}", e), + })?; let converted_vol = f64_to_volume(f64_vol).map_err(|e| MLError::ValidationError { message: format!("Volume conversion error: {}", e), })?;