use crate::core::{error::DbResult, model::data_flow::DataFlow};
pub mod memory;
#[cfg(test)]
use crate::core::db::tx::MockTransaction;
#[async_trait::async_trait]
#[cfg_attr(test, mockall::automock(type Transaction = MockTransaction;))]
pub trait DataFlowRepo: Send + Sync {
type Transaction;
async fn create(&self, tx: &mut Self::Transaction, flow: &DataFlow) -> DbResult<()>;
async fn fetch_by_id(
&self,
tx: &mut Self::Transaction,
flow_id: &str,
) -> DbResult<Option<DataFlow>>;
async fn update(&self, tx: &mut Self::Transaction, flow: &DataFlow) -> DbResult<()>;
async fn delete(&self, tx: &mut Self::Transaction, flow_id: &str) -> DbResult<()>;
}