-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(application-system): Refactor env config (#15096)
* Data Protection config refactor * remove unused variable * Criminal Record client config refactor * HealthInsurance client config refactor * remove logging * Vmst client config refactor * Data Protection config refactor * remove unused variable * Criminal Record client config refactor * Vmst refactor * clean up * Health insurance client config refactor * client path fix * Revert "Vmst client config refactor" This reverts commit d2855b7. * basePath update * vmst client refactor round 2 * Data Protection config refactor * remove unused variable * Criminal Record client config refactor * Vmst refactor * clean up * Health insurance client config refactor * client path fix * Data Protection config refactor * remove unused variable * Criminal Record client config refactor * HealthInsurance client config refactor * Vmst client config refactor * Revert "Vmst client config refactor" This reverts commit d2855b7. * vmst client refactor round 2 * Doublicate key clean up * fallback value for env * Fallback for env variables * chore: nx format:write update dirty files * Update tests to use new module config * Propper mock values * Force feature deploy * clean up * typo fix and other minor clean up --------- Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
Showing
37 changed files
with
405 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 8 additions & 20 deletions
28
libs/api/domains/criminal-record/src/lib/criminalRecord.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
import { Module, DynamicModule } from '@nestjs/common' | ||
import { Module } from '@nestjs/common' | ||
|
||
import { CriminalRecordService } from './criminalRecord.service' | ||
import { | ||
CriminalRecordApiModule, | ||
CriminalRecordApiConfig, | ||
} from '@island.is/clients/criminal-record' | ||
import { CriminalRecordApiModule } from '@island.is/clients/criminal-record' | ||
|
||
export interface Config { | ||
clientConfig: CriminalRecordApiConfig | ||
} | ||
|
||
@Module({}) | ||
export class CriminalRecordModule { | ||
static register(config: Config): DynamicModule { | ||
return { | ||
module: CriminalRecordModule, | ||
providers: [CriminalRecordService], | ||
imports: [CriminalRecordApiModule.register(config.clientConfig)], | ||
exports: [CriminalRecordService], | ||
} | ||
} | ||
} | ||
@Module({ | ||
providers: [CriminalRecordService], | ||
exports: [CriminalRecordService], | ||
imports: [CriminalRecordApiModule], | ||
}) | ||
export class CriminalRecordModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 10 additions & 40 deletions
50
libs/api/domains/directorate-of-labour/src/lib/directorate-of-labour.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,15 @@ | ||
import { DynamicModule, Module } from '@nestjs/common' | ||
|
||
import { Module } from '@nestjs/common' | ||
import { VMSTModule } from '@island.is/clients/vmst' | ||
import { | ||
createXRoadAPIPath, | ||
XRoadMemberClass, | ||
} from '@island.is/shared/utils/server' | ||
|
||
import { DirectorateOfLabourRepository } from './directorate-of-labour.repository' | ||
import { DirectorateOfLabourResolver } from './directorate-of-labour.resolver' | ||
import { DirectorateOfLabourService } from './directorate-of-labour.service' | ||
|
||
const XROAD_BASE_PATH_WITH_ENV = process.env.XROAD_BASE_PATH_WITH_ENV ?? '' | ||
const XROAD_VMST_MEMBER_CODE = process.env.XROAD_VMST_MEMBER_CODE ?? '' | ||
const XROAD_VMST_API_PATH = process.env.XROAD_VMST_API_PATH ?? '' | ||
const XROAD_VMST_API_KEY = process.env.XROAD_VMST_API_KEY ?? '' | ||
const XROAD_CLIENT_ID = process.env.XROAD_CLIENT_ID ?? '' | ||
const XROAD_VMST_MEMBER_CLASS = XRoadMemberClass.GovernmentInstitution | ||
|
||
@Module({}) | ||
export class DirectorateOfLabourModule { | ||
static register(): DynamicModule { | ||
return { | ||
module: DirectorateOfLabourModule, | ||
providers: [ | ||
DirectorateOfLabourResolver, | ||
DirectorateOfLabourService, | ||
DirectorateOfLabourRepository, | ||
], | ||
imports: [ | ||
VMSTModule.register({ | ||
xRoadPath: createXRoadAPIPath( | ||
XROAD_BASE_PATH_WITH_ENV, | ||
XROAD_VMST_MEMBER_CLASS, | ||
XROAD_VMST_MEMBER_CODE, | ||
XROAD_VMST_API_PATH, | ||
), | ||
xRoadClient: XROAD_CLIENT_ID, | ||
apiKey: XROAD_VMST_API_KEY, | ||
}), | ||
], | ||
exports: [], | ||
} | ||
} | ||
} | ||
@Module({ | ||
providers: [ | ||
DirectorateOfLabourResolver, | ||
DirectorateOfLabourService, | ||
DirectorateOfLabourRepository, | ||
], | ||
imports: [VMSTModule], | ||
}) | ||
export class DirectorateOfLabourModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.