public async Task <CompanyAuthenticationProfileEntity?> TrySignUp(IOperation operation, CompanySignUpEntity entity) { if (await userAuthenticationStore.IsUserExist(operation, entity.Email)) { throw new Exception(ExceptionMessage.EmailHasAlreadyExist); } var id = await userAuthenticationStore.TrySignUp(operation, entity); return(await userAuthenticationStore.GetCompanyProfileById(operation, id ?? throw new Exception(ExceptionMessage.CompanySignUpFailedDueToInactiveUserOrUnsuitableData))); }
public async Task UpdateCompanyFullProfile(IOperation operation, CompanyProfileEntity entity) { if (await userAuthenticationStore.IsUserExist(operation, entity.Email, entity.Id)) { throw new Exception(ExceptionMessage.EmailHasAlreadyExist); } await companyProfileStore.UpdateCompanyProfile(operation, entity); }
public async Task UpdateClientFullProfile(IOperation operation, ClientProfileEntity entity) { if (!string.IsNullOrWhiteSpace(entity.Email) && await userAuthenticationStore.IsUserExist(operation, entity.Email, entity.Id)) { throw new Exception(ExceptionMessage.EmailHasAlreadyExist); } await clientProfileStore.UpdateClientProfile(operation, entity); }