use serde::{Deserialize, Serialize};

/// Traceability metadata for a simulation result.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulationMetadata {
    /// Version of the solver crate used.
    pub solver_version: String,
    /// Version of the fluid backend used.
    pub fluid_backend_version: String,
    /// SHA-256 hash of the input configuration uniquely identifying the system configuration.
    pub input_hash: String,
}

impl SimulationMetadata {
    /// Create a new SimulationMetadata with the given input hash.
    pub fn new(input_hash: String) -> Self {
        Self {
            solver_version: env!("CARGO_PKG_VERSION").to_string(),
            fluid_backend_version: "0.1.0".to_string(), // In a real system, we might query entropyk_fluids or coolprop
            input_hash,
        }
    }
}
