use crate::core::{error::DbResult, model::control_plane::ControlPlane};
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 ControlPlaneRepo: Send + Sync {
type Transaction;
async fn create(
&self,
tx: &mut Self::Transaction,
control_plane: &ControlPlane,
) -> DbResult<()>;
async fn fetch_by_id(
&self,
tx: &mut Self::Transaction,
control_plane_id: &str,
) -> DbResult<Option<ControlPlane>>;
}