Removed location entities, fixed configurations and controllers' comments
This commit is contained in:
		| @@ -3,7 +3,6 @@ using ApplicationLayer.Services.Applicants.NeededServices; | ||||
| using ApplicationLayer.Services.AuthServices.NeededServices; | ||||
| using ApplicationLayer.Services.AuthServices.RegisterService.Exceptions; | ||||
| using ApplicationLayer.Services.AuthServices.Requests; | ||||
| using ApplicationLayer.Services.Locations.NeededServices; | ||||
| using Domains.ApplicantDomain; | ||||
| using Domains.Users; | ||||
|  | ||||
| @@ -13,7 +12,6 @@ namespace ApplicationLayer.Services.AuthServices.RegisterService | ||||
|     public class RegisterService( | ||||
|         IUsersRepository users, | ||||
|         IApplicantsRepository applicants, | ||||
|         ICitiesRepository cities, | ||||
|         IUnitOfWork unitOfWork) : IRegisterService | ||||
|     { | ||||
|         async Task IRegisterService.Register(RegisterApplicantRequest request, CancellationToken cancellationToken) | ||||
| @@ -27,21 +25,6 @@ namespace ApplicationLayer.Services.AuthServices.RegisterService | ||||
|             //TODO mapper | ||||
|             var user = new User { Email = request.Email, Password = request.Password, Role = Role.Applicant }; | ||||
|  | ||||
|             var applicantCity = await cities.GetByIdAsync(request.CityOfBirthId, cancellationToken); | ||||
|             var placeOfWorkCity = await cities.GetByIdAsync(request.PlaceOfWork.Address.CityId, cancellationToken); | ||||
|             var placeOfWorkAddress = new Address | ||||
|             { | ||||
|                 Country = placeOfWorkCity.Country, | ||||
|                 City = placeOfWorkCity, | ||||
|                 Building = request.PlaceOfWork.Address.Building, | ||||
|                 Street = request.PlaceOfWork.Address.Street | ||||
|             }; | ||||
|  | ||||
|             var placeOfWork = new PlaceOfWork | ||||
|             { | ||||
|                 Name = request.PlaceOfWork.Name, Address = placeOfWorkAddress, PhoneNum = request.PlaceOfWork.PhoneNum | ||||
|             }; | ||||
|  | ||||
|             var applicant = new Applicant | ||||
|             { | ||||
|                 Citizenship = request.Citizenship, | ||||
| @@ -55,10 +38,10 @@ namespace ApplicationLayer.Services.AuthServices.RegisterService | ||||
|                 MaritalStatus = request.MaritalStatus, | ||||
|                 MotherName = request.MotherName, | ||||
|                 UserId = user.Id, | ||||
|                 CityOfBirth = applicantCity, | ||||
|                 CountryOfBirth = applicantCity.Country, | ||||
|                 CityOfBirth = request.CityOfBirth, | ||||
|                 CountryOfBirth = request.CountryOfBirth, | ||||
|                 IsNonResident = request.IsNonResident, | ||||
|                 PlaceOfWork = placeOfWork | ||||
|                 PlaceOfWork = request.PlaceOfWork | ||||
|             }; | ||||
|  | ||||
|             await users.AddAsync(user, cancellationToken); | ||||
|   | ||||
| @@ -1,5 +1,4 @@ | ||||
| using ApplicationLayer.Services.Applicants.Models; | ||||
| using Domains.ApplicantDomain; | ||||
| using Domains.ApplicantDomain; | ||||
|  | ||||
| namespace ApplicationLayer.Services.AuthServices.Requests | ||||
| { | ||||
| @@ -9,7 +8,8 @@ namespace ApplicationLayer.Services.AuthServices.Requests | ||||
|         Name ApplicantName, | ||||
|         Passport Passport, | ||||
|         DateTime BirthDate, | ||||
|         Guid CityOfBirthId, | ||||
|         string CityOfBirth, | ||||
|         string CountryOfBirth, | ||||
|         string Citizenship, | ||||
|         string CitizenshipByBirth, | ||||
|         Gender Gender, | ||||
| @@ -17,6 +17,6 @@ namespace ApplicationLayer.Services.AuthServices.Requests | ||||
|         Name FatherName, | ||||
|         Name MotherName, | ||||
|         string JobTitle, | ||||
|         PlaceOfWorkModel PlaceOfWork, | ||||
|         PlaceOfWork PlaceOfWork, | ||||
|         bool IsNonResident) : RegisterRequest(Email, Password); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user