19 lines
624 B
C#
19 lines
624 B
C#
using FluentValidation;
|
|
using PARR.API.Contracts.V1.Requests;
|
|
using PARR.DAL.Contracts;
|
|
|
|
namespace PARR.API.Validators
|
|
{
|
|
public class AgentHistoryRequestValidator : AbstractValidator<AgentHistoryRequest>
|
|
{
|
|
public AgentHistoryRequestValidator()
|
|
{
|
|
RuleFor(t => t.TemplateId).NotEmpty().NotNull();
|
|
|
|
RuleFor(t => t.Level)
|
|
.Must(t => t == AgentHistoryLevelEnum.Start || t == AgentHistoryLevelEnum.End)
|
|
.WithMessage($"Допустимые значения: {(int)AgentHistoryLevelEnum.Start}, {(int)AgentHistoryLevelEnum.End}");
|
|
}
|
|
}
|
|
}
|