Repository Interfaces (Clean Architecture - Application Layer): - IRepository<T>: Base repository interface with common CRUD operations - IEmailAccountRepository: Email account operations (GetActive, GetByName, GetWithProfiles) - IEmailProfileRepository: Profile operations (GetActive, GetDueForPolling, GetWithRelated) - IEmailProcessRepository: Process operations (GetWithSteps, GetByType) - IEmailHistoryRepository: History operations (pagination, duplicate detection, date range queries) - IEmailOutboxRepository: Outbox operations (GetPending, GetForRetry, MarkAsSent/Failed) - IUnitOfWork: Transaction management and repository aggregation Service Interfaces (Abstraction for Infrastructure): - IEmailService: IMAP/SMTP operations with OAuth2 support (MailKit wrapper) - IPdfProcessingService: PDF validation, embedded file extraction, ZUGFeRD support - IDmsService: windream DMS integration (archive, search, update index fields) - IEncryptionService: Data protection for passwords and OAuth tokens - IEmailQueue: Async email queue (in-memory Channel, future: RabbitMQ) Dependencies: - Added MimeKit 4.17.0 for email service interface definitions All interfaces follow Clean Architecture principles: - Interfaces in Application layer - Implementations will be in Infrastructure layer
28 lines
875 B
C#
28 lines
875 B
C#
using DigitalData.EmailProfiler.Domain.Entities;
|
|
|
|
namespace DigitalData.EmailProfiler.Application.Interfaces.Services;
|
|
|
|
/// <summary>
|
|
/// Email queue interface for asynchronous email sending.
|
|
/// Current implementation: In-memory Channel<T>
|
|
/// Future: RabbitMQ (see agents.md)
|
|
/// </summary>
|
|
public interface IEmailQueue
|
|
{
|
|
/// <summary>
|
|
/// Enqueue an email for sending.
|
|
/// </summary>
|
|
Task EnqueueAsync(EmailOutbox email, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Dequeue an email for sending.
|
|
/// Returns null if queue is empty.
|
|
/// </summary>
|
|
Task<EmailOutbox?> DequeueAsync(CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Get current queue depth (number of pending emails).
|
|
/// </summary>
|
|
Task<int> GetQueueDepthAsync(CancellationToken cancellationToken = default);
|
|
}
|