using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Domain.Entities;
namespace Wino.Domain.Interfaces
{
public interface IAccountService
{
///
/// Current IAuthenticator that should receive external authentication process to continue with.
/// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
/// to continue process for token exchange.
///
IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
///
/// Returns all local accounts.
///
/// All local accounts
Task> GetAccountsAsync();
///
/// Returns single MailAccount
///
/// AccountId.
Task GetAccountAsync(Guid accountId);
///
/// Deletes all information about the account, including token information.
///
/// MailAccount to be removed
Task DeleteAccountAsync(MailAccount account);
///
/// Returns the custom server information for the given account id.
///
Task GetAccountCustomServerInformationAsync(Guid accountId);
///
/// Updates the given account properties.
///
Task UpdateAccountAsync(MailAccount account);
///
/// Creates new account with the given server information if any.
/// Also sets the account as Startup account if there are no accounts.
///
Task CreateAccountAsync(MailAccount account, TokenInformation tokenInformation, CustomServerInformation customServerInformation);
///
/// Fixed authentication errors for account by forcing interactive login.
///
Task FixTokenIssuesAsync(Guid accountId);
///
/// Removed the attention from an account.
///
/// Account id to remove from
Task ClearAccountAttentionAsync(Guid accountId);
///
/// Updates the account synchronization identifier.
/// For example: Gmail uses this identifier to keep track of the last synchronization.
/// Update is ignored for Gmail if the new identifier is older than the current one.
///
/// Identifier to update
/// Current account synchronization modifier.
Task UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
///
/// Renames the merged inbox with the given id.
///
/// Merged Inbox id
/// New name for the merged/linked inbox.
Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
///
/// Creates a new merged inbox with the given accounts.
///
/// Merged inbox properties.
/// List of accounts to merge together.
Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable accountsToMerge);
///
/// Updates the merged inbox with the given id with the new linked accounts.
///
/// Updating merged inbox id.
/// List of linked account ids.
Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable linkedAccountIds);
///
/// Destroys the merged inbox with the given id.
///
/// Merged inbox id to destroy.
Task UnlinkMergedInboxAsync(Guid mergedInboxId);
///
/// Updates the account listing orders.
///
/// AccountId-OrderNumber pair for all accounts.
Task UpdateAccountOrdersAsync(Dictionary accountIdOrderPair);
}
}