Register page
This commit is contained in:
		| @@ -0,0 +1,21 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using VisaApiClient; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.FluentValidation.Applicants.Models | ||||
| { | ||||
|     /// Model of place of work with attributes required for validation to work | ||||
|     public class PlaceOfWorkModel | ||||
|     { | ||||
|         [Required] | ||||
|         [StringLength(ConfigurationConstraints.PlaceOfWorkNameLength, MinimumLength = 1)] | ||||
|         public string Name { get; set; } = default!; | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public AddressModel Address { get; set; } = new AddressModel(); | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(ConfigurationConstraints.PhoneNumberLength, MinimumLength = ConfigurationConstraints.PhoneNumberMinLength)] | ||||
|         public string PhoneNum { get; set; } = default!; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,68 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using Newtonsoft.Json; | ||||
| using Newtonsoft.Json.Converters; | ||||
| using VisaApiClient; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.FluentValidation.Applicants.Models | ||||
| { | ||||
|     /// Model of request with attributes required for validation to work | ||||
|     public class RegisterApplicantRequestModel | ||||
|     { | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public RegisterRequestModel RegisterRequest { get; set; } = new(); | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public NameModel ApplicantName { get; set; } = new(); | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public PassportModel Passport { get; set; } = new(); | ||||
|  | ||||
|         [Required(AllowEmptyStrings = true)] | ||||
|         public DateTimeOffset BirthDate { get; set; } | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(70, MinimumLength = 1)] | ||||
|         public string CityOfBirth { get; set; } = default!; | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(70, MinimumLength = 1)] | ||||
|         public string CountryOfBirth { get; set; } = default!; | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(30, MinimumLength = 1)] | ||||
|         public string Citizenship { get; set; } = default!; | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(30, MinimumLength = 1)] | ||||
|         public string CitizenshipByBirth { get; set; } = default!; | ||||
|  | ||||
|         [Required(AllowEmptyStrings = true)] | ||||
|         [JsonConverter(typeof(StringEnumConverter))] | ||||
|         public Gender Gender { get; set; } | ||||
|  | ||||
|         [Required(AllowEmptyStrings = true)] | ||||
|         [JsonConverter(typeof(StringEnumConverter))] | ||||
|         public MaritalStatus MaritalStatus { get; set; } | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public NameModel FatherName { get; set; } = new(); | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public NameModel MotherName { get; set; } = new(); | ||||
|  | ||||
|         [Required] | ||||
|         [StringLength(50, MinimumLength = 1)] | ||||
|         public string JobTitle { get; set; } = default!; | ||||
|  | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public PlaceOfWorkModel PlaceOfWork { get; set; } = new(); | ||||
|  | ||||
|         public bool IsNonResident { get; set; } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,13 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using VisaApiClient; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.FluentValidation.Applicants.Models | ||||
| { | ||||
|     /// Model of request with attributes required for validation to work | ||||
|     public class RegisterRequestModel | ||||
|     { | ||||
|         [Required] | ||||
|         [ValidateComplexType] | ||||
|         public AuthData AuthData { get; set; } = new AuthData(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user