use crate::traits::{StoreError, StoreStats};
use noether_core::stage::{Stage, StageId, StageLifecycle};
#[async_trait::async_trait]
pub trait AsyncStageStore: Send + Sync {
async fn put(&self, stage: Stage) -> Result<StageId, StoreError>;
async fn upsert(&self, stage: Stage) -> Result<StageId, StoreError>;
async fn remove(&self, id: &StageId) -> Result<(), StoreError>;
async fn get(&self, id: &StageId) -> Result<Option<Stage>, StoreError>;
async fn contains(&self, id: &StageId) -> Result<bool, StoreError>;
async fn list(&self, lifecycle: Option<StageLifecycle>) -> Result<Vec<Stage>, StoreError>;
async fn update_lifecycle(
&self,
id: &StageId,
lifecycle: StageLifecycle,
) -> Result<(), StoreError>;
async fn stats(&self) -> Result<StoreStats, StoreError>;
}