feat(api): создан ProcessController+валидация входных данных

This commit is contained in:
Mikhail Kuznetsov
2024-03-06 15:56:52 +10:00
parent 9f3b470854
commit 39fd6bccda
4 changed files with 230 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
using FluentValidation;
using PARR.API.Contracts.V1.Requests;
namespace PARR.API.Validators
{
public class ProcessValidator : AbstractValidator<ProcessRequest>
{
private bool? isValid = null;
public ProcessValidator()
{
RuleFor(t => t.Name).NotEmpty().NotNull().WithMessage("Имя процесса не может быть пустым");
RuleFor(t => t.EsppId).NotEmpty().NotNull().WithMessage("EsppId не может быть пустым");
}
}
}