From c197a45f8379a523b3ecd28812a5292d17c58a09 Mon Sep 17 00:00:00 2001 From: prtsie Date: Fri, 6 Sep 2024 23:31:07 +0300 Subject: [PATCH] Application creating but without past visas and visits --- .../Applicants/Models/ApplicantModel.cs | 17 +- .../Services/Users/IUsersService.cs | 7 +- .../Services/Users/UsersService.cs | 16 +- .../Models/PermissionToDestCountryModel.cs | 2 + .../Models/ReentryPermitModel.cs | 2 + .../PermissionToDestCountryInput.razor | 2 +- .../VisaApplications/ReentryPermitInput.razor | 34 +++ .../ErrorHandling/GlobalErrorHandler.razor | 11 +- .../VisaApplicationCreateRequestProfile.cs | 14 ++ .../Helpers/ValidationResultExtensions.cs | 22 ++ .../UserDataProvider/IUserDataProvider.cs | 2 +- .../UserDataProvider/UserDataProvider.cs | 5 +- .../Layout/NavMenu.razor | 7 + .../Pages/Applications.razor | 8 - .../Pages/CreateApplication.razor | 97 +++++++-- .../Pages/Register.razor | 18 +- .../VisaApplicationCreateRequestModel.cs | 2 - .../Validators/PastVisaModelValidator.cs | 27 +++ .../Validators/PastVisitModelValidator.cs | 29 +++ .../PermissionToDestCountryModelValidator.cs | 23 ++ ...aApplicationCreateRequestModelValidator.cs | 42 ++++ .../Controllers/UsersController.cs | 16 +- SchengenVisaApi/VisaApiClient/Client.cs | 197 ++++++++++++++---- .../VisaApiClient/clientGeneratorConfig.nswag | 2 +- 24 files changed, 516 insertions(+), 86 deletions(-) create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/ReentryPermitInput.razor create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/AutoMapper/Profiles/VisaApplicationCreateRequestProfile.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Helpers/ValidationResultExtensions.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisaModelValidator.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisitModelValidator.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PermissionToDestCountryModelValidator.cs create mode 100644 SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/VisaApplicationCreateRequestModelValidator.cs diff --git a/SchengenVisaApi/ApplicationLayer/Services/Applicants/Models/ApplicantModel.cs b/SchengenVisaApi/ApplicationLayer/Services/Applicants/Models/ApplicantModel.cs index eecdd6d..1697dbf 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/Applicants/Models/ApplicantModel.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/Applicants/Models/ApplicantModel.cs @@ -1,4 +1,5 @@ -using Domains.ApplicantDomain; +using System.ComponentModel.DataAnnotations; +using Domains.ApplicantDomain; namespace ApplicationLayer.Services.Applicants.Models; @@ -6,44 +7,58 @@ namespace ApplicationLayer.Services.Applicants.Models; public class ApplicantModel { /// + [Required] public NameModel Name { get; set; } = null!; /// + [Required] public PassportModel Passport { get; set; } = null!; /// + [Required] public DateTime BirthDate { get; set; } /// + [Required] public string CountryOfBirth { get; set; } = null!; /// + [Required] public string CityOfBirth { get; set; } = null!; /// + [Required] public string Citizenship { get; set; } = null!; /// + [Required] public string CitizenshipByBirth { get; set; } = null!; /// + [Required] public Gender Gender { get; set; } /// + [Required] public MaritalStatus MaritalStatus { get; set; } /// + [Required] public NameModel FatherName { get; set; } = null!; /// + [Required] public NameModel MotherName { get; set; } = null!; /// + [Required] public string JobTitle { get; set; } = null!; /// + [Required] public PlaceOfWorkModel PlaceOfWork { get; set; } = null!; /// + [Required] public bool IsNonResident { get; set; } } diff --git a/SchengenVisaApi/ApplicationLayer/Services/Users/IUsersService.cs b/SchengenVisaApi/ApplicationLayer/Services/Users/IUsersService.cs index a0a1840..a243394 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/Users/IUsersService.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/Users/IUsersService.cs @@ -1,4 +1,5 @@ -using ApplicationLayer.Services.Users.Models; +using ApplicationLayer.Services.Applicants.Models; +using ApplicationLayer.Services.Users.Models; using ApplicationLayer.Services.Users.Requests; namespace ApplicationLayer.Services.Users; @@ -19,4 +20,8 @@ public interface IUsersService /// Identifier of account /// Cancellation token Task RemoveAuthorityAccount(Guid userId, CancellationToken cancellationToken); + + /// Get applicant that made request + /// cancellation token + Task GetAuthenticatedApplicant(CancellationToken cancellationToken); } diff --git a/SchengenVisaApi/ApplicationLayer/Services/Users/UsersService.cs b/SchengenVisaApi/ApplicationLayer/Services/Users/UsersService.cs index 529090a..0855cb5 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/Users/UsersService.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/Users/UsersService.cs @@ -1,4 +1,6 @@ using ApplicationLayer.InfrastructureServicesInterfaces; +using ApplicationLayer.Services.Applicants.Models; +using ApplicationLayer.Services.Applicants.NeededServices; using ApplicationLayer.Services.AuthServices.Common; using ApplicationLayer.Services.AuthServices.NeededServices; using ApplicationLayer.Services.Users.Exceptions; @@ -9,7 +11,12 @@ using Domains.Users; namespace ApplicationLayer.Services.Users; -public class UsersService(IMapper mapper, IUsersRepository users, IUnitOfWork unitOfWork) : IUsersService +public class UsersService( + IMapper mapper, + IUserIdProvider userIdProvider, + IUsersRepository users, + IApplicantsRepository applicants, + IUnitOfWork unitOfWork) : IUsersService { async Task> IUsersService.GetAuthoritiesAccountsAsync(CancellationToken cancellationToken) { @@ -35,6 +42,13 @@ public class UsersService(IMapper mapper, IUsersRepository users, IUnitOfWork un await RemoveUserAccount(user, cancellationToken); } + async Task IUsersService.GetAuthenticatedApplicant(CancellationToken cancellationToken) + { + var applicant = await applicants.FindByUserIdAsync(userIdProvider.GetUserId(), cancellationToken); + + return mapper.Map(applicant); + } + /// Updates user account auth data /// User to remove /// New auth data diff --git a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/PermissionToDestCountryModel.cs b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/PermissionToDestCountryModel.cs index cfd6f40..64d8155 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/PermissionToDestCountryModel.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/PermissionToDestCountryModel.cs @@ -7,9 +7,11 @@ namespace ApplicationLayer.Services.VisaApplications.Models; public class PermissionToDestCountryModel { /// Date when permission to destination country expires + [Required] public DateTime ExpirationDate { get; set; } /// Issuing authority [MaxLength(ConfigurationConstraints.IssuerNameLength)] + [Required] public string Issuer { get; set; } = null!; } diff --git a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/ReentryPermitModel.cs b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/ReentryPermitModel.cs index 86a5542..d0f37ec 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/ReentryPermitModel.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Models/ReentryPermitModel.cs @@ -8,8 +8,10 @@ public class ReentryPermitModel { /// Number of re-entry permit [MaxLength(ConfigurationConstraints.ReentryPermitNumberLength)] + [Required] public string Number { get; set; } = null!; /// Date when re-entry permit expires + [Required] public DateTime ExpirationDate { get; set; } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/PermissionToDestCountryInput.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/PermissionToDestCountryInput.razor index 538711a..2a2c2af 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/PermissionToDestCountryInput.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/PermissionToDestCountryInput.razor @@ -13,7 +13,7 @@ Expiration date:
+ min="@formattedDate"/>
diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/ReentryPermitInput.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/ReentryPermitInput.razor new file mode 100644 index 0000000..40f842c --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Components/FormComponents/VisaApplications/ReentryPermitInput.razor @@ -0,0 +1,34 @@ +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider +@using VisaApiClient + +
+
+
+ +
+ +
+ +@code { + private string formattedDate = null!; + + [Parameter, EditorRequired] public ReentryPermitModel ReentryPermit { get; set; } = null!; + + [Inject] IDateTimeProvider DateTimeProvider { get; set; } = null!; + + protected override void OnInitialized() + { + formattedDate = DateTimeProvider.FormattedNow(); + ReentryPermit.ExpirationDate = DateTimeProvider.Now(); + } + +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/ErrorHandling/GlobalErrorHandler.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/ErrorHandling/GlobalErrorHandler.razor index cd8bbc8..91bcd9a 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/ErrorHandling/GlobalErrorHandler.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/ErrorHandling/GlobalErrorHandler.razor @@ -1,4 +1,6 @@ - +@using System.Net +@using VisaApiClient + @ChildContent @@ -7,8 +9,13 @@ [Parameter] public RenderFragment? ChildContent { get; set; } + [Inject] private NavigationManager Nav { get; set; } = null!; + public void Handle(Exception ex) { - + if (ex is ApiException { StatusCode: (int)HttpStatusCode.Unauthorized or (int)HttpStatusCode.Forbidden }) + { + Nav.NavigateTo("/"); + } } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/AutoMapper/Profiles/VisaApplicationCreateRequestProfile.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/AutoMapper/Profiles/VisaApplicationCreateRequestProfile.cs new file mode 100644 index 0000000..2bf617e --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/AutoMapper/Profiles/VisaApplicationCreateRequestProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Infrastructure.AutoMapper.Profiles +{ + public class VisaApplicationCreateRequestProfile : Profile + { + public VisaApplicationCreateRequestProfile() + { + CreateMap(MemberList.Destination); + } + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Helpers/ValidationResultExtensions.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Helpers/ValidationResultExtensions.cs new file mode 100644 index 0000000..d77c8a5 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Helpers/ValidationResultExtensions.cs @@ -0,0 +1,22 @@ +using System.Text; +using FluentValidation.Results; + +namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers +{ + public static class ValidationResultExtensions + { + public static string ToErrorsString(this ValidationResult validationResult) + => ErrorsToString(validationResult.Errors.Select(e => e.ErrorMessage)); + + private static string ErrorsToString(IEnumerable errors) + { + var stringBuilder = new StringBuilder(); + foreach (var error in errors) + { + stringBuilder.Append($"{error}
"); + } + + return stringBuilder.ToString(); + } + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs index 5c16af3..d6b22d2 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/IUserDataProvider.cs @@ -5,7 +5,7 @@ namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvide public interface IUserDataProvider { - public ApplicantModel? GetApplicant(); + public Task GetApplicant(); public string? GetCurrentRole(); } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs index 891d37b..1c32a4b 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Infrastructure/Services/UserDataProvider/UserDataProvider.cs @@ -8,10 +8,9 @@ namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvide { private static readonly JwtSecurityTokenHandler tokenHandler = new (); - public ApplicantModel? GetApplicant() + public async Task GetApplicant() { - //todo api action - return null; + return await client.GetApplicantAsync(); } public string? GetCurrentRole() diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor index 5c3d358..86b80d9 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Layout/NavMenu.razor @@ -22,6 +22,13 @@ + @code { diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor index 8d4ac47..d205367 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Applications.razor @@ -1,5 +1,4 @@ @page "/applications" -@using System.Net @using System.Text @using BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers @using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider @@ -61,14 +60,7 @@ } catch (Exception e) { - if (e is ApiException { Result.Status: (int)HttpStatusCode.Unauthorized } problemDetailsException) - { - htmlBody = $"

{problemDetailsException.Result.Detail!}

"; - } - else - { ErrorHandler.Handle(e); - } } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/CreateApplication.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/CreateApplication.razor index ba34be5..232311d 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/CreateApplication.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/CreateApplication.razor @@ -1,10 +1,17 @@ -@page "/visaApplications/new" +@page "/applications/new" +@using System.Net +@using AutoMapper @using BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models @using BlazorWebAssemblyVisaApiClient.Components.FormComponents.Applicants @using VisaApiClient @using BlazorWebAssemblyVisaApiClient.Components @using BlazorWebAssemblyVisaApiClient.Components.FormComponents.VisaApplications +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers @using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvider +@using FluentValidation +@using Newtonsoft.Json +@using Newtonsoft.Json.Linq @inherits BlazorWebAssemblyVisaApiClient.Components.Base.VisaClientComponentBase New Application @@ -23,9 +30,10 @@


@@ -46,33 +54,98 @@
-
-
+ @if (requestModel.VisaCategory is VisaCategory.Transit) + { +
Permission to destination Country
- -
-

+ + + } + + @if (isNonResident) + { +
+
Re-entry permission
+ +
+
+ } + - +//todo past visas and visits @code { private VisaApplicationCreateRequestModel requestModel = new(); private Status status = null!; + private bool isNonResident; [Inject] IDateTimeProvider DateTimeProvider { get; set; } = null!; - protected override void OnInitialized() + [Inject] IUserDataProvider UserDataProvider { get; set; } = null!; + + [Inject] IValidator VisaApplicationCreateRequestValidator { get; set; } = null!; + + [Inject] IMapper Mapper { get; set; } = null!; + + protected override async Task OnInitializedAsync() { + try + { + isNonResident = (await UserDataProvider.GetApplicant()).IsNonResident; + } + catch (Exception e) + { + ErrorHandler.Handle(e); + } + requestModel.PermissionToDestCountry!.ExpirationDate = DateTimeProvider.Now(); } - private static void TryCreate() + private async Task TryCreate() { + var validationResult = await VisaApplicationCreateRequestValidator.ValidateAsync(requestModel); + if (!validationResult.IsValid) + { + var errorsString = validationResult.ToErrorsString(); + status.SetError(errorsString); + } + status.SetMessage("Wait..."); + + var request = Mapper.Map(requestModel); + try + { + await Client.CreateApplicationAsync(request); + status.SetSucces("Application created successfully."); + } + catch (ApiException e) + { + if (e.StatusCode == (int)HttpStatusCode.BadRequest + && e.Result.AdditionalProperties.TryGetValue("errors", out var errors)) + { + var errorsList = ((JArray)errors).ToObject>(); + if (errorsList is null) + { + ErrorHandler.Handle(new JsonException("Can't convert validation errors to list")); + + return; + } + + status.SetError(string.Join("
", errorsList)); + } + else + { + ErrorHandler.Handle(e); + } + } + catch (Exception e) + { + ErrorHandler.Handle(e); + } } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Register.razor b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Register.razor index b1fa043..170d927 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Register.razor +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Pages/Register.razor @@ -1,6 +1,5 @@ @page "/register" @using System.Net -@using System.Text @using AutoMapper @using VisaApiClient @using BlazorWebAssemblyVisaApiClient.Components.FormComponents.Applicants @@ -8,6 +7,7 @@ @using Newtonsoft.Json @using Newtonsoft.Json.Linq @using BlazorWebAssemblyVisaApiClient.Components +@using BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers @using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider @using BlazorWebAssemblyVisaApiClient.Validation.Applicants.Models @inherits BlazorWebAssemblyVisaApiClient.Components.Base.VisaClientComponentBase @@ -144,23 +144,12 @@ requestModel.BirthDate = DateTime.Now; } - private string ErrorsToString(IEnumerable errors) - { - var stringBuilder = new StringBuilder(); - foreach (var error in errors) - { - stringBuilder.Append($"{error}
"); - } - - return stringBuilder.ToString(); - } - private async void TryRegisterApplicant() { var validationResult = await RegisterApplicantRequestValidator.ValidateAsync(requestModel); if (!validationResult.IsValid) { - var errorsString = ErrorsToString(validationResult.Errors.Select(e => e.ErrorMessage)); + var errorsString = validationResult.ToErrorsString(); status.SetError(errorsString); return; @@ -187,7 +176,7 @@ return; } - status.SetError(ErrorsToString(errorsList)); + status.SetError(string.Join("
", errorsList)); } else { @@ -196,6 +185,7 @@ } catch (Exception e) { + status.SetError("Error occured"); ErrorHandler.Handle(e); } } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Models/VisaApplicationCreateRequestModel.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Models/VisaApplicationCreateRequestModel.cs index 0e8e252..ce979c9 100644 --- a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Models/VisaApplicationCreateRequestModel.cs +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Models/VisaApplicationCreateRequestModel.cs @@ -26,14 +26,12 @@ namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models [Range(0, ConfigurationConstraints.MaxValidDays)] public int ValidDaysRequested { get; set; } - [Required] [ValidateComplexType] public PastVisaModel[] PastVisas { get; set; } = default!; [ValidateComplexType] public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } = new(); - [Required] [ValidateComplexType] public PastVisitModel[] PastVisits { get; set; } = default!; } diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisaModelValidator.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisaModelValidator.cs new file mode 100644 index 0000000..6a3f870 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisaModelValidator.cs @@ -0,0 +1,27 @@ +using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; +using FluentValidation; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Validators; + +public class PastVisaModelValidator : AbstractValidator +{ + public PastVisaModelValidator(IDateTimeProvider dateTimeProvider) + { + RuleFor(v => v.ExpirationDate) + .NotEmpty() + .WithMessage("Expiration date of past visa can not be empty") + .GreaterThan(v => v.IssueDate) + .WithMessage("Past visa expiration date can not be earlier than issue date"); + + RuleFor(v => v.IssueDate) + .NotEmpty() + .WithMessage("Issue date of past visa can not be empty") + .LessThan(dateTimeProvider.Now()) + .WithMessage("Issue date of past visa must be in past"); + + RuleFor(v => v.Name) + .NotEmpty() + .WithMessage("Name of past visa can not be empty"); + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisitModelValidator.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisitModelValidator.cs new file mode 100644 index 0000000..bb19981 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PastVisitModelValidator.cs @@ -0,0 +1,29 @@ +using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; +using FluentValidation; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Validators; + +public class PastVisitModelValidator : AbstractValidator +{ + public PastVisitModelValidator(IDateTimeProvider dateTimeProvider) + { + RuleFor(v => v.StartDate) + .NotEmpty() + .WithMessage("Start date of past visit can not be empty") + .LessThan(v => v.EndDate) + .WithMessage("Start date of past visit must be earlier than end date") + .LessThan(dateTimeProvider.Now()) + .WithMessage("Start date of past visit must be in past"); + + RuleFor(v => v.EndDate) + .NotEmpty() + .WithMessage("End date of past visit can not be empty"); + + RuleFor(v => v.DestinationCountry) + .NotEmpty() + .WithMessage("Destination Country of past visit can not be null") + .MaximumLength(ConfigurationConstraints.CountryNameLength) + .WithMessage($"Destination Country of past visit length must be less than {ConfigurationConstraints.CountryNameLength}"); + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PermissionToDestCountryModelValidator.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PermissionToDestCountryModelValidator.cs new file mode 100644 index 0000000..8ed1c00 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/PermissionToDestCountryModelValidator.cs @@ -0,0 +1,23 @@ +using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; +using FluentValidation; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Validators; + +public class PermissionToDestCountryModelValidator : AbstractValidator +{ + public PermissionToDestCountryModelValidator(IDateTimeProvider dateTimeProvider) + { + RuleFor(p => p!.ExpirationDate) + .NotEmpty() + .WithMessage("Expiration date of permission to destination Country can not be empty") + .GreaterThan(dateTimeProvider.Now()) + .WithMessage("Permission to destination Country must not be expired"); + + RuleFor(p => p!.Issuer) + .NotEmpty() + .WithMessage("Issuer of permission for destination Country can not be empty") + .MaximumLength(ConfigurationConstraints.IssuerNameLength) + .WithMessage($"Issuer of permission to destination Country length must be less than {ConfigurationConstraints.IssuerNameLength}"); + } +} diff --git a/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/VisaApplicationCreateRequestModelValidator.cs b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/VisaApplicationCreateRequestModelValidator.cs new file mode 100644 index 0000000..04f5fc5 --- /dev/null +++ b/SchengenVisaApi/BlazorWebAssemblyVisaApiClient/Validation/VisaApplications/Validators/VisaApplicationCreateRequestModelValidator.cs @@ -0,0 +1,42 @@ +using BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models; +using FluentValidation; +using VisaApiClient; + +namespace BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Validators; + +public class VisaApplicationCreateRequestModelValidator : AbstractValidator +{ + public VisaApplicationCreateRequestModelValidator( + IValidator pastVisaModelValidator, + IValidator permissionToDestCountryModelValidator, + IValidator pastVisitModelValidator) + { + RuleFor(r => r.PermissionToDestCountry) + .NotEmpty() + .WithMessage("For transit you must provide permission to destination country") + .SetValidator(permissionToDestCountryModelValidator) + .When(r => r.VisaCategory is VisaCategory.Transit); + + RuleFor(r => r.DestinationCountry) + .NotEmpty() + .WithMessage("Destination country can not be empty"); + + RuleFor(r => r.VisaCategory) + .IsInEnum(); + + RuleFor(r => r.RequestedNumberOfEntries) + .IsInEnum(); + + RuleFor(r => r.ValidDaysRequested) + .GreaterThan(0) + .WithMessage($"Valid days requested should be positive number and less than {ConfigurationConstraints.MaxValidDays}") + .LessThanOrEqualTo(ConfigurationConstraints.MaxValidDays) + .WithMessage($"Valid days requested must be less than or equal to {ConfigurationConstraints.MaxValidDays}"); + + RuleForEach(r => r.PastVisas) + .SetValidator(pastVisaModelValidator); + + RuleForEach(r => r.PastVisits) + .SetValidator(pastVisitModelValidator); + } +} diff --git a/SchengenVisaApi/SchengenVisaApi/Controllers/UsersController.cs b/SchengenVisaApi/SchengenVisaApi/Controllers/UsersController.cs index aca41d0..031cf14 100644 --- a/SchengenVisaApi/SchengenVisaApi/Controllers/UsersController.cs +++ b/SchengenVisaApi/SchengenVisaApi/Controllers/UsersController.cs @@ -1,4 +1,5 @@ -using ApplicationLayer.Services.AuthServices.Common; +using ApplicationLayer.Services.Applicants.Models; +using ApplicationLayer.Services.AuthServices.Common; using ApplicationLayer.Services.AuthServices.LoginService; using ApplicationLayer.Services.AuthServices.RegisterService; using ApplicationLayer.Services.AuthServices.Requests; @@ -109,4 +110,17 @@ public class UsersController( await usersService.RemoveAuthorityAccount(authorityAccountId, cancellationToken); return Ok(); } + + /// Returns applicant info + [HttpGet("applicant")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [Authorize(policy: PolicyConstants.ApplicantPolicy)] + public async Task GetApplicant(CancellationToken cancellationToken) + { + + var result = await usersService.GetAuthenticatedApplicant(cancellationToken); + return Ok(result); + } } diff --git a/SchengenVisaApi/VisaApiClient/Client.cs b/SchengenVisaApi/VisaApiClient/Client.cs index 6a7e5d5..f81a0f3 100644 --- a/SchengenVisaApi/VisaApiClient/Client.cs +++ b/SchengenVisaApi/VisaApiClient/Client.cs @@ -742,6 +742,110 @@ namespace VisaApiClient } } + /// + /// Returns applicant info + /// + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetApplicantAsync() + { + return GetApplicantAsync(System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns applicant info + /// + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetApplicantAsync(System.Threading.CancellationToken cancellationToken) + { + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + var urlBuilder_ = new System.Text.StringBuilder(); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); + // Operation Path: "users/applicant" + urlBuilder_.Append("users/applicant"); + + await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Forbidden", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// /// Returns pending applications /// @@ -1494,49 +1598,62 @@ 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.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel? Name { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public NameModel Name { get; set; } = new NameModel(); - [Newtonsoft.Json.JsonProperty("passport", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PassportModel? Passport { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("passport", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PassportModel Passport { get; set; } = new PassportModel(); - [Newtonsoft.Json.JsonProperty("birthDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? BirthDate { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("birthDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + 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!; + [Newtonsoft.Json.JsonProperty("countryOfBirth", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string CountryOfBirth { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("cityOfBirth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? CityOfBirth { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("cityOfBirth", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string CityOfBirth { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("citizenship", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? Citizenship { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("citizenship", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Citizenship { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("citizenshipByBirth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? CitizenshipByBirth { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("citizenshipByBirth", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string CitizenshipByBirth { get; set; } = default!; - [Newtonsoft.Json.JsonProperty("gender", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("gender", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [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.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonProperty("maritalStatus", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [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.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel? FatherName { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("fatherName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public NameModel FatherName { get; set; } = new NameModel(); - [Newtonsoft.Json.JsonProperty("motherName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public NameModel? MotherName { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("motherName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public NameModel MotherName { get; set; } = new NameModel(); - [Newtonsoft.Json.JsonProperty("jobTitle", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string? JobTitle { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("jobTitle", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string JobTitle { 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("placeOfWork", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PlaceOfWorkModel PlaceOfWork { get; set; } = new PlaceOfWorkModel(); - [Newtonsoft.Json.JsonProperty("isNonResident", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool? IsNonResident { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("isNonResident", Required = Newtonsoft.Json.Required.Always)] + public bool IsNonResident { get; set; } = default!; } @@ -1714,12 +1831,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 PermissionToDestCountryModel { - [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ExpirationDate { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("expirationDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + 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)] - public string? Issuer { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("issuer", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(200, MinimumLength = 1)] + public string Issuer { get; set; } = default!; } @@ -1774,12 +1893,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 ReentryPermitModel { - [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(25)] - public string? Number { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(25, MinimumLength = 1)] + public string Number { 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("expirationDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public System.DateTimeOffset ExpirationDate { get; set; } = default!; } diff --git a/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag b/SchengenVisaApi/VisaApiClient/clientGeneratorConfig.nswag index 7c81e8b..dc3bcb6 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 \"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}", + "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 \"/users/applicant\": {\r\n \"get\": {\r\n \"tags\": [\r\n \"Users\"\r\n ],\r\n \"summary\": \"Returns applicant info\",\r\n \"operationId\": \"GetApplicant\",\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/ApplicantModel\"\r\n }\r\n },\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ApplicantModel\"\r\n }\r\n },\r\n \"text/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/ApplicantModel\"\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 \"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 \"/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 \"required\": [\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 \"name\",\r\n \"passport\",\r\n \"placeOfWork\"\r\n ],\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 \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"cityOfBirth\": {\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenship\": {\r\n \"minLength\": 1,\r\n \"type\": \"string\"\r\n },\r\n \"citizenshipByBirth\": {\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 \"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 \"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 \"required\": [\r\n \"expirationDate\",\r\n \"issuer\"\r\n ],\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 \"minLength\": 1,\r\n \"type\": \"string\"\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 \"required\": [\r\n \"expirationDate\",\r\n \"number\"\r\n ],\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"number\": {\r\n \"maxLength\": 25,\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 \"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"