namespace GerbilManagerWebAPI.Inbox { /// Connection params for an IMAP fetch (decrypted password — never persisted/logged). public sealed record MailConnection(string GmailAddress, string AppPassword, string Folder); /// A fetched email reduced to what the Request entity needs. public sealed record MailSummary( string MessageId, string? ThreadId, string? InReplyTo, string? References, string FromAddress, string? FromName, string? Subject, string? BodyText, DateTimeOffset ReceivedAt, uint Uid); /// Reads mail from a folder. Abstracted so tests feed canned summaries /// (the live MailKit/Gmail path is gated on Julian's App Password). public interface IGmailMailReader { /// Fetch messages with UID > from the configured folder. Task> FetchAsync(MailConnection connection, uint sinceUid, CancellationToken ct = default); } /// Outcome of a sync run. public sealed record SyncResult(int Imported, string? Error); }