using DigitalData.MessagingService.Abstraction;
using DigitalData.MessagingService.Application.Common.Models.MailSearch;
namespace DigitalData.MessagingService.Application.Common.Interfaces;
///
/// Service interface for reading emails via IMAP.
///
public interface IImapEmailService
{
///
/// Fetches emails from the specified mailbox folder.
///
/// Account whose IMAP settings will be used.
/// Filter to apply when fetching emails.
/// When (default), fetched messages are marked as \Seen on the server.
/// Set to for a non-destructive read (uses BODY.PEEK internally).
///
/// Cancellation token.
Task> FetchEmailsAsync(
EmailAccountDto account,
MailSearchFilter filter,
CancellationToken cancellationToken = default);
///
/// Marks a message as seen (read) on the server.
///
Task MarkAsSeenAsync(
EmailAccountDto account,
long uid,
string folder = "INBOX",
CancellationToken cancellationToken = default);
}