Rename SendEmailCommand to PublishEmailCommand

Refactor the codebase to rename `SendEmailCommand` and its associated components to `PublishEmailCommand` for improved clarity and consistency.

- Updated mapping in `EmailMappingProfile.cs` to use `PublishEmailCommand` instead of `SendEmailCommand`.
- Renamed `SendEmailCommand` to `PublishEmailCommand` in `PublishEmailCommand.cs`, including its methods like `WithAttachments`.
- Renamed `SendEmailCommandHandler` to `PublishEmailCommandHandler` and updated its method signature to handle the new command.
- Renamed `SendEmailCommandValidator` to `PublishEmailCommandValidator` and updated validation rules accordingly.
- Updated the `SendEmail` action in `EmailsController.cs` to accept `PublishEmailCommand` instead of `SendEmailCommand`.

These changes ensure consistency across the codebase and better reflect the purpose of the command.
This commit is contained in:
2026-08-06 12:07:39 +02:00
parent 2e69fac250
commit 20de7da93d
4 changed files with 11 additions and 11 deletions

View File

@@ -11,9 +11,9 @@ public class EmailMappingProfile : Profile
{
public EmailMappingProfile()
{
// SendEmailCommand -> Email
// PublishEmailCommand -> Email
// Sender is resolved via MediatR in the handler and set separately after mapping.
CreateMap<SendEmailCommand, EmailContext>()
CreateMap<PublishEmailCommand, EmailContext>()
.ForMember(dest => dest.Sender, opt => opt.Ignore())
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
}