refactorrr
This commit is contained in:
		| @@ -0,0 +1,18 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.Validation.Applicants.Models | ||||
| { | ||||
|     public enum MaritalStatusModel | ||||
|     { | ||||
|         Other = 0, | ||||
|  | ||||
|         Married = 1, | ||||
|  | ||||
|         Unmarried = 2, | ||||
|  | ||||
|         Separated = 3, | ||||
|  | ||||
|         [Display(Name = "Widow or widower")] | ||||
|         WidowOrWidower = 4 | ||||
|     } | ||||
| } | ||||
| @@ -45,7 +45,7 @@ public class RegisterApplicantRequestModel | ||||
|  | ||||
|     [Required(AllowEmptyStrings = true)] | ||||
|     [JsonConverter(typeof(StringEnumConverter))] | ||||
|     public MaritalStatus MaritalStatus { get; set; } | ||||
|     public MaritalStatusModel MaritalStatus { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     [ValidateComplexType] | ||||
| @@ -64,4 +64,4 @@ public class RegisterApplicantRequestModel | ||||
|     public PlaceOfWorkModel PlaceOfWork { get; set; } = new(); | ||||
|  | ||||
|     public bool IsNonResident { get; set; } | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -14,7 +14,7 @@ public class VisaApplicationCreateRequestModel | ||||
|     public string DestinationCountry { get; set; } = default!; | ||||
|  | ||||
|     [Required] | ||||
|     public VisaCategory VisaCategory { get; set; } | ||||
|     public VisaCategoryModel VisaCategory { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     public bool IsForGroup { get; set; } | ||||
| @@ -34,4 +34,4 @@ public class VisaApplicationCreateRequestModel | ||||
|  | ||||
|     [ValidateComplexType] | ||||
|     public List<PastVisitModel> PastVisits { get; set; } = []; | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,11 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models | ||||
| { | ||||
|     public enum VisaCategoryModel | ||||
|     { | ||||
|         Transit = 0, | ||||
|         [Display(Name = "Short dated")] | ||||
|         ShortDated = 1 | ||||
|     } | ||||
| } | ||||
| @@ -18,7 +18,7 @@ public class VisaApplicationCreateRequestValidator : AbstractValidator<VisaAppli | ||||
|             .NotEmpty() | ||||
|             .WithMessage("For transit you must provide permission to destination country") | ||||
|             .SetValidator(permissionToDestCountryModelValidator) | ||||
|             .When(r => r.VisaCategory is VisaCategory.Transit); | ||||
|             .When(r => r.VisaCategory is VisaCategoryModel.Transit); | ||||
|  | ||||
|         RuleFor(r => r.ReentryPermit) | ||||
|             .NotEmpty() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user