// Copyright (C) 2025  The Software Heritage developers
// See the AUTHORS file at the top-level directory of this distribution
// License: GNU General Public License version 3, or any later version
// See top-level LICENSE file for more information

use std::collections::HashMap;

use crate::EventType;
use serde::Deserialize;
use swh_graph::graph::NodeId;

#[derive(Deserialize, Debug)]
pub struct ReferenceMetric {
    pub range: Range,
    pub metadata: Metadata,
}

#[derive(Deserialize, Debug)]
pub struct Range {
    pub events: HashMap<NodeId, EventType>,
    pub vulnerability_id: String,
    pub repo_url: Vec<String>,
    pub severity: String,
}

#[derive(Deserialize, Debug)]
pub struct Metadata {
    pub old_vulnerable_revision_number: NodeId,
    pub new_vulnerable_revision: Vec<NodeId>,
}
