Commit Graph

65 Commits

Author SHA1 Message Date
3cba69ec42 Refactor email queue worker and interface cleanup
Removed `InitAsync` from `IOutgoingEmailQueue` to decouple RabbitMQ initialization from the interface. Replaced `AsyncIniteWorker` with the correctly named `AsyncInitWorker` in `DependencyInjection.cs` and introduced a new, improved implementation of `AsyncInitWorker`.

The new `AsyncInitWorker` class initializes the outgoing email queue consumer using an event-driven RabbitMQ approach, with enhanced logging and error handling. Removed the outdated `AsyncIniteWorker` class to streamline the codebase.

These changes improve code clarity, maintainability, and correctness.
2026-07-24 12:30:36 +02:00
d91ed70001 Refactor: Replace EmailSenderWorker with AsyncIniteWorker
Removed EmailSenderWorker and its configuration, including
EmailSenderWorkerConfiguration. Introduced AsyncIniteWorker
as a replacement, simplifying the design by removing
configuration-based toggling.

- Deleted EmailSenderWorkerConfiguration.cs.
- Removed EmailSenderWorker and its registration from Program.cs.
- Registered AsyncIniteWorker in DependencyInjection.cs.
- Renamed and refactored EmailSenderWorker to AsyncIniteWorker.
- Updated namespace and removed unused configuration dependencies.
2026-07-24 11:54:34 +02:00
4a6af885de Refactor email queue interface and RabbitMQ handling
Removed `DequeueAsync` from `IOutgoingEmailQueue` and added `GetQueueDepthAsync` to query the queue's message count. Updated RabbitMQ connection and channel creation methods to support `CancellationToken`. Removed `DequeueAsync` implementation from `OutgoingEmailQueue`, signaling a shift away from direct message consumption. These changes improve cancellation handling and simplify the queue's responsibilities.
2026-07-23 17:00:59 +02:00
55e5d689ad Refactor IEmailQueue to IOutgoingEmailQueue
Renamed the `IEmailQueue` interface to `IOutgoingEmailQueue` to improve clarity and better reflect its purpose as an outgoing email queue. Updated all references to the interface across the codebase, including:

- Replaced `IEmailQueue` with `IOutgoingEmailQueue` in `EmailSenderWorker.cs`.
- Renamed the interface in `IOutgoingEmailQueue.cs`.
- Updated `SendEmailCommandHandler` in `SendEmailCommand.cs` to use `IOutgoingEmailQueue`.
- Modified dependency injection in `DependencyInjection.cs` to register `OutgoingEmailQueue` with `IOutgoingEmailQueue`.
- Updated `OutgoingEmailQueue.cs` to implement `IOutgoingEmailQueue`.

These changes improve code readability, maintainability, and naming consistency.
2026-07-23 16:55:52 +02:00
42e9361f1d Refactor RabbitMqEmailQueue to OutgoingEmailQueue
Replaced `RabbitMqEmailQueue` with `OutgoingEmailQueue` in the
dependency injection container to reflect the updated class name.
Renamed the class `RabbitMqEmailQueue` to `OutgoingEmailQueue`
in `OutgoingEmailQueue.cs`, including updates to the constructor
and logger type. This refactor aligns the class name with its
purpose and improves clarity in the codebase.
2026-07-23 16:55:04 +02:00
fbd6c0c521 Refactor email processing and RabbitMQ initialization
Centralized email processing logic in `RabbitMqEmailQueue` by moving it from `EmailSenderWorker`. Updated `IEmailQueue` to replace `StartConsumerAsync` with `InitAsync`, shifting to an initialization-based model for RabbitMQ.

Refactored `RabbitMqEmailQueue` to handle email processing inline, including deserialization, logging, and sending emails via `IEmailService`. Enhanced error handling with detailed logging for failures. Removed lazy initialization (`Lazy<Task>`) in favor of explicit initialization via `InitAsync`.

Simplified `EmailSenderWorker` by removing `ProcessEmailAsync` and its dependency on `IEmailService`. Updated it to call `EmailQueue.InitAsync` for initialization.

Improved logging and error handling for better visibility into email processing and failure scenarios. Updated RabbitMQ acknowledgment and rejection logic to use `args.CancellationToken`.
2026-07-23 16:47:14 +02:00
55feaed361 Make RabbitMQ configuration dynamic
Updated `RabbitMqConfiguration` to include properties for queue and exchange names, replacing hardcoded constants in `RabbitMqEmailQueue`. All RabbitMQ operations now use dynamic values from the configuration object, improving flexibility and configurability. Updated logging to reflect these changes.
2026-07-23 15:53:57 +02:00
169ef7d86b Remove RabbitMQ messaging functionality
The application no longer uses RabbitMQ for command publishing and consumption. This commit removes all RabbitMQ-related code, including:

- Removed RabbitMQ service registrations in `DependencyInjection.cs`.
- Deleted `RabbitMqCommandConsumer.cs`, which implemented a background service for consuming commands.
- Deleted `RabbitMqCommandPublisher.cs`, which implemented a publisher for RabbitMQ-based commands.
- Removed RabbitMQ-specific properties (`ExchangeName`, `QueueName`, `RoutingKey`) from `RabbitMqConfiguration.cs`.

These changes reflect a shift in the application's messaging strategy or architecture.
2026-07-23 15:42:03 +02:00
0e53e8f726 Refactor EmailSenderWorker configuration handling
Introduced a dedicated `EmailSenderWorkerConfiguration` class to centralize and simplify configuration management for the `EmailSenderWorker`. Updated `Program.cs` to use this class for dependency injection and removed the inline configuration logic from `EmailSenderWorker.cs`.

Simplified the worker's constructor by leveraging `IOptions<EmailSenderWorkerConfiguration>`. Removed the unused `MaxRetryCount` property from the configuration class and `appsettings.json`.

Cleaned up `using` directives in `Program.cs` and `EmailSenderWorker.cs` to include the new namespace and remove redundant imports. These changes improve maintainability and align with best practices.
2026-07-23 15:01:33 +02:00
615bf555f8 Add System.Security.Cryptography.Xml package reference
Added a reference to the `System.Security.Cryptography.Xml`
package (version 10.0.10) in the project file to enable
XML cryptographic operations such as signing, verifying,
and encrypting XML data. This change enhances the project's
capabilities for handling secure XML processing.
2026-07-23 13:42:02 +02:00
851a4e94f9 Refactor password handling in EmailAccountDto
Replaced the `EncryptedPassword` property in `EmailAccountDto` with `Password` and `PasswordEncrypted` to support both plain text and encrypted passwords. Updated `LimilabsEmailService` to use the new properties, checking the `PasswordEncrypted` flag to determine whether decryption is needed.
2026-07-23 13:31:27 +02:00
3e04fd7b63 Remove EmailAccount config section from appsettings.json
The `EmailAccount` section has been removed entirely, including
properties such as `Username`, `SmtpServer`, `SmtpPort`,
`SmtpUseSsl`, and `UseOAuth2`. No changes were made to the
`EmailSender` section or the `LuckyPennySoftLicenseKey`.
2026-07-23 13:06:55 +02:00
6a5e0a6086 Refactor EmailAccountDto and improve encryption logic
Refactored `EmailAccountDto` to focus on SMTP-related properties, removing unused fields. Updated `DependencyInjection` to configure data protection with a new key storage path. Simplified `DataProtectionEncryptionService` by removing redundant checks and error handling for encryption and decryption methods.
2026-07-23 13:06:42 +02:00
0ee6e4f96e fix: Register CodePagesEncodingProvider for Limilabs Mail.dll compatibility
- Add static constructor to register System.Text.Encoding.CodePages
- Required for windows-1252 and other extended code page support
- Fixes encoding issues with international email content
2026-07-23 12:41:53 +02:00
4e164a9162 feat: Add LuckyPennySoft license key configuration for AutoMapper and MediatR
- Add license key reading from appsettings.json
- Configure AutoMapper 16.2.0+ with built-in DI extension and license key
- Configure MediatR 14.2.0+ with license key
- Update Program.cs to pass IConfiguration to AddApplicationServices
2026-07-23 12:41:42 +02:00
3d13d10615 chore: Update NuGet package versions
- AutoMapper: 12.0.1 → 16.2.0
- Microsoft.Extensions.Hosting: 10.0.9 → 10.0.10
- Microsoft.Extensions.Options.ConfigurationExtensions: 10.0.9 → 10.0.10
- Add Microsoft.Extensions.Configuration.Abstractions 10.0.10
- Add Microsoft.Extensions.Configuration.Binder 10.0.10
- Add System.Text.Encoding.CodePages 10.0.10
2026-07-23 12:41:30 +02:00
f3eb4bb69b Downgrade AutoMapper and add FluentValidation
The `DigitalData.EmailProfiler.Application.csproj` file was updated to downgrade `AutoMapper` and `AutoMapper.Extensions.Microsoft.DependencyInjection` from versions `16.2.0` and `12.0.0` to `12.0.1`. Additionally, a new dependency on `FluentValidation.DependencyInjectionExtensions` version `12.1.1` was added.

The `DigitalData.EmailProfiler.Infrastructure.csproj` file was updated to downgrade the `AutoMapper` package from version `16.2.0` to `12.0.1`.

These changes address potential compatibility issues and introduce FluentValidation for dependency injection.
2026-07-23 11:27:30 +02:00
27513e73f5 feat(application): Add EmailProcessedEvent domain event 2026-07-23 11:20:14 +02:00
658040bd96 refactor(api): Update EmailsController and EmailSenderWorker for simplified email sending 2026-07-23 11:20:09 +02:00
0adc74e19f refactor(infrastructure): Update RabbitMqCommandConsumer with improved error handling 2026-07-23 11:20:04 +02:00
3be6e28477 refactor(infrastructure): Refactor RabbitMqEmailQueue and remove InMemoryEmailQueue, update DbContext 2026-07-23 11:19:59 +02:00
71e29ac3bb refactor(application): Simplify SendEmailCommand and IEmailQueue/IEmailService interfaces, add Shared reference 2026-07-23 11:19:54 +02:00
828bb168eb refactor(application): Remove old DTOs and mapping profiles, consolidate into EmailMappingProfile 2026-07-23 11:19:47 +02:00
70dd210555 refactor(application): Remove old repository and service interfaces 2026-07-23 11:19:41 +02:00
860ce41192 refactor(domain): Remove entity and event files, add DigitalData.EmailProfiler.Shared reference 2026-07-23 11:19:36 +02:00
1404f90729 remove default Worker 2026-07-22 11:57:53 +02:00
958352a720 feat: Add domain constants, API infrastructure, and configuration
Domain Layer:
- Add DomainConstants for email, attachment, and process constants

API Layer:
- Add EmailsController (minimal REST API endpoints)
- Add ExceptionHandlingMiddleware for global exception handling
- Update Program.cs:
  * Add EmailProfilerDbContext registration (SQL Server)
  * Add Generic Repository<T> scoped registration
  * Add ExceptionHandlingMiddleware to pipeline
  * Add EmailSenderWorker as hosted service
  * Configure Serilog file logging
  * Add Scalar OpenAPI documentation

Configuration:
- Add EmailAccount section in appsettings.json (SMTP credentials)
- Add RabbitMq section (message queue configuration)
- Add Serilog file sink configuration
- Update .csproj with required NuGet packages
- Update solution file

This commit completes the basic API infrastructure setup.
2026-07-22 11:50:17 +02:00
8003715792 feat: Add email sending feature with background worker
Application Layer:
- Add SendEmailCommand with handler (CQRS pattern)
- Add SendEmailCommandValidator (FluentValidation)
- Add EmailOutboxMappingProfile for EmailOutbox entity mappings
- Update EmailAccountMappingProfile with latest field mappings
- Update EmailProfileMappingProfile with latest field mappings

API Layer:
- Add EmailSenderWorker background service
- Worker polls EmailOutbox queue every 5 seconds
- Dequeues emails and processes via SendEmailCommand (MediatR)
- Uses IEmailService (Limilabs) for actual SMTP sending

This implements the outgoing email queue processing pipeline:
EmailOutbox (DB) → IEmailQueue (RabbitMQ) → EmailSenderWorker → SendEmailCommand → IEmailService
2026-07-22 11:49:57 +02:00
d346ed3176 refactor(application): Remove old CQRS commands/queries for minimal API migration
- Remove EmailAccounts CQRS layer (4 files: commands, queries, validators)
- Remove EmailHistories CQRS layer (2 files: queries)
- Remove EmailProcessing CQRS layer (2 files: commands, validators)
- Remove EmailProfiles CQRS layer (8 files: commands, queries, validators)
- Remove corresponding API controllers (3 files)

Total: 19 files removed

Reason: Migrating from full CQRS pattern to minimal API with direct repository access
Note: SendEmailCommand will be added separately for EmailSenderWorker
2026-07-22 11:49:37 +02:00
3f9bfc78a8 feat(infrastructure): Add Limilabs email service and RabbitMQ email queue
- Add LimilabsEmailService for SMTP operations (IEmailService implementation)
- Add RabbitMqEmailQueue for production email queue (RabbitMQ-based)
- Update InMemoryEmailQueue for improved error handling
- Update IEmailQueue interface for RabbitMQ compatibility
- Update DependencyInjection.cs:
  * Switch IEmailService to LimilabsEmailService (Singleton)
  * Switch IEmailQueue to RabbitMqEmailQueue (Singleton)
  * Change IEncryptionService to Singleton (thread-safe)
  * Remove IDmsService registration
- Add required NuGet package references to .csproj

TODO: Add Limilabs.Mail NuGet package (commercial license required)
2026-07-22 11:48:37 +02:00
dbd0d35ba3 refactor: Remove MailKit and windream DMS dependencies
- Remove IDmsService interface (DMS integration deferred to Phase 5)
- Remove MailKitEmailService implementation
- Remove WindreamDmsService implementation
- Simplify IEmailService to SMTP-only operations
- Preparing for Limilabs Mail.dll migration

BREAKING CHANGE: IEmailService no longer supports IMAP/POP3 operations
Reason: Migrating from MailKit to Limilabs Mail.dll
2026-07-22 11:48:19 +02:00
751ef87506 refactor(infrastructure): Improve service implementations and remove legacy references
**Services Refactored:**
- DevExpressPdfProcessingService: Remove unnecessary try-catch (lines 80-87), add stream position validation
- WindreamDmsService: Mark as [Obsolete] - application now only provides email sending functionality
- MailKitEmailService: Keep MailKit implementation (Limilabs DLL to be added separately)

**Custom Exceptions Added:**
- AuthenticationFailedException: OAuth2/IMAP/SMTP authentication failures
- DmsNotAvailableException: windream COM unavailable
- InvalidPdfException: Invalid PDF stream
- NotFoundException: Entity not found in Repository operations

**Legacy Cleanup:**
- Remove legacy VB.NET projects from solution (EmailProfiler.Common, EmailProfiler.Service)
- Delete legacy/ folder reference
- Clean solution file structure

**Stream Validation:**
- All PDF processing methods now validate stream position (reset to 0 if needed)
- Add CanSeek validation for stream-based operations

**Build Status:**  Successful (0 errors, 15 warnings - all acceptable)
2026-07-20 16:36:17 +02:00
8f2365d048 remove Features-directory and move the files to the root directory 2026-07-15 15:03:12 +02:00
bfe24eba06 feat(api): Add REST API controllers with RabbitMQ for POST/PUT/DELETE
Controllers:
- EmailProfilesController: CRUD operations (GET sync, POST/PUT/DELETE async via RabbitMQ)
  * GET /api/emailprofiles - List all profiles
  * GET /api/emailprofiles/{id} - Get profile by ID
  * GET /api/emailprofiles/active - List active profiles
  * POST /api/emailprofiles - Create (202 Accepted, queued to RabbitMQ)
  * PUT /api/emailprofiles/{id} - Update (202 Accepted, queued to RabbitMQ)
  * DELETE /api/emailprofiles/{id} - Delete (202 Accepted, queued to RabbitMQ)

- EmailAccountsController: CRUD operations
  * GET /api/emailaccounts - List all accounts
  * GET /api/emailaccounts/{id} - Get account by ID
  * POST /api/emailaccounts - Create (202 Accepted, queued to RabbitMQ)

- EmailHistoryController: Read-only operations
  * GET /api/emailhistory/profile/{profileId} - Get history with pagination
  * GET /api/emailhistory/{id} - Get history by ID

Changes:
- Fix ICommandPublisher constraint: IRequest → IBaseRequest (supports IRequest<T>)
- All POST/PUT/DELETE return HTTP 202 Accepted (async processing)
- All GET operations return HTTP 200 OK (synchronous via MediatR)
- Proper error handling: 404 Not Found for missing resources
2026-07-14 16:39:35 +02:00
0d22fe0b5c docs: Update AGENTS.md and STATUS.md with RabbitMQ and Phase 2 completion
AGENTS.md:
- Add Section 7: RabbitMQ Command Bus Integration (IMPLEMENTED)
- Document ICommandPublisher, RabbitMqCommandPublisher, RabbitMqCommandConsumer
- Add configuration, DI setup, and usage examples
- Document benefits: async processing, horizontal scaling, retries, persistence

STATUS.md:
- Mark Phase 2 (Application Layer) as 100% complete
- Update Phase 3 (Infrastructure Layer) to 15% (RabbitMQ done)
- Document all completed components: DTOs, Commands, Queries, Validators, Mappings
- Update last modified date to 2026-07-14
2026-07-14 16:37:22 +02:00
1ed489532d feat(application): Add AutoMapper profiles for all entities
- EmailProfileMappingProfile: Command→Entity, DTO→Entity, Entity→DTO
- EmailAccountMappingProfile: Command→Entity, Entity→DTO
- EmailHistoryMappingProfile: CreateDto→Entity, UpdateDto partial mapping, Entity→DTO
- EmailAttachmentMappingProfile: CreateDto→Entity, UpdateDto partial mapping, Entity→DTO

All mappings follow Repository<T> pattern with AutoMapper-based CRUD
2026-07-14 16:37:11 +02:00
eda6257145 feat(application): Add MediatR Commands, Queries, and FluentValidation
Commands (5):
- CreateEmailProfileCommand, UpdateEmailProfileCommand, DeleteEmailProfileCommand
- CreateEmailAccountCommand (OAuth2/password conditional validation)
- ProcessEmailCommand (with CreateEmailHistoryDto, UpdateEmailHistoryStatusDto)

Queries (7):
- GetEmailProfilesQuery, GetEmailProfileByIdQuery, GetActiveEmailProfilesQuery
- GetEmailAccountsQuery, GetEmailAccountByIdQuery
- GetEmailHistoryByProfileQuery (with pagination), GetEmailHistoryByIdQuery

Validators (4):
- CreateEmailProfileCommandValidator, UpdateEmailProfileCommandValidator
- CreateEmailAccountCommandValidator, ProcessEmailCommandValidator

All handlers in same file as commands/queries (AGENTS.md rule #5)
2026-07-14 16:37:00 +02:00
a708799587 refactor(application): Reorganize DTOs - flatten single-DTO folders
- Move EmailAccountDto.cs to Dtos/ (was in EmailAccounts/ subfolder)
- Move EmailProfileDto.cs to Dtos/ (was in EmailProfiles/ subfolder)
- Keep EmailAttachments/ (3 DTOs) and EmailHistories/ (3 DTOs) subfolders
- Update all namespace imports from Dtos.EmailAccounts/EmailProfiles to Dtos
- Simpler structure: single DTOs at root, multiple DTOs in subfolders
2026-07-14 16:36:50 +02:00
b7d65d7d5c refactor(application): Remove IUnitOfWork, add generic IRepository<T> with AutoMapper
- Remove IUnitOfWork pattern (not needed with auto-save repositories)
- Add generic IRepository<T> with CreateAsync<TDto>, UpdateSingleAsync<TDto>, DeleteSingleAsync
- Add UpdateAsync/DeleteAsync for bulk operations
- Add ICommandPublisher interface for RabbitMQ integration
- Add service interfaces: IEmailService, IPdfProcessingService, IDmsService, IEncryptionService, IEmailQueue
- Configure Application DI with MediatR, AutoMapper, FluentValidation
2026-07-14 16:36:41 +02:00
5e8e6a06fe feat(infrastructure): Add RabbitMQ Command Bus integration
- Add RabbitMQ.Client 7.2.1, Microsoft.Extensions.Hosting 10.0.9
- Implement ICommandPublisher interface for async command publishing
- Create RabbitMqCommandPublisher with persistent message delivery
- Create RabbitMqCommandConsumer BackgroundService for command processing
- Add RabbitMqConfiguration with appsettings.json binding
- Configure Infrastructure DI with RabbitMQ services
- Update Program.cs to support appsettings.Secrets.json
- Server: 172.24.12.56:5672, Exchange: emailprofiler.commands
2026-07-14 16:36:23 +02:00
50c21ee628 Refactor MediatR commands and update solution structure
- Consolidated commands and handlers into single files for better organization.
- Updated file naming conventions for commands and queries.
- Added explicit Git operation rules to prevent automatic commits/pushes.
- Introduced new projects and restructured solution file (`legacy` folder).
- Refactored `CreateEmailAccountCommand`, `ProcessEmailCommand`, and others to use `IUnitOfWork`.
- Enhanced `ProcessEmailCommandHandler` with attachment validation and error handling.
- Removed redundant handler files after consolidation.
- Improved code consistency and added `TODO` comments for future enhancements.
2026-07-09 14:37:12 +02:00
45654796b7 feat(application): add MediatR commands and handlers with exception improvements
MediatR Commands (CQRS Pattern):
- CreateEmailProfileCommand + Handler
- UpdateEmailProfileCommand + Handler
- DeleteEmailProfileCommand + Handler
- CreateEmailAccountCommand + Handler
- ProcessEmailCommand + Handler (core email processing logic)

Command Handlers:
- Create/Update/Delete operations for EmailProfile
- Create operation for EmailAccount
- ProcessEmail: Complete email processing workflow including:
  * Duplicate detection using MessageId hash
  * Email history creation
  * PDF attachment validation
  * windream DMS archiving support (placeholder)
  * Domain event publishing (EmailProcessedEvent)
  * Error handling and status tracking

Exception Improvements:
- Added ErrorCode property to DomainException
- Added ErrorCode overload to ValidationException
- Simplified AttachmentProcessingException to use base ErrorCode

Field Mappings Fixed:
- EmailProfile: ProcessId (not EmailProcessId), ValidationSql (not SenderFilter/SubjectFilter)
- EmailAccount: Username, EncryptedPassword, UseOAuth2, EncryptedClientSecret
- EmailHistory: SenderAddress, EmailDate, OriginalMessageId, EmailBodyText/Html
- EmailAttachment: OriginalFileName, SavedFileName, FilePath, FileSize
- Audit fields: AddedWhen/AddedWho, ChangedWhen/ChangedWho (not CreatedDate/By, ModifiedDate/By)

All commands follow Clean Architecture and use UnitOfWork pattern.
Build successful with 1 minor warning (dmsService marked for future implementation).
2026-07-08 15:51:51 +02:00
3778c0b338 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
2026-07-08 10:39:16 +02:00
111d2bf264 fix(domain): use DateTime.Now instead of DateTime.UtcNow for legacy compatibility
CRITICAL FIX: Replace all DateTime.UtcNow with DateTime.Now throughout the application.

Reason: Legacy VB.NET system uses local server time, and database stores all
timestamps as local time. Using UTC breaks compatibility and causes incorrect
time comparisons.

Changes:
- EmailProcessedEvent: ProcessedDate now uses DateTime.Now
- EmailHistory.MarkAsProcessed(): ProcessedDate now uses DateTime.Now
- EmailHistory.MarkAsFailed(): ProcessedDate now uses DateTime.Now
- EmailProfile.UpdateLastPollTime(): LastPollTime now uses DateTime.Now
- EmailProfile.ShouldPoll(): Poll interval comparison now uses DateTime.Now

Documentation:
- Added critical note to agents.md about DateTime usage
- Includes examples and detailed explanation for future developers

This ensures all date/time operations remain compatible with legacy database.
2026-07-08 10:36:13 +02:00
c9251fa622 Add "Solution Items" folder with project documentation
A new "Solution Items" folder has been added to the solution, represented by the GUID `{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}`.

This folder includes the following files:
- `agents.md`
- `IMPLEMENTATION_GUIDE.md`
- `README.md`
- `STATUS.md`

These files are now part of the solution structure, providing better organization and accessibility for project-related documentation.
2026-07-07 19:29:30 +02:00
2393b2649a docs: add project status tracking document
Current implementation status:
-  Phase 1 Complete: Domain Layer (100%)
- 🚧 Phase 2 In Progress: Application Layer (5%)
-  Phases 3-6 Pending

Detailed tracking:
- All completed entities, value objects, enums, services
- All pending repository interfaces, commands, queries
- All pending infrastructure implementations
- All pending API controllers and workers
- Build status confirmation
- Progress visualization (~15% complete)
- Prioritized next steps for future agents

This document provides quick overview of what's done and what's next.
2026-07-07 19:00:07 +02:00
331b73000e docs: add critical notes and future enhancements for agents
Important notes:
- Database schema must NEVER be modified
- MessageId hash algorithm must match legacy system exactly
- No git commits without explicit permission
- Naming conventions (SNAKE_CASE DB, PascalCase C#)

Future enhancements:
- RabbitMQ queue implementation plan (replacing in-memory queue)
- Complete migration path and configuration examples
- Pending implementation tasks for each phase
- Known issues and limitations (PdfSharp, windream COM)

Architecture decisions:
- Clean Architecture with DDD
- CQRS pattern with MediatR
- Repository pattern

Development guidelines:
- Code style conventions
- Logging with Serilog
- Configuration management
- Error handling strategies
- Deployment scenarios (IIS/Windows Service)
2026-07-07 18:59:57 +02:00
e789afe26a docs: add comprehensive implementation guide for AI agents
Step-by-step guide covering all remaining phases:
- Phase 2: Application Layer (Repositories, Services, Commands, Queries, Validators)
- Phase 3: Infrastructure Layer (DbContext, Repositories, External Services)
- Phase 4: API Layer (Controllers, Workers, Middleware)
- Phase 5: Configuration (appsettings, Serilog, Scalar)
- Phase 6: Testing (Unit tests, Integration tests)
- Phase 7: Documentation (README.md in German)
- Phase 8: Build and deployment

Includes complete code examples, best practices, and verification steps.
Future AI agents can follow this guide to continue development systematically.
2026-07-07 18:59:46 +02:00
dd04cd6cba docs: add legacy system analysis documentation
Comprehensive analysis of the VB.NET legacy system:
- Complete database schema documentation
- All table structures (TBDD_*, TBEMLP_* tables)
- Legacy business logic analysis
- VB.NET code patterns and conventions
- Migration considerations

This documentation ensures new implementation maintains compatibility
with existing database and business rules.
2026-07-07 18:59:37 +02:00
43101a6e61 feat(application): add DTOs and application layer dependencies
DTOs:
- EmailProfileDto: Profile data transfer object
- EmailAccountDto: Email account data transfer object
- EmailHistoryDto: Email history data transfer object
- EmailAttachmentDto: Attachment data transfer object

Dependencies:
- MediatR 14.2.0 for CQRS (Commands/Queries)
- AutoMapper 12.0.1 for entity-DTO mapping
- FluentValidation 12.1.1 for input validation

This provides the foundation for the application layer implementation.
2026-07-07 18:59:31 +02:00