//! `Tier2Evidence` — per `data_model.md §2 Perception entities`.

use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum RecommendedNextAction {
    PanFollowFootpath,
    HoldEndpoint,
    PanBroad,
    ReturnToZoomOut,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Tier2Status {
    Ok,
    Timeout,
    Oversize,
    Error,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Tier2Evidence {
    pub roi_id: Uuid,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub path_freshness: Option<f32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub endpoint_score: Option<f32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub concealment_score: Option<f32>,
    pub recommended_next_action: RecommendedNextAction,
    pub source_detections: Vec<Uuid>,
    pub status: Tier2Status,
}
