use super::{Result, SyncAccountId, User, UserId, async_trait}; /// Repository for user account operations. #[async_trait] pub trait UserRepository: Send + Sync { /// Creates a new user account with hashed password. async fn create(&self, email: &str, password: &str, display_name: &str) -> Result; /// Finds a user by email address. async fn find_by_email(&self, email: &str) -> Result>; /// Authenticates a user, returning the user if credentials are valid. async fn authenticate(&self, email: &str, password: &str) -> Result>; /// Updates the user's last login timestamp. async fn update_last_login(&self, user_id: UserId) -> Result<()>; } /// Repository for sync account CRUD operations. #[async_trait] pub trait SyncAccountRepository: Send + Sync { /// Lists all sync accounts for a user. async fn list_all(&self, user_id: UserId) -> Result>; /// Retrieves a sync account by ID. async fn get_by_id( &self, id: SyncAccountId, user_id: UserId, ) -> Result>; /// Creates a new sync account. async fn create( &self, user_id: UserId, provider: &str, account_name: &str, email: Option<&str>, ) -> Result; /// Updates a sync account. async fn update( &self, id: SyncAccountId, user_id: UserId, account_name: &str, sync_calendars: bool, sync_contacts: bool, enabled: bool, ) -> Result>; /// Deletes a sync account. async fn delete(&self, id: SyncAccountId, user_id: UserId) -> Result; }