use revolt_result::Result;
use crate::Account;
#[cfg(feature = "mongodb")]
mod mongodb;
mod reference;
#[async_trait]
pub trait AbstractAccounts: Sync + Send {
async fn fetch_account(&self, id: &str) -> Result<Account>;
async fn fetch_account_by_normalised_email(
&self,
normalised_email: &str,
) -> Result<Option<Account>>;
async fn fetch_account_with_email_verification(&self, token: &str) -> Result<Account>;
async fn fetch_account_with_password_reset(&self, token: &str) -> Result<Account>;
async fn fetch_account_with_deletion_token(&self, token: &str) -> Result<Account>;
async fn fetch_accounts_due_for_deletion(&self) -> Result<Vec<Account>>;
async fn save_account(&self, account: &Account) -> Result<()>;
}