Developer 02 613b2130a5 Refactor email template handling and error management
- Updated EmailTemplateDto to allow mutable Body and Subject properties.
- Implemented IRequest interface in UpdateEmailTemplateCommand for MediatR.
- Enhanced error handling in EmailTemplateController with NotFoundException.
- Introduced UpdateEmailTemplateCommandHandler for processing update commands.
- Added NotFoundException class for improved error handling.
2025-05-07 01:02:30 +02:00

24 lines
796 B
C#

using MediatR;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;
/// <summary>
/// Befehl zum Aktualisieren einer E-Mail-Vorlage.
/// </summary>
/// <param name="Body">
/// (Optional)Der neue Inhalt des E-Mail-Textkörpers. Wenn null, bleibt der vorhandene Inhalt unverändert.
/// </param>
/// <param name="Subject">
/// (Optional) Der neue Betreff der E-Mail. Wenn null, bleibt der vorhandene Betreff unverändert.
/// </param>
public record UpdateEmailTemplateCommand(string? Body = null, string? Subject = null) : IRequest
{
/// <param>
/// Die Abfrage, die die E-Mail-Vorlage darstellt, die aktualisiert werden soll.
/// </param>
[JsonIgnore]
public EmailTemplateQuery? EmailTemplateQuery { get; set; }
}