Add CreateEnvelope command and DTO for envelope creation
Führt den `CreateEnvelopeCommand` Datensatz und seinen Handler ein, der die `IRequest` Schnittstelle von MediatR implementiert. Der Handler wirft derzeit eine `NotImplementedException`. Fügt die Klasse „EnvelopeCreateDto“ mit Eigenschaften für Titel, Nachricht, Sprache, Verfallsdaten, Vertragstyp und TFA-Flag hinzu. Erforderliche Felder werden mit Datenanmerkungen validiert, und für bestimmte Eigenschaften werden Standardwerte festgelegt.
This commit is contained in:
parent
7e07afa384
commit
7871bf72f6
@ -0,0 +1,13 @@
|
||||
using MediatR;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Envelope.Commands;
|
||||
|
||||
public record CreateEnvelopeCommand(EnvelopeCreateDto Envelope) : IRequest;
|
||||
|
||||
public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeCommand>
|
||||
{
|
||||
public Task<Unit> Handle(CreateEnvelopeCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Envelope.Commands;
|
||||
|
||||
public class EnvelopeCreateDto
|
||||
{
|
||||
[Required]
|
||||
public required string Title { get; init; }
|
||||
|
||||
[Required]
|
||||
public required string Message { get; init; }
|
||||
|
||||
public string Language { get; init; } = "de-DE";
|
||||
|
||||
public DateTime? ExpiresWhen { get; init; }
|
||||
|
||||
public DateTime? ExpiresWarningWhen { get; init; }
|
||||
|
||||
public int? ContractType { get; init; } = (int)Common.Constants.ContractType.Contract;
|
||||
|
||||
public bool TFAEnabled { get; init; } = false;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user