Register page

This commit is contained in:
2024-09-01 17:47:49 +03:00
parent 743531e6d4
commit 65876be551
32 changed files with 935 additions and 146 deletions

View File

@@ -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!;
}
}

View File

@@ -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; }
}
}

View File

@@ -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();
}
}