mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merge commit '1260d2932413e79a02bc558beac7af810509470d'
This commit is contained in:
582
angular.json
582
angular.json
@@ -2617,6 +2617,46 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@page/goods-in": {
|
||||
"projectType": "library",
|
||||
"root": "apps/page/goods-in",
|
||||
"sourceRoot": "apps/page/goods-in/src",
|
||||
"prefix": "page",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/page/goods-in/tsconfig.lib.json",
|
||||
"project": "apps/page/goods-in/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/page/goods-in/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/page/goods-in/src/test.ts",
|
||||
"tsConfig": "apps/page/goods-in/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/page/goods-in/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/page/goods-in/tsconfig.lib.json",
|
||||
"apps/page/goods-in/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/autocomplete": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/autocomplete",
|
||||
@@ -2657,6 +2697,126 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@shared/goods-in-out": {
|
||||
"projectType": "library",
|
||||
"root": "apps/shared/goods-in-out",
|
||||
"sourceRoot": "apps/shared/goods-in-out/src",
|
||||
"prefix": "shared",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/shared/goods-in-out/tsconfig.lib.json",
|
||||
"project": "apps/shared/goods-in-out/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/shared/goods-in-out/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/shared/goods-in-out/src/test.ts",
|
||||
"tsConfig": "apps/shared/goods-in-out/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/shared/goods-in-out/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/shared/goods-in-out/tsconfig.lib.json",
|
||||
"apps/shared/goods-in-out/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/tooltip": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/tooltip",
|
||||
"sourceRoot": "apps/ui/tooltip/src",
|
||||
"prefix": "ui",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.lib.json",
|
||||
"project": "apps/ui/tooltip/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/tooltip/src/test.ts",
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/tooltip/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/tooltip/tsconfig.lib.json",
|
||||
"apps/ui/tooltip/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@core/command": {
|
||||
"projectType": "library",
|
||||
"root": "apps/core/command",
|
||||
"sourceRoot": "apps/core/command/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/core/command/tsconfig.lib.json",
|
||||
"project": "apps/core/command/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/core/command/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/core/command/src/test.ts",
|
||||
"tsConfig": "apps/core/command/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/core/command/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/core/command/tsconfig.lib.json",
|
||||
"apps/core/command/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/switch": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/switch",
|
||||
@@ -2697,38 +2857,438 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/tooltip": {
|
||||
"@ui/quantity-dropdown": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/tooltip",
|
||||
"sourceRoot": "apps/ui/tooltip/src",
|
||||
"root": "apps/ui/quantity-dropdown",
|
||||
"sourceRoot": "apps/ui/quantity-dropdown/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.lib.json",
|
||||
"project": "apps/ui/tooltip/ng-package.json"
|
||||
"tsConfig": "apps/ui/quantity-dropdown/tsconfig.lib.json",
|
||||
"project": "apps/ui/quantity-dropdown/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.lib.prod.json"
|
||||
"tsConfig": "apps/ui/quantity-dropdown/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/tooltip/src/test.ts",
|
||||
"tsConfig": "apps/ui/tooltip/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/tooltip/karma.conf.js"
|
||||
"main": "apps/ui/quantity-dropdown/src/test.ts",
|
||||
"tsConfig": "apps/ui/quantity-dropdown/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/quantity-dropdown/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/tooltip/tsconfig.lib.json",
|
||||
"apps/ui/tooltip/tsconfig.spec.json"
|
||||
"apps/ui/quantity-dropdown/tsconfig.lib.json",
|
||||
"apps/ui/quantity-dropdown/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/dropdown": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/dropdown",
|
||||
"sourceRoot": "apps/ui/dropdown/src",
|
||||
"prefix": "ui",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/dropdown/tsconfig.lib.json",
|
||||
"project": "apps/ui/dropdown/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/dropdown/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/dropdown/src/test.ts",
|
||||
"tsConfig": "apps/ui/dropdown/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/dropdown/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/dropdown/tsconfig.lib.json",
|
||||
"apps/ui/dropdown/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@shell/header": {
|
||||
"projectType": "library",
|
||||
"root": "apps/shell/header",
|
||||
"sourceRoot": "apps/shell/header/src",
|
||||
"prefix": "shell",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/shell/header/tsconfig.lib.json",
|
||||
"project": "apps/shell/header/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/shell/header/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/shell/header/src/test.ts",
|
||||
"tsConfig": "apps/shell/header/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/shell/header/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/shell/header/tsconfig.lib.json",
|
||||
"apps/shell/header/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/select-bullet": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/select-bullet",
|
||||
"sourceRoot": "apps/ui/select-bullet/src",
|
||||
"prefix": "ui",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/select-bullet/tsconfig.lib.json",
|
||||
"project": "apps/ui/select-bullet/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/select-bullet/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/select-bullet/src/test.ts",
|
||||
"tsConfig": "apps/ui/select-bullet/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/select-bullet/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/select-bullet/tsconfig.lib.json",
|
||||
"apps/ui/select-bullet/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@page/goods-out": {
|
||||
"projectType": "library",
|
||||
"root": "apps/page/goods-out",
|
||||
"sourceRoot": "apps/page/goods-out/src",
|
||||
"prefix": "page",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/page/goods-out/tsconfig.lib.json",
|
||||
"project": "apps/page/goods-out/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/page/goods-out/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/page/goods-out/src/test.ts",
|
||||
"tsConfig": "apps/page/goods-out/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/page/goods-out/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/page/goods-out/tsconfig.lib.json",
|
||||
"apps/page/goods-out/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/scroll-container": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/scroll-container",
|
||||
"sourceRoot": "apps/ui/scroll-container/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/scroll-container/tsconfig.lib.json",
|
||||
"project": "apps/ui/scroll-container/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/scroll-container/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/scroll-container/src/test.ts",
|
||||
"tsConfig": "apps/ui/scroll-container/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/scroll-container/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/scroll-container/tsconfig.lib.json",
|
||||
"apps/ui/scroll-container/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@ui/loader": {
|
||||
"projectType": "library",
|
||||
"root": "apps/ui/loader",
|
||||
"sourceRoot": "apps/ui/loader/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/ui/loader/tsconfig.lib.json",
|
||||
"project": "apps/ui/loader/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/ui/loader/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/ui/loader/src/test.ts",
|
||||
"tsConfig": "apps/ui/loader/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/ui/loader/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/ui/loader/tsconfig.lib.json",
|
||||
"apps/ui/loader/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@modal/reorder": {
|
||||
"projectType": "library",
|
||||
"root": "apps/modal/reorder",
|
||||
"sourceRoot": "apps/modal/reorder/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/modal/reorder/tsconfig.lib.json",
|
||||
"project": "apps/modal/reorder/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/modal/reorder/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/modal/reorder/src/test.ts",
|
||||
"tsConfig": "apps/modal/reorder/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/modal/reorder/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/modal/reorder/tsconfig.lib.json",
|
||||
"apps/modal/reorder/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@core/signalr": {
|
||||
"projectType": "library",
|
||||
"root": "apps/core/signalr",
|
||||
"sourceRoot": "apps/core/signalr/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/core/signalr/tsconfig.lib.json",
|
||||
"project": "apps/core/signalr/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/core/signalr/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/core/signalr/src/test.ts",
|
||||
"tsConfig": "apps/core/signalr/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/core/signalr/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/core/signalr/tsconfig.lib.json",
|
||||
"apps/core/signalr/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@hub/notifications": {
|
||||
"projectType": "library",
|
||||
"root": "apps/hub/notifications",
|
||||
"sourceRoot": "apps/hub/notifications/src",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/hub/notifications/tsconfig.lib.json",
|
||||
"project": "apps/hub/notifications/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/hub/notifications/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/hub/notifications/src/test.ts",
|
||||
"tsConfig": "apps/hub/notifications/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/hub/notifications/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/hub/notifications/tsconfig.lib.json",
|
||||
"apps/hub/notifications/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@shared/notification-channel-control": {
|
||||
"projectType": "library",
|
||||
"root": "apps/shared/notification-channel-control",
|
||||
"sourceRoot": "apps/shared/notification-channel-control/src",
|
||||
"prefix": "shared",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "apps/shared/notification-channel-control/tsconfig.lib.json",
|
||||
"project": "apps/shared/notification-channel-control/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/shared/notification-channel-control/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "apps/shared/notification-channel-control/src/test.ts",
|
||||
"tsConfig": "apps/shared/notification-channel-control/tsconfig.spec.json",
|
||||
"karmaConfig": "apps/shared/notification-channel-control/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"apps/shared/notification-channel-control/tsconfig.lib.json",
|
||||
"apps/shared/notification-channel-control/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
|
||||
@@ -4,4 +4,5 @@
|
||||
|
||||
export * from './lib/product-image.service';
|
||||
export * from './lib/product-image.module';
|
||||
export * from './lib/product-image.pipe';
|
||||
export * from './lib/tokens';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { applicationReducer } from './store';
|
||||
import { ApplicationService } from './application.service';
|
||||
|
||||
@NgModule({
|
||||
@@ -10,7 +12,7 @@ export class CoreApplicationModule {
|
||||
static forRoot(): ModuleWithProviders<CoreApplicationModule> {
|
||||
return {
|
||||
ngModule: CoreApplicationModule,
|
||||
providers: [ApplicationService],
|
||||
providers: [ApplicationService, StoreModule.forFeature('core-application', applicationReducer).providers],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { processRemoved } from './store';
|
||||
import { processRemoved, selectSection, setSection } from './store';
|
||||
|
||||
@Injectable()
|
||||
export class ApplicationService {
|
||||
@@ -15,6 +15,8 @@ export class ApplicationService {
|
||||
return this.activatedProcessIdSubject.asObservable();
|
||||
}
|
||||
|
||||
readonly section$ = this.store.select(selectSection);
|
||||
|
||||
constructor(private store: Store) {}
|
||||
|
||||
setActivatedProcessId(processId: number) {
|
||||
@@ -28,4 +30,8 @@ export class ApplicationService {
|
||||
}
|
||||
|
||||
createProcess() {}
|
||||
|
||||
setSection(section: 'customer' | 'branch') {
|
||||
this.store.dispatch(setSection({ section }));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,3 +6,5 @@ const prefix = '[CORE-APPLICATION]';
|
||||
* Action nach Entfernung eines Prozesses
|
||||
*/
|
||||
export const processRemoved = createAction(`${prefix} Process Removed`, props<{ processId: number }>());
|
||||
|
||||
export const setSection = createAction(`${prefix} Set Section`, props<{ section: 'customer' | 'branch' }>());
|
||||
|
||||
12
apps/core/application/src/lib/store/application.reducer.ts
Normal file
12
apps/core/application/src/lib/store/application.reducer.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Action, createReducer, on } from '@ngrx/store';
|
||||
import { setSection } from './application.actions';
|
||||
import { ApplicationState, INITIAL_APPLICATION_STATE } from './application.state';
|
||||
|
||||
const _applicationReducer = createReducer(
|
||||
INITIAL_APPLICATION_STATE,
|
||||
on(setSection, (state, { section }) => ({ ...state, section }))
|
||||
);
|
||||
|
||||
export function applicationReducer(state: ApplicationState, action: Action) {
|
||||
return _applicationReducer(state, action);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { createFeatureSelector, createSelector } from '@ngrx/store';
|
||||
import { ApplicationState } from './application.state';
|
||||
export const selectApplicationState = createFeatureSelector<ApplicationState>('core-application');
|
||||
|
||||
export const selectSection = createSelector(selectApplicationState, (s) => s.section);
|
||||
7
apps/core/application/src/lib/store/application.state.ts
Normal file
7
apps/core/application/src/lib/store/application.state.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface ApplicationState {
|
||||
section: 'customer' | 'branch';
|
||||
}
|
||||
|
||||
export const INITIAL_APPLICATION_STATE: ApplicationState = {
|
||||
section: 'customer',
|
||||
};
|
||||
@@ -1,3 +1,6 @@
|
||||
// start:ng42.barrel
|
||||
export * from './application.actions';
|
||||
export * from './application.reducer';
|
||||
export * from './application.selectors';
|
||||
export * from './application.state';
|
||||
// end:ng42.barrel
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Store } from '@ngrx/store';
|
||||
import { getNumberId } from '@utils/id';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { Breadcrumb } from './defs';
|
||||
|
||||
import * as actions from './store/breadcrumb.actions';
|
||||
@@ -13,6 +13,10 @@ import * as selectors from './store/breadcrumb.selectors';
|
||||
export class BreadcrumbService {
|
||||
constructor(private store: Store<any>) {}
|
||||
|
||||
getAll$() {
|
||||
return this.store.select(selectors.selectBreadcrumbs);
|
||||
}
|
||||
|
||||
getByKey$(key: string): Observable<Breadcrumb[]> {
|
||||
return this.store.select(selectors.selectBreadcrumbsByKey, key);
|
||||
}
|
||||
@@ -26,13 +30,13 @@ export class BreadcrumbService {
|
||||
}
|
||||
|
||||
addBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb {
|
||||
const newBreadcrumb: Breadcrumb = { ...breadcrumb, id: getNumberId(), timestamp: Date.now() };
|
||||
const newBreadcrumb: Breadcrumb = { ...breadcrumb, id: getNumberId(), timestamp: Date.now(), changed: Date.now() };
|
||||
this.store.dispatch(actions.addBreadcrumb({ breadcrumb: newBreadcrumb }));
|
||||
return newBreadcrumb;
|
||||
}
|
||||
|
||||
patchBreadcrumb(breadcrumbId: number, changes: Partial<Breadcrumb>) {
|
||||
this.store.dispatch(actions.updateBreadcrumb({ id: breadcrumbId, changes }));
|
||||
this.store.dispatch(actions.updateBreadcrumb({ id: breadcrumbId, changes: { ...changes, changed: Date.now() } }));
|
||||
}
|
||||
|
||||
async addBreadcrumbIfNotExists(breadcrumb: Breadcrumb) {
|
||||
@@ -107,4 +111,10 @@ export class BreadcrumbService {
|
||||
|
||||
this.store.dispatch(actions.removeManyBreadcrumb({ ids: breadcrumbsToRemove.map((crumb) => crumb.id) }));
|
||||
}
|
||||
|
||||
getLatestBreadcrumbForSection(section: 'customer' | 'branch') {
|
||||
return this.store
|
||||
.select(selectors.selectBreadcrumbsBySection, { section })
|
||||
.pipe(map((crumbs) => crumbs.sort((a, b) => b.changed - a.changed).find((f) => true)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,14 @@ export interface Breadcrumb {
|
||||
* Timestamp
|
||||
*/
|
||||
timestamp?: number;
|
||||
|
||||
/**
|
||||
* Cahnged
|
||||
*/
|
||||
changed?: number;
|
||||
|
||||
/**
|
||||
* Applicatiuon Section
|
||||
*/
|
||||
section: 'branch' | 'customer';
|
||||
}
|
||||
|
||||
@@ -39,3 +39,10 @@ export const selectBreadcrumbsByKeyAndTags = createSelector(
|
||||
(entities: Breadcrumb[], { key, tags }: { key: string; tags: string[] }) =>
|
||||
entities.filter((crumb) => crumb.key === key && isArray(crumb.tags) && tags.every((tag) => crumb.tags.includes(tag)))
|
||||
);
|
||||
|
||||
/**
|
||||
* Gibt alle Breadcrumb Entities als Array zurück die die tags enthalten
|
||||
*/
|
||||
export const selectBreadcrumbsBySection = createSelector(selectAll, (entities: Breadcrumb[], { section }: { section: string }) =>
|
||||
entities.filter((crumb) => crumb.section === section)
|
||||
);
|
||||
|
||||
25
apps/core/command/README.md
Normal file
25
apps/core/command/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Command
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.2.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project command` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project command`.
|
||||
|
||||
> Note: Don't forget to add `--project command` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build command` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Publishing
|
||||
|
||||
After building your library with `ng build command`, go to the dist folder `cd dist/command` and run `npm publish`.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test command` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
||||
32
apps/core/command/karma.conf.js
Normal file
32
apps/core/command/karma.conf.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma'),
|
||||
],
|
||||
client: {
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../../../coverage/core/command'),
|
||||
reports: ['html', 'lcovonly', 'text-summary'],
|
||||
fixWebpackSourcePaths: true,
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false,
|
||||
restartOnFileChange: true,
|
||||
});
|
||||
};
|
||||
7
apps/core/command/ng-package.json
Normal file
7
apps/core/command/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/core/command",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
11
apps/core/command/package.json
Normal file
11
apps/core/command/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@core/command",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^10.1.2",
|
||||
"@angular/core": "^10.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
}
|
||||
4
apps/core/command/src/lib/action-handler.interface.ts
Normal file
4
apps/core/command/src/lib/action-handler.interface.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export abstract class ActionHandler<T = any> {
|
||||
constructor(readonly action: string) {}
|
||||
abstract handler(data: T): Promise<T>;
|
||||
}
|
||||
21
apps/core/command/src/lib/command.module.ts
Normal file
21
apps/core/command/src/lib/command.module.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { ModuleWithProviders, NgModule, Type } from '@angular/core';
|
||||
import { ActionHandler } from './action-handler.interface';
|
||||
import { CommandService } from './command.service';
|
||||
import { FEATURE_ACTION_HANDLERS, ROOT_ACTION_HANDLERS } from './tokens';
|
||||
|
||||
@NgModule({})
|
||||
export class CoreCommandModule {
|
||||
static forRoot(actionHandlers: Type<ActionHandler>[]): ModuleWithProviders<CoreCommandModule> {
|
||||
return {
|
||||
ngModule: CoreCommandModule,
|
||||
providers: [CommandService, actionHandlers.map((handler) => ({ provide: ROOT_ACTION_HANDLERS, useClass: handler, multi: true }))],
|
||||
};
|
||||
}
|
||||
|
||||
static forChild(actionHandlers: Type<ActionHandler>[]): ModuleWithProviders<CoreCommandModule> {
|
||||
return {
|
||||
ngModule: CoreCommandModule,
|
||||
providers: [CommandService, actionHandlers.map((handler) => ({ provide: FEATURE_ACTION_HANDLERS, useClass: handler, multi: true }))],
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { OmsService } from './oms.service';
|
||||
import { CommandService } from './command.service';
|
||||
|
||||
describe('OmsService', () => {
|
||||
let service: OmsService;
|
||||
describe('CommandService', () => {
|
||||
let service: CommandService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(OmsService);
|
||||
service = TestBed.inject(CommandService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
34
apps/core/command/src/lib/command.service.ts
Normal file
34
apps/core/command/src/lib/command.service.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { ActionHandler } from './action-handler.interface';
|
||||
import { FEATURE_ACTION_HANDLERS, ROOT_ACTION_HANDLERS } from './tokens';
|
||||
|
||||
@Injectable()
|
||||
export class CommandService {
|
||||
constructor(private injector: Injector) {}
|
||||
|
||||
async handleCommand<T>(command: string, data?: T): Promise<T> {
|
||||
const actions = this.getActions(command);
|
||||
|
||||
for (const action of actions) {
|
||||
const handler = this.getActionHandler(action);
|
||||
if (!handler) {
|
||||
console.error('CommandService.handleCommand', 'Action Handler does not exist', { action });
|
||||
throw new Error('Action Handler does not exist');
|
||||
}
|
||||
console.log('handle command', handler, data);
|
||||
data = await handler.handler(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
getActions(command: string) {
|
||||
return command?.split('|') || [];
|
||||
}
|
||||
|
||||
getActionHandler(action: string): ActionHandler {
|
||||
const featureActionHandlers: ActionHandler[] = this.injector.get(FEATURE_ACTION_HANDLERS, []);
|
||||
const rootActionHandlers: ActionHandler[] = this.injector.get(ROOT_ACTION_HANDLERS, []);
|
||||
|
||||
return [...featureActionHandlers, ...rootActionHandlers].find((handler) => handler.action === action);
|
||||
}
|
||||
}
|
||||
6
apps/core/command/src/lib/index.ts
Normal file
6
apps/core/command/src/lib/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// start:ng42.barrel
|
||||
export * from './action-handler.interface';
|
||||
export * from './command.module';
|
||||
export * from './command.service';
|
||||
export * from './tokens';
|
||||
// end:ng42.barrel
|
||||
6
apps/core/command/src/lib/tokens.ts
Normal file
6
apps/core/command/src/lib/tokens.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { InjectionToken } from '@angular/core';
|
||||
import { ActionHandler } from './action-handler.interface';
|
||||
|
||||
export const ROOT_ACTION_HANDLERS = new InjectionToken<ActionHandler[]>('@core/domain ROOT_ACTION_HANDLER');
|
||||
|
||||
export const FEATURE_ACTION_HANDLERS = new InjectionToken<ActionHandler[]>('@core/domain FEATURE_ACTION_HANDLER');
|
||||
5
apps/core/command/src/public-api.ts
Normal file
5
apps/core/command/src/public-api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Public API Surface of command
|
||||
*/
|
||||
|
||||
export * from './lib';
|
||||
24
apps/core/command/src/test.ts
Normal file
24
apps/core/command/src/test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/dist/zone';
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
declare const require: {
|
||||
context(
|
||||
path: string,
|
||||
deep?: boolean,
|
||||
filter?: RegExp
|
||||
): {
|
||||
keys(): string[];
|
||||
<T>(id: string): T;
|
||||
};
|
||||
};
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
||||
25
apps/core/command/tsconfig.lib.json
Normal file
25
apps/core/command/tsconfig.lib.json
Normal file
@@ -0,0 +1,25 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../out-tsc/lib",
|
||||
"target": "es2015",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"inlineSources": true,
|
||||
"types": [],
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2018"
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"enableResourceInlining": true
|
||||
},
|
||||
"exclude": [
|
||||
"src/test.ts",
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
}
|
||||
10
apps/core/command/tsconfig.lib.prod.json
Normal file
10
apps/core/command/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,10 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
17
apps/core/command/tsconfig.spec.json
Normal file
17
apps/core/command/tsconfig.spec.json
Normal file
@@ -0,0 +1,17 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/test.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
17
apps/core/command/tslint.json
Normal file
17
apps/core/command/tslint.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "../../../tslint.json",
|
||||
"rules": {
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"lib",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"lib",
|
||||
"kebab-case"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { fromEvent } from 'rxjs';
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { map, take, tap } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -8,16 +8,17 @@ import { map, take } from 'rxjs/operators';
|
||||
export class EnvironmentService {
|
||||
constructor() {}
|
||||
|
||||
/** Returns whether app is used within native container*/
|
||||
isNative(): Promise<boolean> {
|
||||
return fromEvent(window, 'message')
|
||||
.pipe(
|
||||
map((evt: MessageEvent) => evt.data),
|
||||
map((data) => data.status === 'INIT'),
|
||||
take(1)
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
// /** Returns whether app is used within native container*/
|
||||
// isNative(): Promise<boolean> {
|
||||
// return fromEvent(window, 'message')
|
||||
// .pipe(
|
||||
// map((evt: MessageEvent) => evt.data),
|
||||
// tap(console.log.bind(window)),
|
||||
// map((data) => data.status === 'INIT'),
|
||||
// take(1)
|
||||
// )
|
||||
// .toPromise();
|
||||
// }
|
||||
|
||||
/** Returns whether current device is mobile phone or tablet */
|
||||
async isMobile(): Promise<boolean> {
|
||||
|
||||
25
apps/core/signalr/README.md
Normal file
25
apps/core/signalr/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Signalr
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.2.4.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project signalr` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project signalr`.
|
||||
|
||||
> Note: Don't forget to add `--project signalr` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build signalr` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Publishing
|
||||
|
||||
After building your library with `ng build signalr`, go to the dist folder `cd dist/signalr` and run `npm publish`.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test signalr` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
||||
32
apps/core/signalr/karma.conf.js
Normal file
32
apps/core/signalr/karma.conf.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma'),
|
||||
],
|
||||
client: {
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../../../coverage/core/signalr'),
|
||||
reports: ['html', 'lcovonly', 'text-summary'],
|
||||
fixWebpackSourcePaths: true,
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false,
|
||||
restartOnFileChange: true,
|
||||
});
|
||||
};
|
||||
7
apps/core/signalr/ng-package.json
Normal file
7
apps/core/signalr/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/core/signalr",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
11
apps/core/signalr/package.json
Normal file
11
apps/core/signalr/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@core/signalr",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^10.2.4",
|
||||
"@angular/core": "^10.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
}
|
||||
10
apps/core/signalr/src/lib/signalr-hub-options.ts
Normal file
10
apps/core/signalr/src/lib/signalr-hub-options.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { IHttpConnectionOptions, IRetryPolicy } from '@microsoft/signalr';
|
||||
|
||||
export interface SignalRHubOptions {
|
||||
url: string;
|
||||
|
||||
enableAutomaticReconnect?: boolean;
|
||||
automaticReconnect?: number[] | IRetryPolicy;
|
||||
|
||||
httpOptions?: IHttpConnectionOptions;
|
||||
}
|
||||
88
apps/core/signalr/src/lib/signalr.hub.ts
Normal file
88
apps/core/signalr/src/lib/signalr.hub.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import { HubConnection, HubConnectionBuilder, HubConnectionState } from '@microsoft/signalr';
|
||||
import { interval, Observable } from 'rxjs';
|
||||
import { shareReplay } from 'rxjs/operators';
|
||||
import { SignalRHubOptions } from './signalr-hub-options';
|
||||
|
||||
export abstract class SignalrHub {
|
||||
private readonly _hubConnection: HubConnection;
|
||||
|
||||
private _listenerCount = 0;
|
||||
|
||||
get connected() {
|
||||
return this._hubConnection.state === HubConnectionState.Connected;
|
||||
}
|
||||
|
||||
get connecting() {
|
||||
return this._hubConnection.state === HubConnectionState.Connecting;
|
||||
}
|
||||
|
||||
get disconnected() {
|
||||
return this._hubConnection.state === HubConnectionState.Disconnected;
|
||||
}
|
||||
|
||||
get disconnecting() {
|
||||
return this._hubConnection.state === HubConnectionState.Disconnecting;
|
||||
}
|
||||
|
||||
get reconnecting() {
|
||||
return this._hubConnection.state === HubConnectionState.Reconnecting;
|
||||
}
|
||||
|
||||
constructor(options: SignalRHubOptions) {
|
||||
let builder = new HubConnectionBuilder();
|
||||
|
||||
builder = builder.withUrl(options.url, options.httpOptions);
|
||||
|
||||
if (options?.automaticReconnect) {
|
||||
if (options.enableAutomaticReconnect) {
|
||||
builder = builder.withAutomaticReconnect(options.automaticReconnect as any);
|
||||
}
|
||||
}
|
||||
|
||||
this._hubConnection = builder.build();
|
||||
|
||||
interval(30000).subscribe(() => {
|
||||
this.checkConnection();
|
||||
});
|
||||
}
|
||||
|
||||
async connect(): Promise<void> {
|
||||
if (this.connected || this.connecting || this.reconnecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this._hubConnection.start().catch((err) => console.error('SignalrHub.connect()', err));
|
||||
}
|
||||
|
||||
disconnect(): Promise<void> {
|
||||
return this._hubConnection.stop().catch((err) => console.error('SignalrHub.stop()', err));
|
||||
}
|
||||
|
||||
checkConnection() {
|
||||
if (this._listenerCount > 0 && this.disconnected) {
|
||||
this.connect();
|
||||
}
|
||||
}
|
||||
|
||||
protected listen<TData>(methodName: string) {
|
||||
return new Observable<TData>((observer) => {
|
||||
const handler = (data) => {
|
||||
observer.next(data);
|
||||
};
|
||||
|
||||
this._hubConnection.on(methodName, handler);
|
||||
this._listenerCount++;
|
||||
|
||||
this.connect().catch((err) => console.error('SignalrHub.listen()', err));
|
||||
|
||||
return () => {
|
||||
this._hubConnection.off(methodName, handler);
|
||||
this._listenerCount++;
|
||||
|
||||
if (this._listenerCount <= 0) {
|
||||
this.disconnect();
|
||||
}
|
||||
};
|
||||
}).pipe(shareReplay(1));
|
||||
}
|
||||
}
|
||||
6
apps/core/signalr/src/public-api.ts
Normal file
6
apps/core/signalr/src/public-api.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Public API Surface of signalr
|
||||
*/
|
||||
|
||||
export * from './lib/signalr-hub-options';
|
||||
export * from './lib/signalr.hub';
|
||||
24
apps/core/signalr/src/test.ts
Normal file
24
apps/core/signalr/src/test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/dist/zone';
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
declare const require: {
|
||||
context(
|
||||
path: string,
|
||||
deep?: boolean,
|
||||
filter?: RegExp
|
||||
): {
|
||||
keys(): string[];
|
||||
<T>(id: string): T;
|
||||
};
|
||||
};
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
||||
25
apps/core/signalr/tsconfig.lib.json
Normal file
25
apps/core/signalr/tsconfig.lib.json
Normal file
@@ -0,0 +1,25 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../out-tsc/lib",
|
||||
"target": "es2015",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"inlineSources": true,
|
||||
"types": [],
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2018"
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"enableResourceInlining": true
|
||||
},
|
||||
"exclude": [
|
||||
"src/test.ts",
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
}
|
||||
10
apps/core/signalr/tsconfig.lib.prod.json
Normal file
10
apps/core/signalr/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,10 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
17
apps/core/signalr/tsconfig.spec.json
Normal file
17
apps/core/signalr/tsconfig.spec.json
Normal file
@@ -0,0 +1,17 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/test.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
17
apps/core/signalr/tslint.json
Normal file
17
apps/core/signalr/tslint.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "../../../tslint.json",
|
||||
"rules": {
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"lib",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"lib",
|
||||
"kebab-case"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { DomainAvailabilityService } from './availability.service';
|
||||
|
||||
@NgModule({
|
||||
providers: [DomainAvailabilityService],
|
||||
})
|
||||
export class AvailabilityModule {}
|
||||
@NgModule()
|
||||
export class DomainAvailabilityModule {
|
||||
static forRoot(): ModuleWithProviders<DomainAvailabilityModule> {
|
||||
return {
|
||||
ngModule: DomainAvailabilityModule,
|
||||
providers: [DomainAvailabilityService],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,25 +3,31 @@ import { ItemDTO } from '@swagger/cat';
|
||||
import { AvailabilityDTO, BranchDTO, OLAAvailabilityDTO, StoreCheckoutService, SupplierDTO } from '@swagger/checkout';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AvailabilityService as SwaggerAvailabilityService } from '@swagger/availability';
|
||||
import { StockService } from '@swagger/cat';
|
||||
import { map, shareReplay, switchMap, withLatestFrom, mergeMap, tap } from 'rxjs/operators';
|
||||
import { isArray, isNullOrUndefined, memorize } from '@utils/common';
|
||||
import { map, shareReplay, switchMap, withLatestFrom, mergeMap } from 'rxjs/operators';
|
||||
import { isArray, memorize } from '@utils/common';
|
||||
import { OrderService } from '@swagger/oms';
|
||||
import { RemiService, StockDTO } from '@swagger/remi';
|
||||
import { ResponseArgsOfIEnumerableOfStockInfoDTO, StockDTO, StockInfoDTO, StockService } from '@swagger/remi';
|
||||
import { ItemData } from './defs/item-data.model';
|
||||
import { SsoService } from 'sso';
|
||||
import { PriceDTO } from '@swagger/availability';
|
||||
import { AvailabilityByBranchDTO } from './defs/availability-by-branch-dto.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@Injectable()
|
||||
export class DomainAvailabilityService {
|
||||
constructor(
|
||||
private swaggerAvailabilityService: SwaggerAvailabilityService,
|
||||
private stockService: StockService,
|
||||
private storeCheckoutService: StoreCheckoutService,
|
||||
private orderService: OrderService,
|
||||
private sso: SsoService,
|
||||
private remi: RemiService
|
||||
private _stock: StockService
|
||||
) {}
|
||||
|
||||
@memorize()
|
||||
getSuppliers(): Observable<SupplierDTO[]> {
|
||||
return this.storeCheckoutService.StoreCheckoutGetSuppliers({}).pipe(
|
||||
map((response) => response.result),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
@memorize()
|
||||
getTakeAwaySupplier(): Observable<SupplierDTO> {
|
||||
return this.storeCheckoutService.StoreCheckoutGetSuppliers({}).pipe(
|
||||
@@ -40,7 +46,7 @@ export class DomainAvailabilityService {
|
||||
|
||||
@memorize()
|
||||
getCurrentStock(): Observable<StockDTO> {
|
||||
return this.remi.RemiCurrentStock().pipe(
|
||||
return this._stock.StockCurrentStock().pipe(
|
||||
map((response) => response.result),
|
||||
shareReplay()
|
||||
);
|
||||
@@ -48,36 +54,107 @@ export class DomainAvailabilityService {
|
||||
|
||||
@memorize()
|
||||
getCurrentBranch(): Observable<BranchDTO> {
|
||||
return this.remi.RemiCurrentBranch().pipe(
|
||||
return this._stock.StockCurrentBranch().pipe(
|
||||
map((response) => response.result),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Stock-Aufruf aus Remi API
|
||||
@memorize({ ttl: 10000 })
|
||||
getTakeAwayAvailabilityByBranches({
|
||||
branchIds,
|
||||
itemId,
|
||||
price,
|
||||
quantity,
|
||||
}: {
|
||||
branchIds: number[];
|
||||
itemId: number;
|
||||
price: PriceDTO;
|
||||
quantity: number;
|
||||
}): Observable<AvailabilityByBranchDTO[]> {
|
||||
return this._stock.StockStockRequest({ stockRequest: { branchIds, itemId } }).pipe(
|
||||
map((response) => response.result),
|
||||
withLatestFrom(this.getTakeAwaySupplier()),
|
||||
map(([result, supplier]) => {
|
||||
const availabilities: AvailabilityByBranchDTO[] = result.map((stockInfo) => {
|
||||
return {
|
||||
availableQuantity: stockInfo.availableQuantity,
|
||||
availabilityType: quantity <= stockInfo.inStock ? 1024 : 1, // 1024 (=Available)
|
||||
inStock: stockInfo.inStock,
|
||||
supplierSSC: quantity <= stockInfo.inStock ? '999' : '',
|
||||
supplierSSCText: quantity <= stockInfo.inStock ? 'Filialentnahme' : '',
|
||||
price,
|
||||
supplier: { id: supplier?.id },
|
||||
branchId: stockInfo.branchId,
|
||||
};
|
||||
});
|
||||
return availabilities;
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
getTakeAwayAvailability({ item, quantity }: { item: ItemData; quantity: number }): Observable<AvailabilityDTO> {
|
||||
return this.getCurrentStock().pipe(
|
||||
switchMap((s) => this.remi.RemiInStock({ articleIds: [item.itemId], stockId: s.id })),
|
||||
switchMap((s) => this._stock.StockInStock({ articleIds: [item.itemId], stockId: s.id })),
|
||||
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
|
||||
map(([response, supplier, branch]) => {
|
||||
const stockInfo = response.result.find((si) => si.branchId === branch.id);
|
||||
const inStock = stockInfo?.inStock ?? 0;
|
||||
const availability: AvailabilityDTO = {
|
||||
availabilityType: quantity <= inStock ? 1024 : 1, // 1024 (=Available)
|
||||
inStock: inStock,
|
||||
ssc: quantity <= inStock ? '999' : '',
|
||||
sscText: quantity <= inStock ? 'Filialentnahme' : '',
|
||||
price: item?.price,
|
||||
supplier: { id: supplier?.id },
|
||||
};
|
||||
|
||||
return availability;
|
||||
const price = item?.price;
|
||||
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
@memorize({ ttl: 10000 })
|
||||
getTakeAwayAvailabilityByBranch({
|
||||
branch,
|
||||
itemId,
|
||||
price,
|
||||
quantity,
|
||||
}: {
|
||||
branch: BranchDTO;
|
||||
itemId: number;
|
||||
price: PriceDTO;
|
||||
quantity: number;
|
||||
}): Observable<AvailabilityDTO> {
|
||||
return this._stock.StockStockRequest({ stockRequest: { branchIds: [branch.id], itemId } }).pipe(
|
||||
withLatestFrom(this.getTakeAwaySupplier()),
|
||||
map(([response, supplier]) => {
|
||||
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
getTakeAwayAvailabilityByEan({
|
||||
eans,
|
||||
price,
|
||||
quantity,
|
||||
}: {
|
||||
eans: string[];
|
||||
price: PriceDTO;
|
||||
quantity: number;
|
||||
}): Observable<AvailabilityDTO> {
|
||||
return this.getCurrentStock().pipe(
|
||||
switchMap((s) => this._stock.StockInStockByEAN({ eans, stockId: s.id })),
|
||||
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
|
||||
map(([response, supplier, branch]) => {
|
||||
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
getTakeAwayAvailabilitiesByEans({ eans }: { eans: string[] }): Observable<StockInfoDTO[]> {
|
||||
const eansFiltered = Array.from(new Set(eans));
|
||||
return this.getCurrentStock().pipe(
|
||||
switchMap((s) => this._stock.StockInStockByEAN({ eans: eansFiltered, stockId: s.id })),
|
||||
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
|
||||
map((response) => response[0].result),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
@memorize({ ttl: 10000 })
|
||||
getPickUpAvailability({ item, branch, quantity }: { item: ItemData; quantity: number; branch: BranchDTO }): Observable<AvailabilityDTO> {
|
||||
return this.swaggerAvailabilityService
|
||||
@@ -85,7 +162,7 @@ export class DomainAvailabilityService {
|
||||
{
|
||||
qty: quantity,
|
||||
ean: item?.ean,
|
||||
itemId: String(item?.itemId),
|
||||
itemId: item?.itemId ? String(item?.itemId) : null,
|
||||
shopId: branch?.id,
|
||||
price: item?.price,
|
||||
},
|
||||
@@ -122,7 +199,7 @@ export class DomainAvailabilityService {
|
||||
.AvailabilityShippingAvailability([
|
||||
{
|
||||
ean: item?.ean,
|
||||
itemId: String(item?.itemId),
|
||||
itemId: item?.itemId ? String(item?.itemId) : null,
|
||||
price: item?.price,
|
||||
qty: quantity,
|
||||
},
|
||||
@@ -154,7 +231,7 @@ export class DomainAvailabilityService {
|
||||
{
|
||||
qty: quantity,
|
||||
ean: item?.ean,
|
||||
itemId: String(item?.itemId),
|
||||
itemId: item?.itemId ? String(item?.itemId) : null,
|
||||
price: item?.price,
|
||||
},
|
||||
])
|
||||
@@ -204,7 +281,7 @@ export class DomainAvailabilityService {
|
||||
.AvailabilityShippingAvailability([
|
||||
{
|
||||
ean: item?.ean,
|
||||
itemId: String(item?.itemId),
|
||||
itemId: item?.itemId ? String(item?.itemId) : null,
|
||||
price: item?.price,
|
||||
qty: 1,
|
||||
},
|
||||
@@ -231,6 +308,21 @@ export class DomainAvailabilityService {
|
||||
);
|
||||
}
|
||||
|
||||
@memorize({ ttl: 10000 })
|
||||
getStoreAvailabilities({ item, branch, quantity }: { item: ItemData; quantity: number; branch: BranchDTO }) {
|
||||
return this.swaggerAvailabilityService
|
||||
.AvailabilityStoreAvailability([
|
||||
{
|
||||
qty: quantity,
|
||||
ean: item?.ean,
|
||||
itemId: item?.itemId ? String(item?.itemId) : null,
|
||||
shopId: branch?.id,
|
||||
price: item?.price,
|
||||
},
|
||||
])
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
isAvailable({ availability }: { availability: AvailabilityDTO }) {
|
||||
return [2, 32, 256, 1024, 2048, 4096].some((code) => availability?.availabilityType === code);
|
||||
}
|
||||
@@ -260,4 +352,30 @@ export class DomainAvailabilityService {
|
||||
supplierProductNumber: availability?.supplierProductNumber,
|
||||
};
|
||||
}
|
||||
|
||||
private _mapToTakeAwayAvailability({
|
||||
response,
|
||||
supplier,
|
||||
branch,
|
||||
quantity,
|
||||
price,
|
||||
}: {
|
||||
response: ResponseArgsOfIEnumerableOfStockInfoDTO;
|
||||
supplier: SupplierDTO;
|
||||
branch: BranchDTO;
|
||||
quantity: number;
|
||||
price: PriceDTO;
|
||||
}): AvailabilityDTO {
|
||||
const stockInfo = response.result.find((si) => si.branchId === branch.id);
|
||||
const inStock = stockInfo?.inStock ?? 0;
|
||||
const availability: AvailabilityDTO = {
|
||||
availabilityType: quantity <= inStock ? 1024 : 1, // 1024 (=Available)
|
||||
inStock: inStock,
|
||||
supplierSSC: quantity <= inStock ? '999' : '',
|
||||
supplierSSCText: quantity <= inStock ? 'Filialentnahme' : '',
|
||||
price,
|
||||
supplier: { id: supplier?.id },
|
||||
};
|
||||
return availability;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { AvailabilityDTO } from '@swagger/checkout';
|
||||
|
||||
export interface AvailabilityByBranchDTO extends AvailabilityDTO {
|
||||
availableQuantity?: number;
|
||||
stockId?: number;
|
||||
branchId: number;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { AutocompleteTokenDTO, PromotionService, QueryTokenDTO, SearchService, StockService } from '@swagger/cat';
|
||||
import { AutocompleteTokenDTO, PromotionService, QueryTokenDTO, SearchService } from '@swagger/cat';
|
||||
import { memorize } from '@utils/common';
|
||||
import { map, shareReplay } from 'rxjs/operators';
|
||||
|
||||
@@ -9,8 +9,7 @@ export class DomainCatalogService {
|
||||
constructor(
|
||||
private searchService: SearchService,
|
||||
private promotionService: PromotionService,
|
||||
private applicationService: ApplicationService,
|
||||
private stockService: StockService
|
||||
private applicationService: ApplicationService
|
||||
) {}
|
||||
|
||||
@memorize()
|
||||
@@ -110,11 +109,4 @@ export class DomainCatalogService {
|
||||
sessionId: this.applicationService.activatedProcessId + '',
|
||||
});
|
||||
}
|
||||
|
||||
getInStock({ branchIds, itemIds }: { branchIds: number[]; itemIds: number[] }) {
|
||||
return this.stockService.StockInStock({
|
||||
branchIds,
|
||||
itemIds,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { DomainCheckoutService } from './checkout.service';
|
||||
import { domainCheckoutReducer } from './store/domain-checkout.reducer';
|
||||
@@ -9,4 +9,16 @@ import { storeFeatureName } from './store/domain-checkout.state';
|
||||
imports: [StoreModule.forFeature(storeFeatureName, domainCheckoutReducer)],
|
||||
providers: [DomainCheckoutService],
|
||||
})
|
||||
export class DomainCheckoutModule {}
|
||||
export class DomainCheckoutModule {
|
||||
static forRoot(): ModuleWithProviders<DomainCheckoutModule> {
|
||||
return {
|
||||
ngModule: RootDomainCheckoutModule,
|
||||
providers: [DomainCheckoutService],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [StoreModule.forFeature(storeFeatureName, domainCheckoutReducer)],
|
||||
})
|
||||
export class RootDomainCheckoutModule {}
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
UpdateShoppingCartItemDTO,
|
||||
InputDTO,
|
||||
} from '@swagger/checkout';
|
||||
import { DisplayOrderDTO, OrderCheckoutService } from '@swagger/oms';
|
||||
import { DisplayOrderDTO, OrderCheckoutService, ReorderValues } from '@swagger/oms';
|
||||
import { isNullOrUndefined, memorize } from '@utils/common';
|
||||
import { combineLatest, Observable, of, concat, isObservable, throwError } from 'rxjs';
|
||||
import { bufferCount, catchError, filter, first, map, mergeMap, shareReplay, tap, withLatestFrom } from 'rxjs/operators';
|
||||
@@ -477,9 +477,16 @@ export class DomainCheckoutService {
|
||||
mergeMap((notificationChannels) => this._setNotificationChannels({ processId, notificationChannels }))
|
||||
);
|
||||
|
||||
const setPayer$ = customerTypes$.pipe(
|
||||
mergeMap(({ isOnline, isB2B }) => {
|
||||
if (isOnline || isB2B) {
|
||||
const setPayer$ = combineLatest([itemOrderOptions$, customerTypes$]).pipe(
|
||||
first(),
|
||||
mergeMap(([itemOrderOptions, customerTypes]) => {
|
||||
if (
|
||||
customerTypes.isB2B ||
|
||||
itemOrderOptions.hasB2BDelivery ||
|
||||
itemOrderOptions.hasDelivery ||
|
||||
itemOrderOptions.hasDigDelivery ||
|
||||
itemOrderOptions.hasDownload
|
||||
) {
|
||||
return this.getPayer({ processId }).pipe(first());
|
||||
}
|
||||
return of(undefined);
|
||||
@@ -705,6 +712,12 @@ export class DomainCheckoutService {
|
||||
);
|
||||
}
|
||||
|
||||
reorder(orderId: number, orderItemId: number, orderItemSubsetId: number, data: ReorderValues) {
|
||||
return this.orderCheckoutService
|
||||
.OrderCheckoutReorder({ orderId, orderItemId, orderItemSubsetId, data })
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
setCustomerFeatures({ processId, customerFeatures }: { processId: number; customerFeatures: { [key: string]: string } }) {
|
||||
this.store.dispatch(DomainCheckoutActions.setCustomerFeatures({ processId, customerFeatures }));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class AcceptedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'ACCEPTED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 4 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ArrivedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'ARRIVED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 128,
|
||||
compartmentInfo: context.compartmentInfo,
|
||||
compartmentNumber: context.compartmentCode,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId) || orderItem.quantity,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class AssembledActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'ASSEMBLED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 67108864,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class AvailableForDownloadActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'AVAILABLEFORDOWNLOAD');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 32768,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class BackToStockActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'BACKTOSTOCK');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 262144,
|
||||
shippingDelayComment: context?.shippingDelayComment,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class CanceledByBuyerActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'CANCELEDBYBUYER');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 512,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class CanceledByRetailerActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'CANCELEDBYRETAILER');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 1024,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class CanceledBySupplierActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'CANCELEDBYSUPPLIER');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 2048,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import { ActionHandler } from '@core/command';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
export abstract class ChangeOrderItemStatusBaseActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(protected domainOmsService: DomainOmsService, protected actionName: string) {
|
||||
super(actionName);
|
||||
}
|
||||
|
||||
async handler(context: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
const updatedItems: OrderItemListItemDTO[] = [];
|
||||
for (const item of context.items) {
|
||||
const response = await this.domainOmsService
|
||||
.changeOrderItemStatus({
|
||||
orderId: item.orderId,
|
||||
orderItemId: item.orderItemId,
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
data: this.getStatusValues(item, context),
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
const resItem = response.result.item1;
|
||||
|
||||
context = { ...context, compartmentCode: resItem.compartmentCode };
|
||||
updatedItems.push({
|
||||
...item,
|
||||
compartmentCode: resItem.compartmentCode,
|
||||
compartmentInfo: resItem.compartmentInfo,
|
||||
estimatedShippingDate: resItem.estimatedShippingDate,
|
||||
isPrebooked: resItem.isPrebooked,
|
||||
processingStatus: resItem.processingStatus,
|
||||
processingStatusDate: resItem.processingStatusDate,
|
||||
quantity: resItem.quantity,
|
||||
specialComment: resItem.specialComment,
|
||||
ssc: resItem.ssc,
|
||||
sscText: resItem.sscText,
|
||||
});
|
||||
}
|
||||
|
||||
return { ...context, items: updatedItems };
|
||||
}
|
||||
|
||||
abstract getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionHandler } from '@core/command';
|
||||
import { DomainReceiptService } from '../receipt.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class CreateShippingNoteActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(private domainReceiptService: DomainReceiptService) {
|
||||
super('CREATE_SHIPPINGNOTE');
|
||||
}
|
||||
|
||||
async handler(data: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
const orderItemStatusIds = data.items.map((item) => item.orderItemSubsetId);
|
||||
|
||||
const response = await this.domainReceiptService
|
||||
.createShippingNotes({
|
||||
orderItemStatusIds,
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
return {
|
||||
...data,
|
||||
receipts: response.result,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class DeliveredActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'DELIVERED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 4194304,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class DetermineSupplierActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'DETERMINESUPPLIER');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 8388608,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class DispatchedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'DISPATCHED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 64,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class DownloadedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'DOWNLOADED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 65536,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class FetchedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'FETCHED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 256,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId) || orderItem.quantity,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class InProcessActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'INPROCESS');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 16,
|
||||
};
|
||||
}
|
||||
}
|
||||
37
apps/domain/oms/src/lib/action-handlers/index.ts
Normal file
37
apps/domain/oms/src/lib/action-handlers/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// start:ng42.barrel
|
||||
export * from './accepted.action-handler';
|
||||
export * from './arrived.action-handler';
|
||||
export * from './assembled.action-handler';
|
||||
export * from './available-for-download.action-handler';
|
||||
export * from './back-to-stock.action-handler';
|
||||
export * from './canceled-by-buyer.action-handler';
|
||||
export * from './canceled-by-retailer.action-handler';
|
||||
export * from './canceled-by-supplier.action-handler';
|
||||
export * from './create-shipping-note.action-handler';
|
||||
export * from './delivered.action-handler';
|
||||
export * from './determine-supplier.action-handler';
|
||||
export * from './dispatched.action-handler';
|
||||
export * from './downloaded.action-handler';
|
||||
export * from './fetched.action-handler';
|
||||
export * from './in-process.action-handler';
|
||||
export * from './not-available.action-handler';
|
||||
export * from './not-fetched.action-handler';
|
||||
export * from './order-at-supplier.action-handler';
|
||||
export * from './order-items.context';
|
||||
export * from './ordering.action-handler';
|
||||
export * from './overdue.action-handler';
|
||||
export * from './packed.action-handler';
|
||||
export * from './parked.action-handler';
|
||||
export * from './placed.action-handler';
|
||||
export * from './preperation-for-shipping.action-handler';
|
||||
export * from './print-compartment-label.action-handler';
|
||||
export * from './print-shipping-note.action-handler';
|
||||
export * from './re-ordered.action-handler';
|
||||
export * from './re-order.action-handler';
|
||||
export * from './redirected-internally.action-handler';
|
||||
export * from './requested.action-handler';
|
||||
export * from './reserved.action-handler';
|
||||
export * from './returned-by-buyer.action-handler';
|
||||
export * from './shipping-note.action-handler';
|
||||
export * from './supplier-temporarily-out-of-stock.action-handler copy';
|
||||
// end:ng42.barrel
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class NotAvailableActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'NOTAVAILABLE');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 4096,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId) || orderItem.quantity,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class NotFetchedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'NOTFETCHED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 131072,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionHandler, CommandService } from '@core/command';
|
||||
import { ReorderModalComponent, ReorderResult } from '@modal/reorder';
|
||||
import { AvailabilityDTO2, OrderItemListItemDTO } from '@swagger/oms';
|
||||
import { UiModalService } from '@ui/modal';
|
||||
import { isResponseArgs } from '@utils/object';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class OrderAtSupplierActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(private _command: CommandService, private _domainOmsService: DomainOmsService, private _uiModal: UiModalService) {
|
||||
super('ORDER_AT_SUPPLIER');
|
||||
}
|
||||
|
||||
async handler(data: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
const updatedItems: OrderItemListItemDTO[] = [];
|
||||
for (const orderItem of data.items) {
|
||||
const result = await this._uiModal
|
||||
.open<ReorderResult, OrderItemListItemDTO>({
|
||||
content: ReorderModalComponent,
|
||||
title: 'Artikel bestellen',
|
||||
data: orderItem,
|
||||
})
|
||||
.afterClosed$.toPromise();
|
||||
|
||||
try {
|
||||
if (result.data) {
|
||||
if (result.data.action === 'REORDER') {
|
||||
await this.patchOrderItemSubset(result.data.item, result.data.availability);
|
||||
await this.orderAtSupplier(result.data.item);
|
||||
updatedItems.push({ ...orderItem, processingStatus: 16 });
|
||||
} else if (result.data.action === 'NOTAVAILABLE') {
|
||||
let context = { ...data, items: [orderItem] };
|
||||
context = await this._command.handleCommand('NOTAVAILABLE', context);
|
||||
updatedItems.push(...context.items);
|
||||
}
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
} catch (err) {
|
||||
if (err instanceof HttpErrorResponse && isResponseArgs(err.error)) {
|
||||
console.error('InvalidProperties: ', err.error.invalidProperties);
|
||||
console.error('Message: ', err.message);
|
||||
} else {
|
||||
console.error('Message: ', err.message);
|
||||
}
|
||||
console.error('OrderAtSupplierActionHandler._domainOmsService.orderAtSupplier', err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return { ...data, items: updatedItems };
|
||||
}
|
||||
|
||||
async patchOrderItemSubset(orderItem: OrderItemListItemDTO, availability: AvailabilityDTO2) {
|
||||
return await this._domainOmsService
|
||||
.patchOrderItemSubset({
|
||||
orderId: orderItem.orderId,
|
||||
orderItemId: orderItem.orderItemId,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
orderItemSubset: {
|
||||
ssc: availability.ssc,
|
||||
sscText: availability.sscText,
|
||||
supplier: {
|
||||
id: availability.supplierId,
|
||||
},
|
||||
isPrebooked: availability.isPrebooked,
|
||||
estimatedShippingDate: availability.at,
|
||||
},
|
||||
})
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
}
|
||||
|
||||
async orderAtSupplier(orderItem: OrderItemListItemDTO) {
|
||||
return await this._domainOmsService
|
||||
.orderAtSupplier({
|
||||
orderId: orderItem.orderId,
|
||||
orderItemId: orderItem.orderItemId,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
})
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { OrderItemListItemDTO, ReceiptDTO } from '@swagger/oms';
|
||||
|
||||
export interface OrderItemsContext {
|
||||
items: OrderItemListItemDTO[];
|
||||
compartmentInfo?: string;
|
||||
compartmentCode?: string;
|
||||
/**
|
||||
* Mapping zwischen OrderItemId und der Menge
|
||||
*/
|
||||
itemQuantity?: Map<number, number>;
|
||||
|
||||
receipts?: ReceiptDTO[];
|
||||
|
||||
shippingDelayComment?: string;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class OrderingActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'ORDERING');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 1,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class OverdueActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'OVERDUE');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 2097152,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class PackedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'PACKED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 134217728,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ParkedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'PARKED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 8 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class PlacedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'PLACED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 2 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class PreparationForShippingActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'PREPERATIONFORSHIPPING');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 32 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionHandler } from '@core/command';
|
||||
import { DomainPrinterService } from '@domain/printer';
|
||||
import { PrintModalComponent, PrintModalData } from '@modal/printer';
|
||||
import { UiModalService } from '@ui/modal';
|
||||
import { NativeContainerService } from 'native-container';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class PrintCompartmentLabelActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(
|
||||
private uiModal: UiModalService,
|
||||
private domainPrinterService: DomainPrinterService,
|
||||
private nativeContainerService: NativeContainerService
|
||||
) {
|
||||
super('PRINT_COMPARTMENTLABEL');
|
||||
}
|
||||
|
||||
async handler(data: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
await this.uiModal
|
||||
.open({
|
||||
content: PrintModalComponent,
|
||||
data: {
|
||||
printImmediately: !this.nativeContainerService.isUiWebview().isNative,
|
||||
printerType: 'Label',
|
||||
print: (printer) =>
|
||||
this.domainPrinterService
|
||||
.printCompartmentLabel({ printer, orderItemSubsetIds: data.items.map((item) => item.orderItemSubsetId) })
|
||||
.toPromise(),
|
||||
} as PrintModalData,
|
||||
})
|
||||
.afterClosed$.toPromise();
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionHandler } from '@core/command';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
import { DomainPrinterService, Printer } from '@domain/printer';
|
||||
import { UiModalService } from '@ui/modal';
|
||||
import { PrintModalComponent, PrintModalData } from '@modal/printer';
|
||||
import { groupBy } from '@ui/common';
|
||||
import { NativeContainerService } from 'native-container';
|
||||
|
||||
@Injectable()
|
||||
export class PrintShippingNoteActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(
|
||||
private uiModal: UiModalService,
|
||||
private domainPrinterService: DomainPrinterService,
|
||||
private nativeContainerService: NativeContainerService
|
||||
) {
|
||||
super('PRINT_SHIPPINGNOTE');
|
||||
}
|
||||
|
||||
async handler(data: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
await this.uiModal
|
||||
.open({
|
||||
content: PrintModalComponent,
|
||||
data: {
|
||||
printImmediately: !this.nativeContainerService.isUiWebview().isNative,
|
||||
printerType: 'Label',
|
||||
print: async (printer) => {
|
||||
try {
|
||||
for (const group of groupBy(data?.receipts, (receipt) => receipt?.buyer?.buyerNumber)) {
|
||||
await this.domainPrinterService.printShippingNote({ printer, receipts: group?.items?.map((r) => r?.id) }).toPromise();
|
||||
}
|
||||
return {
|
||||
error: false,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return {
|
||||
error: true,
|
||||
message: error?.message || error,
|
||||
};
|
||||
}
|
||||
},
|
||||
} as PrintModalData,
|
||||
})
|
||||
.afterClosed$.toPromise();
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionHandler, CommandService } from '@core/command';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
import { UiModalService } from '@ui/modal';
|
||||
import { ReorderModalComponent, ReorderResult } from '@modal/reorder';
|
||||
import { DomainCheckoutService } from '@domain/checkout';
|
||||
import { AvailabilityDTO2, OrderItemListItemDTO } from '@swagger/oms';
|
||||
|
||||
@Injectable()
|
||||
export class ReOrderActionHandler extends ActionHandler<OrderItemsContext> {
|
||||
constructor(private _command: CommandService, private _domainCheckoutService: DomainCheckoutService, private _uiModal: UiModalService) {
|
||||
super('REORDER');
|
||||
}
|
||||
|
||||
async handler(data: OrderItemsContext): Promise<OrderItemsContext> {
|
||||
const updatedItems: OrderItemListItemDTO[] = [];
|
||||
for (const orderItem of data.items) {
|
||||
const result = await this._uiModal
|
||||
.open<ReorderResult, OrderItemListItemDTO>({
|
||||
content: ReorderModalComponent,
|
||||
title: 'Artikel nachbestellen',
|
||||
data: orderItem,
|
||||
})
|
||||
.afterClosed$.toPromise();
|
||||
if (result.data) {
|
||||
if (result.data.action === 'REORDER') {
|
||||
const reorderResult = await this.reorder(result.data.item, result.data.availability);
|
||||
const resItem = reorderResult.item1;
|
||||
|
||||
updatedItems.push({
|
||||
...result.data.item,
|
||||
orderItemSubsetId: resItem.id,
|
||||
compartmentCode: resItem.compartmentCode,
|
||||
compartmentInfo: resItem.compartmentInfo,
|
||||
estimatedShippingDate: resItem.estimatedShippingDate,
|
||||
isPrebooked: resItem.isPrebooked,
|
||||
processingStatus: 8192,
|
||||
processingStatusDate: resItem.processingStatusDate,
|
||||
quantity: resItem.quantity,
|
||||
specialComment: resItem.specialComment,
|
||||
ssc: resItem.ssc,
|
||||
sscText: resItem.sscText,
|
||||
});
|
||||
} else if (result.data.action === 'NOTAVAILABLE') {
|
||||
let context = { ...data, items: [orderItem] };
|
||||
context = await this._command.handleCommand('NOTAVAILABLE', context);
|
||||
updatedItems.push(...context.items);
|
||||
}
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
return { ...data, items: updatedItems };
|
||||
}
|
||||
|
||||
async reorder(orderItem: OrderItemListItemDTO, availability: AvailabilityDTO2) {
|
||||
return await this._domainCheckoutService
|
||||
.reorder(orderItem.orderId, orderItem.orderItemId, orderItem.orderItemSubsetId, {
|
||||
quantity: orderItem.quantity,
|
||||
availability: {
|
||||
availabilityType: availability.status,
|
||||
ssc: availability.ssc,
|
||||
sscText: availability.sscText,
|
||||
supplier: {
|
||||
id: availability.supplierId,
|
||||
},
|
||||
isPrebooked: availability.isPrebooked,
|
||||
estimatedShippingDate: availability.at,
|
||||
price: availability.price,
|
||||
inStock: availability.qty,
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ReOrderedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'REORDERED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 8192,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId) || orderItem.quantity,
|
||||
compartmentNumber: '',
|
||||
compartmentInfo: '',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class RedirectedInternaqllyActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'REDIRECTEDINTERNALLY');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 1048576 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class RequestedActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'REQUESTED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 524288 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ReserverdActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'RESERVED');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 33554432 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ReturnedByBuyerActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'RETURNEDBYBUYER');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return { processingStatus: 16384 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class ShippingNoteActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'SHIPPINGNOTE');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 268435456,
|
||||
quantity: context.itemQuantity?.get(orderItem.orderItemSubsetId) || orderItem.quantity,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomainOmsService } from '../oms.service';
|
||||
import { OrderItemListItemDTO, StatusValues } from '@swagger/oms';
|
||||
import { ChangeOrderItemStatusBaseActionHandler } from './change-order-item-status-base.action-handler';
|
||||
import { OrderItemsContext } from './order-items.context';
|
||||
|
||||
@Injectable()
|
||||
export class SupplierTemporarilyOutOfStockActionHandler extends ChangeOrderItemStatusBaseActionHandler {
|
||||
constructor(domainOmsService: DomainOmsService) {
|
||||
super(domainOmsService, 'SUPPLIERTEMPORARILYOUTOFSTOCK');
|
||||
}
|
||||
|
||||
getStatusValues(orderItem: OrderItemListItemDTO, context: OrderItemsContext): StatusValues {
|
||||
return {
|
||||
processingStatus: 16777216,
|
||||
};
|
||||
}
|
||||
}
|
||||
72
apps/domain/oms/src/lib/goods.service.spec.ts
Normal file
72
apps/domain/oms/src/lib/goods.service.spec.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import { createServiceFactory, SpectatorService } from '@ngneat/spectator';
|
||||
import { AbholfachService, AutocompleteTokenDTO, QueryTokenDTO } from '@swagger/oms';
|
||||
import { DateAdapter } from '@ui/common';
|
||||
import { cold, hot } from 'jasmine-marbles';
|
||||
import { DomainGoodsService } from './goods.service';
|
||||
|
||||
describe('DomainGoodsInServie', () => {
|
||||
let spectator: SpectatorService<DomainGoodsService>;
|
||||
const createService = createServiceFactory({
|
||||
service: DomainGoodsService,
|
||||
providers: [DateAdapter],
|
||||
mocks: [AbholfachService],
|
||||
});
|
||||
|
||||
let abholfachServiceMock: jasmine.SpyObj<AbholfachService>;
|
||||
let dateAdapter: DateAdapter;
|
||||
|
||||
beforeEach(() => {
|
||||
spectator = createService();
|
||||
abholfachServiceMock = spectator.inject(AbholfachService);
|
||||
dateAdapter = spectator.inject(DateAdapter);
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(spectator.service).toBeDefined();
|
||||
});
|
||||
|
||||
describe('search', () => {
|
||||
it('should call AbholfachService.AbholfachWareneingang', () => {
|
||||
const queryTokenDto: QueryTokenDTO = {};
|
||||
abholfachServiceMock.AbholfachWareneingang.and.returnValue(hot('-a|', { a: {} }));
|
||||
expect(spectator.service.search(queryTokenDto)).toBeObservable(cold('-a|', { a: {} }));
|
||||
expect(abholfachServiceMock.AbholfachWareneingang).toHaveBeenCalledWith(queryTokenDto);
|
||||
});
|
||||
});
|
||||
|
||||
describe('complete', () => {
|
||||
it('should call AbholfachService.AbholfachWareneingangAutocomplete', () => {
|
||||
const autocompleteToken: AutocompleteTokenDTO = {};
|
||||
abholfachServiceMock.AbholfachWareneingangAutocomplete.and.returnValue(hot('-a|', { a: {} }));
|
||||
expect(spectator.service.complete(autocompleteToken)).toBeObservable(cold('-a|', { a: {} }));
|
||||
expect(abholfachServiceMock.AbholfachWareneingangAutocomplete).toHaveBeenCalledWith(autocompleteToken);
|
||||
});
|
||||
});
|
||||
|
||||
describe('list', () => {
|
||||
it('should call search with queryToken', () => {
|
||||
const queryToken: QueryTokenDTO = {
|
||||
filter: {
|
||||
orderitemprocessingstatus: '16;8192;1024;512;2048',
|
||||
estimatedshippingdate: '"2021-06-01T22:00:00.000Z"-"2021-06-07T22:00:00.000Z"',
|
||||
},
|
||||
orderBy: [{ by: 'estimatedshippingdate' }],
|
||||
skip: 0,
|
||||
take: 20,
|
||||
};
|
||||
|
||||
spyOn(dateAdapter, 'today').and.returnValue(new Date(2021, 5, 7));
|
||||
spyOn(spectator.service, 'search').and.returnValue(hot('-a|', { a: {} }));
|
||||
expect(spectator.service.list()).toBeObservable(cold('-a|', { a: {} }));
|
||||
expect(spectator.service.search).toHaveBeenCalledWith(queryToken);
|
||||
});
|
||||
});
|
||||
|
||||
describe('querySettings', () => {
|
||||
it('should call AbholfachService.AbholfachWareneingangQuerySettings', () => {
|
||||
abholfachServiceMock.AbholfachWareneingangQuerySettings.and.returnValue(hot('-a|', { a: {} }));
|
||||
expect(spectator.service.goodsInQuerySettings()).toBeObservable(cold('-a|', { a: {} }));
|
||||
expect(abholfachServiceMock.AbholfachWareneingangQuerySettings).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
73
apps/domain/oms/src/lib/goods.service.ts
Normal file
73
apps/domain/oms/src/lib/goods.service.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AbholfachService, AutocompleteTokenDTO, QueryTokenDTO } from '@swagger/oms';
|
||||
import { DateAdapter } from '@ui/common';
|
||||
import { memorize } from '@utils/common';
|
||||
import { shareReplay } from 'rxjs/operators';
|
||||
@Injectable()
|
||||
export class DomainGoodsService {
|
||||
constructor(private abholfachService: AbholfachService, private dateAdapter: DateAdapter) {}
|
||||
|
||||
search(queryToken: QueryTokenDTO) {
|
||||
return this.abholfachService.AbholfachWareneingang(queryToken);
|
||||
}
|
||||
|
||||
complete(autocompleteToken: AutocompleteTokenDTO) {
|
||||
return this.abholfachService.AbholfachWareneingangAutocomplete(autocompleteToken);
|
||||
}
|
||||
|
||||
getItemByOrderNumber(orderNumber: string) {
|
||||
return this.abholfachService.AbholfachWareneingang({
|
||||
filter: { all_branches: 'true' },
|
||||
input: {
|
||||
qs: orderNumber,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getItemByCompartment(compartmentCode: string) {
|
||||
return this.abholfachService.AbholfachWareneingang({
|
||||
filter: { all_branches: 'true' },
|
||||
input: {
|
||||
qs: compartmentCode,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
list() {
|
||||
const base = this.dateAdapter.today();
|
||||
const startDate = this.dateAdapter.addCalendarDays(base, -5);
|
||||
const endDate = this.dateAdapter.addCalendarDays(base, 1);
|
||||
const queryToken: QueryTokenDTO = {
|
||||
filter: {
|
||||
orderitemprocessingstatus: '16;8192;1024;512;2048',
|
||||
estimatedshippingdate: `"${startDate.toJSON()}"-"${endDate.toJSON()}"`,
|
||||
},
|
||||
orderBy: [{ by: 'estimatedshippingdate' }],
|
||||
skip: 0,
|
||||
take: 20,
|
||||
};
|
||||
return this.search(queryToken);
|
||||
}
|
||||
|
||||
@memorize()
|
||||
goodsInQuerySettings() {
|
||||
return this.abholfachService.AbholfachWareneingangQuerySettings().pipe(shareReplay());
|
||||
}
|
||||
|
||||
@memorize()
|
||||
goodsOutQuerySettings() {
|
||||
return this.abholfachService.AbholfachWarenausgabeQuerySettings().pipe(shareReplay());
|
||||
}
|
||||
|
||||
goodsInList(queryToken: QueryTokenDTO) {
|
||||
return this.abholfachService.AbholfachWareneingangsliste(queryToken);
|
||||
}
|
||||
|
||||
goodsInCleanupList() {
|
||||
return this.abholfachService.AbholfachAbholfachbereinigungsliste();
|
||||
}
|
||||
|
||||
goodsInReservationList(queryToken: QueryTokenDTO) {
|
||||
return this.abholfachService.AbholfachReservierungen(queryToken);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { DomainGoodsService } from './goods.service';
|
||||
import { DomainOmsService } from './oms.service';
|
||||
import { DomainReceiptService } from './receipt.service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [],
|
||||
exports: [],
|
||||
})
|
||||
export class OmsModule {}
|
||||
@NgModule()
|
||||
export class DomainOmsModule {
|
||||
static forRoot(): ModuleWithProviders<DomainOmsModule> {
|
||||
return {
|
||||
ngModule: DomainOmsModule,
|
||||
providers: [DomainOmsService, DomainGoodsService, DomainReceiptService],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OrderDTO, OrderListItemDTO, OrderService, StatusValues, ValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO } from '@swagger/oms';
|
||||
import {
|
||||
ChangeStockStatusCodeValues,
|
||||
HistoryDTO,
|
||||
NotificationChannel,
|
||||
OrderCheckoutService,
|
||||
OrderDTO,
|
||||
OrderItemDTO,
|
||||
OrderItemSubsetDTO,
|
||||
OrderListItemDTO,
|
||||
OrderService,
|
||||
ReceiptService,
|
||||
StatusValues,
|
||||
ValueTupleOfLongAndReceiptTypeAndEntityDTOContainerOfReceiptDTO,
|
||||
ValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO,
|
||||
} from '@swagger/oms';
|
||||
import { memorize } from '@utils/common';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { map, mergeMap, shareReplay } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OmsService {
|
||||
constructor(private orderService: OrderService) {}
|
||||
@Injectable()
|
||||
export class DomainOmsService {
|
||||
constructor(
|
||||
private orderService: OrderService,
|
||||
private receiptService: ReceiptService,
|
||||
private _orderCheckoutService: OrderCheckoutService
|
||||
) {}
|
||||
|
||||
getOrderItemsByCustomerNumber(customerNumber: string, skip: number): Observable<OrderListItemDTO[]> {
|
||||
return this.orderService
|
||||
@@ -23,6 +40,72 @@ export class OmsService {
|
||||
return this.orderService.OrderGetBranches({});
|
||||
}
|
||||
|
||||
getHistory(orderItemSubsetId: number): Observable<HistoryDTO> {
|
||||
return this.orderService.OrderGetOrderItemStatusHistory({ orderItemSubsetId }).pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
getReceipts(orderItemSubsetIds: number[]): Observable<ValueTupleOfLongAndReceiptTypeAndEntityDTOContainerOfReceiptDTO[]> {
|
||||
return this.receiptService
|
||||
.ReceiptGetReceiptsByOrderItemSubset({
|
||||
payload: {
|
||||
receiptType: (65 as unknown) as any,
|
||||
ids: orderItemSubsetIds,
|
||||
eagerLoading: 1,
|
||||
},
|
||||
})
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
@memorize()
|
||||
getVATs() {
|
||||
return this.orderService.OrderGetVATs({}).pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
// ttl 4 Stunden
|
||||
@memorize({ ttl: 14400000 })
|
||||
getStockStatusCodes({ supplierId, eagerLoading = 0 }: { supplierId: number; eagerLoading?: number }) {
|
||||
return this.orderService.OrderGetStockStatusCodes({ supplierId, eagerLoading }).pipe(
|
||||
map((response) => response.result),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
patchOrderItem(payload: { orderItemId: number; orderId: number; orderItem: Partial<OrderItemDTO> }) {
|
||||
return this.orderService.OrderPatchOrderItem(payload).pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
patchOrderItemSubset(payload: {
|
||||
orderItemSubsetId: number;
|
||||
orderItemId: number;
|
||||
orderId: number;
|
||||
orderItemSubset: Partial<OrderItemSubsetDTO>;
|
||||
}) {
|
||||
return this.orderService.OrderPatchOrderItemSubset(payload).pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
patchComment({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
specialComment,
|
||||
}: {
|
||||
orderId: number;
|
||||
orderItemId: number;
|
||||
orderItemSubsetId: number;
|
||||
specialComment: string;
|
||||
}) {
|
||||
return this.orderService
|
||||
.OrderPatchOrderItemSubset({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
orderItemSubset: {
|
||||
specialComment,
|
||||
},
|
||||
})
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
changeOrderStatus(
|
||||
orderId: number,
|
||||
orderItemId: number,
|
||||
@@ -38,4 +121,102 @@ export class OmsService {
|
||||
})
|
||||
.pipe(map((o) => o.result));
|
||||
}
|
||||
|
||||
setEstimatedShippingDate(orderId: number, orderItemId: number, orderItemSubsetId: number, estimatedShippingDate: Date | string) {
|
||||
return this.orderService
|
||||
.OrderPatchOrderItemSubset({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
orderItemSubset: {
|
||||
estimatedShippingDate: estimatedShippingDate instanceof Date ? estimatedShippingDate.toJSON() : estimatedShippingDate,
|
||||
},
|
||||
})
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
setPickUpDeadline(orderId: number, orderItemId: number, orderItemSubsetId: number, pickUpDeadline: string) {
|
||||
return this.orderService
|
||||
.OrderPatchOrderItemSubset({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
orderItemSubset: {
|
||||
compartmentStop: pickUpDeadline,
|
||||
},
|
||||
})
|
||||
.pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
changeOrderItemStatus(data: OrderService.OrderChangeStatusParams) {
|
||||
return this.orderService.OrderChangeStatus(data);
|
||||
}
|
||||
|
||||
changeStockStatusCode(payload: ChangeStockStatusCodeValues[]) {
|
||||
return this.orderService.OrderChangeStockStatusCode(payload).pipe(map((response) => response.result));
|
||||
}
|
||||
|
||||
orderAtSupplier({ orderId, orderItemId, orderItemSubsetId }: { orderId: number; orderItemId: number; orderItemSubsetId: number }) {
|
||||
return this._orderCheckoutService.OrderCheckoutOrderSubsetItemAtSupplier({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
});
|
||||
}
|
||||
|
||||
getNotifications(orderId: number): Observable<{ selected: NotificationChannel; email: string; mobile: string }> {
|
||||
return this.getOrder(orderId).pipe(
|
||||
map((order) => ({
|
||||
selected: order.notificationChannels,
|
||||
email: order.buyer?.communicationDetails?.email,
|
||||
mobile: order.buyer?.communicationDetails?.mobile,
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
updateNotifications(orderId: number, changes: { selected: NotificationChannel; email: string; mobile: string }) {
|
||||
const communicationDetails = {
|
||||
email: changes.email,
|
||||
mobile: changes.mobile,
|
||||
};
|
||||
|
||||
if (!(changes.selected & 1)) {
|
||||
delete communicationDetails.email;
|
||||
}
|
||||
if (!(changes.selected & 2)) {
|
||||
delete communicationDetails.mobile;
|
||||
}
|
||||
|
||||
return this.orderService
|
||||
.OrderPatchOrder({
|
||||
orderId: orderId,
|
||||
order: {
|
||||
notificationChannels: changes.selected,
|
||||
buyer: { communicationDetails },
|
||||
},
|
||||
})
|
||||
.pipe(map((res) => res.result));
|
||||
}
|
||||
|
||||
getCompletedTasks({
|
||||
orderId,
|
||||
orderItemId,
|
||||
orderItemSubsetId,
|
||||
}: {
|
||||
orderId: number;
|
||||
orderItemId: number;
|
||||
orderItemSubsetId: number;
|
||||
}): Observable<Record<string, Date>> {
|
||||
return this.orderService
|
||||
.OrderGetOrderItemSubsetTasks({ orderId, orderItemId, orderItemSubsetId, completed: new Date(0).toISOString() })
|
||||
.pipe(
|
||||
map((res) =>
|
||||
res.result.reduce((data, result) => {
|
||||
data[result.name] = new Date(result.completed);
|
||||
|
||||
return data;
|
||||
}, {} as Record<string, Date>)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
17
apps/domain/oms/src/lib/receipt.service.ts
Normal file
17
apps/domain/oms/src/lib/receipt.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ReceiptOrderItemSubsetReferenceValues, ReceiptService } from '@swagger/oms';
|
||||
|
||||
@Injectable()
|
||||
export class DomainReceiptService {
|
||||
constructor(private receiptService: ReceiptService) {}
|
||||
|
||||
createShippingNotes(params: ReceiptService.ReceiptCreateShippingNote2Params) {
|
||||
return this.receiptService.ReceiptCreateShippingNote2(params);
|
||||
}
|
||||
|
||||
getReceipts(payload: ReceiptOrderItemSubsetReferenceValues) {
|
||||
return this.receiptService.ReceiptGetReceiptsByOrderItemSubset({
|
||||
payload: payload,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,8 @@
|
||||
* Public API Surface of oms
|
||||
*/
|
||||
|
||||
export * from './lib/goods.service';
|
||||
export * from './lib/receipt.service';
|
||||
export * from './lib/oms.service';
|
||||
export * from './lib/oms.module';
|
||||
export * from './lib/action-handlers';
|
||||
|
||||
@@ -88,6 +88,37 @@ export class DomainPrinterService {
|
||||
);
|
||||
}
|
||||
|
||||
getAvailableLabelPrinters(): Observable<Printer[] | { error: string }> {
|
||||
return this.printService.PrintLabelPrinters().pipe(
|
||||
catchError((error) => of({ error })),
|
||||
map((response: any) => {
|
||||
if (response.error && response.error.status === 503) {
|
||||
return {
|
||||
error: response.message ? response.message : 'Das Backend ist derzeit nicht erreichbar',
|
||||
};
|
||||
}
|
||||
if (response.error && response.error.name === 'TimeoutError') {
|
||||
return { error: response.message ? response.message : 'API Timeout' };
|
||||
}
|
||||
if (response.error) {
|
||||
return {
|
||||
error: response.message ? response.message : response.error.message ? response.error.message : 'Ein Fehler ist aufgetreten',
|
||||
};
|
||||
}
|
||||
|
||||
return response.result.map(
|
||||
(t) =>
|
||||
<Printer>{
|
||||
key: t.key,
|
||||
value: t.value,
|
||||
description: t.description,
|
||||
selected: t.selected,
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
printOrder({ orderIds, printer }: { orderIds: number[]; printer: string }): Observable<ResponseArgs> {
|
||||
const params = <any>{
|
||||
printer: printer,
|
||||
@@ -96,6 +127,20 @@ export class DomainPrinterService {
|
||||
return this.oMSPrintService.OMSPrintAbholscheinById(params).pipe(timeout(20000));
|
||||
}
|
||||
|
||||
printShippingNote({ receipts, printer }: { receipts: number[]; printer: string }) {
|
||||
return this.oMSPrintService.OMSPrintLieferschein({
|
||||
printer,
|
||||
data: receipts,
|
||||
});
|
||||
}
|
||||
|
||||
printCompartmentLabel({ orderItemSubsetIds, printer }: { orderItemSubsetIds: number[]; printer: string }) {
|
||||
return this.oMSPrintService.OMSPrintAbholfachetikett({
|
||||
printer,
|
||||
data: orderItemSubsetIds,
|
||||
});
|
||||
}
|
||||
|
||||
printProduct({ item, printer }: { item: ItemDTO; printer: string }): Observable<ResponseArgs> {
|
||||
const params = <PrintRequestOfIEnumerableOfItemDTO>{
|
||||
printer: printer,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export type ProcessingStatusType = 'Approved' | 'InProcess' | 'Completed' | 'Overdue' | 'Archived' | 'Uncompleted';
|
||||
export type ProcessingStatusType = 'Approved' | 'InProcess' | 'Completed' | 'Overdue' | 'Archived' | 'Uncompleted' | 'Removed';
|
||||
|
||||
export type ProcessingStatusList = ProcessingStatusType[];
|
||||
|
||||
@@ -144,6 +144,7 @@ export class DomainTaskCalendarService {
|
||||
* 4 = Completed
|
||||
* 8 = Overdue
|
||||
* 16 = Archived
|
||||
* 32 = Removed
|
||||
* 64 = Uncompleted
|
||||
*/
|
||||
const processingStatusList: ProcessingStatusList = [];
|
||||
@@ -168,6 +169,10 @@ export class DomainTaskCalendarService {
|
||||
processingStatusList.push('Archived');
|
||||
}
|
||||
|
||||
if (!!(processingStatus & 32)) {
|
||||
processingStatusList.push('Removed');
|
||||
}
|
||||
|
||||
if (!!(processingStatus & 64)) {
|
||||
processingStatusList.push('Uncompleted');
|
||||
}
|
||||
|
||||
25
apps/hub/notifications/README.md
Normal file
25
apps/hub/notifications/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Notifications
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.2.4.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project notifications` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project notifications`.
|
||||
|
||||
> Note: Don't forget to add `--project notifications` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build notifications` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Publishing
|
||||
|
||||
After building your library with `ng build notifications`, go to the dist folder `cd dist/notifications` and run `npm publish`.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test notifications` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
||||
32
apps/hub/notifications/karma.conf.js
Normal file
32
apps/hub/notifications/karma.conf.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma'),
|
||||
],
|
||||
client: {
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../../../coverage/hub/notifications'),
|
||||
reports: ['html', 'lcovonly', 'text-summary'],
|
||||
fixWebpackSourcePaths: true,
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false,
|
||||
restartOnFileChange: true,
|
||||
});
|
||||
};
|
||||
7
apps/hub/notifications/ng-package.json
Normal file
7
apps/hub/notifications/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/hub/notifications",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
11
apps/hub/notifications/package.json
Normal file
11
apps/hub/notifications/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@hub/notifications",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^10.2.4",
|
||||
"@angular/core": "^10.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
}
|
||||
15
apps/hub/notifications/src/lib/defs/envelope.dto.ts
Normal file
15
apps/hub/notifications/src/lib/defs/envelope.dto.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { TargetDTO } from './target.dto';
|
||||
|
||||
export interface EnvelopeDTO<T> {
|
||||
uId?: string;
|
||||
|
||||
timestamp?: string;
|
||||
|
||||
sequence?: number;
|
||||
|
||||
target?: TargetDTO;
|
||||
|
||||
action?: string;
|
||||
|
||||
data?: T;
|
||||
}
|
||||
5
apps/hub/notifications/src/lib/defs/index.ts
Normal file
5
apps/hub/notifications/src/lib/defs/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// start:ng42.barrel
|
||||
export * from './envelope.dto';
|
||||
export * from './message-board-item.dto';
|
||||
export * from './target.dto';
|
||||
// end:ng42.barrel
|
||||
@@ -0,0 +1,19 @@
|
||||
import { QueryTokenDTO } from '@swagger/cat';
|
||||
|
||||
export interface MessageBoardItemDTO {
|
||||
uId?: string;
|
||||
|
||||
type?: string;
|
||||
|
||||
category?: string;
|
||||
|
||||
command?: string;
|
||||
|
||||
headline?: string;
|
||||
|
||||
text?: string;
|
||||
|
||||
queryToken?: QueryTokenDTO;
|
||||
|
||||
expirationDate?: string;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user