diff --git a/libs/api/domains/health-directorate/src/lib/health-directorate.module.ts b/libs/api/domains/health-directorate/src/lib/health-directorate.module.ts index 23a06c73e96c..a4386cc36008 100644 --- a/libs/api/domains/health-directorate/src/lib/health-directorate.module.ts +++ b/libs/api/domains/health-directorate/src/lib/health-directorate.module.ts @@ -2,9 +2,10 @@ import { HealthDirectorateClientModule } from '@island.is/clients/health-directo import { Module } from '@nestjs/common' import { HealthDirectorateResolver } from './health-directorate.resolver' import { HealthDirectorateService } from './health-directorate.service' +import { FeatureFlagModule } from '@island.is/nest/feature-flags' @Module({ - imports: [HealthDirectorateClientModule], + imports: [HealthDirectorateClientModule, FeatureFlagModule], providers: [HealthDirectorateResolver, HealthDirectorateService], }) export class HealthDirectorateModule {} diff --git a/libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts b/libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts index 9961e0cd8328..9473cac0eca2 100644 --- a/libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts +++ b/libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts @@ -22,8 +22,12 @@ import { DonorInput, Organ, OrganDonation } from './models/organ-donation.model' import type { Locale } from '@island.is/shared/types' import { Vaccinations } from './models/vaccinations.model' import { HealthDirectorateService } from './health-directorate.service' - -@UseGuards(IdsUserGuard, ScopesGuard) +import { + FeatureFlag, + FeatureFlagGuard, + Features, +} from '@island.is/nest/feature-flags' +@UseGuards(IdsUserGuard, ScopesGuard, FeatureFlagGuard) @Scopes(ApiScope.internal) @Audit({ namespace: '@island.is/api/health-directorate' }) @Resolver(() => OrganDonation) @@ -35,6 +39,7 @@ export class HealthDirectorateResolver { name: 'healthDirectorateOrganDonation', }) @Audit() + @FeatureFlag(Features.servicePortalHealthOrganDonationPageEnabled) async getDonorStatus( @Args('locale', { type: () => String, nullable: true }) locale: Locale = 'is', @@ -58,6 +63,7 @@ export class HealthDirectorateResolver { name: 'healthDirectorateOrganDonationUpdateDonorStatus', }) @Audit() + @FeatureFlag(Features.servicePortalHealthOrganDonationPageEnabled) async updateDonorStatus( @Args('input') input: DonorInput, @Args('locale', { type: () => String, nullable: true }) @@ -72,6 +78,7 @@ export class HealthDirectorateResolver { name: 'healthDirectorateVaccinations', }) @Audit() + @FeatureFlag(Features.servicePortalHealthVaccinationsPageEnabled) getVaccinations( @Args('locale', { type: () => String, nullable: true }) locale: Locale = 'is', diff --git a/libs/feature-flags/src/lib/features.ts b/libs/feature-flags/src/lib/features.ts index 71759a803ae5..ae839cdd1690 100644 --- a/libs/feature-flags/src/lib/features.ts +++ b/libs/feature-flags/src/lib/features.ts @@ -45,7 +45,8 @@ export enum Features { servicePortalVehicleBulkMileagePageEnabled = 'isServicePortalVehicleBulkMileagePageEnabled', servicePortalSocialInsurancePageEnabled = 'isServicePortalSocialInsurancePageEnabled', servicePortalSocialInsuranceIncomePlanPageEnabled = 'isServicePortalSocialInsuranceIncomePlanPageEnabled', - + servicePortalHealthVaccinationsPageEnabled = 'isServicePortalHealthVaccinationsPageEnabled', + servicePortalHealthOrganDonationPageEnabled = 'isServicePortalHealthOrganDonationPageEnabled', ServicePortalNotificationsEnabled = 'isServicePortalNotificationsPageEnabled', servicePortalLawAndOrderModuleEnabled = 'isServicePortalLawAndOrderModuleEnabled', servicePortalDocumentsActionsEnabled = 'isServicePortalDocumentsActionsEnabled',