Skip to content

Commit

Permalink
feat(ids-api): Add feature flag for general mandate delegation type. (#…
Browse files Browse the repository at this point in the history
…16182)

* Add feature flag for general mandate delegation type.

* Flip featureFlagService.getValue to be default false

---------

Co-authored-by: Sævar Már Atlason <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 27, 2024
1 parent 5efe4fd commit a8b2817
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,21 @@ export class DelegationsIncomingService {
}

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

if (
Expand All @@ -220,7 +228,7 @@ export class DelegationsIncomingService {
const isLegalRepresentativeDelegationEnabled =
await this.featureFlagService.getValue(
Features.isLegalRepresentativeDelegationEnabled,
true,
false,
user,
)
if (isLegalRepresentativeDelegationEnabled) {
Expand Down
3 changes: 3 additions & 0 deletions libs/feature-flags/src/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export enum Features {

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

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

export enum ServerSideFeature {
Expand Down

0 comments on commit a8b2817

Please sign in to comment.