feat(application): add repository and service interfaces

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
This commit is contained in:
2026-07-08 10:39:16 +02:00
parent 111d2bf264
commit 3778c0b338
13 changed files with 455 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using DigitalData.EmailProfiler.Domain.Entities;
namespace DigitalData.EmailProfiler.Application.Interfaces.Repositories;
/// <summary>
/// Repository interface for EmailProfile entity.
/// </summary>
public interface IEmailProfileRepository : IRepository<EmailProfile>
{
/// <summary>
/// Get all active profiles.
/// </summary>
Task<IEnumerable<EmailProfile>> GetActiveProfilesAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Get profiles that should be polled now (based on PollIntervalMinutes).
/// </summary>
Task<IEnumerable<EmailProfile>> GetProfilesDueForPollingAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Get profile with all related entities (EmailAccount, EmailProcess, ProcessSteps).
/// </summary>
Task<EmailProfile?> GetWithRelatedEntitiesAsync(int id, CancellationToken cancellationToken = default);
/// <summary>
/// Get profiles by email account ID.
/// </summary>
Task<IEnumerable<EmailProfile>> GetByEmailAccountIdAsync(int emailAccountId, CancellationToken cancellationToken = default);
}