use async_trait::async_trait;

use std::fmt::Debug;

use crate::interpret::InterpretError;

use crate::{interpret::Outcome, topology::Topology};

/// Represents an entity responsible for collecting and organizing observability data
/// from various telemetry sources
/// A `Monitor` abstracts the logic required to scrape, aggregate, and structure
/// monitoring data, enabling consistent processing regardless of the underlying data source.
#[async_trait]
pub trait Monitor<T: Topology>: Debug + Send + Sync {
    async fn deploy_monitor(
        &self,
        topology: &T,
        alert_receivers: Vec<AlertReceiver>,
    ) -> Result<Outcome, InterpretError>;

    async fn delete_monitor(
        &self,
        topolgy: &T,
        alert_receivers: Vec<AlertReceiver>,
    ) -> Result<Outcome, InterpretError>;
}

pub struct AlertReceiver {
    pub receiver_id: String,
}
