-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf2d801
commit 20f4ced
Showing
42 changed files
with
538 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,44 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
import { PDSPIPPathwayPersistenceInfrastructureModule } from '@bewoak/pathway-design-server-pathway-infrastructure'; | ||
import { | ||
PDSPIPPathwayPersistenceInfrastructureModule, | ||
type PDSPIPPersistenceDriverAuthorized, | ||
} from '@bewoak/pathway-design-server-pathway-infrastructure'; | ||
import { | ||
PDSPIAChangeTitlePathwayInterfaceAdaptersModule, | ||
PDSPIAInitializePathwayInterfaceAdaptersModule, | ||
} from '@bewoak/pathway-design-server-pathway-interface-adapters'; | ||
import { PDSPPPathwayPresentersModule } from '@bewoak/pathway-design-server-pathway-presenters'; | ||
import { | ||
PDSPPPathwayPresentersModule, | ||
type PDSPPPresenterDriverAuthorized, | ||
} from '@bewoak/pathway-design-server-pathway-presenters'; | ||
import { CqrsModule } from '@nestjs/cqrs'; | ||
|
||
@Module({ | ||
imports: [ | ||
PDSPIAChangeTitlePathwayInterfaceAdaptersModule.withPresenter(PDSPPPathwayPresentersModule.use('toJson')) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use('inMemory')) | ||
.build(), | ||
PDSPIAInitializePathwayInterfaceAdaptersModule.withPresenter(PDSPPPathwayPresentersModule.use('toJson')) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use('inMemory')) | ||
.build(), | ||
CqrsModule.forRoot(), | ||
CqrsModule.forRoot(), | ||
], | ||
controllers: [], | ||
providers: [], | ||
}) | ||
export class AppModule {} | ||
interface ApplicationBootstrapOptions { | ||
persistenceDriver: PDSPIPPersistenceDriverAuthorized; | ||
presenterDriver: PDSPPPresenterDriverAuthorized; | ||
} | ||
|
||
@Module({}) | ||
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation> | ||
export class AppModule { | ||
static register(options: ApplicationBootstrapOptions) { | ||
return { | ||
module: AppModule, | ||
imports: [ | ||
PDSPIAChangeTitlePathwayInterfaceAdaptersModule.withPresenter( | ||
PDSPPPathwayPresentersModule.use(options.presenterDriver) | ||
) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use(options.persistenceDriver)) | ||
.build(), | ||
PDSPIAInitializePathwayInterfaceAdaptersModule.withPresenter( | ||
PDSPPPathwayPresentersModule.use(options.presenterDriver) | ||
) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use(options.persistenceDriver)) | ||
.build(), | ||
CqrsModule.forRoot(), | ||
CqrsModule.forRoot(), | ||
], | ||
}; | ||
} | ||
} |
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,10 @@ | ||
import { pDSPIPPersistenceKeys } from '@bewoak/pathway-design-server-pathway-infrastructure'; | ||
import { pDSPPPresenterKeys } from '@bewoak/pathway-design-server-pathway-presenters'; | ||
import { z } from 'zod'; | ||
|
||
export const envSchema = z.object({ | ||
GLOBAL_PREFIX: z.string(), | ||
PERSISTENCE_DRIVER: z.enum(pDSPIPPersistenceKeys), | ||
PORT: z.string().transform((value) => Number.parseInt(value, 10)), | ||
PRESENTER_DRIVER: z.enum(pDSPPPresenterKeys), | ||
}); |
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
9 changes: 6 additions & 3 deletions
9
apps/pathway-design/server/src/specs/change-title-pathway/index.feature
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,12 +1,15 @@ | ||
Feature: Platform - Change the title of a pathway in a memory database with json presenter | ||
Feature: Platform - Change the title of a pathway | ||
|
||
Scenario: I want to change the title of a learning pathway on the platform | ||
Given I am authenticated on the platform for change the title of the pathway in memory persistence and json presenter | ||
Given I have a pathway on the platform recorded in memory with these data | ||
Given I am authenticated on the platform for change the title of the pathway with "<presenter>" and "<persistence>" | ||
Given I have a pathway on the platform with these data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
When I want to change the title of the pathway on the platform "My New Pathway" | ||
Then I should receive from the platform the new title of the pathway | ||
| title | | ||
| My New Pathway | | ||
|
||
Examples: | ||
| presenter | persistence | | ||
| toJson | inMemory | |
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
10 changes: 6 additions & 4 deletions
10
apps/pathway-design/server/src/specs/initialize-pathway/index.feature
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,13 +1,15 @@ | ||
Feature: Platform - Initialize Pathway in a memory database with json presenter | ||
Feature: Platform - Initialize a Pathway | ||
|
||
Scenario: I want to initialize a learning pathway on the platform | ||
Given I am authenticated on the platform for initialize a pathway in memory persistence and json presenter | ||
Given I am authenticated on the platform for initialize a pathway with "<presenter>" and "<persistence>" | ||
When I want to initialize on the platform a pathway with these data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
Then I should retrieve from the platform a pathway initialized with its data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
Then The pathway received from the platform should be have a unique identifier | ||
|
||
|
||
|
||
Examples: | ||
| presenter | persistence | | ||
| toJson | inMemory | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ | |
"noVoidTypeReturn": { | ||
"level": "error" | ||
} | ||
}, | ||
"complexity": { | ||
"noForEach": "off" | ||
} | ||
} | ||
}, | ||
|
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,22 @@ | ||
{ | ||
"jsc": { | ||
"target": "es2022", | ||
"parser": { | ||
"syntax": "typescript", | ||
"decorators": true, | ||
"dynamicImport": true | ||
}, | ||
"transform": { | ||
"decoratorMetadata": true, | ||
"legacyDecorator": true | ||
}, | ||
"keepClassNames": true, | ||
"externalHelpers": true, | ||
"loose": true | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"sourceMaps": true, | ||
"exclude": [".*\\.spec.tsx?$", ".*\\.step.ts$", ".*\\.test.tsx?$", ".*.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,17 @@ | ||
{ | ||
"$schema": "../../../../../node_modules/@biomejs/biome/configuration_schema.json", | ||
"extends": ["../../../../../biome.json"], | ||
"linter": { | ||
"rules": { | ||
"nursery": { | ||
"noRestrictedImports": { | ||
"options": { | ||
"paths": {} | ||
}, | ||
"level": "error" | ||
} | ||
} | ||
} | ||
}, | ||
"overrides": [{}] | ||
} |
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,11 @@ | ||
module.exports = { | ||
default: { | ||
paths: ['libs/common/configs/server/env/src/lib/**/*.feature'], | ||
requireModule: ['ts-node/register', 'tsconfig-paths/register'], | ||
require: ['libs/common/configs/server/env/src/lib/**/*.step.ts'], | ||
format: [ | ||
'json:dist/reports/libs/common/configs/server/env/test-feature/index.json', | ||
'html:dist/reports/libs/common/configs/server/env/test-feature/index.html', | ||
], | ||
}, | ||
}; |
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,9 @@ | ||
{ | ||
"name": "@bewoak/common-configs-server-env", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"@swc/helpers": "~0.5.11" | ||
}, | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts" | ||
} |
Oops, something went wrong.