@dssp/project 0.0.2
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/CHANGELOG.md +8 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/assets/images/o-mark.png +0 -0
- package/assets/images/x-mark.png +0 -0
- package/client/bootstrap.ts +0 -0
- package/client/index.ts +0 -0
- package/client/pages/checklist/checklist-importer.ts +96 -0
- package/client/pages/checklist/checklist-list-page.ts +355 -0
- package/client/pages/lib/waether.ts +159 -0
- package/client/pages/project/ox-progress-circle.ts +133 -0
- package/client/pages/project/project-create-popup.ts +148 -0
- package/client/pages/project/project-detail.ts +618 -0
- package/client/pages/project/project-list.ts +354 -0
- package/client/pages/project/project-plan-management.ts +437 -0
- package/client/pages/project/project-schedule-list.ts +280 -0
- package/client/pages/project/project-schedule.ts +248 -0
- package/client/pages/project/project-setting-list.ts +298 -0
- package/client/pages/project/project-update.ts +797 -0
- package/client/pages/resource/resource-importer.ts +96 -0
- package/client/pages/resource/resource-list-page.ts +355 -0
- package/client/pages/task/task-importer.ts +96 -0
- package/client/pages/task/task-list-page.ts +355 -0
- package/client/route.ts +39 -0
- package/client/tsconfig.json +11 -0
- package/dist-client/bootstrap.d.ts +0 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/checklist/checklist-importer.d.ts +9 -0
- package/dist-client/pages/checklist/checklist-importer.js +100 -0
- package/dist-client/pages/checklist/checklist-importer.js.map +1 -0
- package/dist-client/pages/checklist/checklist-list-page.d.ts +62 -0
- package/dist-client/pages/checklist/checklist-list-page.js +331 -0
- package/dist-client/pages/checklist/checklist-list-page.js.map +1 -0
- package/dist-client/pages/lib/waether.d.ts +6 -0
- package/dist-client/pages/lib/waether.js +152 -0
- package/dist-client/pages/lib/waether.js.map +1 -0
- package/dist-client/pages/project/ox-progress-circle.d.ts +41 -0
- package/dist-client/pages/project/ox-progress-circle.js +182 -0
- package/dist-client/pages/project/ox-progress-circle.js.map +1 -0
- package/dist-client/pages/project/project-create-popup.d.ts +14 -0
- package/dist-client/pages/project/project-create-popup.js +153 -0
- package/dist-client/pages/project/project-create-popup.js.map +1 -0
- package/dist-client/pages/project/project-detail.d.ts +35 -0
- package/dist-client/pages/project/project-detail.js +617 -0
- package/dist-client/pages/project/project-detail.js.map +1 -0
- package/dist-client/pages/project/project-list.d.ts +88 -0
- package/dist-client/pages/project/project-list.js +303 -0
- package/dist-client/pages/project/project-list.js.map +1 -0
- package/dist-client/pages/project/project-plan-management.d.ts +27 -0
- package/dist-client/pages/project/project-plan-management.js +438 -0
- package/dist-client/pages/project/project-plan-management.js.map +1 -0
- package/dist-client/pages/project/project-schedule-list.d.ts +18 -0
- package/dist-client/pages/project/project-schedule-list.js +292 -0
- package/dist-client/pages/project/project-schedule-list.js.map +1 -0
- package/dist-client/pages/project/project-schedule.d.ts +23 -0
- package/dist-client/pages/project/project-schedule.js +256 -0
- package/dist-client/pages/project/project-schedule.js.map +1 -0
- package/dist-client/pages/project/project-setting-list.d.ts +23 -0
- package/dist-client/pages/project/project-setting-list.js +307 -0
- package/dist-client/pages/project/project-setting-list.js.map +1 -0
- package/dist-client/pages/project/project-update.d.ts +24 -0
- package/dist-client/pages/project/project-update.js +797 -0
- package/dist-client/pages/project/project-update.js.map +1 -0
- package/dist-client/pages/resource/resource-importer.d.ts +9 -0
- package/dist-client/pages/resource/resource-importer.js +100 -0
- package/dist-client/pages/resource/resource-importer.js.map +1 -0
- package/dist-client/pages/resource/resource-list-page.d.ts +62 -0
- package/dist-client/pages/resource/resource-list-page.js +331 -0
- package/dist-client/pages/resource/resource-list-page.js.map +1 -0
- package/dist-client/pages/task/task-importer.d.ts +9 -0
- package/dist-client/pages/task/task-importer.js +100 -0
- package/dist-client/pages/task/task-importer.js.map +1 -0
- package/dist-client/pages/task/task-list-page.d.ts +62 -0
- package/dist-client/pages/task/task-list-page.js +331 -0
- package/dist-client/pages/task/task-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +32 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/project-to-excel.js +30 -0
- package/dist-server/controllers/project-to-excel.js.map +1 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/routes.js +105 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/check-item/check-item-mutation.js +129 -0
- package/dist-server/service/check-item/check-item-mutation.js.map +1 -0
- package/dist-server/service/check-item/check-item-query.js +86 -0
- package/dist-server/service/check-item/check-item-query.js.map +1 -0
- package/dist-server/service/check-item/check-item-type.js +69 -0
- package/dist-server/service/check-item/check-item-type.js.map +1 -0
- package/dist-server/service/check-item/check-item.js +84 -0
- package/dist-server/service/check-item/check-item.js.map +1 -0
- package/dist-server/service/check-item/index.js +9 -0
- package/dist-server/service/check-item/index.js.map +1 -0
- package/dist-server/service/checklist/checklist-mutation.js +129 -0
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
- package/dist-server/service/checklist/checklist-query.js +86 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -0
- package/dist-server/service/checklist/checklist-type.js +69 -0
- package/dist-server/service/checklist/checklist-type.js.map +1 -0
- package/dist-server/service/checklist/checklist.js +120 -0
- package/dist-server/service/checklist/checklist.js.map +1 -0
- package/dist-server/service/checklist/index.js +9 -0
- package/dist-server/service/checklist/index.js.map +1 -0
- package/dist-server/service/index.js +36 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/project/index.js +11 -0
- package/dist-server/service/project/index.js.map +1 -0
- package/dist-server/service/project/project-mutation.js +190 -0
- package/dist-server/service/project/project-mutation.js.map +1 -0
- package/dist-server/service/project/project-query.js +143 -0
- package/dist-server/service/project/project-query.js.map +1 -0
- package/dist-server/service/project/project-type.js +106 -0
- package/dist-server/service/project/project-type.js.map +1 -0
- package/dist-server/service/project/project.js +146 -0
- package/dist-server/service/project/project.js.map +1 -0
- package/dist-server/service/resource/index.js +9 -0
- package/dist-server/service/resource/index.js.map +1 -0
- package/dist-server/service/resource/resource-mutation.js +129 -0
- package/dist-server/service/resource/resource-mutation.js.map +1 -0
- package/dist-server/service/resource/resource-query.js +86 -0
- package/dist-server/service/resource/resource-query.js.map +1 -0
- package/dist-server/service/resource/resource-type.js +69 -0
- package/dist-server/service/resource/resource-type.js.map +1 -0
- package/dist-server/service/resource/resource.js +62 -0
- package/dist-server/service/resource/resource.js.map +1 -0
- package/dist-server/service/task/index.js +9 -0
- package/dist-server/service/task/index.js.map +1 -0
- package/dist-server/service/task/task-mutation.js +129 -0
- package/dist-server/service/task/task-mutation.js.map +1 -0
- package/dist-server/service/task/task-query.js +86 -0
- package/dist-server/service/task/task-query.js.map +1 -0
- package/dist-server/service/task/task-type.js +69 -0
- package/dist-server/service/task/task-type.js.map +1 -0
- package/dist-server/service/task/task.js +106 -0
- package/dist-server/service/task/task.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/management/alarm.md +160 -0
- package/helps/management/alter-video.md +160 -0
- package/helps/management/cctv.md +160 -0
- package/helps/management/device.md +160 -0
- package/helps/management/parking.md +160 -0
- package/helps/management/site.md +160 -0
- package/helps/management/sun-pnl.md +160 -0
- package/helps/project/checklist.md +160 -0
- package/helps/project/project.md +160 -0
- package/helps/project/resource.md +160 -0
- package/helps/project/task.md +160 -0
- package/package.json +38 -0
- package/server/controllers/index.ts +0 -0
- package/server/controllers/project-to-excel.ts +40 -0
- package/server/index.ts +3 -0
- package/server/middlewares/index.ts +3 -0
- package/server/routes.ts +108 -0
- package/server/service/check-item/check-item-mutation.ts +142 -0
- package/server/service/check-item/check-item-query.ts +56 -0
- package/server/service/check-item/check-item-type.ts +49 -0
- package/server/service/check-item/check-item.ts +74 -0
- package/server/service/check-item/index.ts +6 -0
- package/server/service/checklist/checklist-mutation.ts +142 -0
- package/server/service/checklist/checklist-query.ts +56 -0
- package/server/service/checklist/checklist-type.ts +49 -0
- package/server/service/checklist/checklist.ts +105 -0
- package/server/service/checklist/index.ts +6 -0
- package/server/service/index.ts +35 -0
- package/server/service/project/index.ts +8 -0
- package/server/service/project/project-mutation.ts +201 -0
- package/server/service/project/project-query.ts +103 -0
- package/server/service/project/project-type.ts +71 -0
- package/server/service/project/project.ts +131 -0
- package/server/service/resource/index.ts +6 -0
- package/server/service/resource/resource-mutation.ts +139 -0
- package/server/service/resource/resource-query.ts +56 -0
- package/server/service/resource/resource-type.ts +49 -0
- package/server/service/resource/resource.ts +56 -0
- package/server/service/task/index.ts +6 -0
- package/server/service/task/task-mutation.ts +136 -0
- package/server/service/task/task-query.ts +56 -0
- package/server/service/task/task-type.ts +49 -0
- package/server/service/task/task.ts +97 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +20 -0
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +9 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChecklistMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
8
|
+
const checklist_1 = require("./checklist");
|
|
9
|
+
const checklist_type_1 = require("./checklist-type");
|
|
10
|
+
let ChecklistMutation = class ChecklistMutation {
|
|
11
|
+
async createChecklist(checklist, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await tx.getRepository(checklist_1.Checklist).save(Object.assign(Object.assign({}, checklist), { domain, creator: user, updater: user }));
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
async updateChecklist(id, patch, context) {
|
|
17
|
+
const { domain, user, tx } = context.state;
|
|
18
|
+
const repository = tx.getRepository(checklist_1.Checklist);
|
|
19
|
+
const checklist = await repository.findOne({
|
|
20
|
+
where: { id }
|
|
21
|
+
});
|
|
22
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, checklist), patch), { updater: user }));
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
async updateMultipleChecklist(patches, context) {
|
|
26
|
+
const { domain, user, tx } = context.state;
|
|
27
|
+
let results = [];
|
|
28
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
29
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
30
|
+
const checklistRepo = tx.getRepository(checklist_1.Checklist);
|
|
31
|
+
if (_createRecords.length > 0) {
|
|
32
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
33
|
+
const newRecord = _createRecords[i];
|
|
34
|
+
const result = await checklistRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
35
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (_updateRecords.length > 0) {
|
|
39
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
40
|
+
const updateRecord = _updateRecords[i];
|
|
41
|
+
const checklist = await checklistRepo.findOneBy({ id: updateRecord.id });
|
|
42
|
+
const result = await checklistRepo.save(Object.assign(Object.assign(Object.assign({}, checklist), updateRecord), { updater: user }));
|
|
43
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return results;
|
|
47
|
+
}
|
|
48
|
+
async deleteChecklist(id, context) {
|
|
49
|
+
const { domain, tx } = context.state;
|
|
50
|
+
await tx.getRepository(checklist_1.Checklist).delete({ id });
|
|
51
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
async deleteChecklists(ids, context) {
|
|
55
|
+
const { domain, tx } = context.state;
|
|
56
|
+
await tx.getRepository(checklist_1.Checklist).delete({
|
|
57
|
+
id: (0, typeorm_1.In)(ids)
|
|
58
|
+
});
|
|
59
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
async importChecklists(checklists, context) {
|
|
63
|
+
const { domain, tx } = context.state;
|
|
64
|
+
await Promise.all(checklists.map(async (checklist) => {
|
|
65
|
+
const createdChecklist = await tx.getRepository(checklist_1.Checklist).save(Object.assign({ domain }, checklist));
|
|
66
|
+
}));
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
72
|
+
(0, type_graphql_1.Mutation)(returns => checklist_1.Checklist, { description: 'To create new Checklist' }),
|
|
73
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('checklist')),
|
|
74
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [checklist_type_1.NewChecklist, Object]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
|
+
], ChecklistMutation.prototype, "createChecklist", null);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
81
|
+
(0, type_graphql_1.Mutation)(returns => checklist_1.Checklist, { description: 'To modify Checklist information' }),
|
|
82
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
83
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
84
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
85
|
+
tslib_1.__metadata("design:type", Function),
|
|
86
|
+
tslib_1.__metadata("design:paramtypes", [String, checklist_type_1.ChecklistPatch, Object]),
|
|
87
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
88
|
+
], ChecklistMutation.prototype, "updateChecklist", null);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
91
|
+
(0, type_graphql_1.Mutation)(returns => [checklist_1.Checklist], { description: "To modify multiple Checklists' information" }),
|
|
92
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [checklist_type_1.ChecklistPatch])),
|
|
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
|
+
], ChecklistMutation.prototype, "updateMultipleChecklist", null);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
100
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Checklist' }),
|
|
101
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
102
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
103
|
+
tslib_1.__metadata("design:type", Function),
|
|
104
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
105
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
106
|
+
], ChecklistMutation.prototype, "deleteChecklist", null);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
109
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Checklists' }),
|
|
110
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
111
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
112
|
+
tslib_1.__metadata("design:type", Function),
|
|
113
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
114
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
115
|
+
], ChecklistMutation.prototype, "deleteChecklists", null);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
118
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Checklists' }),
|
|
119
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('checklists', type => [checklist_type_1.ChecklistPatch])),
|
|
120
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
121
|
+
tslib_1.__metadata("design:type", Function),
|
|
122
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
123
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
124
|
+
], ChecklistMutation.prototype, "importChecklists", null);
|
|
125
|
+
ChecklistMutation = tslib_1.__decorate([
|
|
126
|
+
(0, type_graphql_1.Resolver)(checklist_1.Checklist)
|
|
127
|
+
], ChecklistMutation);
|
|
128
|
+
exports.ChecklistMutation = ChecklistMutation;
|
|
129
|
+
//# sourceMappingURL=checklist-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-mutation.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,2CAAuC;AACvC,qDAA+D;AAGxD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AAAN,KAAK,CAAC,eAAe,CACD,SAAuB,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE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BAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAc,CAAC,CAAC,CAAA;IAC3C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAWP;AAnIU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,iBAAiB,CAoI7B;AApIY,8CAAiB","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 { Checklist } from './checklist'\nimport { NewChecklist, ChecklistPatch } from './checklist-type'\n\n@Resolver(Checklist)\nexport class ChecklistMutation {\n @Directive('@transaction')\n @Mutation(returns => Checklist, { description: 'To create new Checklist' })\n async createChecklist(\n @Arg('checklist') checklist: NewChecklist,\n @Ctx() context: ResolverContext\n ): Promise<Checklist> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Checklist).save({\n ...checklist,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Checklist, { description: 'To modify Checklist information' })\n async updateChecklist(\n @Arg('id') id: string,\n @Arg('patch') patch: ChecklistPatch,\n @Ctx() context: ResolverContext\n ): Promise<Checklist> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Checklist)\n const checklist = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...checklist,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Checklist], { description: \"To modify multiple Checklists' information\" })\n async updateMultipleChecklist(\n @Arg('patches', type => [ChecklistPatch]) patches: ChecklistPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Checklist[]> {\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 checklistRepo = tx.getRepository(Checklist)\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 checklistRepo.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 checklist = await checklistRepo.findOneBy({ id: updateRecord.id })\n\n const result = await checklistRepo.save({\n ...checklist,\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 @Mutation(returns => Boolean, { description: 'To delete Checklist' })\n async deleteChecklist(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Checklist).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Checklists' })\n async deleteChecklists(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Checklist).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple Checklists' })\n async importChecklists(\n @Arg('checklists', type => [ChecklistPatch]) checklists: ChecklistPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n checklists.map(async (checklist: ChecklistPatch) => {\n const createdChecklist: Checklist = await tx.getRepository(Checklist).save({ domain, ...checklist })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChecklistQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const checklist_1 = require("./checklist");
|
|
10
|
+
const checklist_type_1 = require("./checklist-type");
|
|
11
|
+
let ChecklistQuery = class ChecklistQuery {
|
|
12
|
+
async checklist(id, context) {
|
|
13
|
+
const { domain } = context.state;
|
|
14
|
+
return await (0, shell_1.getRepository)(checklist_1.Checklist).findOne({
|
|
15
|
+
where: { id }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async checklists(params, context) {
|
|
19
|
+
const { domain } = context.state;
|
|
20
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
21
|
+
domain,
|
|
22
|
+
params,
|
|
23
|
+
repository: await (0, shell_1.getRepository)(checklist_1.Checklist),
|
|
24
|
+
searchables: ['name', 'description']
|
|
25
|
+
});
|
|
26
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
27
|
+
return { items, total };
|
|
28
|
+
}
|
|
29
|
+
async thumbnail(checklist) {
|
|
30
|
+
const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
|
|
31
|
+
where: {
|
|
32
|
+
refType: checklist_1.Checklist.name,
|
|
33
|
+
refBy: checklist.id
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
|
|
37
|
+
}
|
|
38
|
+
async updater(checklist) {
|
|
39
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checklist.updaterId });
|
|
40
|
+
}
|
|
41
|
+
async creator(checklist) {
|
|
42
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checklist.creatorId });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, type_graphql_1.Query)(returns => checklist_1.Checklist, { nullable: true, description: 'To fetch a Checklist' }),
|
|
47
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
48
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
49
|
+
tslib_1.__metadata("design:type", Function),
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
51
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
52
|
+
], ChecklistQuery.prototype, "checklist", null);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.Query)(returns => checklist_type_1.ChecklistList, { description: 'To fetch multiple Checklists' }),
|
|
55
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
56
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
57
|
+
tslib_1.__metadata("design:type", Function),
|
|
58
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
59
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
60
|
+
], ChecklistQuery.prototype, "checklists", null);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.FieldResolver)(type => String),
|
|
63
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
|
+
], ChecklistQuery.prototype, "thumbnail", null);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
70
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
71
|
+
tslib_1.__metadata("design:type", Function),
|
|
72
|
+
tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
|
|
73
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
+
], ChecklistQuery.prototype, "updater", null);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
77
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
78
|
+
tslib_1.__metadata("design:type", Function),
|
|
79
|
+
tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
|
|
80
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
81
|
+
], ChecklistQuery.prototype, "creator", null);
|
|
82
|
+
ChecklistQuery = tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.Resolver)(checklist_1.Checklist)
|
|
84
|
+
], ChecklistQuery);
|
|
85
|
+
exports.ChecklistQuery = ChecklistQuery;
|
|
86
|
+
//# sourceMappingURL=checklist-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-query.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2CAAuC;AACvC,qDAAgD;AAGzC,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAY,EAAU,EAAS,OAAwB;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,qBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CAAS,MAAiB,EAAS,OAAwB;QACzE,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,qBAAS,CAAC;YAC1C,WAA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mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;gDAazC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;+CAS3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;6CAEzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;6CAEzC;AA9CU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,cAAc,CA+C1B;AA/CY,wCAAc","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 { Checklist } from './checklist'\nimport { ChecklistList } from './checklist-type'\n\n@Resolver(Checklist)\nexport class ChecklistQuery {\n @Query(returns => Checklist!, { nullable: true, description: 'To fetch a Checklist' })\n async checklist(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Checklist> {\n const { domain } = context.state\n\n return await getRepository(Checklist).findOne({\n where: { id }\n })\n }\n\n @Query(returns => ChecklistList, { description: 'To fetch multiple Checklists' })\n async checklists(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ChecklistList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Checklist),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() checklist: Checklist): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n refType: Checklist.name,\n refBy: checklist.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => User)\n async updater(@Root() checklist: Checklist): Promise<User> {\n return await getRepository(User).findOneBy({ id: checklist.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() checklist: Checklist): Promise<User> {\n return await getRepository(User).findOneBy({ id: checklist.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChecklistList = exports.ChecklistPatch = exports.NewChecklist = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const checklist_1 = require("./checklist");
|
|
7
|
+
let NewChecklist = class NewChecklist {
|
|
8
|
+
};
|
|
9
|
+
tslib_1.__decorate([
|
|
10
|
+
(0, type_graphql_1.Field)(),
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
12
|
+
], NewChecklist.prototype, "name", void 0);
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], NewChecklist.prototype, "description", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
19
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
20
|
+
], NewChecklist.prototype, "active", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], NewChecklist.prototype, "params", void 0);
|
|
25
|
+
NewChecklist = tslib_1.__decorate([
|
|
26
|
+
(0, type_graphql_1.InputType)()
|
|
27
|
+
], NewChecklist);
|
|
28
|
+
exports.NewChecklist = NewChecklist;
|
|
29
|
+
let ChecklistPatch = class ChecklistPatch {
|
|
30
|
+
};
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], ChecklistPatch.prototype, "id", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], ChecklistPatch.prototype, "name", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], ChecklistPatch.prototype, "description", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
46
|
+
], ChecklistPatch.prototype, "active", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], ChecklistPatch.prototype, "cuFlag", void 0);
|
|
51
|
+
ChecklistPatch = tslib_1.__decorate([
|
|
52
|
+
(0, type_graphql_1.InputType)()
|
|
53
|
+
], ChecklistPatch);
|
|
54
|
+
exports.ChecklistPatch = ChecklistPatch;
|
|
55
|
+
let ChecklistList = class ChecklistList {
|
|
56
|
+
};
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, type_graphql_1.Field)(type => [checklist_1.Checklist]),
|
|
59
|
+
tslib_1.__metadata("design:type", Array)
|
|
60
|
+
], ChecklistList.prototype, "items", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
63
|
+
tslib_1.__metadata("design:type", Number)
|
|
64
|
+
], ChecklistList.prototype, "total", void 0);
|
|
65
|
+
ChecklistList = tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.ObjectType)()
|
|
67
|
+
], ChecklistList);
|
|
68
|
+
exports.ChecklistList = ChecklistList;
|
|
69
|
+
//# sourceMappingURL=checklist-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-type.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,2CAAuC;AAGhC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAYxB,CAAA;AAXC;IAAC,IAAA,oBAAK,GAAE;;0CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;AAXJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAYxB;AAZY,oCAAY;AAelB,IAAM,cAAc,GAApB,MAAM,cAAc;CAe1B,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAdJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAe1B;AAfY,wCAAc;AAkBpB,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC;;4CACT;AAElB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;AALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Checklist } from './checklist'\n\n@InputType()\nexport class NewChecklist {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class ChecklistPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ChecklistList {\n @Field(type => [Checklist])\n items: Checklist[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Checklist = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const task_1 = require("../task/task");
|
|
9
|
+
const check_item_1 = require("../check-item/check-item");
|
|
10
|
+
let Checklist = class Checklist {
|
|
11
|
+
};
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
14
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], Checklist.prototype, "id", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '이름' }),
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], Checklist.prototype, "name", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '문서 번호' }),
|
|
24
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
26
|
+
], Checklist.prototype, "documentNo", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '부위' }),
|
|
29
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], Checklist.prototype, "part", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '위치' }),
|
|
34
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], Checklist.prototype, "location", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '시공자 점검일' }),
|
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
40
|
+
tslib_1.__metadata("design:type", Date)
|
|
41
|
+
], Checklist.prototype, "constructionInspectorDate", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '감리자 점검일' }),
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", Date)
|
|
46
|
+
], Checklist.prototype, "supervisorInspectorDate", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '총괄 시공 책임자 사인' }),
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], Checklist.prototype, "overallConstructionSignature", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '공종별 시공 관리자 사인' }),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
tslib_1.__metadata("design:type", String)
|
|
56
|
+
], Checklist.prototype, "taskConstructionSignature", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '총괄 감리 책임자 사인' }),
|
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
60
|
+
tslib_1.__metadata("design:type", String)
|
|
61
|
+
], Checklist.prototype, "overallSupervisorySignature", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '건축사보 (공종별 감리 관리자) 사인' }),
|
|
64
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
+
tslib_1.__metadata("design:type", String)
|
|
66
|
+
], Checklist.prototype, "taskSupervisorySignature", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, type_graphql_1.Field)(() => task_1.Task),
|
|
69
|
+
(0, typeorm_1.ManyToOne)(() => task_1.Task, task => task.checklists),
|
|
70
|
+
tslib_1.__metadata("design:type", task_1.Task)
|
|
71
|
+
], Checklist.prototype, "task", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.RelationId)((checklist) => checklist.task),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], Checklist.prototype, "taskId", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.Field)(() => check_item_1.CheckItem),
|
|
78
|
+
(0, typeorm_1.OneToMany)(() => check_item_1.CheckItem, checkItem => checkItem.checklist),
|
|
79
|
+
tslib_1.__metadata("design:type", Array)
|
|
80
|
+
], Checklist.prototype, "checkItems", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
+
tslib_1.__metadata("design:type", Date)
|
|
85
|
+
], Checklist.prototype, "createdAt", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
+
tslib_1.__metadata("design:type", Date)
|
|
90
|
+
], Checklist.prototype, "updatedAt", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", Date)
|
|
95
|
+
], Checklist.prototype, "deletedAt", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
98
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
100
|
+
], Checklist.prototype, "creator", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.RelationId)((checklist) => checklist.creator),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], Checklist.prototype, "creatorId", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
107
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
108
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
109
|
+
], Checklist.prototype, "updater", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, typeorm_1.RelationId)((checklist) => checklist.updater),
|
|
112
|
+
tslib_1.__metadata("design:type", String)
|
|
113
|
+
], Checklist.prototype, "updaterId", void 0);
|
|
114
|
+
Checklist = tslib_1.__decorate([
|
|
115
|
+
(0, typeorm_1.Entity)(),
|
|
116
|
+
(0, typeorm_1.Index)('ix_checklist_0', (checklist) => [checklist.task], { where: '"deleted_at" IS NULL' }),
|
|
117
|
+
(0, type_graphql_1.ObjectType)({ description: '체크리스트' })
|
|
118
|
+
], Checklist);
|
|
119
|
+
exports.Checklist = Checklist;
|
|
120
|
+
//# sourceMappingURL=checklist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAsE;AAEtE,yDAAgD;AAChD,uCAAmC;AACnC,yDAAoD;AAK7C,IAAM,SAAS,GAAf,MAAM,SAAS;CAmFrB,CAAA;AAlFC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACC;AAEnB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACb;AAEb;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC5C,IAA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AC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;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;0CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAlFP,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACtG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;GACxB,SAAS,CAmFrB;AAnFY,8BAAS","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 { User } from '@things-factory/auth-base'\nimport { Task } from '../task/task'\nimport { CheckItem } from '../check-item/check-item'\n\n@Entity()\n@Index('ix_checklist_0', (checklist: Checklist) => [checklist.task], { where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: '체크리스트' })\nexport class Checklist {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, comment: '이름' })\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true, comment: '문서 번호' })\n @Field({ nullable: true })\n documentNo?: string\n\n @Column({ nullable: true, comment: '부위' })\n @Field({ nullable: true })\n part?: string\n\n @Column({ nullable: true, comment: '위치' })\n @Field({ nullable: true })\n location?: string\n\n @Column({ nullable: true, comment: '시공자 점검일' })\n @Field({ nullable: true })\n constructionInspectorDate?: Date\n\n @Column({ nullable: true, comment: '감리자 점검일' })\n @Field({ nullable: true })\n supervisorInspectorDate?: Date\n\n @Column({ nullable: true, comment: '총괄 시공 책임자 사인' })\n @Field({ nullable: true })\n overallConstructionSignature?: string\n\n @Column({ nullable: true, comment: '공종별 시공 관리자 사인' })\n @Field({ nullable: true })\n taskConstructionSignature?: string\n\n @Column({ nullable: true, comment: '총괄 감리 책임자 사인' })\n @Field({ nullable: true })\n overallSupervisorySignature?: string\n\n @Column({ nullable: true, comment: '건축사보 (공종별 감리 관리자) 사인' })\n @Field({ nullable: true })\n taskSupervisorySignature?: string\n\n // 공정표 작업 정보 (상위 테이블 참조)\n @Field(() => Task)\n @ManyToOne(() => Task, task => task.checklists)\n task?: Task\n\n @RelationId((checklist: Checklist) => checklist.task)\n taskId?: string\n\n // 체크리스트 아이템 정보 (하위 테이블 참조)\n @Field(() => CheckItem)\n @OneToMany(() => CheckItem, checkItem => checkItem.checklist)\n checkItems?: CheckItem[]\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((checklist: Checklist) => checklist.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((checklist: Checklist) => checklist.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const checklist_1 = require("./checklist");
|
|
5
|
+
const checklist_query_1 = require("./checklist-query");
|
|
6
|
+
const checklist_mutation_1 = require("./checklist-mutation");
|
|
7
|
+
exports.entities = [checklist_1.Checklist];
|
|
8
|
+
exports.resolvers = [checklist_query_1.ChecklistQuery, checklist_mutation_1.ChecklistMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/checklist/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,uDAAkD;AAClD,6DAAwD;AAE3C,QAAA,QAAQ,GAAG,CAAC,qBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA","sourcesContent":["import { Checklist } from './checklist'\nimport { ChecklistQuery } from './checklist-query'\nimport { ChecklistMutation } from './checklist-mutation'\n\nexport const entities = [Checklist]\nexport const resolvers = [ChecklistQuery, ChecklistMutation]\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.types = exports.schema = exports.entities = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* EXPORT ENTITY TYPES */
|
|
6
|
+
tslib_1.__exportStar(require("./resource/resource"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./check-item/check-item"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./checklist/checklist"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./task/task"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./project/project"), exports);
|
|
11
|
+
/* IMPORT ENTITIES AND RESOLVERS */
|
|
12
|
+
const resource_1 = require("./resource");
|
|
13
|
+
const check_item_1 = require("./check-item");
|
|
14
|
+
const checklist_1 = require("./checklist");
|
|
15
|
+
const task_1 = require("./task");
|
|
16
|
+
const project_1 = require("./project");
|
|
17
|
+
exports.entities = [
|
|
18
|
+
/* ENTITIES */
|
|
19
|
+
...resource_1.entities,
|
|
20
|
+
...check_item_1.entities,
|
|
21
|
+
...checklist_1.entities,
|
|
22
|
+
...task_1.entities,
|
|
23
|
+
...project_1.entities
|
|
24
|
+
];
|
|
25
|
+
exports.schema = {
|
|
26
|
+
resolverClasses: [
|
|
27
|
+
/* RESOLVER CLASSES */
|
|
28
|
+
...resource_1.resolvers,
|
|
29
|
+
...check_item_1.resolvers,
|
|
30
|
+
...checklist_1.resolvers,
|
|
31
|
+
...task_1.resolvers,
|
|
32
|
+
...project_1.resolvers
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
exports.types = [...project_1.types];
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8DAAmC;AACnC,kEAAuC;AACvC,gEAAqC;AACrC,sDAA2B;AAC3B,4DAAiC;AAEjC,mCAAmC;AACnC,yCAAyF;AACzF,6CAA6F;AAC7F,2CAA4F;AAC5F,iCAA6E;AAC7E,uCAA6G;AAEhG,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,mBAAgB;IACnB,GAAG,qBAAiB;IACpB,GAAG,oBAAiB;IACpB,GAAG,eAAY;IACf,GAAG,kBAAe;CACnB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,oBAAiB;QACpB,GAAG,sBAAkB;QACrB,GAAG,qBAAkB;QACrB,GAAG,gBAAa;QAChB,GAAG,mBAAgB;KACpB;CACF,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,GAAG,eAAY,CAAC,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './resource/resource'\nexport * from './check-item/check-item'\nexport * from './checklist/checklist'\nexport * from './task/task'\nexport * from './project/project'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as ResourceEntities, resolvers as ResourceResolvers } from './resource'\nimport { entities as CheckItemEntities, resolvers as CheckItemResolvers } from './check-item'\nimport { entities as ChecklistEntities, resolvers as ChecklistResolvers } from './checklist'\nimport { entities as TaskEntities, resolvers as TaskResolvers } from './task'\nimport { entities as ProjectEntities, resolvers as ProjectResolvers, types as ProjectTypes } from './project'\n\nexport const entities = [\n /* ENTITIES */\n ...ResourceEntities,\n ...CheckItemEntities,\n ...ChecklistEntities,\n ...TaskEntities,\n ...ProjectEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...ResourceResolvers,\n ...CheckItemResolvers,\n ...ChecklistResolvers,\n ...TaskResolvers,\n ...ProjectResolvers\n ]\n}\n\nexport const types = [...ProjectTypes]\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.types = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const project_1 = require("./project");
|
|
5
|
+
const project_query_1 = require("./project-query");
|
|
6
|
+
const project_mutation_1 = require("./project-mutation");
|
|
7
|
+
const project_type_1 = require("./project-type");
|
|
8
|
+
exports.entities = [project_1.Project];
|
|
9
|
+
exports.resolvers = [project_query_1.ProjectQuery, project_mutation_1.ProjectMutation];
|
|
10
|
+
exports.types = [project_type_1.InspectionSummary];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/project/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,mDAA8C;AAC9C,yDAAoD;AACpD,iDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAC3C,QAAA,KAAK,GAAG,CAAC,gCAAiB,CAAC,CAAA","sourcesContent":["import { Project } from './project'\nimport { ProjectQuery } from './project-query'\nimport { ProjectMutation } from './project-mutation'\nimport { InspectionSummary } from './project-type'\n\nexport const entities = [Project]\nexport const resolvers = [ProjectQuery, ProjectMutation]\nexport const types = [InspectionSummary]\n"]}
|