use serde::{Deserialize, Serialize};

use crate::inspect::smp::services::{SmpServiceConsumerHypothesis, SmpServiceTraceBranchStatus};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpRegionServiceTraceEntry {
    pub name: String,
    #[serde(default)]
    pub profile_collection_count: Option<u32>,
    pub policy_leading_f32_0_text: String,
    pub policy_leading_f32_1_text: String,
    pub policy_leading_f32_2_text: String,
    #[serde(default)]
    pub policy_reserved_dword_hex_words: Vec<String>,
    pub policy_trailing_word_hex: String,
    #[serde(default)]
    pub branches: Vec<SmpServiceTraceBranchStatus>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpRegionServiceTraceReport {
    pub profile_family: String,
    #[serde(default)]
    pub region_collection_header_present: bool,
    #[serde(default)]
    pub region_record_triplet_count: usize,
    #[serde(default)]
    pub queued_notice_record_count: usize,
    #[serde(default)]
    pub atlas_candidate_consumers: Vec<String>,
    #[serde(default)]
    pub known_owner_bridge_fields: Vec<String>,
    #[serde(default)]
    pub known_bridge_helpers: Vec<String>,
    #[serde(default)]
    pub next_owner_questions: Vec<String>,
    #[serde(default)]
    pub candidate_consumer_hypotheses: Vec<SmpServiceConsumerHypothesis>,
    #[serde(default)]
    pub entries: Vec<SmpRegionServiceTraceEntry>,
    #[serde(default)]
    pub notes: Vec<String>,
}
