use rrt_fixtures::JsonDiffEntry;
use rrt_runtime::inspect::smp::save_load::{SmpLoadedSaveSlice, SmpSaveLoadSummary};
use rrt_runtime::summary::RuntimeSummary;
use serde::Serialize;
use serde_json::Value;

#[derive(Debug, Serialize)]
pub(crate) struct FinanceDiffEntry {
    pub(crate) path: String,
    pub(crate) left: Value,
    pub(crate) right: Value,
}

#[derive(Debug, Serialize)]
pub(crate) struct FinanceDiffReport {
    pub(crate) matches: bool,
    pub(crate) difference_count: usize,
    pub(crate) differences: Vec<FinanceDiffEntry>,
}

#[derive(Debug, Serialize)]
pub(crate) struct RuntimeFixtureSummaryReport {
    pub(crate) fixture_id: String,
    pub(crate) command_count: usize,
    pub(crate) final_summary: RuntimeSummary,
    pub(crate) expected_summary_matches: bool,
    pub(crate) expected_summary_mismatches: Vec<String>,
    pub(crate) expected_state_fragment_matches: bool,
    pub(crate) expected_state_fragment_mismatches: Vec<String>,
}

#[derive(Debug, Serialize)]
pub(crate) struct RuntimeStateSummaryReport {
    pub(crate) snapshot_id: String,
    pub(crate) summary: RuntimeSummary,
}

#[derive(Debug, Serialize)]
pub(crate) struct RuntimeStateDiffReport {
    pub(crate) matches: bool,
    pub(crate) difference_count: usize,
    pub(crate) differences: Vec<JsonDiffEntry>,
}

#[derive(Debug, Serialize)]

pub(crate) struct RuntimeSaveLoadSummaryOutput {
    pub(crate) path: String,
    pub(crate) summary: SmpSaveLoadSummary,
}

#[derive(Debug, Serialize)]
pub(crate) struct RuntimeLoadedSaveSliceOutput {
    pub(crate) path: String,
    pub(crate) save_slice: SmpLoadedSaveSlice,
}

#[derive(Debug, Serialize)]

pub(crate) struct RuntimeSaveSliceExportOutput {
    pub(crate) path: String,
    pub(crate) output_path: String,
    pub(crate) save_slice_id: String,
}

#[derive(Debug, Serialize)]
pub(crate) struct RuntimeOverlayImportExportOutput {
    pub(crate) output_path: String,
    pub(crate) import_id: String,
    pub(crate) base_snapshot_path: String,
    pub(crate) save_slice_path: String,
}
