Add DeleteOutResCommandValidator for input validation

Introduce DeleteOutResCommandValidator using FluentValidation
to enforce business rules for the DeleteOutResCommand. Added
a validation rule to ensure at least one of ActionId or
ProfileId is provided, with a descriptive error message if
neither is present. Included necessary using directives for
FluentValidation and the relevant namespace.
This commit is contained in:
tekh 2025-12-08 11:28:43 +01:00
parent 243cc97aa2
commit b9f5a3f10c

View File

@ -0,0 +1,14 @@
using FluentValidation;
namespace ReC.Application.OutResults.Commands;
public class DeleteOutResCommandValidator : AbstractValidator<DeleteOutResCommand>
{
public DeleteOutResCommandValidator()
{
RuleFor(x => x)
.Must(x => x.ActionId.HasValue || x.ProfileId.HasValue)
.WithMessage("At least one of ActionId or ProfileId must be provided.")
.WithName("Identifier");
}
}