use crate::backlog::{BacklogItem, ItemId};
use crate::error::Result;
use crate::sprint::{Sprint, SprintId};
use std::future::Future;
use std::path::PathBuf;
pub trait BacklogItemRepository {
fn save(&self, item: &BacklogItem) -> impl Future<Output = Result<()>>;
fn load(&self, id: &ItemId) -> impl Future<Output = Result<BacklogItem>>;
fn list(&self) -> impl Future<Output = Result<Vec<BacklogItem>>>;
fn delete(&self, id: &ItemId) -> impl Future<Output = Result<()>>;
fn archive(&self, id: &ItemId) -> impl Future<Output = Result<PathBuf>>;
fn next_id(&self, prefix: &str) -> impl Future<Output = Result<ItemId>>;
}
pub trait SprintRepository {
fn save(&self, sprint: &Sprint) -> impl Future<Output = Result<()>>;
fn load(&self, id: &SprintId) -> impl Future<Output = Result<Sprint>>;
fn list(&self) -> impl Future<Output = Result<Vec<Sprint>>>;
fn delete(&self, id: &SprintId) -> impl Future<Output = Result<()>>;
}