using MimeKit; using Wino.Domain.Entities; using Wino.Domain.Models.MailItem; using Wino.Domain.Models.Synchronization; namespace Wino.Domain.Interfaces { /// /// Database change processor that handles common operations for all synchronizers. /// When a synchronizer detects a change, it should call the appropriate method in this class to reflect the change in the database. /// Different synchronizers might need additional implementations. /// , and /// None of the synchronizers can directly change anything in the database. /// public interface IDefaultChangeProcessor { Task UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string deltaSynchronizationIdentifier); Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId); Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId); Task ChangeMailReadStatusAsync(string mailCopyId, bool isRead); Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged); Task CreateMailAsync(Guid AccountId, NewMailItemPackage package); Task DeleteMailAsync(Guid accountId, string mailId); Task> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable downloadedMailCopyIds); Task SaveMimeFileAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId); Task DeleteFolderAsync(Guid accountId, string remoteFolderId); Task InsertFolderAsync(MailItemFolder folder); Task UpdateFolderAsync(MailItemFolder folder); /// /// Returns the list of folders that are available for account. /// /// Account id to get folders for. /// All folders. Task> GetLocalFoldersAsync(Guid accountId); Task> GetSynchronizationFoldersAsync(SynchronizationOptions options); Task MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId); Task UpdateFolderLastSyncDateAsync(Guid folderId); Task> GetExistingFoldersAsync(Guid accountId); } }