@dssp/project 1.0.0-alpha.1 → 1.0.0-alpha.101
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/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +1 -1
- package/dist-client/index.js.map +1 -1
- package/dist-client/pages/lib/chatbot-widget.d.ts +53 -0
- package/dist-client/pages/lib/chatbot-widget.js +631 -0
- package/dist-client/pages/lib/chatbot-widget.js.map +1 -0
- package/dist-client/pages/lib/select2-component.d.ts +1 -1
- package/dist-client/pages/lib/select2-component.js +36 -36
- package/dist-client/pages/lib/select2-component.js.map +1 -1
- package/dist-client/pages/lib/waether.d.ts +2 -1
- package/dist-client/pages/lib/waether.js +7 -3
- package/dist-client/pages/lib/waether.js.map +1 -1
- package/dist-client/pages/project/component/pagenation.d.ts +18 -0
- package/dist-client/pages/project/component/pagenation.js +142 -0
- package/dist-client/pages/project/component/pagenation.js.map +1 -0
- package/dist-client/pages/project/component/project-update-header.js +26 -3
- package/dist-client/pages/project/component/project-update-header.js.map +1 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +308 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +356 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +682 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +33 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js +676 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +1 -0
- package/dist-client/pages/project/popup/popup-plan-export.d.ts +10 -0
- package/dist-client/pages/project/popup/popup-plan-export.js +242 -0
- package/dist-client/pages/project/popup/popup-plan-export.js.map +1 -0
- package/dist-client/pages/project/popup/popup-plan-upload.d.ts +3 -0
- package/dist-client/pages/project/popup/popup-plan-upload.js +130 -4
- package/dist-client/pages/project/popup/popup-plan-upload.js.map +1 -1
- package/dist-client/pages/project/popup/popup-project-create.js.map +1 -1
- package/dist-client/pages/project/popup/{popup-schedule-upload.d.ts → popup-task-upload.d.ts} +1 -1
- package/dist-client/pages/project/popup/{popup-schedule-upload.js → popup-task-upload.js} +9 -9
- package/dist-client/pages/project/popup/popup-task-upload.js.map +1 -0
- package/dist-client/pages/project/project-completed-list.d.ts +5 -0
- package/dist-client/pages/project/project-completed-list.js +32 -4
- package/dist-client/pages/project/project-completed-list.js.map +1 -1
- package/dist-client/pages/project/project-detail.d.ts +8 -1
- package/dist-client/pages/project/project-detail.js +488 -163
- package/dist-client/pages/project/project-detail.js.map +1 -1
- package/dist-client/pages/project/project-list.d.ts +69 -0
- package/dist-client/pages/project/project-list.js +94 -16
- package/dist-client/pages/project/project-list.js.map +1 -1
- package/dist-client/pages/project/project-plan-management.js +35 -14
- package/dist-client/pages/project/project-plan-management.js.map +1 -1
- package/dist-client/pages/project/project-setting-list.d.ts +7 -0
- package/dist-client/pages/project/project-setting-list.js +82 -27
- package/dist-client/pages/project/project-setting-list.js.map +1 -1
- package/dist-client/pages/project/{project-schedule-list.d.ts → project-task-list.d.ts} +2 -2
- package/dist-client/pages/project/{project-schedule-list.js → project-task-list.js} +11 -11
- package/dist-client/pages/project/project-task-list.js.map +1 -0
- package/dist-client/pages/project/{project-schedule.d.ts → project-task.d.ts} +17 -4
- package/dist-client/pages/project/project-task.js +692 -0
- package/dist-client/pages/project/project-task.js.map +1 -0
- package/dist-client/pages/project/project-update.d.ts +35 -0
- package/dist-client/pages/project/project-update.js +633 -49
- package/dist-client/pages/project/project-update.js.map +1 -1
- package/dist-client/pages/resource/construction-detail-type-popup.js.map +1 -1
- package/dist-client/pages/resource/construction-type-management.js +14 -0
- package/dist-client/pages/resource/construction-type-management.js.map +1 -1
- package/dist-client/pages/resource/inspection-drawing-type-management.js.map +1 -1
- package/dist-client/pages/resource/inspection-part-popup.js.map +1 -1
- package/dist-client/pages/resource/resource-importer.js.map +1 -1
- package/dist-client/pages/resource/resource-list-page.d.ts +1 -2
- package/dist-client/pages/resource/resource-list-page.js +1 -2
- package/dist-client/pages/resource/resource-list-page.js.map +1 -1
- package/dist-client/pages/resource/worker-type-management.js.map +1 -1
- package/dist-client/pages/task/task-importer.js.map +1 -1
- package/dist-client/pages/task/task-list-page.d.ts +1 -2
- package/dist-client/pages/task/task-list-page.js +1 -2
- package/dist-client/pages/task/task-list-page.js.map +1 -1
- package/dist-client/pages/task-resource/task-resource-importer.js.map +1 -1
- package/dist-client/pages/task-resource/task-resource-list-page.d.ts +1 -2
- package/dist-client/pages/task-resource/task-resource-list-page.js +1 -2
- package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +4 -4
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/domain-context.d.ts +18 -0
- package/dist-client/shared/domain-context.js +28 -0
- package/dist-client/shared/domain-context.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/domain-switch.d.ts +19 -0
- package/dist-client/viewparts/domain-switch.js +274 -0
- package/dist-client/viewparts/domain-switch.js.map +1 -0
- package/dist-server/controllers/export-tasks.js +1 -2
- package/dist-server/controllers/export-tasks.js.map +1 -1
- package/dist-server/controllers/import-task.js +1 -2
- package/dist-server/controllers/import-task.js.map +1 -1
- package/dist-server/controllers/parse-excel.d.ts +0 -2
- package/dist-server/controllers/parse-excel.js +1 -2
- package/dist-server/controllers/parse-excel.js.map +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/1723861466413-seed-roles.js.map +1 -1
- package/dist-server/migrations/1723861466414-seed-codes.js +1 -1
- package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -1
- package/dist-server/migrations/1723861476419-seed-resources.js.map +1 -1
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +1 -1
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js +4 -4
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-mutation.js +2 -2
- package/dist-server/service/construction-type/construction-type-mutation.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-query.d.ts +2 -2
- package/dist-server/service/construction-type/construction-type-query.js +7 -12
- package/dist-server/service/construction-type/construction-type-query.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-type.d.ts +1 -0
- package/dist-server/service/construction-type/construction-type-type.js +8 -4
- package/dist-server/service/construction-type/construction-type-type.js.map +1 -1
- package/dist-server/service/construction-type/construction-type.d.ts +1 -0
- package/dist-server/service/construction-type/construction-type.js +7 -2
- package/dist-server/service/construction-type/construction-type.js.map +1 -1
- package/dist-server/service/index.d.ts +3 -2
- package/dist-server/service/index.js +6 -2
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +7 -12
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +4 -4
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-mutation.js +2 -2
- package/dist-server/service/inspection-part/inspection-part-mutation.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-query.js +2 -2
- package/dist-server/service/inspection-part/inspection-part-query.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-type.js +4 -4
- package/dist-server/service/inspection-part/inspection-part-type.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part.js +2 -2
- package/dist-server/service/inspection-part/inspection-part.js.map +1 -1
- package/dist-server/service/manager/index.d.ts +2 -0
- package/dist-server/service/manager/index.js +3 -1
- package/dist-server/service/manager/index.js.map +1 -1
- package/dist-server/service/manager/manager-mutation.js +2 -2
- package/dist-server/service/manager/manager-mutation.js.map +1 -1
- package/dist-server/service/manager/manager-query.d.ts +1 -1
- package/dist-server/service/manager/manager-query.js +5 -9
- package/dist-server/service/manager/manager-query.js.map +1 -1
- package/dist-server/service/manager/manager-type.js +4 -4
- package/dist-server/service/manager/manager-type.js.map +1 -1
- package/dist-server/service/manager/manager.js +2 -2
- package/dist-server/service/manager/manager.js.map +1 -1
- package/dist-server/service/project/issue-project-code.d.ts +7 -0
- package/dist-server/service/project/issue-project-code.js +27 -0
- package/dist-server/service/project/issue-project-code.js.map +1 -0
- package/dist-server/service/project/project-mutation.d.ts +3 -0
- package/dist-server/service/project/project-mutation.js +231 -24
- package/dist-server/service/project/project-mutation.js.map +1 -1
- package/dist-server/service/project/project-query.d.ts +14 -2
- package/dist-server/service/project/project-query.js +167 -16
- package/dist-server/service/project/project-query.js.map +1 -1
- package/dist-server/service/project/project-type.d.ts +14 -2
- package/dist-server/service/project/project-type.js +57 -11
- package/dist-server/service/project/project-type.js.map +1 -1
- package/dist-server/service/project/project.d.ts +29 -0
- package/dist-server/service/project/project.js +103 -5
- package/dist-server/service/project/project.js.map +1 -1
- package/dist-server/service/resource/resource-mutation.js +7 -8
- package/dist-server/service/resource/resource-mutation.js.map +1 -1
- package/dist-server/service/resource/resource-query.d.ts +2 -2
- package/dist-server/service/resource/resource-query.js +7 -12
- package/dist-server/service/resource/resource-query.js.map +1 -1
- package/dist-server/service/resource/resource-type.js +6 -6
- package/dist-server/service/resource/resource-type.js.map +1 -1
- package/dist-server/service/resource/resource.js +3 -3
- package/dist-server/service/resource/resource.js.map +1 -1
- package/dist-server/service/task/task-mutation.js +2 -2
- package/dist-server/service/task/task-mutation.js.map +1 -1
- package/dist-server/service/task/task-query.d.ts +2 -0
- package/dist-server/service/task/task-query.js +15 -4
- package/dist-server/service/task/task-query.js.map +1 -1
- package/dist-server/service/task/task-type.js +10 -10
- package/dist-server/service/task/task-type.js.map +1 -1
- package/dist-server/service/task/task.d.ts +2 -0
- package/dist-server/service/task/task.js +13 -8
- package/dist-server/service/task/task.js.map +1 -1
- package/dist-server/service/task-checklist-binding/index.d.ts +5 -0
- package/dist-server/service/task-checklist-binding/index.js +9 -0
- package/dist-server/service/task-checklist-binding/index.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +5 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +188 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +8 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +61 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +15 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +57 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +22 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js +106 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-mutation.js +2 -2
- package/dist-server/service/task-resource/task-resource-mutation.js.map +1 -1
- package/dist-server/service/task-resource/task-resource-query.d.ts +2 -2
- package/dist-server/service/task-resource/task-resource-query.js +6 -11
- package/dist-server/service/task-resource/task-resource-query.js.map +1 -1
- package/dist-server/service/task-resource/task-resource-type.js +6 -6
- package/dist-server/service/task-resource/task-resource-type.js.map +1 -1
- package/dist-server/service/task-resource/task-resource.js +2 -2
- package/dist-server/service/task-resource/task-resource.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-mutation.js +2 -2
- package/dist-server/service/worker-type/worker-type-mutation.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-query.d.ts +2 -2
- package/dist-server/service/worker-type/worker-type-query.js +7 -12
- package/dist-server/service/worker-type/worker-type-query.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-type.js +4 -4
- package/dist-server/service/worker-type/worker-type-type.js.map +1 -1
- package/dist-server/service/worker-type/worker-type.js +2 -2
- package/dist-server/service/worker-type/worker-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -11
- package/things-factory.config.js +3 -3
- package/translations/en.json +10 -9
- package/translations/ja.json +15 -1
- package/translations/ko.json +3 -0
- package/translations/ms.json +15 -1
- package/translations/zh.json +15 -1
- package/dist-client/pages/project/popup/popup-schedule-upload.js.map +0 -1
- package/dist-client/pages/project/project-schedule-list.js.map +0 -1
- package/dist-client/pages/project/project-schedule.js +0 -407
- package/dist-client/pages/project/project-schedule.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Project = exports.ProjectState = void 0;
|
|
3
|
+
exports.Project = exports.SectorType = exports.BuildingUsage = exports.ProjectType = exports.InputType = exports.ProjectState = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
@@ -13,9 +13,43 @@ var ProjectState;
|
|
|
13
13
|
(function (ProjectState) {
|
|
14
14
|
ProjectState["ONGOING"] = "10";
|
|
15
15
|
ProjectState["COMPLETED"] = "20";
|
|
16
|
-
})(ProjectState
|
|
16
|
+
})(ProjectState || (exports.ProjectState = ProjectState = {}));
|
|
17
|
+
var InputType;
|
|
18
|
+
(function (InputType) {
|
|
19
|
+
InputType["MANUAL"] = "10";
|
|
20
|
+
InputType["AUTO"] = "20";
|
|
21
|
+
})(InputType || (exports.InputType = InputType = {}));
|
|
22
|
+
var ProjectType;
|
|
23
|
+
(function (ProjectType) {
|
|
24
|
+
ProjectType["DSSP"] = "DSSP";
|
|
25
|
+
ProjectType["DCSP"] = "DCSP";
|
|
26
|
+
ProjectType["DKPI"] = "DKPI";
|
|
27
|
+
})(ProjectType || (exports.ProjectType = ProjectType = {}));
|
|
28
|
+
var BuildingUsage;
|
|
29
|
+
(function (BuildingUsage) {
|
|
30
|
+
BuildingUsage["RESIDENTIAL"] = "RESIDENTIAL";
|
|
31
|
+
BuildingUsage["NON_RESIDENTIAL"] = "NON_RESIDENTIAL";
|
|
32
|
+
})(BuildingUsage || (exports.BuildingUsage = BuildingUsage = {}));
|
|
33
|
+
var SectorType;
|
|
34
|
+
(function (SectorType) {
|
|
35
|
+
SectorType["PUBLIC"] = "PUBLIC";
|
|
36
|
+
SectorType["PRIVATE"] = "PRIVATE";
|
|
37
|
+
})(SectorType || (exports.SectorType = SectorType = {}));
|
|
38
|
+
(0, type_graphql_1.registerEnumType)(BuildingUsage, {
|
|
39
|
+
name: 'BuildingUsage',
|
|
40
|
+
description: '건물 용도 (주거/비주거)'
|
|
41
|
+
});
|
|
42
|
+
(0, type_graphql_1.registerEnumType)(SectorType, {
|
|
43
|
+
name: 'SectorType',
|
|
44
|
+
description: '발주 유형 (공공/민간)'
|
|
45
|
+
});
|
|
46
|
+
(0, type_graphql_1.registerEnumType)(ProjectState, {
|
|
47
|
+
name: 'ProjectState',
|
|
48
|
+
description: '프로젝트 상태 (ONGOING=10 진행중, COMPLETED=20 완료)'
|
|
49
|
+
});
|
|
17
50
|
let Project = class Project {
|
|
18
51
|
};
|
|
52
|
+
exports.Project = Project;
|
|
19
53
|
tslib_1.__decorate([
|
|
20
54
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
55
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -30,16 +64,35 @@ tslib_1.__decorate([
|
|
|
30
64
|
(0, typeorm_1.RelationId)((project) => project.domain),
|
|
31
65
|
tslib_1.__metadata("design:type", String)
|
|
32
66
|
], Project.prototype, "domainId", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({
|
|
69
|
+
nullable: true,
|
|
70
|
+
unique: true,
|
|
71
|
+
comment: '프로젝트 관리번호 (YYYY-NNNNN, 테넌트 승격 시 자동 발번, 정책상 변경 불가 - promoteProjectToTenant 만이 설정)'
|
|
72
|
+
}),
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], Project.prototype, "code", void 0);
|
|
33
76
|
tslib_1.__decorate([
|
|
34
77
|
(0, typeorm_1.Column)({ nullable: false, comment: '프로젝트 이름' }),
|
|
35
78
|
(0, type_graphql_1.Field)({ nullable: false }),
|
|
36
79
|
tslib_1.__metadata("design:type", String)
|
|
37
80
|
], Project.prototype, "name", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '문서 네이밍 ({프로젝트 명} 검측 제00-00001호)' }),
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
+
tslib_1.__metadata("design:type", String)
|
|
85
|
+
], Project.prototype, "documentNaming", void 0);
|
|
38
86
|
tslib_1.__decorate([
|
|
39
87
|
(0, typeorm_1.Column)({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' }),
|
|
40
88
|
(0, type_graphql_1.Field)({ nullable: false }),
|
|
41
89
|
tslib_1.__metadata("design:type", String)
|
|
42
90
|
], Project.prototype, "state", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '현장 시방서 PDF URL - 검사기준 매칭 API의 site_spec_pdf_url 로 사용 (https 전체 URL)' }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], Project.prototype, "siteSpecPdfUrl", void 0);
|
|
43
96
|
tslib_1.__decorate([
|
|
44
97
|
(0, typeorm_1.Column)({ type: 'date', nullable: true, comment: '착공일정' }),
|
|
45
98
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -84,6 +137,41 @@ tslib_1.__decorate([
|
|
|
84
137
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
85
138
|
tslib_1.__metadata("design:type", Number)
|
|
86
139
|
], Project.prototype, "structuralSafetyRate", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true, default: 0, comment: '로봇 작업 대수' }),
|
|
142
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
143
|
+
tslib_1.__metadata("design:type", Number)
|
|
144
|
+
], Project.prototype, "robotCount", void 0);
|
|
145
|
+
tslib_1.__decorate([
|
|
146
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '우편 코드 (5자리)' }),
|
|
147
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
148
|
+
tslib_1.__metadata("design:type", String)
|
|
149
|
+
], Project.prototype, "postalCode", void 0);
|
|
150
|
+
tslib_1.__decorate([
|
|
151
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '지역 구분 코드 (우편 코드의 앞 2자리)' }),
|
|
152
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
153
|
+
tslib_1.__metadata("design:type", String)
|
|
154
|
+
], Project.prototype, "geoGroup", void 0);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '프로젝트 유형' }),
|
|
157
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
158
|
+
tslib_1.__metadata("design:type", String)
|
|
159
|
+
], Project.prototype, "projectType", void 0);
|
|
160
|
+
tslib_1.__decorate([
|
|
161
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '입력 유형 (MANUAL: 수동, AUTO: 자동)' }),
|
|
162
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
163
|
+
tslib_1.__metadata("design:type", String)
|
|
164
|
+
], Project.prototype, "inputType", void 0);
|
|
165
|
+
tslib_1.__decorate([
|
|
166
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '건물 용도 (RESIDENTIAL: 주거, NON_RESIDENTIAL: 비주거)' }),
|
|
167
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
168
|
+
tslib_1.__metadata("design:type", String)
|
|
169
|
+
], Project.prototype, "buildingUsage", void 0);
|
|
170
|
+
tslib_1.__decorate([
|
|
171
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, comment: '발주 유형 (PUBLIC: 공공, PRIVATE: 민간)' }),
|
|
172
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
173
|
+
tslib_1.__metadata("design:type", String)
|
|
174
|
+
], Project.prototype, "sectorType", void 0);
|
|
87
175
|
tslib_1.__decorate([
|
|
88
176
|
(0, typeorm_1.OneToOne)(type => building_complex_1.BuildingComplex),
|
|
89
177
|
(0, typeorm_1.JoinColumn)(),
|
|
@@ -138,12 +226,22 @@ tslib_1.__decorate([
|
|
|
138
226
|
], Project.prototype, "updaterId", void 0);
|
|
139
227
|
tslib_1.__decorate([
|
|
140
228
|
(0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
|
|
141
|
-
tslib_1.__metadata("design:type", attachment_base_1.Attachment
|
|
229
|
+
tslib_1.__metadata("design:type", attachment_base_1.Attachment
|
|
230
|
+
// 완공 보고서 파일
|
|
231
|
+
)
|
|
142
232
|
], Project.prototype, "scheduleTable", void 0);
|
|
143
|
-
|
|
233
|
+
tslib_1.__decorate([
|
|
234
|
+
(0, typeorm_1.ManyToOne)(type => attachment_base_1.Attachment),
|
|
235
|
+
(0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
|
|
236
|
+
tslib_1.__metadata("design:type", attachment_base_1.Attachment)
|
|
237
|
+
], Project.prototype, "completeReport", void 0);
|
|
238
|
+
tslib_1.__decorate([
|
|
239
|
+
(0, typeorm_1.RelationId)((project) => project.completeReport),
|
|
240
|
+
tslib_1.__metadata("design:type", String)
|
|
241
|
+
], Project.prototype, "completeReportId", void 0);
|
|
242
|
+
exports.Project = Project = tslib_1.__decorate([
|
|
144
243
|
(0, type_graphql_1.ObjectType)({ description: '프로젝트' }),
|
|
145
244
|
(0, typeorm_1.Entity)(),
|
|
146
245
|
(0, typeorm_1.Index)('ix_project_building', (project) => [project.buildingComplex], { unique: true, where: '"deleted_at" IS NULL' })
|
|
147
246
|
], Project);
|
|
148
|
-
exports.Project = Project;
|
|
149
247
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../server/service/project/project.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAoD;AAEpD,iDAAgE;AAChE,yDAAgD;AAChD,uCAAmC;AACnC,6DAAwD;AACxD,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ateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToOne,\n OneToMany,\n JoinColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, roundTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Task } from '../task/task'\nimport { BuildingComplex } from '@dssp/building-complex'\nimport { Attachment } from '@things-factory/attachment-base'\n\nexport enum ProjectState {\n 'ONGOING' = '10',\n 'COMPLETED' = '20'\n}\n\n@ObjectType({ description: '프로젝트' })\n@Entity()\n@Index('ix_project_building', (project: Project) => [project.buildingComplex], { unique: true, where: '\"deleted_at\" IS NULL' })\nexport class Project {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((project: Project) => project.domain)\n domainId?: string\n\n @Column({ nullable: false, comment: '프로젝트 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' })\n @Field({ nullable: false })\n state?: ProjectState\n\n @Column({ type: 'date', nullable: true, comment: '착공일정' })\n @Field({ nullable: true })\n startDate?: string\n\n @Column({ type: 'date', nullable: true, comment: '준공일정' })\n @Field({ nullable: true })\n endDate?: string\n\n // 대표 사진\n @Field(type => Attachment, { nullable: true })\n mainPhoto?: Attachment\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '전체 진행현황' })\n @Field({ nullable: true })\n totalProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '주간 진행현황' })\n @Field({ nullable: true })\n weeklyProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: 'KPI' })\n @Field({ nullable: true })\n kpi?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '검측/통과 비율' })\n @Field({ nullable: true })\n inspPassRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '로봇 작업 진행율' })\n @Field({ nullable: true })\n robotProgressRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '구조 안전도' })\n @Field({ nullable: true })\n structuralSafetyRate?: number\n\n // 단지 정보 (1:1 테이블 참조)\n @OneToOne(type => BuildingComplex)\n @JoinColumn()\n @Field({ nullable: true })\n buildingComplex?: BuildingComplex\n\n @RelationId((project: Project) => project.buildingComplex)\n buildingComplexId?: string\n\n // 작업 정보 (하위 테이블 참조)\n @OneToMany(() => Task, task => task.project)\n @Field(() => [Task], { nullable: true })\n tasks?: Task[]\n\n // 루트 작업 정보 (부모가 없는 상위 작업)\n @Field(() => [Task], { nullable: true })\n rootTasks?: Task[]\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((project: Project) => project.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((project: Project) => project.updater)\n updaterId?: string\n\n // 공정표 파일\n @Field(type => Attachment, { nullable: true })\n scheduleTable?: Attachment\n}\n"]}
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../server/service/project/project.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAsE;AAEtE,iDAAgE;AAChE,yDAAgD;AAChD,uCAAmC;AACnC,6DAAwD;AACxD,qEAA4D;AAE5D,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAgB,CAAA;IAChB,gCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,4BAAZ,YAAY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IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;;iDAChC;kBA1Jd,OAAO;IAHnB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACnC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;GAClH,OAAO,CA2JnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToOne,\n OneToMany,\n JoinColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain, roundTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Task } from '../task/task'\nimport { BuildingComplex } from '@dssp/building-complex'\nimport { Attachment } from '@things-factory/attachment-base'\n\nexport enum ProjectState {\n 'ONGOING' = '10',\n 'COMPLETED' = '20'\n}\nexport enum InputType {\n MANUAL = '10',\n AUTO = '20'\n}\nexport enum ProjectType {\n DSSP = 'DSSP',\n DCSP = 'DCSP',\n DKPI = 'DKPI'\n}\n\nexport enum BuildingUsage {\n RESIDENTIAL = 'RESIDENTIAL',\n NON_RESIDENTIAL = 'NON_RESIDENTIAL'\n}\n\nexport enum SectorType {\n PUBLIC = 'PUBLIC',\n PRIVATE = 'PRIVATE'\n}\n\nregisterEnumType(BuildingUsage, {\n name: 'BuildingUsage',\n description: '건물 용도 (주거/비주거)'\n})\n\nregisterEnumType(SectorType, {\n name: 'SectorType',\n description: '발주 유형 (공공/민간)'\n})\n\nregisterEnumType(ProjectState, {\n name: 'ProjectState',\n description: '프로젝트 상태 (ONGOING=10 진행중, COMPLETED=20 완료)'\n})\n\n@ObjectType({ description: '프로젝트' })\n@Entity()\n@Index('ix_project_building', (project: Project) => [project.buildingComplex], { unique: true, where: '\"deleted_at\" IS NULL' })\nexport class Project {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((project: Project) => project.domain)\n domainId?: string\n\n @Column({\n nullable: true,\n unique: true,\n comment: '프로젝트 관리번호 (YYYY-NNNNN, 테넌트 승격 시 자동 발번, 정책상 변경 불가 - promoteProjectToTenant 만이 설정)'\n })\n @Field({ nullable: true })\n code?: string\n\n @Column({ nullable: false, comment: '프로젝트 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: true, comment: '문서 네이밍 ({프로젝트 명} 검측 제00-00001호)' })\n @Field({ nullable: true })\n documentNaming?: string\n\n @Column({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' })\n @Field({ nullable: false })\n state?: ProjectState\n\n @Column({ type: 'text', nullable: true, comment: '현장 시방서 PDF URL - 검사기준 매칭 API의 site_spec_pdf_url 로 사용 (https 전체 URL)' })\n @Field({ nullable: true })\n siteSpecPdfUrl?: string\n\n @Column({ type: 'date', nullable: true, comment: '착공일정' })\n @Field({ nullable: true })\n startDate?: string\n\n @Column({ type: 'date', nullable: true, comment: '준공일정' })\n @Field({ nullable: true })\n endDate?: string\n\n // 대표 사진\n @Field(type => Attachment, { nullable: true })\n mainPhoto?: Attachment\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '전체 진행현황' })\n @Field({ nullable: true })\n totalProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '주간 진행현황' })\n @Field({ nullable: true })\n weeklyProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: 'KPI' })\n @Field({ nullable: true })\n kpi?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '검측/통과 비율' })\n @Field({ nullable: true })\n inspPassRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '로봇 작업 진행율' })\n @Field({ nullable: true })\n robotProgressRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '구조 안전도' })\n @Field({ nullable: true })\n structuralSafetyRate?: number\n\n @Column({ type: 'int', nullable: true, default: 0, comment: '로봇 작업 대수' })\n @Field({ nullable: true })\n robotCount?: number\n\n @Column({ type: 'text', nullable: true, comment: '우편 코드 (5자리)' })\n @Field({ nullable: true })\n postalCode?: string\n\n @Column({ type: 'text', nullable: true, comment: '지역 구분 코드 (우편 코드의 앞 2자리)' })\n @Field({ nullable: true })\n geoGroup?: string\n\n @Column({ type: 'text', nullable: true, comment: '프로젝트 유형' })\n @Field({ nullable: true })\n projectType?: ProjectType\n\n @Column({ type: 'text', nullable: true, comment: '입력 유형 (MANUAL: 수동, AUTO: 자동)' })\n @Field({ nullable: true })\n inputType?: InputType\n\n @Column({ type: 'text', nullable: true, comment: '건물 용도 (RESIDENTIAL: 주거, NON_RESIDENTIAL: 비주거)' })\n @Field({ nullable: true })\n buildingUsage?: BuildingUsage\n\n @Column({ type: 'text', nullable: true, comment: '발주 유형 (PUBLIC: 공공, PRIVATE: 민간)' })\n @Field({ nullable: true })\n sectorType?: SectorType\n\n // 단지 정보 (1:1 테이블 참조)\n @OneToOne(type => BuildingComplex)\n @JoinColumn()\n @Field({ nullable: true })\n buildingComplex?: BuildingComplex\n\n @RelationId((project: Project) => project.buildingComplex)\n buildingComplexId?: string\n\n // 작업 정보 (하위 테이블 참조)\n @OneToMany(() => Task, task => task.project)\n @Field(() => [Task], { nullable: true })\n tasks?: Task[]\n\n // 루트 작업 정보 (부모가 없는 상위 작업)\n @Field(() => [Task], { nullable: true })\n rootTasks?: Task[]\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((project: Project) => project.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((project: Project) => project.updater)\n updaterId?: string\n\n // 공정표 파일\n @Field(type => Attachment, { nullable: true })\n scheduleTable?: Attachment\n\n // 완공 보고서 파일\n @ManyToOne(type => Attachment)\n @Field(type => Attachment, { nullable: true })\n completeReport?: Attachment\n\n @RelationId((project: Project) => project.completeReport)\n completeReportId?: string\n}\n"]}
|
|
@@ -13,10 +13,10 @@ let ResourceMutation = class ResourceMutation {
|
|
|
13
13
|
return result;
|
|
14
14
|
}
|
|
15
15
|
async updateResource(id, patch, context) {
|
|
16
|
-
const {
|
|
16
|
+
const { user, tx } = context.state;
|
|
17
17
|
const repository = tx.getRepository(resource_1.Resource);
|
|
18
18
|
const resource = await repository.findOne({
|
|
19
|
-
where: {
|
|
19
|
+
where: { id }
|
|
20
20
|
});
|
|
21
21
|
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, resource), patch), { updater: user }));
|
|
22
22
|
return result;
|
|
@@ -45,14 +45,13 @@ let ResourceMutation = class ResourceMutation {
|
|
|
45
45
|
return results;
|
|
46
46
|
}
|
|
47
47
|
async deleteResource(id, context) {
|
|
48
|
-
const {
|
|
49
|
-
await tx.getRepository(resource_1.Resource).delete({
|
|
48
|
+
const { tx } = context.state;
|
|
49
|
+
await tx.getRepository(resource_1.Resource).delete({ id });
|
|
50
50
|
return true;
|
|
51
51
|
}
|
|
52
52
|
async deleteResources(ids, context) {
|
|
53
|
-
const {
|
|
53
|
+
const { tx } = context.state;
|
|
54
54
|
await tx.getRepository(resource_1.Resource).delete({
|
|
55
|
-
domain: { id: domain.id },
|
|
56
55
|
id: (0, typeorm_1.In)(ids)
|
|
57
56
|
});
|
|
58
57
|
return true;
|
|
@@ -65,6 +64,7 @@ let ResourceMutation = class ResourceMutation {
|
|
|
65
64
|
return true;
|
|
66
65
|
}
|
|
67
66
|
};
|
|
67
|
+
exports.ResourceMutation = ResourceMutation;
|
|
68
68
|
tslib_1.__decorate([
|
|
69
69
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
70
70
|
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
@@ -125,8 +125,7 @@ tslib_1.__decorate([
|
|
|
125
125
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
126
126
|
tslib_1.__metadata("design:returntype", Promise)
|
|
127
127
|
], ResourceMutation.prototype, "importResources", null);
|
|
128
|
-
ResourceMutation = tslib_1.__decorate([
|
|
128
|
+
exports.ResourceMutation = ResourceMutation = tslib_1.__decorate([
|
|
129
129
|
(0, type_graphql_1.Resolver)(resource_1.Resource)
|
|
130
130
|
], ResourceMutation);
|
|
131
|
-
exports.ResourceMutation = ResourceMutation;
|
|
132
131
|
//# sourceMappingURL=resource-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-mutation.js","sourceRoot":"","sources":["../../../server/service/resource/resource-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAqC;AACrC,mDAA4D;AAGrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,IAAI,iCAC/C,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAA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IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAQxE;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,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,6BAAa,CAAC,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAWP;2BA/HU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAgI5B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Resource } from './resource'\nimport { NewResource, ResourcePatch } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Resource, { description: 'To create new Resource' })\n async createResource(@Arg('resource') resource: NewResource, @Ctx() context: ResolverContext): Promise<Resource> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Resource).save({\n ...resource,\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 => Resource, { description: 'To modify Resource information' })\n async updateResource(\n @Arg('id') id: string,\n @Arg('patch') patch: ResourcePatch,\n @Ctx() context: ResolverContext\n ): Promise<Resource> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(Resource)\n const resource = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...resource,\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 => [Resource], { description: \"To modify multiple Resources' information\" })\n async updateMultipleResource(\n @Arg('patches', type => [ResourcePatch]) patches: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Resource[]> {\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 resourceRepo = tx.getRepository(Resource)\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 resourceRepo.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 resource = await resourceRepo.findOneBy({ id: updateRecord.id })\n\n const result = await resourceRepo.save({\n ...resource,\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 Resource' })\n async deleteResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Resource).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Resources' })\n async deleteResources(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Resource).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 Resources' })\n async importResources(\n @Arg('resources', type => [ResourcePatch]) resources: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n resources.map(async (resource: ResourcePatch) => {\n const createdResource: Resource = await tx.getRepository(Resource).save({ domain, ...resource })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -3,8 +3,8 @@ import { User } from '@things-factory/auth-base';
|
|
|
3
3
|
import { Resource } from './resource';
|
|
4
4
|
import { ResourceList } from './resource-type';
|
|
5
5
|
export declare class ResourceQuery {
|
|
6
|
-
resource(id: string
|
|
7
|
-
resources(params: ListParam
|
|
6
|
+
resource(id: string): Promise<Resource>;
|
|
7
|
+
resources(params: ListParam): Promise<ResourceList>;
|
|
8
8
|
domain(resource: Resource): Promise<Domain>;
|
|
9
9
|
updater(resource: Resource): Promise<User>;
|
|
10
10
|
creator(resource: Resource): Promise<User>;
|
|
@@ -8,16 +8,13 @@ const auth_base_1 = require("@things-factory/auth-base");
|
|
|
8
8
|
const resource_1 = require("./resource");
|
|
9
9
|
const resource_type_1 = require("./resource-type");
|
|
10
10
|
let ResourceQuery = class ResourceQuery {
|
|
11
|
-
async resource(id
|
|
12
|
-
const { domain } = context.state;
|
|
11
|
+
async resource(id) {
|
|
13
12
|
return await (0, shell_1.getRepository)(resource_1.Resource).findOne({
|
|
14
|
-
where: {
|
|
13
|
+
where: { id }
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
|
-
async resources(params
|
|
18
|
-
const { domain } = context.state;
|
|
16
|
+
async resources(params) {
|
|
19
17
|
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
20
|
-
domain,
|
|
21
18
|
params,
|
|
22
19
|
repository: await (0, shell_1.getRepository)(resource_1.Resource),
|
|
23
20
|
searchables: ['name', 'description']
|
|
@@ -35,22 +32,21 @@ let ResourceQuery = class ResourceQuery {
|
|
|
35
32
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: resource.creatorId });
|
|
36
33
|
}
|
|
37
34
|
};
|
|
35
|
+
exports.ResourceQuery = ResourceQuery;
|
|
38
36
|
tslib_1.__decorate([
|
|
39
37
|
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
40
38
|
(0, type_graphql_1.Query)(returns => resource_1.Resource, { nullable: true, description: 'To fetch a Resource' }),
|
|
41
39
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
42
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
43
40
|
tslib_1.__metadata("design:type", Function),
|
|
44
|
-
tslib_1.__metadata("design:paramtypes", [String
|
|
41
|
+
tslib_1.__metadata("design:paramtypes", [String]),
|
|
45
42
|
tslib_1.__metadata("design:returntype", Promise)
|
|
46
43
|
], ResourceQuery.prototype, "resource", null);
|
|
47
44
|
tslib_1.__decorate([
|
|
48
45
|
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
49
46
|
(0, type_graphql_1.Query)(returns => resource_type_1.ResourceList, { description: 'To fetch multiple Resources' }),
|
|
50
47
|
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
51
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
52
48
|
tslib_1.__metadata("design:type", Function),
|
|
53
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam
|
|
49
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam]),
|
|
54
50
|
tslib_1.__metadata("design:returntype", Promise)
|
|
55
51
|
], ResourceQuery.prototype, "resources", null);
|
|
56
52
|
tslib_1.__decorate([
|
|
@@ -74,8 +70,7 @@ tslib_1.__decorate([
|
|
|
74
70
|
tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
|
|
75
71
|
tslib_1.__metadata("design:returntype", Promise)
|
|
76
72
|
], ResourceQuery.prototype, "creator", null);
|
|
77
|
-
ResourceQuery = tslib_1.__decorate([
|
|
73
|
+
exports.ResourceQuery = ResourceQuery = tslib_1.__decorate([
|
|
78
74
|
(0, type_graphql_1.Resolver)(resource_1.Resource)
|
|
79
75
|
], ResourceQuery);
|
|
80
|
-
exports.ResourceQuery = ResourceQuery;
|
|
81
76
|
//# sourceMappingURL=resource-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-query.js","sourceRoot":"","sources":["../../../server/service/resource/resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAqC;AACrC,mDAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU
|
|
1
|
+
{"version":3,"file":"resource-query.js","sourceRoot":"","sources":["../../../server/service/resource/resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAqC;AACrC,mDAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU;QAClC,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB;QACvC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC;YACzC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC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,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;wBApCU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAqCzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Resource } from './resource'\nimport { ResourceList } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceQuery {\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Resource!, { nullable: true, description: 'To fetch a Resource' })\n async resource(@Arg('id') id: string): Promise<Resource> {\n return await getRepository(Resource).findOne({\n where: { id }\n })\n }\n\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ResourceList, { description: 'To fetch multiple Resources' })\n async resources(@Args() params: ListParam): Promise<ResourceList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(Resource),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() resource: Resource): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: resource.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.creatorId })\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const resource_1 = require("./resource");
|
|
7
7
|
let NewResource = class NewResource {
|
|
8
8
|
};
|
|
9
|
+
exports.NewResource = NewResource;
|
|
9
10
|
tslib_1.__decorate([
|
|
10
11
|
(0, type_graphql_1.Field)(),
|
|
11
12
|
tslib_1.__metadata("design:type", String)
|
|
@@ -18,12 +19,12 @@ tslib_1.__decorate([
|
|
|
18
19
|
(0, type_graphql_1.Field)(),
|
|
19
20
|
tslib_1.__metadata("design:type", String)
|
|
20
21
|
], NewResource.prototype, "unit", void 0);
|
|
21
|
-
NewResource = tslib_1.__decorate([
|
|
22
|
+
exports.NewResource = NewResource = tslib_1.__decorate([
|
|
22
23
|
(0, type_graphql_1.InputType)()
|
|
23
24
|
], NewResource);
|
|
24
|
-
exports.NewResource = NewResource;
|
|
25
25
|
let ResourcePatch = class ResourcePatch {
|
|
26
26
|
};
|
|
27
|
+
exports.ResourcePatch = ResourcePatch;
|
|
27
28
|
tslib_1.__decorate([
|
|
28
29
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
29
30
|
tslib_1.__metadata("design:type", String)
|
|
@@ -44,12 +45,12 @@ tslib_1.__decorate([
|
|
|
44
45
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
46
|
tslib_1.__metadata("design:type", String)
|
|
46
47
|
], ResourcePatch.prototype, "cuFlag", void 0);
|
|
47
|
-
ResourcePatch = tslib_1.__decorate([
|
|
48
|
+
exports.ResourcePatch = ResourcePatch = tslib_1.__decorate([
|
|
48
49
|
(0, type_graphql_1.InputType)()
|
|
49
50
|
], ResourcePatch);
|
|
50
|
-
exports.ResourcePatch = ResourcePatch;
|
|
51
51
|
let ResourceList = class ResourceList {
|
|
52
52
|
};
|
|
53
|
+
exports.ResourceList = ResourceList;
|
|
53
54
|
tslib_1.__decorate([
|
|
54
55
|
(0, type_graphql_1.Field)(type => [resource_1.Resource]),
|
|
55
56
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -58,8 +59,7 @@ tslib_1.__decorate([
|
|
|
58
59
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
59
60
|
tslib_1.__metadata("design:type", Number)
|
|
60
61
|
], ResourceList.prototype, "total", void 0);
|
|
61
|
-
ResourceList = tslib_1.__decorate([
|
|
62
|
+
exports.ResourceList = ResourceList = tslib_1.__decorate([
|
|
62
63
|
(0, type_graphql_1.ObjectType)()
|
|
63
64
|
], ResourceList);
|
|
64
|
-
exports.ResourceList = ResourceList;
|
|
65
65
|
//# sourceMappingURL=resource-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-type.js","sourceRoot":"","sources":["../../../server/service/resource/resource-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;
|
|
1
|
+
{"version":3,"file":"resource-type.js","sourceRoot":"","sources":["../../../server/service/resource/resource-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;AATY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,CAAC;;yCACV;AAGlB;IADC,IAAA,oBAAK,GAAE;;yCACI;sBARD,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CASvB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import { InputType, Field, ID, ObjectType, Int } from 'type-graphql'\nimport { Resource, ResourceType } from './resource'\n\n@InputType()\nexport class NewResource {\n @Field()\n name: string\n\n @Field(type => ResourceType)\n type: ResourceType\n\n @Field()\n unit: string\n}\n\n@InputType()\nexport class ResourcePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ResourceType, { nullable: true })\n type?: ResourceType\n\n @Field({ nullable: true })\n unit?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ResourceList {\n @Field(type => [Resource])\n items: Resource[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -12,13 +12,14 @@ var ResourceType;
|
|
|
12
12
|
ResourceType["HUMAN"] = "HUMAN";
|
|
13
13
|
ResourceType["MATERIAL"] = "MATERIAL";
|
|
14
14
|
ResourceType["EQUIPMENT"] = "EQUIPMENT";
|
|
15
|
-
})(ResourceType
|
|
15
|
+
})(ResourceType || (exports.ResourceType = ResourceType = {}));
|
|
16
16
|
(0, type_graphql_1.registerEnumType)(ResourceType, {
|
|
17
17
|
name: 'ResourceType',
|
|
18
18
|
description: '자원 유형'
|
|
19
19
|
});
|
|
20
20
|
let Resource = class Resource {
|
|
21
21
|
};
|
|
22
|
+
exports.Resource = Resource;
|
|
22
23
|
tslib_1.__decorate([
|
|
23
24
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
25
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -85,9 +86,8 @@ tslib_1.__decorate([
|
|
|
85
86
|
(0, typeorm_1.OneToMany)(() => task_resource_1.TaskResource, taskResource => taskResource.resource),
|
|
86
87
|
tslib_1.__metadata("design:type", Array)
|
|
87
88
|
], Resource.prototype, "taskResources", void 0);
|
|
88
|
-
Resource = tslib_1.__decorate([
|
|
89
|
+
exports.Resource = Resource = tslib_1.__decorate([
|
|
89
90
|
(0, typeorm_1.Entity)(),
|
|
90
91
|
(0, type_graphql_1.ObjectType)({ description: '자원' })
|
|
91
92
|
], Resource);
|
|
92
|
-
exports.Resource = Resource;
|
|
93
93
|
//# sourceMappingURL=resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../server/service/resource/resource.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAsE;AACtE,iDAA8C;AAC9C,yDAAgD;AAChD,kEAA6D;AAE7D,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../server/service/resource/resource.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAsE;AACtE,iDAA8C;AAC9C,yDAAgD;AAChD,kEAA6D;AAE7D,IAAY,YAIX;AAJD,WAAY,Y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DateColumn,\n Entity,\n Column,\n PrimaryGeneratedColumn,\n ManyToOne,\n RelationId,\n OneToMany\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaskResource } from '../task-resource/task-resource'\n\nexport enum ResourceType {\n HUMAN = 'HUMAN',\n MATERIAL = 'MATERIAL',\n EQUIPMENT = 'EQUIPMENT'\n}\n\nregisterEnumType(ResourceType, {\n name: 'ResourceType',\n description: '자원 유형'\n})\n\n@Entity()\n@ObjectType({ description: '자원' })\nexport class Resource {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((resource: Resource) => resource.domain)\n domainId?: string\n\n @Column({ nullable: false, comment: '자원 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: false, default: ResourceType.HUMAN, comment: '자원 유형' })\n @Field({ nullable: false })\n type: ResourceType\n\n @Column({ nullable: false, comment: '단위 (예: man/day, kg, hour 등)' })\n @Field({ nullable: false })\n unit: string\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((resource: Resource) => resource.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((resource: Resource) => resource.updater)\n updaterId?: string\n\n @OneToMany(() => TaskResource, taskResource => taskResource.resource)\n taskResources?: TaskResource[]\n}\n"]}
|
|
@@ -67,6 +67,7 @@ let TaskMutation = class TaskMutation {
|
|
|
67
67
|
return true;
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
+
exports.TaskMutation = TaskMutation;
|
|
70
71
|
tslib_1.__decorate([
|
|
71
72
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
72
73
|
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
@@ -128,8 +129,7 @@ tslib_1.__decorate([
|
|
|
128
129
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
129
130
|
tslib_1.__metadata("design:returntype", Promise)
|
|
130
131
|
], TaskMutation.prototype, "importTasks", null);
|
|
131
|
-
TaskMutation = tslib_1.__decorate([
|
|
132
|
+
exports.TaskMutation = TaskMutation = tslib_1.__decorate([
|
|
132
133
|
(0, type_graphql_1.Resolver)(task_1.Task)
|
|
133
134
|
], TaskMutation);
|
|
134
|
-
exports.TaskMutation = TaskMutation;
|
|
135
135
|
//# sourceMappingURL=task-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-mutation.js","sourceRoot":"","sources":["../../../server/service/task/task-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,iCAA6B;AAC7B,2CAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAIjB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAa,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAC,IAAI,iCAC3C,IAAI,KACP,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAgB,KAAgB,EAAS,OAAwB;QACrG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,K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C,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAUpE;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,0BAA0B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC,CAAA;IAAsB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAU9E;uBA5HU,YAAY;IADxB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,YAAY,CA6HxB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { Task } from './task'\nimport { NewTask, TaskPatch } from './task-type'\n\n@Resolver(Task)\nexport class TaskMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Task, { description: 'To create new Task' })\n async createTask(@Arg('task') task: NewTask, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Task).save({\n ...task,\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 => Task, { description: 'To modify Task information' })\n async updateTask(@Arg('id') id: string, @Arg('patch') patch: TaskPatch, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Task)\n const task = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...task,\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 => [Task], { description: \"To modify multiple Tasks' information\" })\n async updateMultipleTask(\n @Arg('patches', type => [TaskPatch]) patches: TaskPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Task[]> {\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 taskRepo = tx.getRepository(Task)\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 taskRepo.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 task = await taskRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taskRepo.save({\n ...task,\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 Task' })\n async deleteTask(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\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 Tasks' })\n async deleteTasks(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\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 Tasks' })\n async importTasks(@Arg('tasks', type => [TaskPatch]) tasks: TaskPatch[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n tasks.map(async (task: TaskPatch) => {\n const createdTask: Task = await tx.getRepository(Task).save({ domain, ...task })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { User } from '@things-factory/auth-base';
|
|
|
3
3
|
import { Task } from './task';
|
|
4
4
|
import { TaskList } from './task-type';
|
|
5
5
|
import { TaskResource } from '../task-resource/task-resource';
|
|
6
|
+
import { TaskChecklistBinding } from '../task-checklist-binding/task-checklist-binding';
|
|
6
7
|
export declare class DigestedResource {
|
|
7
8
|
type?: string;
|
|
8
9
|
allocated?: number;
|
|
@@ -14,6 +15,7 @@ export declare class TaskQuery {
|
|
|
14
15
|
children(task: Task, params: ListParam, context: ResolverContext): Promise<Task[]>;
|
|
15
16
|
taskResources(task: Task): Promise<TaskResource[]>;
|
|
16
17
|
resources(task: Task): Promise<DigestedResource[]>;
|
|
18
|
+
taskChecklistBinding(task: Task): Promise<TaskChecklistBinding>;
|
|
17
19
|
updater(task: Task): Promise<User>;
|
|
18
20
|
creator(task: Task): Promise<User>;
|
|
19
21
|
}
|