Add validation to ReadHistoryQuery and remove StatusName

Updated ReadHistoryQuery to include a [Required] attribute for the EnvelopeId property, enforcing mandatory validation. Removed the StatusName property from ReadHistoryResponse, which may impact how status is accessed in the application.
This commit is contained in:
Developer 02 2025-05-12 11:07:53 +02:00
parent 6a6da4a876
commit 41b2841c25
2 changed files with 2 additions and 5 deletions

View File

@ -1,5 +1,6 @@
using EnvelopeGenerator.Common;
using MediatR;
using System.ComponentModel.DataAnnotations;
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
@ -11,6 +12,7 @@ namespace EnvelopeGenerator.Application.Histories.Queries.Read;
/// <param name="Status">Der Status des Umschlags, der abgefragt werden soll. Kann optional angegeben werden, um die Ergebnisse zu filtern.</param>
/// <param name="OnlyLast">Abfrage zur Steuerung, ob nur der aktuelle Status oder der gesamte Datensatz zurückgegeben wird.</param>
public record ReadHistoryQuery(
[Required]
int EnvelopeId,
Constants.EnvelopeStatus? Status = null,
bool? OnlyLast = true) : IRequest<IEnumerable<ReadHistoryResponse>>

View File

@ -27,11 +27,6 @@ public class ReadHistoryResponse
/// </summary>
public int Status { get; set; }
/// <summary>
/// Gets or sets the name of the status.
/// </summary>
public string? StatusName => Status.ToString();
/// <summary>
///
/// </summary>