Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @@ -0,0 +1,31 @@ | ||||
| using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; | ||||
| using FluentValidation; | ||||
| using VisaApiClient; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Validators; | ||||
|  | ||||
| public class PastVisaModelValidator : AbstractValidator<PastVisaModel> | ||||
| { | ||||
|     public PastVisaModelValidator(IDateTimeProvider dateTimeProvider) | ||||
|     { | ||||
|         RuleFor(v => v.ExpirationDate) | ||||
|             .NotEmpty() | ||||
|             .WithMessage("Expiration date of past visa can not be empty") | ||||
|             .GreaterThan(v => v.IssueDate) | ||||
|             .WithMessage("Past visa expiration date can not be earlier than issue date"); | ||||
|  | ||||
|         RuleFor(v => v.IssueDate) | ||||
|             .NotEmpty() | ||||
|             .WithMessage("Issue date of past visa can not be empty") | ||||
|             .LessThan(dateTimeProvider.Now()) | ||||
|             .WithMessage("Issue date of past visa must be in past"); | ||||
|  | ||||
|         RuleFor(v => v.Name) | ||||
|             .NotEmpty() | ||||
|             .WithMessage("Name of past visa can not be empty") | ||||
|             .Matches(Constants.EnglishPhraseRegex) | ||||
|             .WithMessage("Name of past visa can contain only english letters, digits and special symbols") | ||||
|             .MaximumLength(ConfigurationConstraints.VisaNameLength) | ||||
|             .WithMessage($"Past visa name length must be less than {ConfigurationConstraints.VisaNameLength}"); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user