file-scoped namespaces
This commit is contained in:
		| @@ -2,22 +2,21 @@ | ||||
| using ApplicationLayer.Services.AuthServices.Common; | ||||
| using Domains.ApplicantDomain; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests | ||||
| { | ||||
|     public record RegisterApplicantRequest( | ||||
|         AuthData AuthData, | ||||
|         Name ApplicantName, | ||||
|         Passport Passport, | ||||
|         DateTime BirthDate, | ||||
|         string CityOfBirth, | ||||
|         string CountryOfBirth, | ||||
|         string Citizenship, | ||||
|         string CitizenshipByBirth, | ||||
|         Gender Gender, | ||||
|         MaritalStatus MaritalStatus, | ||||
|         Name FatherName, | ||||
|         Name MotherName, | ||||
|         string JobTitle, | ||||
|         PlaceOfWorkModel PlaceOfWork, | ||||
|         bool IsNonResident) : RegisterRequest(AuthData); | ||||
| } | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests; | ||||
|  | ||||
| public record RegisterApplicantRequest( | ||||
|     AuthData AuthData, | ||||
|     Name ApplicantName, | ||||
|     Passport Passport, | ||||
|     DateTime BirthDate, | ||||
|     string CityOfBirth, | ||||
|     string CountryOfBirth, | ||||
|     string Citizenship, | ||||
|     string CitizenshipByBirth, | ||||
|     Gender Gender, | ||||
|     MaritalStatus MaritalStatus, | ||||
|     Name FatherName, | ||||
|     Name MotherName, | ||||
|     string JobTitle, | ||||
|     PlaceOfWorkModel PlaceOfWork, | ||||
|     bool IsNonResident) : RegisterRequest(AuthData); | ||||
| @@ -1,6 +1,5 @@ | ||||
| using ApplicationLayer.Services.AuthServices.Common; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests | ||||
| { | ||||
|     public record RegisterRequest(AuthData AuthData); | ||||
| } | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests; | ||||
|  | ||||
| public record RegisterRequest(AuthData AuthData); | ||||
| @@ -3,12 +3,12 @@ using ApplicationLayer.Services.AuthServices.NeededServices; | ||||
| using Domains; | ||||
| using FluentValidation; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation; | ||||
|  | ||||
| public class AuthDataValidator : AbstractValidator<AuthData> | ||||
| { | ||||
|     public class AuthDataValidator : AbstractValidator<AuthData> | ||||
|     public AuthDataValidator(IUsersRepository users) | ||||
|     { | ||||
|         public AuthDataValidator(IUsersRepository users) | ||||
|         { | ||||
|             RuleFor(d => d.Email) | ||||
|                 .NotEmpty() | ||||
|                 .WithMessage("Email can not be empty") | ||||
| @@ -28,5 +28,4 @@ namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
|                 .MaximumLength(ConfigurationConstraints.PasswordLength) | ||||
|                 .WithMessage($"Password length must be less than {ConfigurationConstraints.PasswordLength}"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
| @@ -2,12 +2,12 @@ | ||||
| using Domains.ApplicantDomain; | ||||
| using FluentValidation; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation; | ||||
|  | ||||
| public class NameValidator : AbstractValidator<Name> | ||||
| { | ||||
|     public class NameValidator : AbstractValidator<Name> | ||||
|     public NameValidator() | ||||
|     { | ||||
|         public NameValidator() | ||||
|         { | ||||
|             RuleFor(m => m.FirstName) | ||||
|                 .NotEmpty() | ||||
|                 .WithMessage("First Name can not be empty") | ||||
| @@ -24,5 +24,4 @@ namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
|                 .MaximumLength(ConfigurationConstraints.NameLength) | ||||
|                 .WithMessage($"Patronymic length must be less than {ConfigurationConstraints.NameLength}"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
| @@ -3,12 +3,12 @@ using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using FluentValidation; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation; | ||||
|  | ||||
| public class PassportValidator : AbstractValidator<Passport> | ||||
| { | ||||
|     public class PassportValidator : AbstractValidator<Passport> | ||||
|     public PassportValidator(IDateTimeProvider dateTimeProvider) | ||||
|     { | ||||
|         public PassportValidator(IDateTimeProvider dateTimeProvider) | ||||
|         { | ||||
|             RuleFor(r => r.Issuer) | ||||
|                 .NotEmpty() | ||||
|                 .WithMessage("Passport issuer can not be empty") | ||||
| @@ -33,5 +33,4 @@ namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
|                 .LessThanOrEqualTo(dateTimeProvider.Now()) | ||||
|                 .WithMessage("Passport issue date must be in past"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
| @@ -2,12 +2,12 @@ | ||||
| using Domains; | ||||
| using FluentValidation; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation; | ||||
|  | ||||
| public class PlaceOfWorkModelValidator : AbstractValidator<PlaceOfWorkModel> | ||||
| { | ||||
|     public class PlaceOfWorkModelValidator : AbstractValidator<PlaceOfWorkModel> | ||||
|     public PlaceOfWorkModelValidator() | ||||
|     { | ||||
|         public PlaceOfWorkModelValidator() | ||||
|         { | ||||
|             RuleFor(p => p.Name) | ||||
|                 .NotEmpty() | ||||
|                 .WithMessage("Place of work name can not be empty") | ||||
| @@ -46,5 +46,4 @@ namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
|                 .MaximumLength(ConfigurationConstraints.CountryNameLength) | ||||
|                 .WithMessage($"Building of place of work length must be less than {ConfigurationConstraints.BuildingNumberLength}"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
| @@ -5,17 +5,17 @@ using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using FluentValidation; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests.Validation; | ||||
|  | ||||
| public class RegisterApplicantRequestValidator : AbstractValidator<RegisterApplicantRequest> | ||||
| { | ||||
|     public class RegisterApplicantRequestValidator : AbstractValidator<RegisterApplicantRequest> | ||||
|     public RegisterApplicantRequestValidator( | ||||
|         IDateTimeProvider dateTimeProvider, | ||||
|         IValidator<Name> nameValidator, | ||||
|         IValidator<AuthData> authDataValidator, | ||||
|         IValidator<Passport> passportValidator, | ||||
|         IValidator<PlaceOfWorkModel> placeOfWorkModelValidator) | ||||
|     { | ||||
|         public RegisterApplicantRequestValidator( | ||||
|             IDateTimeProvider dateTimeProvider, | ||||
|             IValidator<Name> nameValidator, | ||||
|             IValidator<AuthData> authDataValidator, | ||||
|             IValidator<Passport> passportValidator, | ||||
|             IValidator<PlaceOfWorkModel> placeOfWorkModelValidator) | ||||
|         { | ||||
|             RuleFor(r => r.AuthData) | ||||
|                 .SetValidator(authDataValidator); | ||||
|  | ||||
| @@ -74,5 +74,4 @@ namespace ApplicationLayer.Services.AuthServices.Requests.Validation | ||||
|             RuleFor(r => r.PlaceOfWork) | ||||
|                 .SetValidator(placeOfWorkModelValidator); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user