Application creating but without past visas and visits
This commit is contained in:
		| @@ -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 | ||||
| { | ||||
|     /// <inheritdoc cref="Applicant.Name" /> | ||||
|     [Required] | ||||
|     public NameModel Name { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.Passport" /> | ||||
|     [Required] | ||||
|     public PassportModel Passport { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.BirthDate" /> | ||||
|     [Required] | ||||
|     public DateTime BirthDate { get; set; } | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.CountryOfBirth" /> | ||||
|     [Required] | ||||
|     public string CountryOfBirth { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.CityOfBirth" /> | ||||
|     [Required] | ||||
|     public string CityOfBirth { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.Citizenship" /> | ||||
|     [Required] | ||||
|     public string Citizenship { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.CitizenshipByBirth" /> | ||||
|     [Required] | ||||
|     public string CitizenshipByBirth { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.Gender" /> | ||||
|     [Required] | ||||
|     public Gender Gender { get; set; } | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.MaritalStatus" /> | ||||
|     [Required] | ||||
|     public MaritalStatus MaritalStatus { get; set; } | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.FatherName" /> | ||||
|     [Required] | ||||
|     public NameModel FatherName { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.MotherName" /> | ||||
|     [Required] | ||||
|     public NameModel MotherName { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.JobTitle" /> | ||||
|     [Required] | ||||
|     public string JobTitle { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.PlaceOfWork" /> | ||||
|     [Required] | ||||
|     public PlaceOfWorkModel PlaceOfWork { get; set; } = null!; | ||||
|  | ||||
|     /// <inheritdoc cref="Applicant.IsNonResident" /> | ||||
|     [Required] | ||||
|     public bool IsNonResident { get; set; } | ||||
| } | ||||
|   | ||||
| @@ -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 | ||||
|     /// <param name="userId">Identifier of account</param> | ||||
|     /// <param name="cancellationToken">Cancellation token</param> | ||||
|     Task RemoveAuthorityAccount(Guid userId, CancellationToken cancellationToken); | ||||
|  | ||||
|     /// Get applicant that made request | ||||
|     /// <param name="cancellationToken">cancellation token</param> | ||||
|     Task<ApplicantModel> GetAuthenticatedApplicant(CancellationToken cancellationToken); | ||||
| } | ||||
|   | ||||
| @@ -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<List<UserModel>> IUsersService.GetAuthoritiesAccountsAsync(CancellationToken cancellationToken) | ||||
|     { | ||||
| @@ -35,6 +42,13 @@ public class UsersService(IMapper mapper, IUsersRepository users, IUnitOfWork un | ||||
|         await RemoveUserAccount(user, cancellationToken); | ||||
|     } | ||||
|  | ||||
|     async Task<ApplicantModel> IUsersService.GetAuthenticatedApplicant(CancellationToken cancellationToken) | ||||
|     { | ||||
|         var applicant = await applicants.FindByUserIdAsync(userIdProvider.GetUserId(), cancellationToken); | ||||
|  | ||||
|         return mapper.Map<ApplicantModel>(applicant); | ||||
|     } | ||||
|  | ||||
|     /// Updates user account auth data | ||||
|     /// <param name="user">User to remove</param> | ||||
|     /// <param name="authData">New auth data</param> | ||||
|   | ||||
| @@ -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!; | ||||
| } | ||||
|   | ||||
| @@ -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; } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user