use anyhow::Result;
use async_trait::async_trait;
use sepora_core::{Calendar, Diary, Todo};

#[async_trait]
pub trait Storage: Send + Sync {
    // Todos
    async fn list_todos(&self) -> Result<Vec<Todo>>;
    async fn create_todo(&self, todo: Todo) -> Result<()>;
    async fn update_todo(&self, todo: Todo) -> Result<()>;
    async fn delete_todo(&self, id: &str) -> Result<()>;

    // Diaries
    async fn list_diaries(&self) -> Result<Vec<Diary>>;
    async fn create_diary(&self, diary: Diary) -> Result<()>;
    async fn update_diary(&self, diary: Diary) -> Result<()>;
    async fn delete_diary(&self, id: &str) -> Result<()>;

    // Calendars
    async fn list_calendars(&self) -> Result<Vec<Calendar>>;
    async fn create_calendar(&self, cal: Calendar) -> Result<()>;
    async fn update_calendar(&self, cal: Calendar) -> Result<()>;
    async fn delete_calendar(&self, id: &str) -> Result<()>;
}
