Refactored `Email` and `SendingEmailEvent` to use `record` types, consolidating email-related data into the `Email` class. Updated `SendEmailCommand` to return a `Guid` and simplified mapping logic in `EmailMappingProfile`. Adjusted `SendEmailCommandHandler` to construct `SendingEmailEvent` manually.
Updated `SendingEmailConsumer`, `EmailsController`, and `EmailSender` to reflect the new structure. Removed the old `Email` implementation. Improved logging to reference the `Mail` property.
Revised tests to align with the new structure, ensuring immutability and better separation of concerns.
This commit renames and refactors all instances of `OutgoingEmail` to `SendingEmail` across the codebase to improve terminology consistency and align with domain language.
- Renamed classes, interfaces, and records (e.g., `OutgoingEmailPublisher` → `SendingEmailPublisher`, `OutgoingEmailEvent` → `SendingEmailEvent`).
- Updated method signatures, parameters, and return types to use `SendingEmail`.
- Adjusted dependency injection registrations to reflect the new naming.
- Updated mappings in `EmailMappingProfile` to map `SendEmailCommand` to `SendingEmailEvent`.
- Refactored `SendEmailCommand` and its handler to work with `SendingEmailEvent`.
- Updated `EmailsController` to use `SendingEmailEvent` in the `SendEmail` action.
- Refactored integration tests to test `SendingEmailPublisher` and updated test data accordingly.
- Updated log messages, error handling, and comments to reflect the new terminology.
- Revised documentation and utility methods to use `SendingEmailEvent`.
This refactor ensures consistency, improves readability, and reduces ambiguity in the codebase.
The `DigitalData.MessagingService.Publisher.Abstraction` project has been removed, and its functionality has been merged into a new project named `DigitalData.MessagingService.Abstraction`.
- Updated namespaces from `Publisher.Abstraction` to `Abstraction` across all relevant files, including DTOs, interfaces, and classes.
- Modified the solution file to remove `Publisher.Abstraction` and add `Abstraction`, updating solution configurations and nested project mappings.
- Replaced project references to `Publisher.Abstraction` with `Abstraction` in all affected project files.
- Updated tests and integration tests to reflect the namespace and project changes.
- Refactored application-level files such as `EmailMappingProfile` and `DependencyInjection.cs` to use the new namespace.
This refactor simplifies the project structure and ensures consistency across the solution.
Refactored the `Email` and `OutgoingEmailEvent` classes to replace the `Recipient` property with a `Recipients` collection, enabling support for multiple recipients. Updated all related test cases, including `EmailSenderTests`, `EmailSenderUrlOverloadTests`, and `OutgoingEmailPublisherTests`, to reflect this change.
Moved the `EmailAccountDto` class and its references from the `DigitalData.MessagingService.Application.Common.Dtos` namespace to the `DigitalData.MessagingService.Publisher.Abstraction` namespace for better code organization. Updated `using` directives across affected files.
Removed unused `using` directives and updated the `Email` class's `ToEvent` method to map the new `Recipients` property. Adjusted test assertions to validate collections instead of single recipient strings.
Introduced a new `Email` record to simplify the representation of outgoing email messages. Updated the `EmailSender.Send` method to accept `Email` instead of `OutgoingEmailEvent`, with a `ToEvent()` method handling the conversion internally.
Refactored test cases to use the `Email` record, removing redundant properties (`Id` and `QueuedAt`) that are now auto-generated. Updated XML documentation to reflect these changes. Adjusted namespaces and added necessary `using` directives for proper referencing.
These changes improve code readability, maintainability, and centralize the mapping logic for outgoing email events.
Replaced `DigitalData.MessagingService.Client.DependencyInjection`
namespace with `DigitalData.MessagingService.Client` across the
codebase to simplify and streamline the project structure.
Removed unused `Microsoft.Extensions.Logging` and `System`
dependencies from `EmailSender.cs`. Updated project references
in `DigitalData.MessagingService.Tests.csproj` to reflect the
namespace and project restructuring. Adjusted `using` directives
in test files to align with the new namespace.
Enhanced test coverage for RabbitMQ integration by adding:
- New package references for dependency injection, logging, and RabbitMQ.
- `EmailSenderCollection` and `EmailSenderFixture` for managing static client lifecycle in integration tests.
- Integration tests for `EmailSender` and `OutgoingEmailPublisher` to verify connection management, message publishing, and serialization.
- `EmailSenderUrlOverloadTests` to validate URL-based connection overload behavior.
- `RabbitMqTestConfig` for centralized RabbitMQ test configuration.
- Unit tests for URL parsing logic in `EmailSenderUrlParsingTests`.
These changes improve reliability, maintainability, and test coverage for the messaging service.