@dssp/project 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/project/project-detail.ts +109 -30
- package/client/pages/project/project-list.ts +46 -10
- package/client/pages/project/project-schedule-list.ts +11 -3
- package/client/pages/project/project-schedule.ts +111 -312
- package/client/pages/project/project-setting-list.ts +11 -3
- package/client/pages/resource/construction-detail-type-popup.ts +201 -0
- package/client/pages/resource/construction-type-management.ts +40 -39
- package/client/pages/resource/inspection-drawing-type-management.ts +210 -0
- package/client/pages/resource/inspection-part-popup.ts +201 -0
- package/client/pages/resource/manager-management.ts +0 -27
- package/client/pages/{checklist/checklist-importer.ts → resource/resource-importer.ts} +11 -8
- package/client/pages/{checklist/checklist-list-page.ts → resource/resource-list-page.ts} +41 -25
- package/client/pages/resource/worker-type-management.ts +3 -37
- package/client/pages/task-resource/task-resource-importer.ts +97 -0
- package/client/pages/task-resource/task-resource-list-page.ts +356 -0
- package/client/route.ts +13 -1
- package/dist-client/pages/project/project-detail.d.ts +5 -1
- package/dist-client/pages/project/project-detail.js +123 -40
- package/dist-client/pages/project/project-detail.js.map +1 -1
- package/dist-client/pages/project/project-list.d.ts +33 -7
- package/dist-client/pages/project/project-list.js +26 -11
- package/dist-client/pages/project/project-list.js.map +1 -1
- package/dist-client/pages/project/project-schedule-list.js +11 -3
- package/dist-client/pages/project/project-schedule-list.js.map +1 -1
- package/dist-client/pages/project/project-schedule.d.ts +5 -1
- package/dist-client/pages/project/project-schedule.js +117 -306
- package/dist-client/pages/project/project-schedule.js.map +1 -1
- package/dist-client/pages/project/project-setting-list.js +11 -3
- package/dist-client/pages/project/project-setting-list.js.map +1 -1
- package/dist-client/pages/resource/construction-detail-type-popup.d.ts +2 -0
- package/dist-client/pages/resource/construction-detail-type-popup.js +197 -0
- package/dist-client/pages/resource/construction-detail-type-popup.js.map +1 -0
- package/dist-client/pages/resource/construction-type-management.d.ts +12 -0
- package/dist-client/pages/resource/construction-type-management.js +30 -38
- package/dist-client/pages/resource/construction-type-management.js.map +1 -1
- package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +34 -0
- package/dist-client/pages/resource/inspection-drawing-type-management.js +198 -0
- package/dist-client/pages/resource/inspection-drawing-type-management.js.map +1 -0
- package/dist-client/pages/resource/inspection-part-popup.d.ts +2 -0
- package/dist-client/pages/resource/inspection-part-popup.js +197 -0
- package/dist-client/pages/resource/inspection-part-popup.js.map +1 -0
- package/dist-client/pages/resource/manager-management.js +0 -27
- package/dist-client/pages/resource/manager-management.js.map +1 -1
- package/dist-client/pages/{checklist/checklist-importer.d.ts → resource/resource-importer.d.ts} +2 -2
- package/dist-client/pages/{checklist/checklist-importer.js → resource/resource-importer.js} +10 -10
- package/dist-client/pages/resource/resource-importer.js.map +1 -0
- package/dist-client/pages/{checklist/checklist-list-page.d.ts → resource/resource-list-page.d.ts} +6 -6
- package/dist-client/pages/{checklist/checklist-list-page.js → resource/resource-list-page.js} +41 -32
- package/dist-client/pages/resource/resource-list-page.js.map +1 -0
- package/dist-client/pages/resource/worker-type-management.d.ts +7 -1
- package/dist-client/pages/resource/worker-type-management.js +3 -45
- package/dist-client/pages/resource/worker-type-management.js.map +1 -1
- package/dist-client/pages/task-resource/task-resource-importer.d.ts +10 -0
- package/dist-client/pages/task-resource/task-resource-importer.js +101 -0
- package/dist-client/pages/task-resource/task-resource-importer.js.map +1 -0
- package/dist-client/pages/task-resource/task-resource-list-page.d.ts +63 -0
- package/dist-client/pages/task-resource/task-resource-list-page.js +332 -0
- package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +9 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/import-task.d.ts +19 -0
- package/dist-server/controllers/import-task.js +104 -0
- package/dist-server/controllers/import-task.js.map +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1723861466413-seed-roles.d.ts +5 -0
- package/dist-server/migrations/1723861466413-seed-roles.js +117 -0
- package/dist-server/migrations/1723861466413-seed-roles.js.map +1 -0
- package/dist-server/migrations/1723861466414-seed-codes.d.ts +5 -0
- package/dist-server/migrations/1723861466414-seed-codes.js +132 -0
- package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -0
- package/dist-server/migrations/1723861476419-seed-resources.d.ts +5 -0
- package/dist-server/migrations/1723861476419-seed-resources.js +57 -0
- package/dist-server/migrations/1723861476419-seed-resources.js.map +1 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +5 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js +68 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +1 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +5 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +189 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +6 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +56 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +9 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js +53 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +11 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js +43 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +15 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.js +69 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.js.map +1 -0
- package/dist-server/service/construction-detail-type/index.d.ts +5 -0
- package/dist-server/service/construction-detail-type/index.js +9 -0
- package/dist-server/service/construction-detail-type/index.js.map +1 -0
- package/dist-server/service/construction-type/construction-type-query.d.ts +2 -0
- package/dist-server/service/construction-type/construction-type-query.js +14 -0
- package/dist-server/service/construction-type/construction-type-query.js.map +1 -1
- package/dist-server/service/construction-type/construction-type.d.ts +2 -0
- package/dist-server/service/construction-type/construction-type.js +6 -0
- package/dist-server/service/construction-type/construction-type.js.map +1 -1
- package/dist-server/service/index.d.ts +7 -5
- package/dist-server/service/index.js +21 -10
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/index.d.ts +5 -0
- package/dist-server/service/inspection-drawing-type/index.js +9 -0
- package/dist-server/service/inspection-drawing-type/index.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +6 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +64 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +12 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +83 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +10 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +39 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +16 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +72 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +1 -0
- package/dist-server/service/inspection-part/index.d.ts +5 -0
- package/dist-server/service/inspection-part/index.js +9 -0
- package/dist-server/service/inspection-part/index.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +6 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.js +55 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-query.d.ts +10 -0
- package/dist-server/service/inspection-part/inspection-part-query.js +66 -0
- package/dist-server/service/inspection-part/inspection-part-query.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-type.d.ts +11 -0
- package/dist-server/service/inspection-part/inspection-part-type.js +43 -0
- package/dist-server/service/inspection-part/inspection-part-type.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part.d.ts +15 -0
- package/dist-server/service/inspection-part/inspection-part.js +69 -0
- package/dist-server/service/inspection-part/inspection-part.js.map +1 -0
- package/dist-server/service/project/index.d.ts +0 -2
- package/dist-server/service/project/index.js +1 -3
- package/dist-server/service/project/index.js.map +1 -1
- package/dist-server/service/project/project-query.d.ts +7 -5
- package/dist-server/service/project/project-query.js +34 -38
- package/dist-server/service/project/project-query.js.map +1 -1
- package/dist-server/service/project/project-type.d.ts +3 -6
- package/dist-server/service/project/project-type.js +25 -35
- package/dist-server/service/project/project-type.js.map +1 -1
- package/dist-server/service/project/project.d.ts +3 -2
- package/dist-server/service/project/project.js +10 -10
- package/dist-server/service/project/project.js.map +1 -1
- package/dist-server/service/resource/index.d.ts +6 -0
- package/dist-server/service/resource/index.js +10 -0
- package/dist-server/service/resource/index.js.map +1 -0
- package/dist-server/service/resource/resource-mutation.d.ts +10 -0
- package/dist-server/service/resource/resource-mutation.js +132 -0
- package/dist-server/service/resource/resource-mutation.js.map +1 -0
- package/dist-server/service/resource/resource-query.d.ts +11 -0
- package/dist-server/service/{checklist/checklist-query.js → resource/resource-query.js} +33 -38
- package/dist-server/service/resource/resource-query.js.map +1 -0
- package/dist-server/service/resource/resource-type.d.ts +17 -0
- package/dist-server/service/resource/resource-type.js +65 -0
- package/dist-server/service/resource/resource-type.js.map +1 -0
- package/dist-server/service/resource/resource.d.ts +24 -0
- package/dist-server/service/resource/resource.js +93 -0
- package/dist-server/service/resource/resource.js.map +1 -0
- package/dist-server/service/task/task-mutation.js +6 -0
- package/dist-server/service/task/task-mutation.js.map +1 -1
- package/dist-server/service/task/task-query.d.ts +9 -1
- package/dist-server/service/task/task-query.js +142 -20
- package/dist-server/service/task/task-query.js.map +1 -1
- package/dist-server/service/task/task-type.d.ts +13 -0
- package/dist-server/service/task/task-type.js +57 -12
- package/dist-server/service/task/task-type.js.map +1 -1
- package/dist-server/service/task/task.d.ts +12 -5
- package/dist-server/service/task/task.js +51 -16
- package/dist-server/service/task/task.js.map +1 -1
- package/dist-server/service/task-resource/index.d.ts +6 -0
- package/dist-server/service/task-resource/index.js +10 -0
- package/dist-server/service/task-resource/index.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-mutation.d.ts +10 -0
- package/dist-server/service/task-resource/task-resource-mutation.js +132 -0
- package/dist-server/service/task-resource/task-resource-mutation.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-query.d.ts +7 -0
- package/dist-server/service/task-resource/task-resource-query.js +50 -0
- package/dist-server/service/task-resource/task-resource-query.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-type.d.ts +17 -0
- package/dist-server/service/task-resource/task-resource-type.js +65 -0
- package/dist-server/service/task-resource/task-resource-type.js.map +1 -0
- package/dist-server/service/task-resource/task-resource.d.ts +13 -0
- package/dist-server/service/task-resource/task-resource.js +59 -0
- package/dist-server/service/task-resource/task-resource.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/project/checklist-type-detail.md +160 -0
- package/helps/project/checklist-type.md +160 -0
- package/helps/project/task-resource.md +160 -0
- package/package.json +11 -7
- package/server/controllers/import-task.ts +140 -0
- package/server/index.ts +1 -0
- package/server/migrations/1723861466413-seed-roles.ts +128 -0
- package/server/migrations/1723861466414-seed-codes.ts +139 -0
- package/server/migrations/1723861476419-seed-resources.ts +62 -0
- package/server/migrations/1723861478420-seed-/bsample-project.ts +87 -0
- package/server/migrations/1723861478421-seed-/bsample-tasks.ts +194 -0
- package/server/migrations/index.ts +9 -0
- package/server/service/construction-detail-type/construction-detail-type-mutation.ts +57 -0
- package/server/service/construction-detail-type/construction-detail-type-query.ts +31 -0
- package/server/service/construction-detail-type/construction-detail-type-type.ts +26 -0
- package/server/service/construction-detail-type/construction-detail-type.ts +52 -0
- package/server/service/construction-detail-type/index.ts +6 -0
- package/server/service/construction-type/construction-type-query.ts +9 -0
- package/server/service/construction-type/construction-type.ts +8 -2
- package/server/service/index.ts +24 -11
- package/server/service/inspection-drawing-type/index.ts +6 -0
- package/server/service/inspection-drawing-type/inspection-drawing-type-mutation.ts +69 -0
- package/server/service/inspection-drawing-type/inspection-drawing-type-query.ts +55 -0
- package/server/service/inspection-drawing-type/inspection-drawing-type-type.ts +23 -0
- package/server/service/inspection-drawing-type/inspection-drawing-type.ts +68 -0
- package/server/service/inspection-part/index.ts +6 -0
- package/server/service/inspection-part/inspection-part-mutation.ts +52 -0
- package/server/service/inspection-part/inspection-part-query.ts +41 -0
- package/server/service/inspection-part/inspection-part-type.ts +26 -0
- package/server/service/inspection-part/inspection-part.ts +51 -0
- package/server/service/project/index.ts +0 -2
- package/server/service/project/project-query.ts +30 -38
- package/server/service/project/project-type.ts +22 -27
- package/server/service/project/project.ts +11 -12
- package/server/service/resource/index.ts +7 -0
- package/server/service/resource/resource-mutation.ts +137 -0
- package/server/service/resource/resource-query.ts +50 -0
- package/server/service/resource/resource-type.ts +41 -0
- package/server/service/resource/resource.ts +82 -0
- package/server/service/task/task-mutation.ts +8 -9
- package/server/service/task/task-query.ts +135 -22
- package/server/service/task/task-type.ts +41 -15
- package/server/service/task/task.ts +44 -15
- package/server/service/task-resource/index.ts +7 -0
- package/server/service/task-resource/task-resource-mutation.ts +140 -0
- package/server/service/task-resource/task-resource-query.ts +36 -0
- package/server/service/task-resource/task-resource-type.ts +41 -0
- package/server/service/task-resource/task-resource.ts +51 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +15 -1
- package/translations/ko.json +9 -5
- package/dist-client/pages/checklist/checklist-importer.js.map +0 -1
- package/dist-client/pages/checklist/checklist-list-page.js.map +0 -1
- package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
- package/dist-server/service/check-item/check-item-mutation.js +0 -129
- package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
- package/dist-server/service/check-item/check-item-query.d.ts +0 -11
- package/dist-server/service/check-item/check-item-query.js +0 -86
- package/dist-server/service/check-item/check-item-query.js.map +0 -1
- package/dist-server/service/check-item/check-item-type.d.ts +0 -18
- package/dist-server/service/check-item/check-item-type.js +0 -69
- package/dist-server/service/check-item/check-item-type.js.map +0 -1
- package/dist-server/service/check-item/check-item.d.ts +0 -18
- package/dist-server/service/check-item/check-item.js +0 -84
- package/dist-server/service/check-item/check-item.js.map +0 -1
- package/dist-server/service/check-item/index.d.ts +0 -5
- package/dist-server/service/check-item/index.js +0 -9
- package/dist-server/service/check-item/index.js.map +0 -1
- package/dist-server/service/checklist/checklist-mutation.d.ts +0 -10
- package/dist-server/service/checklist/checklist-mutation.js +0 -129
- package/dist-server/service/checklist/checklist-mutation.js.map +0 -1
- package/dist-server/service/checklist/checklist-query.d.ts +0 -11
- package/dist-server/service/checklist/checklist-query.js.map +0 -1
- package/dist-server/service/checklist/checklist-type.d.ts +0 -18
- package/dist-server/service/checklist/checklist-type.js +0 -69
- package/dist-server/service/checklist/checklist-type.js.map +0 -1
- package/dist-server/service/checklist/checklist.d.ts +0 -26
- package/dist-server/service/checklist/checklist.js +0 -120
- package/dist-server/service/checklist/checklist.js.map +0 -1
- package/dist-server/service/checklist/index.d.ts +0 -5
- package/dist-server/service/checklist/index.js +0 -9
- package/dist-server/service/checklist/index.js.map +0 -1
- package/server/service/check-item/check-item-mutation.ts +0 -142
- package/server/service/check-item/check-item-query.ts +0 -56
- package/server/service/check-item/check-item-type.ts +0 -49
- package/server/service/check-item/check-item.ts +0 -74
- package/server/service/check-item/index.ts +0 -6
- package/server/service/checklist/checklist-mutation.ts +0 -142
- package/server/service/checklist/checklist-query.ts +0 -56
- package/server/service/checklist/checklist-type.ts +0 -49
- package/server/service/checklist/checklist.ts +0 -105
- package/server/service/checklist/index.ts +0 -6
|
@@ -1,25 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskList = exports.TaskPatch = exports.NewTask = void 0;
|
|
3
|
+
exports.TaskList = exports.TaskPatch = exports.NewTask = exports.ObjectRefForTask = exports.ObjectRefForProject = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
7
|
const task_1 = require("./task");
|
|
8
|
+
let ObjectRefForProject = class ObjectRefForProject extends shell_1.ObjectRef {
|
|
9
|
+
};
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '프로젝트 이름 (선택 사항)' }),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], ObjectRefForProject.prototype, "name", void 0);
|
|
14
|
+
ObjectRefForProject = tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.InputType)()
|
|
16
|
+
], ObjectRefForProject);
|
|
17
|
+
exports.ObjectRefForProject = ObjectRefForProject;
|
|
18
|
+
let ObjectRefForTask = class ObjectRefForTask extends shell_1.ObjectRef {
|
|
19
|
+
};
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업 코드 (선택 사항)' }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], ObjectRefForTask.prototype, "code", void 0);
|
|
24
|
+
ObjectRefForTask = tslib_1.__decorate([
|
|
25
|
+
(0, type_graphql_1.InputType)()
|
|
26
|
+
], ObjectRefForTask);
|
|
27
|
+
exports.ObjectRefForTask = ObjectRefForTask;
|
|
7
28
|
let NewTask = class NewTask {
|
|
8
29
|
};
|
|
9
30
|
tslib_1.__decorate([
|
|
10
|
-
(0, type_graphql_1.Field)(),
|
|
31
|
+
(0, type_graphql_1.Field)({ description: '프로젝트 내에서 유니크한 작업 코드' }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], NewTask.prototype, "code", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, type_graphql_1.Field)({ description: '작업의 이름' }),
|
|
11
36
|
tslib_1.__metadata("design:type", String)
|
|
12
37
|
], NewTask.prototype, "name", void 0);
|
|
13
38
|
tslib_1.__decorate([
|
|
14
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
|
+
(0, type_graphql_1.Field)(type => ObjectRefForProject, { nullable: true, description: '작업이 속한 프로젝트 (선택 사항)' }),
|
|
40
|
+
tslib_1.__metadata("design:type", ObjectRefForProject)
|
|
41
|
+
], NewTask.prototype, "project", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)(type => ObjectRefForTask, { nullable: true, description: '부모 작업, 해당 작업이 하위 작업인 경우 (선택 사항)' }),
|
|
44
|
+
tslib_1.__metadata("design:type", ObjectRefForTask)
|
|
45
|
+
], NewTask.prototype, "parent", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업에 대한 설명 (선택 사항)' }),
|
|
15
48
|
tslib_1.__metadata("design:type", String)
|
|
16
49
|
], NewTask.prototype, "description", void 0);
|
|
17
50
|
tslib_1.__decorate([
|
|
18
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업이 활성 상태인지 여부 (선택 사항)' }),
|
|
19
52
|
tslib_1.__metadata("design:type", Boolean)
|
|
20
53
|
], NewTask.prototype, "active", void 0);
|
|
21
54
|
tslib_1.__decorate([
|
|
22
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업에 대한 추가 파라미터, JSON 형식으로 저장 (선택 사항)' }),
|
|
23
56
|
tslib_1.__metadata("design:type", String)
|
|
24
57
|
], NewTask.prototype, "params", void 0);
|
|
25
58
|
NewTask = tslib_1.__decorate([
|
|
@@ -29,23 +62,35 @@ exports.NewTask = NewTask;
|
|
|
29
62
|
let TaskPatch = class TaskPatch {
|
|
30
63
|
};
|
|
31
64
|
tslib_1.__decorate([
|
|
32
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: '수정할 작업의 ID (선택 사항)' }),
|
|
33
66
|
tslib_1.__metadata("design:type", String)
|
|
34
67
|
], TaskPatch.prototype, "id", void 0);
|
|
35
68
|
tslib_1.__decorate([
|
|
36
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '프로젝트 내에서 유니크한 작업 코드 (선택 사항)' }),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], TaskPatch.prototype, "code", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업의 이름 (선택 사항)' }),
|
|
37
74
|
tslib_1.__metadata("design:type", String)
|
|
38
75
|
], TaskPatch.prototype, "name", void 0);
|
|
39
76
|
tslib_1.__decorate([
|
|
40
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
+
(0, type_graphql_1.Field)(type => ObjectRefForProject, { nullable: true, description: '작업이 속한 프로젝트 (선택 사항)' }),
|
|
78
|
+
tslib_1.__metadata("design:type", ObjectRefForProject)
|
|
79
|
+
], TaskPatch.prototype, "project", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, type_graphql_1.Field)(type => ObjectRefForTask, { nullable: true, description: '부모 작업, 해당 작업이 하위 작업인 경우 (선택 사항)' }),
|
|
82
|
+
tslib_1.__metadata("design:type", ObjectRefForTask)
|
|
83
|
+
], TaskPatch.prototype, "parent", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업에 대한 설명 (선택 사항)' }),
|
|
41
86
|
tslib_1.__metadata("design:type", String)
|
|
42
87
|
], TaskPatch.prototype, "description", void 0);
|
|
43
88
|
tslib_1.__decorate([
|
|
44
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '작업이 활성 상태인지 여부 (선택 사항)' }),
|
|
45
90
|
tslib_1.__metadata("design:type", Boolean)
|
|
46
91
|
], TaskPatch.prototype, "active", void 0);
|
|
47
92
|
tslib_1.__decorate([
|
|
48
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "생성('+') 또는 수정('M') 플래그 (선택 사항)" }),
|
|
49
94
|
tslib_1.__metadata("design:type", String)
|
|
50
95
|
], TaskPatch.prototype, "cuFlag", void 0);
|
|
51
96
|
TaskPatch = tslib_1.__decorate([
|
|
@@ -55,11 +100,11 @@ exports.TaskPatch = TaskPatch;
|
|
|
55
100
|
let TaskList = class TaskList {
|
|
56
101
|
};
|
|
57
102
|
tslib_1.__decorate([
|
|
58
|
-
(0, type_graphql_1.Field)(type => [task_1.Task]),
|
|
103
|
+
(0, type_graphql_1.Field)(type => [task_1.Task], { description: '작업 리스트 항목들' }),
|
|
59
104
|
tslib_1.__metadata("design:type", Array)
|
|
60
105
|
], TaskList.prototype, "items", void 0);
|
|
61
106
|
tslib_1.__decorate([
|
|
62
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
107
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '전체 작업 수' }),
|
|
63
108
|
tslib_1.__metadata("design:type", Number)
|
|
64
109
|
], TaskList.prototype, "total", void 0);
|
|
65
110
|
TaskList = tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-type.js","sourceRoot":"","sources":["../../../server/service/task/task-type.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"task-type.js","sourceRoot":"","sources":["../../../server/service/task/task-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,iDAA+D;AAC/D,iCAA6B;AAGtB,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iBAAS;CAGjD,CAAA;AAFC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;iDAC7C;AAFF,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAG/B;AAHY,kDAAmB;AAMzB,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,iBAAS;CAG9C,CAAA;AAFC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;8CAC3C;AAFF,gBAAgB;IAD5B,IAAA,wBAAS,GAAE;GACC,gBAAgB,CAG5B;AAHY,4CAAgB;AAMtB,IAAM,OAAO,GAAb,MAAM,OAAO;CAqBnB,CAAA;AApBC;IAAC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;qCAClC;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;;qCACrB;AAEZ;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;sCACjF,mBAAmB;wCAAA;AAE7B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI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AAW,EAAE,mBAAmB,EAAE,CAAC;;8CACxC;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;yCACjD;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;yCAC1D;AAvBJ,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAwBrB;AAxBY,8BAAS;AA2Bf,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAMpB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAI,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;uCACxC;AAEb;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;uCAClC;AALF,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAMpB;AANY,4BAAQ","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\nimport { Task } from './task'\n\n@InputType()\nexport class ObjectRefForProject extends ObjectRef {\n @Field({ nullable: true, description: '프로젝트 이름 (선택 사항)' })\n name?: string\n}\n\n@InputType()\nexport class ObjectRefForTask extends ObjectRef {\n @Field({ nullable: true, description: '작업 코드 (선택 사항)' })\n code?: string\n}\n\n@InputType()\nexport class NewTask {\n @Field({ description: '프로젝트 내에서 유니크한 작업 코드' })\n code: string\n\n @Field({ description: '작업의 이름' })\n name: string\n\n @Field(type => ObjectRefForProject, { nullable: true, description: '작업이 속한 프로젝트 (선택 사항)' })\n project?: ObjectRefForProject\n\n @Field(type => ObjectRefForTask, { nullable: true, description: '부모 작업, 해당 작업이 하위 작업인 경우 (선택 사항)' })\n parent?: ObjectRefForTask\n\n @Field({ nullable: true, description: '작업에 대한 설명 (선택 사항)' })\n description?: string\n\n @Field({ nullable: true, description: '작업이 활성 상태인지 여부 (선택 사항)' })\n active?: boolean\n\n @Field({ nullable: true, description: '작업에 대한 추가 파라미터, JSON 형식으로 저장 (선택 사항)' })\n params?: string\n}\n\n@InputType()\nexport class TaskPatch {\n @Field(type => ID, { nullable: true, description: '수정할 작업의 ID (선택 사항)' })\n id?: string\n\n @Field({ nullable: true, description: '프로젝트 내에서 유니크한 작업 코드 (선택 사항)' })\n code?: string\n\n @Field({ nullable: true, description: '작업의 이름 (선택 사항)' })\n name?: string\n\n @Field(type => ObjectRefForProject, { nullable: true, description: '작업이 속한 프로젝트 (선택 사항)' })\n project?: ObjectRefForProject\n\n @Field(type => ObjectRefForTask, { nullable: true, description: '부모 작업, 해당 작업이 하위 작업인 경우 (선택 사항)' })\n parent?: ObjectRefForTask\n\n @Field({ nullable: true, description: '작업에 대한 설명 (선택 사항)' })\n description?: string\n\n @Field({ nullable: true, description: '작업이 활성 상태인지 여부 (선택 사항)' })\n active?: boolean\n\n @Field({ nullable: true, description: \"생성('+') 또는 수정('M') 플래그 (선택 사항)\" })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaskList {\n @Field(type => [Task], { description: '작업 리스트 항목들' })\n items: Task[]\n\n @Field(type => Int, { description: '전체 작업 수' })\n total: number\n}\n"]}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import { User } from '@things-factory/auth-base';
|
|
2
2
|
import { Project } from '../project/project';
|
|
3
|
-
import {
|
|
3
|
+
import { TaskResource } from '../task-resource/task-resource';
|
|
4
4
|
export declare enum TaskType {
|
|
5
|
-
GROUP = "
|
|
6
|
-
TASK = "
|
|
5
|
+
GROUP = "group",
|
|
6
|
+
TASK = "task"
|
|
7
7
|
}
|
|
8
8
|
export declare class Task {
|
|
9
9
|
readonly id: string;
|
|
10
|
+
code: string;
|
|
10
11
|
name?: string;
|
|
11
12
|
type?: TaskType;
|
|
12
|
-
|
|
13
|
+
parent: Task;
|
|
14
|
+
parentId?: string;
|
|
15
|
+
children?: Task[];
|
|
13
16
|
startDate?: Date;
|
|
14
17
|
endDate?: Date;
|
|
18
|
+
duration?: number;
|
|
19
|
+
dependsOn?: string;
|
|
15
20
|
project?: Project;
|
|
16
21
|
projectId?: string;
|
|
17
|
-
|
|
22
|
+
tags?: string[];
|
|
23
|
+
progress?: number;
|
|
24
|
+
taskResources?: TaskResource[];
|
|
18
25
|
createdAt?: Date;
|
|
19
26
|
updatedAt?: Date;
|
|
20
27
|
deletedAt?: Date;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var Task_1;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.Task = exports.TaskType = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const typeorm_1 = require("typeorm");
|
|
6
7
|
const type_graphql_1 = require("type-graphql");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
9
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
10
|
const project_1 = require("../project/project");
|
|
9
|
-
|
|
11
|
+
// import { Checklist } from '@dssp/supervisor'
|
|
12
|
+
const task_resource_1 = require("../task-resource/task-resource");
|
|
10
13
|
var TaskType;
|
|
11
14
|
(function (TaskType) {
|
|
12
|
-
TaskType["GROUP"] = "
|
|
13
|
-
TaskType["TASK"] = "
|
|
15
|
+
TaskType["GROUP"] = "group";
|
|
16
|
+
TaskType["TASK"] = "task";
|
|
14
17
|
})(TaskType = exports.TaskType || (exports.TaskType = {}));
|
|
15
18
|
(0, type_graphql_1.registerEnumType)(TaskType, {
|
|
16
19
|
name: 'TaskType',
|
|
17
20
|
description: '작업 타입'
|
|
18
21
|
});
|
|
19
|
-
let Task = class Task {
|
|
22
|
+
let Task = Task_1 = class Task {
|
|
20
23
|
};
|
|
21
24
|
tslib_1.__decorate([
|
|
22
25
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
26
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
24
27
|
tslib_1.__metadata("design:type", String)
|
|
25
28
|
], Task.prototype, "id", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ nullable: false, comment: '프로젝트 내에서 유니크한 작업 코드' }),
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Task.prototype, "code", void 0);
|
|
26
34
|
tslib_1.__decorate([
|
|
27
35
|
(0, typeorm_1.Column)({ nullable: true, comment: '작업 명' }),
|
|
28
36
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -34,10 +42,19 @@ tslib_1.__decorate([
|
|
|
34
42
|
tslib_1.__metadata("design:type", String)
|
|
35
43
|
], Task.prototype, "type", void 0);
|
|
36
44
|
tslib_1.__decorate([
|
|
37
|
-
(0, typeorm_1.
|
|
45
|
+
(0, typeorm_1.ManyToOne)(type => Task_1, task => task.children, { nullable: true }),
|
|
38
46
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", Task)
|
|
48
|
+
], Task.prototype, "parent", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.RelationId)((task) => task.parent),
|
|
39
51
|
tslib_1.__metadata("design:type", String)
|
|
40
|
-
], Task.prototype, "
|
|
52
|
+
], Task.prototype, "parentId", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(type => Task_1, task => task.parent, { nullable: true }),
|
|
55
|
+
(0, type_graphql_1.Field)(type => [Task_1], { nullable: true }),
|
|
56
|
+
tslib_1.__metadata("design:type", Array)
|
|
57
|
+
], Task.prototype, "children", void 0);
|
|
41
58
|
tslib_1.__decorate([
|
|
42
59
|
(0, typeorm_1.Column)({ nullable: true, comment: '시작일' }),
|
|
43
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -46,13 +63,21 @@ tslib_1.__decorate([
|
|
|
46
63
|
tslib_1.__decorate([
|
|
47
64
|
(0, typeorm_1.Column)({ nullable: true, comment: '종료일' }),
|
|
48
65
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
49
|
-
tslib_1.__metadata("design:type", Date
|
|
50
|
-
// 프로젝트 정보 (상위 테이블 참조)
|
|
51
|
-
)
|
|
66
|
+
tslib_1.__metadata("design:type", Date)
|
|
52
67
|
], Task.prototype, "endDate", void 0);
|
|
53
68
|
tslib_1.__decorate([
|
|
54
|
-
(0,
|
|
55
|
-
(0,
|
|
69
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '기간' }),
|
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
+
tslib_1.__metadata("design:type", Number)
|
|
72
|
+
], Task.prototype, "duration", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '선행 태스크 코드' }),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], Task.prototype, "dependsOn", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.ManyToOne)(type => project_1.Project, project => project.tasks),
|
|
80
|
+
(0, type_graphql_1.Field)(type => project_1.Project),
|
|
56
81
|
tslib_1.__metadata("design:type", project_1.Project)
|
|
57
82
|
], Task.prototype, "project", void 0);
|
|
58
83
|
tslib_1.__decorate([
|
|
@@ -60,10 +85,20 @@ tslib_1.__decorate([
|
|
|
60
85
|
tslib_1.__metadata("design:type", String)
|
|
61
86
|
], Task.prototype, "projectId", void 0);
|
|
62
87
|
tslib_1.__decorate([
|
|
63
|
-
(0,
|
|
64
|
-
(0,
|
|
88
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true, default: null }),
|
|
89
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
90
|
+
tslib_1.__metadata("design:type", Array)
|
|
91
|
+
], Task.prototype, "tags", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '진행율' }),
|
|
94
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
95
|
+
tslib_1.__metadata("design:type", Number)
|
|
96
|
+
], Task.prototype, "progress", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.OneToMany)(type => task_resource_1.TaskResource, taskResource => taskResource.task, { cascade: true }),
|
|
99
|
+
(0, type_graphql_1.Field)(type => [task_resource_1.TaskResource], { nullable: true }),
|
|
65
100
|
tslib_1.__metadata("design:type", Array)
|
|
66
|
-
], Task.prototype, "
|
|
101
|
+
], Task.prototype, "taskResources", void 0);
|
|
67
102
|
tslib_1.__decorate([
|
|
68
103
|
(0, typeorm_1.CreateDateColumn)(),
|
|
69
104
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -97,9 +132,9 @@ tslib_1.__decorate([
|
|
|
97
132
|
(0, typeorm_1.RelationId)((task) => task.updater),
|
|
98
133
|
tslib_1.__metadata("design:type", String)
|
|
99
134
|
], Task.prototype, "updaterId", void 0);
|
|
100
|
-
Task = tslib_1.__decorate([
|
|
135
|
+
Task = Task_1 = tslib_1.__decorate([
|
|
101
136
|
(0, typeorm_1.Entity)(),
|
|
102
|
-
(0, typeorm_1.Index)('
|
|
137
|
+
(0, typeorm_1.Index)('ix_task_project_code', (task) => [task.project, task.code], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
103
138
|
(0, type_graphql_1.ObjectType)({ description: '공정표 작업 정보' })
|
|
104
139
|
], Task);
|
|
105
140
|
exports.Task = Task;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../server/service/task/task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task.js","source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AI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;qCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;uCACvB;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;qCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;uCACvB;AA3FP,IAAI;IAHhB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACzH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;GAC5B,IAAI,CA4FhB;AA5FY,oBAAI","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Project } from '../project/project'\n// import { Checklist } from '@dssp/supervisor'\nimport { TaskResource } from '../task-resource/task-resource'\n\nexport enum TaskType {\n GROUP = 'group',\n TASK = 'task'\n}\n\nregisterEnumType(TaskType, {\n name: 'TaskType',\n description: '작업 타입'\n})\n\n@Entity()\n@Index('ix_task_project_code', (task: Task) => [task.project, task.code], { unique: true, where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: '공정표 작업 정보' })\nexport class Task {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: false, comment: '프로젝트 내에서 유니크한 작업 코드' })\n @Field({ nullable: false })\n code: string\n\n @Column({ nullable: true, comment: '작업 명' })\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true, comment: '테스크 타입 (group: 공종, task: 세부 공종)' })\n @Field({ nullable: true })\n type?: TaskType\n\n @ManyToOne(type => Task, task => task.children, { nullable: true })\n @Field({ nullable: true })\n parent: Task\n\n @RelationId((task: Task) => task.parent)\n parentId?: string\n\n @OneToMany(type => Task, task => task.parent, { nullable: true })\n @Field(type => [Task], { nullable: true })\n children?: Task[]\n\n @Column({ nullable: true, comment: '시작일' })\n @Field({ nullable: true })\n startDate?: Date\n\n @Column({ nullable: true, comment: '종료일' })\n @Field({ nullable: true })\n endDate?: Date\n\n @Column({ nullable: true, comment: '기간' })\n @Field({ nullable: true })\n duration?: number\n\n @Column({ nullable: true, comment: '선행 태스크 코드' })\n @Field({ nullable: true })\n dependsOn?: string\n\n @ManyToOne(type => Project, project => project.tasks)\n @Field(type => Project)\n project?: Project\n\n @RelationId((task: Task) => task.project)\n projectId?: string\n\n @Column('simple-json', { nullable: true, default: null })\n @Field(type => ScalarObject, { nullable: true })\n tags?: string[]\n\n @Column({ nullable: true, comment: '진행율' })\n @Field({ nullable: true })\n progress?: number\n\n // @OneToMany(type => Checklist, checklist => checklist.task, { nullable: true })\n // @Field(type => [Checklist], { nullable: true })\n // checklists?: Checklist[]\n\n @OneToMany(type => TaskResource, taskResource => taskResource.task, { cascade: true })\n @Field(type => [TaskResource], { nullable: true })\n taskResources?: TaskResource[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((task: Task) => task.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((task: Task) => task.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskResource } from './task-resource';
|
|
2
|
+
import { TaskResourceQuery } from './task-resource-query';
|
|
3
|
+
import { TaskResourceMutation } from './task-resource-mutation';
|
|
4
|
+
export declare const entities: (typeof TaskResource)[];
|
|
5
|
+
export declare const resolvers: (typeof TaskResourceQuery | typeof TaskResourceMutation)[];
|
|
6
|
+
export declare const subscribers: any[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const task_resource_1 = require("./task-resource");
|
|
5
|
+
const task_resource_query_1 = require("./task-resource-query");
|
|
6
|
+
const task_resource_mutation_1 = require("./task-resource-mutation");
|
|
7
|
+
exports.entities = [task_resource_1.TaskResource];
|
|
8
|
+
exports.resolvers = [task_resource_query_1.TaskResourceQuery, task_resource_mutation_1.TaskResourceMutation];
|
|
9
|
+
exports.subscribers = [];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/task-resource/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,+DAAyD;AACzD,qEAA+D;AAElD,QAAA,QAAQ,GAAG,CAAC,4BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,uCAAiB,EAAE,6CAAoB,CAAC,CAAA;AACrD,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { TaskResource } from './task-resource'\nimport { TaskResourceQuery } from './task-resource-query'\nimport { TaskResourceMutation } from './task-resource-mutation'\n\nexport const entities = [TaskResource]\nexport const resolvers = [TaskResourceQuery, TaskResourceMutation]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TaskResource } from './task-resource';
|
|
2
|
+
import { NewTaskResource, TaskResourcePatch } from './task-resource-type';
|
|
3
|
+
export declare class TaskResourceMutation {
|
|
4
|
+
createTaskResource(taskResource: NewTaskResource, context: ResolverContext): Promise<TaskResource>;
|
|
5
|
+
updateTaskResource(id: string, patch: TaskResourcePatch, context: ResolverContext): Promise<TaskResource>;
|
|
6
|
+
updateMultipleTaskResource(patches: TaskResourcePatch[], context: ResolverContext): Promise<TaskResource[]>;
|
|
7
|
+
deleteTaskResource(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteTaskResources(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importTaskResources(taskResources: TaskResourcePatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskResourceMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const task_resource_1 = require("./task-resource");
|
|
8
|
+
const task_resource_type_1 = require("./task-resource-type");
|
|
9
|
+
let TaskResourceMutation = class TaskResourceMutation {
|
|
10
|
+
async createTaskResource(taskResource, context) {
|
|
11
|
+
const { domain, user, tx } = context.state;
|
|
12
|
+
const result = await tx.getRepository(task_resource_1.TaskResource).save(Object.assign(Object.assign({}, taskResource), { domain, creator: user, updater: user }));
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
async updateTaskResource(id, patch, context) {
|
|
16
|
+
const { domain, user, tx } = context.state;
|
|
17
|
+
const repository = tx.getRepository(task_resource_1.TaskResource);
|
|
18
|
+
const taskResource = await repository.findOne({
|
|
19
|
+
where: { id }
|
|
20
|
+
});
|
|
21
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, taskResource), patch), { updater: user }));
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
async updateMultipleTaskResource(patches, context) {
|
|
25
|
+
const { domain, user, tx } = context.state;
|
|
26
|
+
let results = [];
|
|
27
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
28
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
29
|
+
const taskResourceRepo = tx.getRepository(task_resource_1.TaskResource);
|
|
30
|
+
if (_createRecords.length > 0) {
|
|
31
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
32
|
+
const newRecord = _createRecords[i];
|
|
33
|
+
const result = await taskResourceRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
34
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (_updateRecords.length > 0) {
|
|
38
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
39
|
+
const updateRecord = _updateRecords[i];
|
|
40
|
+
const taskResource = await taskResourceRepo.findOneBy({ id: updateRecord.id });
|
|
41
|
+
const result = await taskResourceRepo.save(Object.assign(Object.assign(Object.assign({}, taskResource), updateRecord), { updater: user }));
|
|
42
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return results;
|
|
46
|
+
}
|
|
47
|
+
async deleteTaskResource(id, context) {
|
|
48
|
+
const { domain, tx } = context.state;
|
|
49
|
+
await tx.getRepository(task_resource_1.TaskResource).delete({ id });
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
async deleteTaskResources(ids, context) {
|
|
53
|
+
const { domain, tx } = context.state;
|
|
54
|
+
await tx.getRepository(task_resource_1.TaskResource).delete({
|
|
55
|
+
id: (0, typeorm_1.In)(ids)
|
|
56
|
+
});
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
async importTaskResources(taskResources, context) {
|
|
60
|
+
const { domain, tx } = context.state;
|
|
61
|
+
await Promise.all(taskResources.map(async (taskResource) => {
|
|
62
|
+
const createdTaskResource = await tx.getRepository(task_resource_1.TaskResource).save(Object.assign({ domain }, taskResource));
|
|
63
|
+
}));
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
69
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
70
|
+
(0, type_graphql_1.Mutation)(returns => task_resource_1.TaskResource, { description: 'To create new TaskResource' }),
|
|
71
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('taskResource')),
|
|
72
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
73
|
+
tslib_1.__metadata("design:type", Function),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [task_resource_type_1.NewTaskResource, Object]),
|
|
75
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
76
|
+
], TaskResourceMutation.prototype, "createTaskResource", null);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
79
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
80
|
+
(0, type_graphql_1.Mutation)(returns => task_resource_1.TaskResource, { description: 'To modify TaskResource information' }),
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
82
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
83
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
84
|
+
tslib_1.__metadata("design:type", Function),
|
|
85
|
+
tslib_1.__metadata("design:paramtypes", [String, task_resource_type_1.TaskResourcePatch, Object]),
|
|
86
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
87
|
+
], TaskResourceMutation.prototype, "updateTaskResource", null);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
90
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
91
|
+
(0, type_graphql_1.Mutation)(returns => [task_resource_1.TaskResource], { description: "To modify multiple TaskResources' information" }),
|
|
92
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [task_resource_type_1.TaskResourcePatch])),
|
|
93
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
94
|
+
tslib_1.__metadata("design:type", Function),
|
|
95
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
96
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
97
|
+
], TaskResourceMutation.prototype, "updateMultipleTaskResource", null);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
100
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
101
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete TaskResource' }),
|
|
102
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
103
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
104
|
+
tslib_1.__metadata("design:type", Function),
|
|
105
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
106
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
107
|
+
], TaskResourceMutation.prototype, "deleteTaskResource", null);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
110
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
111
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple TaskResources' }),
|
|
112
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
113
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
114
|
+
tslib_1.__metadata("design:type", Function),
|
|
115
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
116
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
117
|
+
], TaskResourceMutation.prototype, "deleteTaskResources", null);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
120
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
121
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple TaskResources' }),
|
|
122
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('taskResources', type => [task_resource_type_1.TaskResourcePatch])),
|
|
123
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
124
|
+
tslib_1.__metadata("design:type", Function),
|
|
125
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
126
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
127
|
+
], TaskResourceMutation.prototype, "importTaskResources", null);
|
|
128
|
+
TaskResourceMutation = tslib_1.__decorate([
|
|
129
|
+
(0, type_graphql_1.Resolver)(task_resource_1.TaskResource)
|
|
130
|
+
], TaskResourceMutation);
|
|
131
|
+
exports.TaskResourceMutation = TaskResourceMutation;
|
|
132
|
+
//# sourceMappingURL=task-resource-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-resource-mutation.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAIzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAC,IAAI,iCACnD,YAAY,KACf,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAA;QACjD,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,+CAC/B,YAAY,GACZ,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,0BAA0B,CACe,OAA4B,EAClE,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA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EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAQ5E;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAE/E,mBAAA,IAAA,kBAAG,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,CAAC,CAAA;IACjD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;AAnIU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAoIhC;AApIY,oDAAoB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { TaskResource } from './task-resource'\nimport { NewTaskResource, TaskResourcePatch } from './task-resource-type'\n\n@Resolver(TaskResource)\nexport class TaskResourceMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => TaskResource, { description: 'To create new TaskResource' })\n async createTaskResource(\n @Arg('taskResource') taskResource: NewTaskResource,\n @Ctx() context: ResolverContext\n ): Promise<TaskResource> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(TaskResource).save({\n ...taskResource,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => TaskResource, { description: 'To modify TaskResource information' })\n async updateTaskResource(\n @Arg('id') id: string,\n @Arg('patch') patch: TaskResourcePatch,\n @Ctx() context: ResolverContext\n ): Promise<TaskResource> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(TaskResource)\n const taskResource = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...taskResource,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [TaskResource], { description: \"To modify multiple TaskResources' information\" })\n async updateMultipleTaskResource(\n @Arg('patches', type => [TaskResourcePatch]) patches: TaskResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<TaskResource[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const taskResourceRepo = tx.getRepository(TaskResource)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await taskResourceRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const taskResource = await taskResourceRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taskResourceRepo.save({\n ...taskResource,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete TaskResource' })\n async deleteTaskResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaskResource).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple TaskResources' })\n async deleteTaskResources(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaskResource).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple TaskResources' })\n async importTaskResources(\n @Arg('taskResources', type => [TaskResourcePatch]) taskResources: TaskResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n taskResources.map(async (taskResource: TaskResourcePatch) => {\n const createdTaskResource: TaskResource = await tx.getRepository(TaskResource).save({ domain, ...taskResource })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ListParam } from '@things-factory/shell';
|
|
2
|
+
import { TaskResource } from './task-resource';
|
|
3
|
+
import { TaskResourceList } from './task-resource-type';
|
|
4
|
+
export declare class TaskResourceQuery {
|
|
5
|
+
taskResource(id: string, context: ResolverContext): Promise<TaskResource>;
|
|
6
|
+
taskResources(params: ListParam, context: ResolverContext): Promise<TaskResourceList>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskResourceQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const task_resource_1 = require("./task-resource");
|
|
8
|
+
const task_resource_type_1 = require("./task-resource-type");
|
|
9
|
+
let TaskResourceQuery = class TaskResourceQuery {
|
|
10
|
+
async taskResource(id, context) {
|
|
11
|
+
const { domain } = context.state;
|
|
12
|
+
return await (0, shell_1.getRepository)(task_resource_1.TaskResource).findOne({
|
|
13
|
+
where: { id }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async taskResources(params, context) {
|
|
17
|
+
const { domain } = context.state;
|
|
18
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
19
|
+
domain,
|
|
20
|
+
params,
|
|
21
|
+
repository: await (0, shell_1.getRepository)(task_resource_1.TaskResource),
|
|
22
|
+
searchables: ['name', 'description']
|
|
23
|
+
});
|
|
24
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
25
|
+
return { items, total };
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
30
|
+
(0, type_graphql_1.Query)(returns => task_resource_1.TaskResource, { nullable: true, description: 'To fetch a TaskResource' }),
|
|
31
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
32
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
33
|
+
tslib_1.__metadata("design:type", Function),
|
|
34
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
35
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
36
|
+
], TaskResourceQuery.prototype, "taskResource", null);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
39
|
+
(0, type_graphql_1.Query)(returns => task_resource_type_1.TaskResourceList, { description: 'To fetch multiple TaskResources' }),
|
|
40
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
41
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
42
|
+
tslib_1.__metadata("design:type", Function),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
44
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
45
|
+
], TaskResourceQuery.prototype, "taskResources", null);
|
|
46
|
+
TaskResourceQuery = tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Resolver)(task_resource_1.TaskResource)
|
|
48
|
+
], TaskResourceQuery);
|
|
49
|
+
exports.TaskResourceQuery = TaskResourceQuery;
|
|
50
|
+
//# sourceMappingURL=task-resource-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-resource-query.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAE9F,iDAAuG;AAEvG,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAwB;QACvE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAwB;QAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC;YAC7C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAxBO;IAFL,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACxE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAM/C;AAIK;IAFL,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qCAAgB,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;IAClE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;sDAa5C;AA1BU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CA2B7B;AA3BY,8CAAiB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaskResource } from './task-resource'\nimport { TaskResourceList } from './task-resource-type'\n\n@Resolver(TaskResource)\nexport class TaskResourceQuery {\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => TaskResource!, { nullable: true, description: 'To fetch a TaskResource' })\n async taskResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaskResource> {\n const { domain } = context.state\n\n return await getRepository(TaskResource).findOne({\n where: { id }\n })\n }\n\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => TaskResourceList, { description: 'To fetch multiple TaskResources' })\n async taskResources(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaskResourceList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaskResource),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TaskResource } from './task-resource';
|
|
2
|
+
export declare class NewTaskResource {
|
|
3
|
+
taskId: string;
|
|
4
|
+
resourceId: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class TaskResourcePatch {
|
|
8
|
+
id?: string;
|
|
9
|
+
taskId?: string;
|
|
10
|
+
resourceId?: string;
|
|
11
|
+
quantity?: number;
|
|
12
|
+
cuFlag?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class TaskResourceList {
|
|
15
|
+
items: TaskResource[];
|
|
16
|
+
total: number;
|
|
17
|
+
}
|