//! Trading Engine Basic Types - NO RE-EXPORTS
//!
//! This module contains only trading engine specific types.
//! All common types must be imported directly from common::types.

#![deny(
    clippy::unwrap_used,
    clippy::expect_used,
    clippy::panic,
    clippy::unimplemented,
    clippy::unreachable
)]

// Import error type from crate for backward compatibility
use crate::types::errors::FoxhuntError;

// ============================================================================
// TRADING ENGINE SPECIFIC TYPES ONLY
// ============================================================================

/// Bridge functions for existing code that expects TradingError static methods
/// These maintain backward compatibility while using the unified error system
#[derive(Debug)]
/// TradingError
/// 
/// Auto-generated documentation placeholder - enhance with specifics
pub struct TradingError;

impl TradingError {
    /// Create an invalid price error
    #[must_use]
    pub fn invalid_price(value: f64, message: &str) -> FoxhuntError {
        FoxhuntError::InvalidPrice {
            value: value.to_string(),
            reason: message.to_owned(),
            symbol: None,
        }
    }

    /// Create an invalid quantity error
    #[must_use]
    pub fn invalid_quantity(value: f64, message: &str) -> FoxhuntError {
        FoxhuntError::InvalidQuantity {
            value: value.to_string(),
            reason: message.to_owned(),
            symbol: None,
        }
    }

    /// Create a division by zero error
    #[must_use]
    pub fn division_by_zero(message: &str) -> FoxhuntError {
        FoxhuntError::DivisionByZero {
            operation: message.to_owned(),
            context: None,
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_compatibility_bridges() {
        // Test that compatibility bridges work
        let error = TradingError::invalid_price(0.0, "Price cannot be zero");
        match error {
            FoxhuntError::InvalidPrice { value, reason, .. } => {
                assert_eq!(value, "0");
                assert_eq!(reason, "Price cannot be zero");
            }
            _ => panic!("Wrong error type"),
        }
    }
}
