-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TECH] Extract flash-certification cross-injection from shared (PIX-1…
- Loading branch information
Showing
7 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ertification/flash-certification/application/flash-assessment-configuration-controller.js
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
38 changes: 38 additions & 0 deletions
38
api/src/certification/flash-certification/domain/usecases/index.js
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// eslint-disable import/no-restricted-paths | ||
import { dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
import * as challengeRepository from '../../../../shared/infrastructure/repositories/challenge-repository.js'; | ||
import { injectDependencies } from '../../../../shared/infrastructure/utils/dependency-injection.js'; | ||
import { importNamedExportsFromDirectory } from '../../../../shared/infrastructure/utils/import-named-exports-from-directory.js'; | ||
import * as flashAlgorithmConfigurationRepository from '../../infrastructure/repositories/flash-algorithm-configuration-repository.js'; | ||
import * as flashAlgorithmService from '../services/algorithm-methods/flash.js'; | ||
|
||
/** | ||
* Using {@link https://jsdoc.app/tags-type "Closure Compiler's syntax"} to document injected dependencies | ||
* | ||
* @typedef {challengeRepository} ChallengeRepository | ||
* @typedef {flashAlgorithmConfigurationRepository} FlashAlgorithmConfigurationRepository | ||
* @typedef {flashAlgorithmService} FlashAlgorithmService | ||
*/ | ||
const dependencies = { | ||
challengeRepository, | ||
flashAlgorithmConfigurationRepository, | ||
flashAlgorithmService, | ||
}; | ||
|
||
const path = dirname(fileURLToPath(import.meta.url)); | ||
|
||
const usecasesWithoutInjectedDependencies = { | ||
...(await importNamedExportsFromDirectory({ | ||
path, | ||
ignoredFileNames: ['index.js'], | ||
})), | ||
}; | ||
|
||
const usecases = injectDependencies(usecasesWithoutInjectedDependencies, dependencies); | ||
|
||
/** | ||
* @typedef {dependencies} dependencies | ||
*/ | ||
export { usecases }; |
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
2 changes: 1 addition & 1 deletion
2
...h-certification/integration/application/flash-assessment-configuration-controller_test.js
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