Refactor: Rename OutgoingEmail to SendingEmail
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.
This commit is contained in:
@@ -330,7 +330,7 @@ return Accepted(); // HTTP 202 - command queued for processing
|
||||
arguments: null);
|
||||
}
|
||||
|
||||
public async Task EnqueueAsync(OutgoingEmail email, CancellationToken cancellationToken)
|
||||
public async Task EnqueueAsync(SendingEmail email, CancellationToken cancellationToken)
|
||||
{
|
||||
var json = JsonSerializer.Serialize(email);
|
||||
var body = Encoding.UTF8.GetBytes(json);
|
||||
@@ -347,7 +347,7 @@ return Accepted(); // HTTP 202 - command queued for processing
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task<OutgoingEmail?> DequeueAsync(CancellationToken cancellationToken)
|
||||
public async Task<SendingEmail?> DequeueAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var result = _channel.BasicGet(QueueName, autoAck: false);
|
||||
|
||||
@@ -355,7 +355,7 @@ return Accepted(); // HTTP 202 - command queued for processing
|
||||
return null;
|
||||
|
||||
var json = Encoding.UTF8.GetString(result.Body.ToArray());
|
||||
var email = JsonSerializer.Deserialize<OutgoingEmail>(json);
|
||||
var email = JsonSerializer.Deserialize<SendingEmail>(json);
|
||||
|
||||
_channel.BasicAck(result.DeliveryTag, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user