use crate::domain::{HardwareReport, PublishConfig, PublishError};
use async_trait::async_trait;
use std::path::Path;
#[async_trait]
pub trait DataPublisher: Send + Sync {
async fn publish(
&self,
report: &HardwareReport,
config: &PublishConfig,
) -> Result<(), PublishError>;
async fn test_connectivity(&self, config: &PublishConfig) -> Result<bool, PublishError>;
}
#[async_trait]
pub trait FileRepository: Send + Sync {
async fn save_json(&self, report: &HardwareReport, path: &Path) -> Result<(), PublishError>;
async fn save_toml(&self, report: &HardwareReport, path: &Path) -> Result<(), PublishError>;
async fn load_json(&self, path: &Path) -> Result<HardwareReport, PublishError>;
async fn load_toml(&self, path: &Path) -> Result<HardwareReport, PublishError>;
async fn file_exists(&self, path: &Path) -> Result<bool, PublishError>;
}