From 41b2841c25cde06f32076b98d17e1a40ec68d37c Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 12 May 2025 11:07:53 +0200 Subject: [PATCH] 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. --- .../Histories/Queries/Read/ReadHistoryQuery.cs | 2 ++ .../Histories/Queries/Read/ReadHistoryResponse.cs | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryQuery.cs b/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryQuery.cs index 8e1990d4..7737edef 100644 --- a/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryQuery.cs +++ b/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryQuery.cs @@ -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; /// Der Status des Umschlags, der abgefragt werden soll. Kann optional angegeben werden, um die Ergebnisse zu filtern. /// Abfrage zur Steuerung, ob nur der aktuelle Status oder der gesamte Datensatz zurückgegeben wird. public record ReadHistoryQuery( + [Required] int EnvelopeId, Constants.EnvelopeStatus? Status = null, bool? OnlyLast = true) : IRequest> diff --git a/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryResponse.cs b/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryResponse.cs index 960d5c6d..a0ff24ae 100644 --- a/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryResponse.cs +++ b/EnvelopeGenerator.Application/Histories/Queries/Read/ReadHistoryResponse.cs @@ -27,11 +27,6 @@ public class ReadHistoryResponse /// public int Status { get; set; } - /// - /// Gets or sets the name of the status. - /// - public string? StatusName => Status.ToString(); - /// /// ///