2022-05-31 12:30:03 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
|
|
|
|
using FluentValidation;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Validators
|
|
|
|
|
{
|
|
|
|
|
public class TimeDtoValidator : AbstractValidator<TimeDto>
|
|
|
|
|
{
|
|
|
|
|
public TimeDtoValidator()
|
|
|
|
|
{
|
2022-06-15 14:57:37 +05:00
|
|
|
|
RuleFor(x => x.Hour)
|
|
|
|
|
.InclusiveBetween(0, 23)
|
2022-05-31 12:30:03 +05:00
|
|
|
|
.WithMessage("hour should be in [0; 23]");
|
|
|
|
|
|
|
|
|
|
RuleFor(x => x.Minute)
|
|
|
|
|
.InclusiveBetween(0, 59)
|
|
|
|
|
.WithMessage("minute should be in [0; 59]");
|
|
|
|
|
|
|
|
|
|
RuleFor(x => x.Second)
|
|
|
|
|
.InclusiveBetween(0, 59)
|
|
|
|
|
.WithMessage("second should be in [0; 59]");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|