diff --git a/src/ReC.Application/Common/Validations/InsertResultCommandValidator.cs b/src/ReC.Application/Common/Validations/InsertResultCommandValidator.cs new file mode 100644 index 0000000..5403e15 --- /dev/null +++ b/src/ReC.Application/Common/Validations/InsertResultCommandValidator.cs @@ -0,0 +1,21 @@ +using FluentValidation; +using ReC.Application.Results.Commands; + +namespace ReC.Application.Common.Validations; + +public class InsertResultCommandValidator : AbstractValidator +{ + public InsertResultCommandValidator() + { + RuleFor(x => x.ActionId) + .NotNull() + .WithMessage("ActionId is required.") + .GreaterThan(0L) + .When(x => x.ActionId.HasValue) + .WithMessage("ActionId must be greater than 0."); + + RuleFor(x => x.References.BatchId) + .NotEmpty() + .WithMessage("BatchId is required."); + } +}