-
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
ebbc879
commit 1580a62
Showing
48 changed files
with
428 additions
and
31 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
File renamed without changes.
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
...tialize-pathway/services/index.service.ts → ...-pathway/services/init-pathway.service.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
4 changes: 2 additions & 2 deletions
4
libs/pathway-design/server/pathway/application/src/lib/pathway-application.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
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
6 changes: 3 additions & 3 deletions
6
libs/pathway-design/server/pathway/business/src/lib/entities/pathway.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
6 changes: 3 additions & 3 deletions
6
libs/pathway-design/server/pathway/business/src/lib/entities/pathway.types.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
6 changes: 3 additions & 3 deletions
6
libs/pathway-design/server/pathway/business/src/lib/factories/pathway.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
File renamed without changes.
File renamed without changes.
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
...ib/usecases/change-title/index.usecase.ts → ...ases/change-title/change-title.usecase.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
File renamed without changes.
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
...c/lib/usecases/intialize/index.usecase.ts → ...rc/lib/usecases/intialize/init.usecase.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
2 changes: 1 addition & 1 deletion
2
...src/lib/value-objects/description.spec.ts → ...-objects/description.value-object.spec.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../lib/value-objects/research-field.spec.ts → ...jects/research-field.value-object.spec.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...iness/src/lib/value-objects/title.spec.ts → .../value-objects/title.value-object.spec.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
File renamed without changes.
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$"] | ||
} |
17 changes: 17 additions & 0 deletions
17
libs/pathway-design/server/pathway/infrastructure/biome.json
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": [{}] | ||
} |
15 changes: 15 additions & 0 deletions
15
libs/pathway-design/server/pathway/infrastructure/cucumber.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,15 @@ | ||
module.exports = { | ||
default: { | ||
paths: [ | ||
'libs/pathway-design/server/pathway/infrastructure/src/lib/**/*.feature', | ||
], | ||
requireModule: ['ts-node/register', 'tsconfig-paths/register'], | ||
require: [ | ||
'libs/pathway-design/server/pathway/infrastructure/src/lib/**/*.step.ts', | ||
], | ||
format: [ | ||
'json:dist/reports/libs/pathway-design/pathway/infrastructure/test-feature/index.json', | ||
'html:dist/reports/libs/pathway-design/pathway/infrastructure/test-feature/index.html', | ||
], | ||
}, | ||
}; |
9 changes: 9 additions & 0 deletions
9
libs/pathway-design/server/pathway/infrastructure/package.json
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/pathway-design-server-pathway-infrastructure", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"@swc/helpers": "~0.5.11" | ||
}, | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts" | ||
} |
50 changes: 50 additions & 0 deletions
50
libs/pathway-design/server/pathway/infrastructure/project.json
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,50 @@ | ||
{ | ||
"name": "pathway-design-server-pathway-infrastructure", | ||
"$schema": "../../../../../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/pathway-design/server/pathway/infrastructure/src", | ||
"projectType": "library", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/js:swc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/libs/pathway-design/server/pathway/infrastructure", | ||
"main": "libs/pathway-design/server/pathway/infrastructure/src/index.ts", | ||
"tsConfig": "libs/pathway-design/server/pathway/infrastructure/tsconfig.lib.json", | ||
"assets": [] | ||
} | ||
}, | ||
"nx-release-publish": { | ||
"options": { | ||
"packageRoot": "dist/{projectRoot}" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "bun run biome check --write {projectRoot} --config-path={projectRoot}/biome.json" | ||
} | ||
}, | ||
"test": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "bun test --coverage --coverage-dir=dist/reports/{projectRoot}/coverage --coverage-reporter=lcov {projectRoot}" | ||
} | ||
}, | ||
"test-feature": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "TS_NODE_PROJECT='{projectRoot}/tsconfig.spec.json' bun run cucumber-js --config={projectRoot}/cucumber.js" | ||
} | ||
} | ||
}, | ||
"tags": ["type:infrastructure:pathway-design:server"], | ||
"release": { | ||
"version": { | ||
"generatorOptions": { | ||
"packageRoot": "dist/{projectRoot}", | ||
"currentVersionResolver": "git-tag" | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
.../server/pathway/infrastructure/src/lib/common/persistence/in-memory/constants/pathways.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type { PathwayEntity } from '../entities/pathway.entity'; | ||
|
||
export const pathways = new Map<string, PathwayEntity>(); |
6 changes: 6 additions & 0 deletions
6
...er/pathway/infrastructure/src/lib/common/persistence/in-memory/entities/pathway.entity.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class PathwayEntity { | ||
description: string; | ||
id: string; | ||
researchField: string; | ||
title: string; | ||
} |
11 changes: 11 additions & 0 deletions
11
...lib/initialize-pathway/persistence/in-memory/init-pathway-in-memory-persistence.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PathwayDesignInfrastructureInitializePathwayPersistenceInMemory } from './init-pathway.memory'; | ||
|
||
@Module({ | ||
imports: [], | ||
providers: [ | ||
PathwayDesignInfrastructureInitializePathwayPersistenceInMemory, | ||
], | ||
exports: [PathwayDesignInfrastructureInitializePathwayPersistenceInMemory], | ||
}) | ||
export class InitPathwayInMemoryPersistenceModule {} |
58 changes: 58 additions & 0 deletions
58
...frastructure/src/lib/initialize-pathway/persistence/in-memory/init-pathway.memory.spec.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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { PathwayDesignServerPathwayBusinessEntitiesPathway } from '@bewoak/pathway-design-server-pathway-business'; | ||
import { type Mock, beforeEach, describe, expect, spyOn, test } from 'bun:test'; | ||
import { type Observable, isObservable } from 'rxjs'; | ||
import { PathwayDesignInfrastructureInitializePathwayPersistenceInMemory } from './init-pathway.memory'; | ||
|
||
describe('PathwayDesignInfrastructureInitializePathwayPersistenceInMemory', () => { | ||
describe('When I save a pathway', () => { | ||
let infrastructureInitializePathwayPersistenceInMemory: PathwayDesignInfrastructureInitializePathwayPersistenceInMemory; | ||
|
||
let pathway: PathwayDesignServerPathwayBusinessEntitiesPathway; | ||
|
||
let infrastructureInitializePathwayPersistenceInMemorySaveSpy: Mock< | ||
( | ||
pathway: PathwayDesignServerPathwayBusinessEntitiesPathway | ||
) => Observable<PathwayDesignServerPathwayBusinessEntitiesPathway> | ||
>; | ||
|
||
let result: Observable<PathwayDesignServerPathwayBusinessEntitiesPathway>; | ||
|
||
beforeEach(() => { | ||
infrastructureInitializePathwayPersistenceInMemory = | ||
new PathwayDesignInfrastructureInitializePathwayPersistenceInMemory(); | ||
|
||
pathway = new PathwayDesignServerPathwayBusinessEntitiesPathway(); | ||
|
||
infrastructureInitializePathwayPersistenceInMemorySaveSpy = spyOn( | ||
infrastructureInitializePathwayPersistenceInMemory, | ||
'save' | ||
); | ||
|
||
result = | ||
infrastructureInitializePathwayPersistenceInMemory.save( | ||
pathway | ||
); | ||
}); | ||
|
||
test('should return the pathway', () => { | ||
expect( | ||
infrastructureInitializePathwayPersistenceInMemory | ||
).toBeDefined(); | ||
expect( | ||
infrastructureInitializePathwayPersistenceInMemorySaveSpy | ||
).toHaveBeenCalledWith(pathway); | ||
}); | ||
|
||
test('result should be an observable of pathway', (done) => { | ||
expect(isObservable(result)).toBe(true); | ||
|
||
result.subscribe({ | ||
next: (value) => { | ||
expect(value).toBe(pathway); | ||
done(); | ||
}, | ||
error: (err) => done(err), | ||
}); | ||
}); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
...ay/infrastructure/src/lib/initialize-pathway/persistence/in-memory/init-pathway.memory.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { | ||
PathwayDesignServerPathwayBusinessEntitiesPathway, | ||
PathwayDesignServerPathwayBusinessPortsInitPathwayMemory, | ||
} from '@bewoak/pathway-design-server-pathway-business'; | ||
import { of } from 'rxjs'; | ||
|
||
export class PathwayDesignInfrastructureInitializePathwayPersistenceInMemory | ||
implements PathwayDesignServerPathwayBusinessPortsInitPathwayMemory | ||
{ | ||
save( | ||
pathwayDesignServerPathwayBusinessEntitiesPathway: PathwayDesignServerPathwayBusinessEntitiesPathway | ||
) { | ||
return of(pathwayDesignServerPathwayBusinessEntitiesPathway); | ||
} | ||
} |
Empty file.
Oops, something went wrong.