//! `Detection`, `DetectionBatch` — per `data_model.md §2 Perception entities`.

use serde::{Deserialize, Serialize};

use super::frame::BoundingBox;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Detection {
    pub class_id: u32,
    pub class_name: String,
    pub confidence: f32,
    pub bbox_normalized: BoundingBox,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mask_or_polyline: Option<Vec<u8>>,
    pub source_frame_seq: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DetectionBatch {
    pub frame_seq: u64,
    pub detections: Vec<Detection>,
    pub latency_ms: u32,
    pub model_version: String,
}
