From f90a0e7e822d80b75955b5f9c59b20aaccbd61b7 Mon Sep 17 00:00:00 2001 From: prtsie Date: Fri, 6 Sep 2024 21:37:16 +0300 Subject: [PATCH] Applications.razor for applicants --- .../Services/AuthServices/Common/AuthToken.cs | 9 +- .../VisaApplicationModelForApplicant.cs | 13 +- .../VisaApplicationModelForAuthority.cs | 14 +- .../Components/Auth/AuthComponent.razor | 40 ++--- .../UserDataProvider/IUserDataProvider.cs | 12 ++ .../UserDataProvider/UserDataProvider.cs | 30 ++++ .../Layout/NavMenu.razor | 7 + .../Pages/Applications.razor | 64 +++++--- .../BlazorWebAssemblyVisaApiClient/Program.cs | 2 + .../Infrastructure/Auth/TokenGenerator.cs | 2 +- SchengenVisaApi/VisaApiClient/Client.cs | 146 ++++++++++-------- SchengenVisaApi/VisaApiClient/ClientBase.cs | 7 +- .../VisaApiClient/clientGeneratorConfig.nswag | 6 +- 13 files changed, 227 insertions(+), 125 deletions(-) create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs diff --git a/SchengenVisaApi/ApplicationLayer/Services/AuthServices/Common/AuthToken.cs b/SchengenVisaApi/ApplicationLayer/Services/AuthServices/Common/AuthToken.cs index 14ed58f..7c152ad 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/AuthServices/Common/AuthToken.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/AuthServices/Common/AuthToken.cs @@ -1,4 +1,9 @@ -namespace ApplicationLayer.Services.AuthServices.Common +using System.ComponentModel.DataAnnotations; + +namespace ApplicationLayer.Services.AuthServices.Common { - public record AuthToken(string Token); + public class AuthToken + { + [Required] public string Token { get; set; } = null!; + } } diff --git a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForApplicant.cs b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForApplicant.cs index d12499b..d7898a9 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForApplicant.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForApplicant.cs @@ -1,4 +1,5 @@ -using Domains.VisaApplicationDomain; +using System.ComponentModel.DataAnnotations; +using Domains.VisaApplicationDomain; namespace ApplicationLayer.Services.VisaApplications.Models; @@ -6,38 +7,48 @@ namespace ApplicationLayer.Services.VisaApplications.Models; public class VisaApplicationModelForApplicant { /// + [Required] public Guid Id { get; set; } /// + [Required] public ApplicationStatus Status { get; set; } /// public ReentryPermitModel? ReentryPermit { get; set; } /// + [Required] public string DestinationCountry { get; set; } = null!; /// + [Required] public List PastVisas { get; set; } = null!; /// public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } /// + [Required] public List PastVisits { get; set; } = null!; /// + [Required] public VisaCategory VisaCategory { get; set; } /// + [Required] public bool ForGroup { get; set; } /// + [Required] public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } /// + [Required] public DateTime RequestDate { get; set; } /// + [Required] public int ValidDaysRequested { get; set; } } diff --git a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForAuthority.cs b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForAuthority.cs index 6142168..3feb233 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForAuthority.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/VisaApplicationModelForAuthority.cs @@ -1,4 +1,5 @@ -using ApplicationLayer.Services.Applicants.Models; +using System.ComponentModel.DataAnnotations; +using ApplicationLayer.Services.Applicants.Models; using Domains.VisaApplicationDomain; namespace ApplicationLayer.Services.VisaApplications.Models; @@ -7,40 +8,51 @@ namespace ApplicationLayer.Services.VisaApplications.Models; public class VisaApplicationModelForAuthority { /// + [Required] public Guid Id { get; set; } /// Applicant of application + [Required] public ApplicantModel Applicant { get; set; } = null!; /// + [Required] public ApplicationStatus Status { get; set; } /// public ReentryPermitModel? ReentryPermit { get; set; } /// + [Required] public string DestinationCountry { get; set; } = null!; /// + [Required] public List PastVisas { get; set; } = null!; /// public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } + [Required] public List PastVisits { get; set; } = null!; /// + [Required] public VisaCategory VisaCategory { get; set; } /// + [Required] public bool ForGroup { get; set; } /// + [Required] public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } /// + [Required] public DateTime RequestDate { get; set; } /// + [Required] public int ValidDaysRequested { get; set; } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/Auth/AuthComponent.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/Auth/AuthComponent.razor index f531914..2883b7e 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/Auth/AuthComponent.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/Auth/AuthComponent.razor @@ -1,16 +1,10 @@ @using System.Net -@using System.IdentityModel.Tokens.Jwt -@using System.Security.Claims -@using BlazorWebAssemblyVisaApiClient.Components.Auth.Exceptions @using BlazorWebAssemblyVisaApiClient.ErrorHandling +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider @using VisaApiClient @code { - public static bool LoggedIn; - public static ApplicantModel? CurrentApplicant; //todo api action - public static string? CurrentRole; - private static AuthData savedData = null!; - private static readonly JwtSecurityTokenHandler TokenHandler = new(); + public static AuthData? AuthData; [CascadingParameter] private GlobalErrorHandler ErrorHandler { get; set; } = null!; @@ -20,6 +14,8 @@ [Inject] private NavigationManager Nav { get; set; } = null!; + [Inject] private IUserDataProvider UserDataProvider { get; set; } = null!; + ///Authorize with email and password /// Message to user public async Task TryAuthorize(AuthData authData) @@ -28,12 +24,8 @@ try { var token = await Client.LoginAsync(authData.Email, authData.Password); - Client.SetAuthToken(token); - CurrentRole = TokenHandler.ReadJwtToken(token.Token) - .Claims - .FirstOrDefault(claim => claim.Type == ClaimTypes.Role)? - .Value; - savedData = authData; + Client.AuthToken = token; + AuthData = authData; Status?.SetSucces("Logged in successfully."); } @@ -57,20 +49,18 @@ } ///Re-auth if token expired or something - public async Task ReAuthenticate(bool redirectOnFailure = true) + public async Task ReAuthenticate() { - if (!LoggedIn) + if (AuthData is not null) { - if (redirectOnFailure) - { - Nav.NavigateTo("/"); - return; - } - - throw new NotLoggedInException(); + await TryAuthorize(AuthData); + } + else + { + Client.AuthToken = null; + AuthData = null; + Nav.NavigateTo("/"); } - - await TryAuthorize(savedData); } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs new file mode 100644 index 0000000..5c16af3 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs @@ -0,0 +1,12 @@ +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider +{ + public interface IUserDataProvider + { + + public ApplicantModel? GetApplicant(); + + public string? GetCurrentRole(); + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs new file mode 100644 index 0000000..891d37b --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs @@ -0,0 +1,30 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider +{ + public class UserDataProvider(Client client) : IUserDataProvider + { + private static readonly JwtSecurityTokenHandler tokenHandler = new (); + + public ApplicantModel? GetApplicant() + { + //todo api action + return null; + } + + public string? GetCurrentRole() + { + if (client.AuthToken is null) + { + return null; + } + + var token = tokenHandler.ReadJwtToken(client.AuthToken.Token); + var role = token.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.Role)?.Value; + + return role; + } + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor index 0a20ac1..5c3d358 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor @@ -15,6 +15,13 @@ + @code { diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor index 6915e8b..8d4ac47 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor @@ -1,17 +1,30 @@ @page "/applications" @using System.Net @using System.Text -@using BlazorWebAssemblyVisaApiClient.Components.Auth @using BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider @using VisaApiClient @inherits BlazorWebAssemblyVisaApiClient.Components.Base.VisaClientComponentBase -@(AuthComponent.CurrentRole ?? "bruh") +Applications -@((MarkupString)htmlMarkup) + + + @((MarkupString)htmlHead) + + + @((MarkupString)htmlBody) + +
@code { - private string htmlMarkup = "bruh"; + private string htmlBody = null!; + + private string htmlHead = null!; + + [Inject] private IUserDataProvider UserDataProvider { get; set; } = null!; + + [Inject] private NavigationManager Nav { get; set; } = null!; protected override async Task OnInitializedAsync() { @@ -19,35 +32,42 @@ try { - switch (AuthComponent.CurrentRole) - { - case "Applicant": - var applications = await Client.GetForApplicantAsync(); + switch (UserDataProvider.GetCurrentRole()) + { + case "Applicant": + htmlHead = "Destination CountryVisa CategoryRequest dateDays requestedStatus"; + var applications = await Client.GetForApplicantAsync(); - stringBuilder.AppendLine(""); - foreach (var application in applications) - { - stringBuilder.AppendLine($""); - } + foreach (var application in applications) + { + var rowClass = application.Status switch + { + ApplicationStatus.Pending => "", + ApplicationStatus.Approved => "table-success", + ApplicationStatus.Rejected => "table-danger", + ApplicationStatus.Closed => "table-danger", + _ => throw new ArgumentOutOfRangeException() + }; - stringBuilder.AppendLine("
Destination CountryVisa CategoryRequest dateDays requestedStatus
{application.DestinationCountry}{application.VisaCategory.GetDisplayName()}{application.RequestDate.ToString("d")}{application.ValidDaysRequested}{application.Status.GetDisplayName()}
"); - htmlMarkup = stringBuilder.ToString(); - break; + stringBuilder.AppendLine($"{application.DestinationCountry}{application.VisaCategory.GetDisplayName()}{application.RequestDate.ToString("d")}{application.ValidDaysRequested}{application.Status.GetDisplayName()}"); + } + + htmlBody = stringBuilder.ToString(); + break; default: - htmlMarkup = AuthComponent.CurrentRole; - break; - } + Nav.NavigateTo("/"); //todo feedback + break; + } } catch (Exception e) { if (e is ApiException { Result.Status: (int)HttpStatusCode.Unauthorized } problemDetailsException) { - htmlMarkup = problemDetailsException.Result.Detail!; + htmlBody = $"

{problemDetailsException.Result.Detail!}

"; } else { - //ErrorHandler.Handle(e); - throw; + ErrorHandler.Handle(e); } } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Program.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Program.cs index 2b4cb76..e011331 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Program.cs +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Program.cs @@ -1,5 +1,6 @@ using System.Reflection; using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; +using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider; using FluentValidation; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; @@ -23,6 +24,7 @@ public class Program builder.Services.AddScoped(sp => new Client(baseAddress, sp.GetRequiredService())); builder.Services.AddSingleton(); + builder.Services.AddScoped(); builder.Services.AddAutoMapper(Assembly.GetExecutingAssembly()); builder.Services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly()); diff --git a/SchengenVisaApi/Infrastructure/Auth/TokenGenerator.cs b/SchengenVisaApi/Infrastructure/Auth/TokenGenerator.cs index dd012f6..e40a76c 100644 --- a/SchengenVisaApi/Infrastructure/Auth/TokenGenerator.cs +++ b/SchengenVisaApi/Infrastructure/Auth/TokenGenerator.cs @@ -29,6 +29,6 @@ public class TokenGenerator(TokenGeneratorOptions options, JwtSecurityTokenHandl signingCredentials: options.Credentials, claims: claims); - return new AuthToken(tokenHandler.WriteToken(token)); + return new AuthToken { Token = tokenHandler.WriteToken(token) }; } } diff --git a/SchengenVisaApi/VisaApiClient/Client.cs b/SchengenVisaApi/VisaApiClient/Client.cs index b084c8c..6a7e5d5 100644 --- a/SchengenVisaApi/VisaApiClient/Client.cs +++ b/SchengenVisaApi/VisaApiClient/Client.cs @@ -1494,14 +1494,14 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApplicantModel { - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel Name { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public NameModel? Name { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("passport", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PassportModel Passport { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("passport", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PassportModel? Passport { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("birthDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset BirthDate { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("birthDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? BirthDate { get; set; } = default!; [Newtonsoft.Json.JsonProperty("countryOfBirth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string? CountryOfBirth { get; set; } = default!; @@ -1515,28 +1515,28 @@ namespace VisaApiClient [Newtonsoft.Json.JsonProperty("citizenshipByBirth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string? CitizenshipByBirth { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("gender", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("gender", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public Gender Gender { get; set; } = default!; + public Gender? Gender { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("maritalStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("maritalStatus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public MaritalStatus MaritalStatus { get; set; } = default!; + public MaritalStatus? MaritalStatus { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("fatherName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel FatherName { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("fatherName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public NameModel? FatherName { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("motherName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel MotherName { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("motherName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public NameModel? MotherName { get; set; } = default!; [Newtonsoft.Json.JsonProperty("jobTitle", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string? JobTitle { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("placeOfWork", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PlaceOfWorkModel PlaceOfWork { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("placeOfWork", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PlaceOfWorkModel? PlaceOfWork { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("isNonResident", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool IsNonResident { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("isNonResident", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsNonResident { get; set; } = default!; } @@ -1576,8 +1576,9 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AuthToken { - [Newtonsoft.Json.JsonProperty("token", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? Token { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("token", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Token { get; set; } = default!; } @@ -1713,8 +1714,8 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PermissionToDestCountryModel { - [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset ExpirationDate { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? ExpirationDate { get; set; } = default!; [Newtonsoft.Json.JsonProperty("issuer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.StringLength(200)] @@ -1777,8 +1778,8 @@ namespace VisaApiClient [System.ComponentModel.DataAnnotations.StringLength(25)] public string? Number { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset ExpirationDate { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? ExpirationDate { get; set; } = default!; } @@ -1894,8 +1895,8 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class VisaApplicationCreateRequest { - [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ReentryPermitModel ReentryPermit { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ReentryPermitModel? ReentryPermit { get; set; } = default!; [Newtonsoft.Json.JsonProperty("destinationCountry", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] @@ -1923,8 +1924,8 @@ namespace VisaApiClient [System.ComponentModel.DataAnnotations.Required] public System.Collections.Generic.ICollection PastVisas { get; set; } = new System.Collections.ObjectModel.Collection(); - [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PermissionToDestCountryModel PermissionToDestCountry { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } = default!; [Newtonsoft.Json.JsonProperty("pastVisits", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] @@ -1935,43 +1936,51 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class VisaApplicationModelForApplicant { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid Id { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public ApplicationStatus Status { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ReentryPermitModel ReentryPermit { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ReentryPermitModel? ReentryPermit { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("destinationCountry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? DestinationCountry { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("destinationCountry", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string DestinationCountry { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("pastVisas", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection? PastVisas { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("pastVisas", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection PastVisas { get; set; } = new System.Collections.ObjectModel.Collection(); - [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PermissionToDestCountryModel PermissionToDestCountry { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("pastVisits", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection? PastVisits { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("pastVisits", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection PastVisits { get; set; } = new System.Collections.ObjectModel.Collection(); - [Newtonsoft.Json.JsonProperty("visaCategory", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("visaCategory", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public VisaCategory VisaCategory { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("forGroup", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("forGroup", Required = Newtonsoft.Json.Required.Always)] public bool ForGroup { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("requestedNumberOfEntries", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("requestedNumberOfEntries", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("requestDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("requestDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.DateTimeOffset RequestDate { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("validDaysRequested", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("validDaysRequested", Required = Newtonsoft.Json.Required.Always)] public int ValidDaysRequested { get; set; } = default!; } @@ -1979,46 +1988,55 @@ namespace VisaApiClient [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class VisaApplicationModelForAuthority { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid Id { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("applicant", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ApplicantModel Applicant { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("applicant", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ApplicantModel Applicant { get; set; } = new ApplicantModel(); - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public ApplicationStatus Status { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ReentryPermitModel ReentryPermit { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("reentryPermit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ReentryPermitModel? ReentryPermit { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("destinationCountry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? DestinationCountry { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("destinationCountry", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string DestinationCountry { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("pastVisas", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection? PastVisas { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("pastVisas", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection PastVisas { get; set; } = new System.Collections.ObjectModel.Collection(); - [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PermissionToDestCountryModel PermissionToDestCountry { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("permissionToDestCountry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("pastVisits", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection? PastVisits { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("pastVisits", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection PastVisits { get; set; } = new System.Collections.ObjectModel.Collection(); - [Newtonsoft.Json.JsonProperty("visaCategory", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("visaCategory", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public VisaCategory VisaCategory { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("forGroup", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("forGroup", Required = Newtonsoft.Json.Required.Always)] public bool ForGroup { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("requestedNumberOfEntries", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("requestedNumberOfEntries", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("requestDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("requestDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.DateTimeOffset RequestDate { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("validDaysRequested", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("validDaysRequested", Required = Newtonsoft.Json.Required.Always)] public int ValidDaysRequested { get; set; } = default!; } diff --git a/SchengenVisaApi/VisaApiClient/ClientBase.cs b/SchengenVisaApi/VisaApiClient/ClientBase.cs index 5fcdbe5..b4150b8 100644 --- a/SchengenVisaApi/VisaApiClient/ClientBase.cs +++ b/SchengenVisaApi/VisaApiClient/ClientBase.cs @@ -4,12 +4,7 @@ namespace VisaApiClient { public class ClientBase { - protected AuthToken? AuthToken { get; private set; } - - public void SetAuthToken(AuthToken token) - { - AuthToken = token; - } + public AuthToken? AuthToken { get; set; } protected Task CreateHttpRequestMessageAsync(CancellationToken cancellationToken) { diff --git a/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag b/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag index d7f5a18..7c81e8b 100644 --- a/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag +++ b/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag @@ -3,7 +3,7 @@ "defaultVariables": null, "documentGenerator": { "fromDocument": { - "json": "{\r\n \"openapi\": \"3.0.1\",\r\n \"info\": {\r\n \"title\": \"SchengenVisaApi\",\r\n \"version\": \"1.0\"\r\n },\r\n \"paths\": {\r\n \"/users/register\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Adds applicant with user account\",\r\n \"operationId\": \"Register\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/authorities\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Adds approving authority with user account\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"RegisterAuthority\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"get\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Returns list of authority accounts\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"GetAuthorityAccounts\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/login\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Returns JWT-token for authentication\",\r\n \"operationId\": \"Login\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"email\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": \"password\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/authorities/{authorityAccountId}\": {\r\n \"put\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Changes authority's account authentication data\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"ChangeAuthorityAuthData\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"authorityAccountId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"delete\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Removes authority's account\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"RemoveAuthorityAccount\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"authorityAccountId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/pending\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Returns pending applications\",\r\n \"description\": \"Accessible only for approving authorities\",\r\n \"operationId\": \"GetPending\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/ofApplicant\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Returns all applications of one applicant\",\r\n \"description\": \"Returns applications of authorized applicant\",\r\n \"operationId\": \"GetForApplicant\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Adds new application\",\r\n \"description\": \"Adds application for authorized applicant\",\r\n \"operationId\": \"CreateApplication\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/{applicationId}\": {\r\n \"patch\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Sets application status to closed\",\r\n \"description\": \"Accessible only for applicant\",\r\n \"operationId\": \"CloseApplication\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"applicationId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/approving/{applicationId}\": {\r\n \"patch\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Approve or reject applications\",\r\n \"description\": \"Accessible only for authorities\",\r\n \"operationId\": \"SetStatusFromAuthority\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"applicationId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n },\r\n {\r\n \"name\": \"status\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthorityRequestStatuses\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"AddressModel\": {\r\n \"required\": [\r\n \"building\",\r\n \"city\",\r\n \"country\",\r\n \"street\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"country\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"city\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"street\": {\r\n \"maxLength\": 100,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"building\": {\r\n \"maxLength\": 10,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ApplicantModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"passport\": {\r\n \"$ref\": \"#/components/schemas/PassportModel\"\r\n },\r\n \"birthDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"countryOfBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"cityOfBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"citizenship\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"citizenshipByBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"gender\": {\r\n \"$ref\": \"#/components/schemas/Gender\"\r\n },\r\n \"maritalStatus\": {\r\n \"$ref\": \"#/components/schemas/MaritalStatus\"\r\n },\r\n \"fatherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"motherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"jobTitle\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"placeOfWork\": {\r\n \"$ref\": \"#/components/schemas/PlaceOfWorkModel\"\r\n },\r\n \"isNonResident\": {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ApplicationStatus\": {\r\n \"enum\": [\r\n \"Pending\",\r\n \"Approved\",\r\n \"Rejected\",\r\n \"Closed\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"AuthData\": {\r\n \"required\": [\r\n \"email\",\r\n \"password\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"email\": {\r\n \"maxLength\": 254,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"password\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"AuthToken\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"token\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"AuthorityRequestStatuses\": {\r\n \"enum\": [\r\n \"Approved\",\r\n \"Rejected\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"Gender\": {\r\n \"enum\": [\r\n \"Unknown\",\r\n \"Male\",\r\n \"Female\",\r\n \"Turkish\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"MaritalStatus\": {\r\n \"enum\": [\r\n \"Other\",\r\n \"Married\",\r\n \"Unmarried\",\r\n \"Separated\",\r\n \"WidowOrWidower\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"NameModel\": {\r\n \"required\": [\r\n \"firstName\",\r\n \"surname\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"firstName\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"surname\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"patronymic\": {\r\n \"maxLength\": 50,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PassportModel\": {\r\n \"required\": [\r\n \"expirationDate\",\r\n \"issueDate\",\r\n \"issuer\",\r\n \"number\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"number\": {\r\n \"maxLength\": 20,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"issuer\": {\r\n \"maxLength\": 200,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"issueDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PastVisaModel\": {\r\n \"required\": [\r\n \"expirationDate\",\r\n \"issueDate\",\r\n \"name\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"issueDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"name\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PastVisitModel\": {\r\n \"required\": [\r\n \"destinationCountry\",\r\n \"endDate\",\r\n \"startDate\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"startDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"endDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"destinationCountry\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PermissionToDestCountryModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"issuer\": {\r\n \"maxLength\": 200,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PlaceOfWorkModel\": {\r\n \"required\": [\r\n \"address\",\r\n \"name\",\r\n \"phoneNum\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"maxLength\": 200,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"address\": {\r\n \"$ref\": \"#/components/schemas/AddressModel\"\r\n },\r\n \"phoneNum\": {\r\n \"maxLength\": 13,\r\n \"minLength\": 11,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ProblemDetails\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"type\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"title\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"status\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\",\r\n \"nullable\": true\r\n },\r\n \"detail\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"instance\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": {}\r\n },\r\n \"ReentryPermitModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"number\": {\r\n \"maxLength\": 25,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RegisterApplicantRequest\": {\r\n \"required\": [\r\n \"applicantName\",\r\n \"birthDate\",\r\n \"citizenship\",\r\n \"citizenshipByBirth\",\r\n \"cityOfBirth\",\r\n \"countryOfBirth\",\r\n \"fatherName\",\r\n \"gender\",\r\n \"isNonResident\",\r\n \"jobTitle\",\r\n \"maritalStatus\",\r\n \"motherName\",\r\n \"passport\",\r\n \"placeOfWork\",\r\n \"registerRequest\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"registerRequest\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n },\r\n \"applicantName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"passport\": {\r\n \"$ref\": \"#/components/schemas/PassportModel\"\r\n },\r\n \"birthDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"cityOfBirth\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"countryOfBirth\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenship\": {\r\n \"maxLength\": 30,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenshipByBirth\": {\r\n \"maxLength\": 30,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"gender\": {\r\n \"$ref\": \"#/components/schemas/Gender\"\r\n },\r\n \"maritalStatus\": {\r\n \"$ref\": \"#/components/schemas/MaritalStatus\"\r\n },\r\n \"fatherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"motherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"jobTitle\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"placeOfWork\": {\r\n \"$ref\": \"#/components/schemas/PlaceOfWorkModel\"\r\n },\r\n \"isNonResident\": {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RegisterRequest\": {\r\n \"required\": [\r\n \"authData\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"authData\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RequestedNumberOfEntries\": {\r\n \"enum\": [\r\n \"Many\",\r\n \"One\",\r\n \"Two\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"UserModel\": {\r\n \"required\": [\r\n \"email\",\r\n \"id\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\",\r\n \"readOnly\": true\r\n },\r\n \"email\": {\r\n \"maxLength\": 254,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationCreateRequest\": {\r\n \"required\": [\r\n \"destinationCountry\",\r\n \"isForGroup\",\r\n \"pastVisas\",\r\n \"pastVisits\",\r\n \"requestedNumberOfEntries\",\r\n \"validDaysRequested\",\r\n \"visaCategory\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"isForGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"validDaysRequested\": {\r\n \"maximum\": 90,\r\n \"minimum\": 0,\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n }\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n }\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationModelForApplicant\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"status\": {\r\n \"$ref\": \"#/components/schemas/ApplicationStatus\"\r\n },\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n },\r\n \"nullable\": true\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n },\r\n \"nullable\": true\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"forGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"requestDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"validDaysRequested\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationModelForAuthority\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"applicant\": {\r\n \"$ref\": \"#/components/schemas/ApplicantModel\"\r\n },\r\n \"status\": {\r\n \"$ref\": \"#/components/schemas/ApplicationStatus\"\r\n },\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n },\r\n \"nullable\": true\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n },\r\n \"nullable\": true\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"forGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"requestDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"validDaysRequested\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaCategory\": {\r\n \"enum\": [\r\n \"Transit\",\r\n \"ShortDated\"\r\n ],\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"securitySchemes\": {\r\n \"Bearer\": {\r\n \"type\": \"http\",\r\n \"description\": \"Provide a JWT-token.\",\r\n \"scheme\": \"Bearer\",\r\n \"bearerFormat\": \"JWT\"\r\n }\r\n }\r\n },\r\n \"security\": [\r\n {\r\n \"Bearer\": []\r\n }\r\n ]\r\n}", + "json": "{\r\n \"openapi\": \"3.0.1\",\r\n \"info\": {\r\n \"title\": \"SchengenVisaApi\",\r\n \"version\": \"1.0\"\r\n },\r\n \"paths\": {\r\n \"/users/register\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Adds applicant with user account\",\r\n \"operationId\": \"Register\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterApplicantRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/authorities\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Adds approving authority with user account\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"RegisterAuthority\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"get\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Returns list of authority accounts\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"GetAuthorityAccounts\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/UserModel\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/login\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Returns JWT-token for authentication\",\r\n \"operationId\": \"Login\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"email\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": \"password\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthToken\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/users/authorities/{authorityAccountId}\": {\r\n \"put\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Changes authority's account authentication data\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"ChangeAuthorityAuthData\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"authorityAccountId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"delete\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Removes authority's account\",\r\n \"description\": \"Accessible only for admins\",\r\n \"operationId\": \"RemoveAuthorityAccount\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"authorityAccountId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/pending\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Returns pending applications\",\r\n \"description\": \"Accessible only for approving authorities\",\r\n \"operationId\": \"GetPending\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForAuthority\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/ofApplicant\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Returns all applications of one applicant\",\r\n \"description\": \"Returns applications of authorized applicant\",\r\n \"operationId\": \"GetForApplicant\",\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationModelForApplicant\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications\": {\r\n \"post\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Adds new application\",\r\n \"description\": \"Adds application for authorized applicant\",\r\n \"operationId\": \"CreateApplication\",\r\n \"requestBody\": {\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n },\r\n \"application/*+json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/VisaApplicationCreateRequest\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/{applicationId}\": {\r\n \"patch\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Sets application status to closed\",\r\n \"description\": \"Accessible only for applicant\",\r\n \"operationId\": \"CloseApplication\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"applicationId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": {\r\n \"description\": \"Bad Request\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/visaApplications/approving/{applicationId}\": {\r\n \"patch\": {\r\n \"tags\": [\r\n \"VisaApplication\"\r\n ],\r\n \"summary\": \"Approve or reject applications\",\r\n \"description\": \"Accessible only for authorities\",\r\n \"operationId\": \"SetStatusFromAuthority\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"applicationId\",\r\n \"in\": \"path\",\r\n \"required\": true,\r\n \"schema\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n }\r\n },\r\n {\r\n \"name\": \"status\",\r\n \"in\": \"query\",\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/AuthorityRequestStatuses\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Success\"\r\n },\r\n \"403\": {\r\n \"description\": \"Forbidden\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"401\": {\r\n \"description\": \"Unauthorized\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n },\r\n \"404\": {\r\n \"description\": \"Not Found\",\r\n \"content\": {\r\n \"text/plain\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ProblemDetails\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"AddressModel\": {\r\n \"required\": [\r\n \"building\",\r\n \"city\",\r\n \"country\",\r\n \"street\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"country\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"city\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"street\": {\r\n \"maxLength\": 100,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"building\": {\r\n \"maxLength\": 10,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ApplicantModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"passport\": {\r\n \"$ref\": \"#/components/schemas/PassportModel\"\r\n },\r\n \"birthDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"countryOfBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"cityOfBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"citizenship\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"citizenshipByBirth\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"gender\": {\r\n \"$ref\": \"#/components/schemas/Gender\"\r\n },\r\n \"maritalStatus\": {\r\n \"$ref\": \"#/components/schemas/MaritalStatus\"\r\n },\r\n \"fatherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"motherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"jobTitle\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"placeOfWork\": {\r\n \"$ref\": \"#/components/schemas/PlaceOfWorkModel\"\r\n },\r\n \"isNonResident\": {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ApplicationStatus\": {\r\n \"enum\": [\r\n \"Pending\",\r\n \"Approved\",\r\n \"Rejected\",\r\n \"Closed\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"AuthData\": {\r\n \"required\": [\r\n \"email\",\r\n \"password\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"email\": {\r\n \"maxLength\": 254,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"password\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"AuthToken\": {\r\n \"required\": [\r\n \"token\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"token\": {\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"AuthorityRequestStatuses\": {\r\n \"enum\": [\r\n \"Approved\",\r\n \"Rejected\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"Gender\": {\r\n \"enum\": [\r\n \"Unknown\",\r\n \"Male\",\r\n \"Female\",\r\n \"Turkish\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"MaritalStatus\": {\r\n \"enum\": [\r\n \"Other\",\r\n \"Married\",\r\n \"Unmarried\",\r\n \"Separated\",\r\n \"WidowOrWidower\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"NameModel\": {\r\n \"required\": [\r\n \"firstName\",\r\n \"surname\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"firstName\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"surname\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"patronymic\": {\r\n \"maxLength\": 50,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PassportModel\": {\r\n \"required\": [\r\n \"expirationDate\",\r\n \"issueDate\",\r\n \"issuer\",\r\n \"number\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"number\": {\r\n \"maxLength\": 20,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"issuer\": {\r\n \"maxLength\": 200,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"issueDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PastVisaModel\": {\r\n \"required\": [\r\n \"expirationDate\",\r\n \"issueDate\",\r\n \"name\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"issueDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"name\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PastVisitModel\": {\r\n \"required\": [\r\n \"destinationCountry\",\r\n \"endDate\",\r\n \"startDate\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"startDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"endDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"destinationCountry\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PermissionToDestCountryModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"issuer\": {\r\n \"maxLength\": 200,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"PlaceOfWorkModel\": {\r\n \"required\": [\r\n \"address\",\r\n \"name\",\r\n \"phoneNum\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"maxLength\": 200,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"address\": {\r\n \"$ref\": \"#/components/schemas/AddressModel\"\r\n },\r\n \"phoneNum\": {\r\n \"maxLength\": 13,\r\n \"minLength\": 11,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"ProblemDetails\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"type\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"title\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"status\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\",\r\n \"nullable\": true\r\n },\r\n \"detail\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"instance\": {\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n }\r\n },\r\n \"additionalProperties\": {}\r\n },\r\n \"ReentryPermitModel\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"number\": {\r\n \"maxLength\": 25,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"expirationDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RegisterApplicantRequest\": {\r\n \"required\": [\r\n \"applicantName\",\r\n \"birthDate\",\r\n \"citizenship\",\r\n \"citizenshipByBirth\",\r\n \"cityOfBirth\",\r\n \"countryOfBirth\",\r\n \"fatherName\",\r\n \"gender\",\r\n \"isNonResident\",\r\n \"jobTitle\",\r\n \"maritalStatus\",\r\n \"motherName\",\r\n \"passport\",\r\n \"placeOfWork\",\r\n \"registerRequest\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"registerRequest\": {\r\n \"$ref\": \"#/components/schemas/RegisterRequest\"\r\n },\r\n \"applicantName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"passport\": {\r\n \"$ref\": \"#/components/schemas/PassportModel\"\r\n },\r\n \"birthDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"cityOfBirth\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"countryOfBirth\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenship\": {\r\n \"maxLength\": 30,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenshipByBirth\": {\r\n \"maxLength\": 30,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"gender\": {\r\n \"$ref\": \"#/components/schemas/Gender\"\r\n },\r\n \"maritalStatus\": {\r\n \"$ref\": \"#/components/schemas/MaritalStatus\"\r\n },\r\n \"fatherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"motherName\": {\r\n \"$ref\": \"#/components/schemas/NameModel\"\r\n },\r\n \"jobTitle\": {\r\n \"maxLength\": 50,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"placeOfWork\": {\r\n \"$ref\": \"#/components/schemas/PlaceOfWorkModel\"\r\n },\r\n \"isNonResident\": {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RegisterRequest\": {\r\n \"required\": [\r\n \"authData\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"authData\": {\r\n \"$ref\": \"#/components/schemas/AuthData\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"RequestedNumberOfEntries\": {\r\n \"enum\": [\r\n \"Many\",\r\n \"One\",\r\n \"Two\"\r\n ],\r\n \"type\": \"string\"\r\n },\r\n \"UserModel\": {\r\n \"required\": [\r\n \"email\",\r\n \"id\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\",\r\n \"readOnly\": true\r\n },\r\n \"email\": {\r\n \"maxLength\": 254,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationCreateRequest\": {\r\n \"required\": [\r\n \"destinationCountry\",\r\n \"isForGroup\",\r\n \"pastVisas\",\r\n \"pastVisits\",\r\n \"requestedNumberOfEntries\",\r\n \"validDaysRequested\",\r\n \"visaCategory\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"maxLength\": 70,\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"isForGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"validDaysRequested\": {\r\n \"maximum\": 90,\r\n \"minimum\": 0,\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n }\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n }\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationModelForApplicant\": {\r\n \"required\": [\r\n \"destinationCountry\",\r\n \"forGroup\",\r\n \"id\",\r\n \"pastVisas\",\r\n \"pastVisits\",\r\n \"requestDate\",\r\n \"requestedNumberOfEntries\",\r\n \"status\",\r\n \"validDaysRequested\",\r\n \"visaCategory\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"status\": {\r\n \"$ref\": \"#/components/schemas/ApplicationStatus\"\r\n },\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n }\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n }\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"forGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"requestDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"validDaysRequested\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaApplicationModelForAuthority\": {\r\n \"required\": [\r\n \"applicant\",\r\n \"destinationCountry\",\r\n \"forGroup\",\r\n \"id\",\r\n \"pastVisas\",\r\n \"pastVisits\",\r\n \"requestDate\",\r\n \"requestedNumberOfEntries\",\r\n \"status\",\r\n \"validDaysRequested\",\r\n \"visaCategory\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"applicant\": {\r\n \"$ref\": \"#/components/schemas/ApplicantModel\"\r\n },\r\n \"status\": {\r\n \"$ref\": \"#/components/schemas/ApplicationStatus\"\r\n },\r\n \"reentryPermit\": {\r\n \"$ref\": \"#/components/schemas/ReentryPermitModel\"\r\n },\r\n \"destinationCountry\": {\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"pastVisas\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisaModel\"\r\n }\r\n },\r\n \"permissionToDestCountry\": {\r\n \"$ref\": \"#/components/schemas/PermissionToDestCountryModel\"\r\n },\r\n \"pastVisits\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/PastVisitModel\"\r\n }\r\n },\r\n \"visaCategory\": {\r\n \"$ref\": \"#/components/schemas/VisaCategory\"\r\n },\r\n \"forGroup\": {\r\n \"type\": \"boolean\"\r\n },\r\n \"requestedNumberOfEntries\": {\r\n \"$ref\": \"#/components/schemas/RequestedNumberOfEntries\"\r\n },\r\n \"requestDate\": {\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n },\r\n \"validDaysRequested\": {\r\n \"type\": \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"additionalProperties\": false\r\n },\r\n \"VisaCategory\": {\r\n \"enum\": [\r\n \"Transit\",\r\n \"ShortDated\"\r\n ],\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"securitySchemes\": {\r\n \"Bearer\": {\r\n \"type\": \"http\",\r\n \"description\": \"Provide a JWT-token.\",\r\n \"scheme\": \"Bearer\",\r\n \"bearerFormat\": \"JWT\"\r\n }\r\n }\r\n },\r\n \"security\": [\r\n {\r\n \"Bearer\": []\r\n }\r\n ]\r\n}", "url": "https://localhost:44370/swagger/v1/swagger.json", "output": null, "newLineBehavior": "Auto" @@ -89,7 +89,7 @@ "inlineNamedTuples": true, "inlineNamedAny": false, "generateDtoTypes": true, - "generateOptionalPropertiesAsNullable": false, + "generateOptionalPropertiesAsNullable": true, "generateNullableReferenceTypes": true, "templateDirectory": null, "serviceHost": null, @@ -98,4 +98,4 @@ "newLineBehavior": "Auto" } } -} +} \ No newline at end of file