Skip to content

Commit

Permalink
fix(OSP Invite): handle theme for shared realm (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhiren-singh-007 authored Aug 14, 2024
1 parent 6ca675f commit be8f1d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ public IQueryable<CompanyApplication> GetExternalCompanyApplicationsFilteredQuer
.SingleOrDefaultAsync();

/// <inheritdoc />
public Task<(Guid CompanyId, string CompanyName, string? BusinessPartnerNumber, IEnumerable<string> IamIdpAliasse, CompanyApplicationTypeId ApplicationTypeId, Guid? NetworkRegistrationProcessId)> GetCompanyAndApplicationDetailsForApprovalAsync(Guid applicationId) =>
public Task<(Guid CompanyId, string CompanyName, string? BusinessPartnerNumber, IEnumerable<string> SharedIdpAliase, CompanyApplicationTypeId ApplicationTypeId, Guid? NetworkRegistrationProcessId)> GetCompanyAndApplicationDetailsForApprovalAsync(Guid applicationId) =>
portalDbContext.CompanyApplications.Where(companyApplication =>
companyApplication.Id == applicationId &&
companyApplication.ApplicationStatusId == CompanyApplicationStatusId.SUBMITTED)
.Select(ca => new ValueTuple<Guid, string, string?, IEnumerable<string>, CompanyApplicationTypeId, Guid?>(
ca.CompanyId,
ca.Company!.Name,
ca.Company.BusinessPartnerNumber,
ca.Company.IdentityProviders.Select(x => x.IamIdentityProvider!.IamIdpAlias),
ca.Company.IdentityProviders.Where(x => x.IdentityProviderTypeId == IdentityProviderTypeId.SHARED && x.IamIdentityProvider != null).Select(x => x.IamIdentityProvider!.IamIdpAlias),
ca.CompanyApplicationTypeId,
ca.CompanyApplicationTypeId == CompanyApplicationTypeId.EXTERNAL ?
ca.Company.NetworkRegistration!.ProcessId :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface IApplicationRepository
Task<CompanyApplicationDetailData?> GetCompanyApplicationDetailDataAsync(Guid applicationId, Guid userCompanyId, Guid? companyId);
Task<(string CompanyName, string? FirstName, string? LastName, string? Email, IEnumerable<(Guid ApplicationId, CompanyApplicationStatusId ApplicationStatusId, IEnumerable<(string? FirstName, string? LastName, string? Email)> InvitedUsers)> Applications)> GetCompanyApplicationsDeclineData(Guid companyUserId, IEnumerable<CompanyApplicationStatusId> applicationStatusIds);
Task<(bool IsValidApplicationId, Guid CompanyId, bool IsSubmitted)> GetCompanyIdSubmissionStatusForApplication(Guid applicationId);
Task<(Guid CompanyId, string CompanyName, string? BusinessPartnerNumber, IEnumerable<string> IamIdpAliasse, CompanyApplicationTypeId ApplicationTypeId, Guid? NetworkRegistrationProcessId)> GetCompanyAndApplicationDetailsForApprovalAsync(Guid applicationId);
Task<(Guid CompanyId, string CompanyName, string? BusinessPartnerNumber, IEnumerable<string> SharedIdpAliase, CompanyApplicationTypeId ApplicationTypeId, Guid? NetworkRegistrationProcessId)> GetCompanyAndApplicationDetailsForApprovalAsync(Guid applicationId);
Task<(Guid CompanyId, string CompanyName, string? BusinessPartnerNumber)> GetCompanyAndApplicationDetailsForCreateWalletAsync(Guid applicationId);
IAsyncEnumerable<CompanyInvitedUserData> GetInvitedUsersDataByApplicationIdUntrackedAsync(Guid applicationId);
IAsyncEnumerable<EmailData> GetEmailDataUntrackedAsync(Guid applicationId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public ApplicationActivationService(
throw new ConflictException($"CompanyApplication {context.ApplicationId} is not in status SUBMITTED");
}

var (companyId, companyName, businessPartnerNumber, iamIdpAliasse, applicationTypeId, networkRegistrationProcessId) = result;
var (companyId, companyName, businessPartnerNumber, sharedIdpAliase, applicationTypeId, networkRegistrationProcessId) = result;
if (string.IsNullOrWhiteSpace(businessPartnerNumber))
{
throw new ConflictException($"BusinessPartnerNumber (bpn) for CompanyApplications {context.ApplicationId} company {companyId} is empty");
Expand All @@ -99,7 +99,7 @@ public ApplicationActivationService(
var userRolesRepository = _portalRepositories.GetInstance<IUserRolesRepository>();
var assignedRoles = await AssignRolesAndBpn(context.ApplicationId, userRolesRepository, applicationRepository, businessPartnerNumber).ConfigureAwait(ConfigureAwaitOptions.None);
await RemoveRegistrationRoles(context.ApplicationId, userRolesRepository).ConfigureAwait(ConfigureAwaitOptions.None);
await SetTheme(iamIdpAliasse).ConfigureAwait(ConfigureAwaitOptions.None);
await SetTheme(sharedIdpAliase).ConfigureAwait(ConfigureAwaitOptions.None);

applicationRepository.AttachAndModifyCompanyApplication(context.ApplicationId, ca =>
{
Expand Down

0 comments on commit be8f1d7

Please sign in to comment.