use std::{collections::HashMap, sync::Mutex};
use crate::config::Config;
use super::{QuerentError, Workflow, WorkflowManager};
pub struct Querent {
manager: WorkflowManager,
}
impl Querent {
pub fn new() -> Result<Self, String> {
let manager = WorkflowManager::new()?;
Ok(Self { manager })
}
pub fn add_workflow(&self, workflow: Workflow) -> Result<(), String> {
self.manager.add_workflow(workflow)?;
Ok(())
}
pub async fn start_workflows(&self) -> Result<(), QuerentError> {
self.manager.start_workflows().await?;
Ok(())
}
pub fn get_workflows(&self) -> Vec<Workflow> {
self.manager.get_workflows()
}
}