use super::{DateTime, NewSavedView, Result, SavedView, SavedViewId, UserId, Utc, async_trait}; /// Repository for saved view / filter configurations. #[async_trait] pub trait SavedViewRepository: Send + Sync { /// Lists all saved views for a user. async fn list_all(&self, user_id: UserId) -> Result>; /// Lists pinned views for sidebar display. async fn list_pinned(&self, user_id: UserId) -> Result>; /// Gets a saved view by ID. async fn get_by_id(&self, id: SavedViewId, user_id: UserId) -> Result>; /// Creates a new saved view. async fn create(&self, user_id: UserId, view: NewSavedView) -> Result; /// Updates an existing saved view. async fn update( &self, id: SavedViewId, user_id: UserId, view: NewSavedView, ) -> Result>; /// Deletes a saved view. async fn delete(&self, id: SavedViewId, user_id: UserId) -> Result; /// Toggles the pinned status of a view. async fn toggle_pinned(&self, id: SavedViewId, user_id: UserId) -> Result>; /// Updates the position of a view in the sidebar. async fn update_position( &self, id: SavedViewId, user_id: UserId, position: i32, ) -> Result>; } /// Repository for backup settings management. #[async_trait] pub trait BackupSettingsRepository: Send + Sync { /// Gets the backup settings for a user. async fn get(&self, user_id: UserId) -> Result>; /// Creates or updates backup settings. async fn upsert( &self, user_id: UserId, settings: crate::models::NewBackupSettings, ) -> Result; /// Updates the last backup timestamp. async fn update_last_backup_at(&self, user_id: UserId, timestamp: DateTime) -> Result<()>; }