Add DeleteObjectProcedureValidator with validation rules

Introduced DeleteObjectProcedureValidator using FluentValidation to ensure Start is greater than 0 and End is greater than or equal to Start, with custom error messages for each rule.
This commit is contained in:
2026-04-16 14:36:43 +02:00
parent f5b2db0296
commit 0a564d8aa8

View File

@@ -0,0 +1,18 @@
using FluentValidation;
using ReC.Application.Common.Procedures.DeleteProcedure;
namespace ReC.Application.Common.Validations;
public class DeleteObjectProcedureValidator : AbstractValidator<DeleteObjectProcedure>
{
public DeleteObjectProcedureValidator()
{
RuleFor(x => x.Start)
.GreaterThan(0)
.WithMessage("Start GUID/ID must be greater than 0.");
RuleFor(x => x.End)
.GreaterThanOrEqualTo(x => x.Start)
.WithMessage("End GUID/ID must be greater than or equal to Start GUID/ID.");
}
}