Skip to content

Commit

Permalink
Cleanup legal repr. and general mandate feature flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
valurefugl committed Dec 31, 2024
1 parent 74f5c19 commit d987a7f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,13 @@ export class DelegationsIncomingService {

// If procuration holder is enabled, we need to get the general mandate delegations
if (types?.includes(AuthDelegationType.ProcurationHolder)) {
const isGeneralMandateDelegationEnabled =
await this.featureFlagService.getValue(
Features.isGeneralMandateDelegationEnabled,
false,
delegationPromises.push(
this.delegationsIncomingCustomService.findCompanyGeneralMandate(
user,
)
if (isGeneralMandateDelegationEnabled) {
delegationPromises.push(
this.delegationsIncomingCustomService.findCompanyGeneralMandate(
user,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

if (providers.includes(AuthDelegationProvider.CompanyRegistry)) {
Expand Down Expand Up @@ -220,21 +212,13 @@ export class DelegationsIncomingService {
}

if (types?.includes(AuthDelegationType.GeneralMandate)) {
const isGeneralMandateDelegationEnabled =
await this.featureFlagService.getValue(
Features.isGeneralMandateDelegationEnabled,
false,
delegationPromises.push(
this.delegationsIncomingCustomService.findAllAvailableGeneralMandate(
user,
)
if (isGeneralMandateDelegationEnabled) {
delegationPromises.push(
this.delegationsIncomingCustomService.findAllAvailableGeneralMandate(
user,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

if (
Expand All @@ -260,22 +244,14 @@ export class DelegationsIncomingService {
if (
providers.includes(AuthDelegationProvider.DistrictCommissionersRegistry)
) {
const isLegalRepresentativeDelegationEnabled =
await this.featureFlagService.getValue(
Features.isLegalRepresentativeDelegationEnabled,
false,
delegationPromises.push(
this.getAvailableDistrictCommissionersRegistryDelegations(
user,
)
if (isLegalRepresentativeDelegationEnabled) {
delegationPromises.push(
this.getAvailableDistrictCommissionersRegistryDelegations(
user,
types,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
types,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

const delegationSets = await Promise.all(delegationPromises)
Expand Down
6 changes: 0 additions & 6 deletions libs/feature-flags/src/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ export enum Features {
isPasskeyRegistrationEnabled = 'isPasskeyRegistrationEnabled',
isPasskeyAuthEnabled = 'isPasskeyAuthEnabled',

// Legal represantative delegation type
isLegalRepresentativeDelegationEnabled = 'isLegalRepresentativeDelegationEnabled',

// General mandate delegation type
isGeneralMandateDelegationEnabled = 'isGeneralMandateDelegationEnabled',

// Should auth api use national registry v3 for checking deceased status
isNationalRegistryV3DeceasedStatusEnabled = 'isNationalRegistryV3DeceasedStatusEnabled',
}
Expand Down

0 comments on commit d987a7f

Please sign in to comment.