@dssp/supervision 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +186 -0
  2. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +160 -0
  3. package/client/pages/building-inspection/building-inspection-list.ts +430 -0
  4. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +94 -0
  5. package/client/pages/building-inspection/inspection-create-popup.ts +696 -0
  6. package/client/pages/checklist/checklist-view.ts +443 -0
  7. package/client/pages/checklist-template/checklist-template-item.ts +240 -0
  8. package/client/pages/checklist-template/checklist-template-list.ts +271 -0
  9. package/client/pages/checklist-template/checklist-type-management.ts +242 -0
  10. package/client/route.ts +14 -18
  11. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +21 -0
  12. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +187 -0
  13. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -0
  14. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +21 -0
  15. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +169 -0
  16. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -0
  17. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +67 -0
  18. package/dist-client/pages/building-inspection/building-inspection-list.js +434 -0
  19. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -0
  20. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +1 -0
  21. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +118 -0
  22. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -0
  23. package/dist-client/pages/building-inspection/inspection-create-popup.d.ts +3 -0
  24. package/dist-client/pages/building-inspection/inspection-create-popup.js +735 -0
  25. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -0
  26. package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
  27. package/dist-client/pages/checklist/checklist-view.js +434 -0
  28. package/dist-client/pages/checklist/checklist-view.js.map +1 -0
  29. package/dist-client/pages/checklist-template/checklist-template-item.d.ts +2 -0
  30. package/dist-client/pages/checklist-template/checklist-template-item.js +237 -0
  31. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -0
  32. package/dist-client/pages/{check-item/check-item-list-page.d.ts → checklist-template/checklist-template-list.d.ts} +8 -27
  33. package/dist-client/pages/checklist-template/checklist-template-list.js +259 -0
  34. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -0
  35. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +48 -0
  36. package/dist-client/pages/checklist-template/checklist-type-management.js +229 -0
  37. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -0
  38. package/dist-client/route.d.ts +1 -1
  39. package/dist-client/route.js +10 -13
  40. package/dist-client/route.js.map +1 -1
  41. package/dist-client/tsconfig.tsbuildinfo +1 -1
  42. package/dist-server/index.d.ts +1 -1
  43. package/dist-server/index.js +1 -1
  44. package/dist-server/index.js.map +1 -1
  45. package/dist-server/service/building-inspection/building-inspection-history.d.ts +17 -0
  46. package/dist-server/service/building-inspection/building-inspection-history.js +85 -0
  47. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -0
  48. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +8 -0
  49. package/dist-server/service/building-inspection/building-inspection-mutation.js +148 -0
  50. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -0
  51. package/dist-server/service/building-inspection/building-inspection-query.d.ts +20 -0
  52. package/dist-server/service/building-inspection/building-inspection-query.js +235 -0
  53. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -0
  54. package/dist-server/service/building-inspection/building-inspection-type.d.ts +43 -0
  55. package/dist-server/service/building-inspection/building-inspection-type.js +153 -0
  56. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -0
  57. package/dist-server/service/building-inspection/building-inspection.d.ts +26 -0
  58. package/dist-server/service/building-inspection/building-inspection.js +113 -0
  59. package/dist-server/service/building-inspection/building-inspection.js.map +1 -0
  60. package/dist-server/service/building-inspection/event-subscriber.d.ts +7 -0
  61. package/dist-server/service/building-inspection/event-subscriber.js +21 -0
  62. package/dist-server/service/building-inspection/event-subscriber.js.map +1 -0
  63. package/dist-server/service/building-inspection/index.d.ts +10 -0
  64. package/dist-server/service/building-inspection/index.js +14 -0
  65. package/dist-server/service/building-inspection/index.js.map +1 -0
  66. package/dist-server/service/checklist/checklist-history.d.ts +24 -0
  67. package/dist-server/service/checklist/checklist-history.js +120 -0
  68. package/dist-server/service/checklist/checklist-history.js.map +1 -0
  69. package/dist-server/service/checklist/checklist-mutation.d.ts +8 -0
  70. package/dist-server/service/checklist/checklist-mutation.js +96 -0
  71. package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
  72. package/dist-server/service/checklist/checklist-query.d.ts +12 -0
  73. package/dist-server/service/checklist/checklist-query.js +83 -0
  74. package/dist-server/service/checklist/checklist-query.js.map +1 -0
  75. package/dist-server/service/checklist/checklist-type.d.ts +18 -0
  76. package/dist-server/service/checklist/checklist-type.js +69 -0
  77. package/dist-server/service/checklist/checklist-type.js.map +1 -0
  78. package/dist-server/service/checklist/checklist.d.ts +31 -0
  79. package/dist-server/service/checklist/checklist.js +143 -0
  80. package/dist-server/service/checklist/checklist.js.map +1 -0
  81. package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
  82. package/dist-server/service/checklist/event-subscriber.js +21 -0
  83. package/dist-server/service/checklist/event-subscriber.js.map +1 -0
  84. package/dist-server/service/checklist/index.d.ts +8 -0
  85. package/dist-server/service/checklist/index.js +12 -0
  86. package/dist-server/service/checklist/index.js.map +1 -0
  87. package/dist-server/service/checklist-item/checklist-item-mutation.d.ts +2 -0
  88. package/dist-server/service/checklist-item/checklist-item-mutation.js +13 -0
  89. package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -0
  90. package/dist-server/service/checklist-item/checklist-item-query.d.ts +10 -0
  91. package/dist-server/service/checklist-item/checklist-item-query.js +68 -0
  92. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -0
  93. package/dist-server/service/checklist-item/checklist-item-type.d.ts +5 -0
  94. package/dist-server/service/checklist-item/checklist-item-type.js +21 -0
  95. package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -0
  96. package/dist-server/service/checklist-item/checklist-item.d.ts +26 -0
  97. package/dist-server/service/checklist-item/checklist-item.js +113 -0
  98. package/dist-server/service/checklist-item/checklist-item.js.map +1 -0
  99. package/dist-server/service/checklist-item/index.d.ts +5 -0
  100. package/dist-server/service/checklist-item/index.js +10 -0
  101. package/dist-server/service/checklist-item/index.js.map +1 -0
  102. package/dist-server/service/checklist-template/checklist-template-mutation.d.ts +6 -0
  103. package/dist-server/service/checklist-template/checklist-template-mutation.js +64 -0
  104. package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -0
  105. package/dist-server/service/checklist-template/checklist-template-query.d.ts +10 -0
  106. package/dist-server/service/checklist-template/checklist-template-query.js +65 -0
  107. package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -0
  108. package/dist-server/service/checklist-template/checklist-template-type.d.ts +10 -0
  109. package/dist-server/service/checklist-template/checklist-template-type.js +39 -0
  110. package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -0
  111. package/dist-server/service/checklist-template/checklist-template.d.ts +17 -0
  112. package/dist-server/service/checklist-template/checklist-template.js +78 -0
  113. package/dist-server/service/checklist-template/checklist-template.js.map +1 -0
  114. package/dist-server/service/checklist-template/index.d.ts +5 -0
  115. package/dist-server/service/checklist-template/index.js +9 -0
  116. package/dist-server/service/checklist-template/index.js.map +1 -0
  117. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.d.ts +7 -0
  118. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +68 -0
  119. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -0
  120. package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +10 -0
  121. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +66 -0
  122. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -0
  123. package/dist-server/service/checklist-template-item/checklist-template-item-type.d.ts +16 -0
  124. package/dist-server/service/checklist-template-item/checklist-template-item-type.js +60 -0
  125. package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -0
  126. package/dist-server/service/checklist-template-item/checklist-template-item.d.ts +19 -0
  127. package/dist-server/service/checklist-template-item/checklist-template-item.js +87 -0
  128. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -0
  129. package/dist-server/service/checklist-template-item/index.d.ts +5 -0
  130. package/dist-server/service/checklist-template-item/index.js +9 -0
  131. package/dist-server/service/checklist-template-item/index.js.map +1 -0
  132. package/dist-server/service/checklist-type/checklist-type-mutation.d.ts +6 -0
  133. package/dist-server/service/checklist-type/checklist-type-mutation.js +64 -0
  134. package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -0
  135. package/dist-server/service/checklist-type/checklist-type-query.d.ts +10 -0
  136. package/dist-server/service/checklist-type/checklist-type-query.js +65 -0
  137. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -0
  138. package/dist-server/service/checklist-type/checklist-type-type.d.ts +11 -0
  139. package/dist-server/service/checklist-type/checklist-type-type.js +43 -0
  140. package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -0
  141. package/dist-server/service/checklist-type/checklist-type.d.ts +19 -0
  142. package/dist-server/service/checklist-type/checklist-type.js +78 -0
  143. package/dist-server/service/checklist-type/checklist-type.js.map +1 -0
  144. package/dist-server/service/checklist-type/index.d.ts +5 -0
  145. package/dist-server/service/checklist-type/index.js +9 -0
  146. package/dist-server/service/checklist-type/index.js.map +1 -0
  147. package/dist-server/service/index.d.ts +8 -3
  148. package/dist-server/service/index.js +25 -5
  149. package/dist-server/service/index.js.map +1 -1
  150. package/dist-server/service/issue/issue.d.ts +1 -3
  151. package/dist-server/service/issue/issue.js +1 -7
  152. package/dist-server/service/issue/issue.js.map +1 -1
  153. package/dist-server/service/supervisor/supervisor.d.ts +1 -3
  154. package/dist-server/service/supervisor/supervisor.js +1 -7
  155. package/dist-server/service/supervisor/supervisor.js.map +1 -1
  156. package/dist-server/tsconfig.tsbuildinfo +1 -1
  157. package/helps/supervision/checklist-item.md +160 -0
  158. package/helps/supervision/checklist.md +160 -0
  159. package/package.json +11 -7
  160. package/server/index.ts +1 -1
  161. package/server/service/building-inspection/building-inspection-history.ts +70 -0
  162. package/server/service/building-inspection/building-inspection-mutation.ts +147 -0
  163. package/server/service/building-inspection/building-inspection-query.ts +202 -0
  164. package/server/service/building-inspection/building-inspection-type.ts +101 -0
  165. package/server/service/building-inspection/building-inspection.ts +106 -0
  166. package/server/service/building-inspection/event-subscriber.ts +20 -0
  167. package/server/service/building-inspection/index.ts +11 -0
  168. package/server/service/checklist/checklist-history.ts +96 -0
  169. package/server/service/checklist/checklist-mutation.ts +103 -0
  170. package/server/service/checklist/checklist-query.ts +52 -0
  171. package/server/service/{check-item/check-item-type.ts → checklist/checklist-type.ts} +6 -18
  172. package/server/service/checklist/checklist.ts +127 -0
  173. package/server/service/checklist/event-subscriber.ts +17 -0
  174. package/server/service/checklist/index.ts +9 -0
  175. package/server/service/checklist-item/checklist-item-mutation.ts +5 -0
  176. package/server/service/checklist-item/checklist-item-query.ts +43 -0
  177. package/server/service/checklist-item/checklist-item-type.ts +12 -0
  178. package/server/service/checklist-item/checklist-item.ts +100 -0
  179. package/server/service/checklist-item/index.ts +7 -0
  180. package/server/service/checklist-template/checklist-template-mutation.ts +66 -0
  181. package/server/service/checklist-template/checklist-template-query.ts +39 -0
  182. package/server/service/checklist-template/checklist-template-type.ts +23 -0
  183. package/server/service/checklist-template/checklist-template.ts +71 -0
  184. package/server/service/checklist-template/index.ts +6 -0
  185. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +64 -0
  186. package/server/service/checklist-template-item/checklist-template-item-query.ts +39 -0
  187. package/server/service/checklist-template-item/checklist-template-item-type.ts +39 -0
  188. package/server/service/checklist-template-item/checklist-template-item.ts +67 -0
  189. package/server/service/checklist-template-item/index.ts +6 -0
  190. package/server/service/checklist-type/checklist-type-mutation.ts +66 -0
  191. package/server/service/checklist-type/checklist-type-query.ts +39 -0
  192. package/server/service/checklist-type/checklist-type-type.ts +26 -0
  193. package/server/service/checklist-type/checklist-type.ts +64 -0
  194. package/server/service/checklist-type/index.ts +6 -0
  195. package/server/service/index.ts +59 -23
  196. package/server/service/issue/issue.ts +1 -6
  197. package/server/service/supervisor/supervisor.ts +1 -6
  198. package/things-factory.config.js +11 -7
  199. package/client/pages/check-item/check-item-importer.ts +0 -94
  200. package/client/pages/check-item/check-item-list-page.ts +0 -340
  201. package/dist-client/pages/check-item/check-item-importer.d.ts +0 -10
  202. package/dist-client/pages/check-item/check-item-importer.js +0 -101
  203. package/dist-client/pages/check-item/check-item-importer.js.map +0 -1
  204. package/dist-client/pages/check-item/check-item-list-page.js +0 -323
  205. package/dist-client/pages/check-item/check-item-list-page.js.map +0 -1
  206. package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
  207. package/dist-server/service/check-item/check-item-mutation.js +0 -168
  208. package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
  209. package/dist-server/service/check-item/check-item-query.d.ts +0 -12
  210. package/dist-server/service/check-item/check-item-query.js +0 -97
  211. package/dist-server/service/check-item/check-item-query.js.map +0 -1
  212. package/dist-server/service/check-item/check-item-type.d.ts +0 -23
  213. package/dist-server/service/check-item/check-item-type.js +0 -86
  214. package/dist-server/service/check-item/check-item-type.js.map +0 -1
  215. package/dist-server/service/check-item/check-item.d.ts +0 -28
  216. package/dist-server/service/check-item/check-item.js +0 -117
  217. package/dist-server/service/check-item/check-item.js.map +0 -1
  218. package/dist-server/service/check-item/index.d.ts +0 -6
  219. package/dist-server/service/check-item/index.js +0 -10
  220. package/dist-server/service/check-item/index.js.map +0 -1
  221. package/server/service/check-item/check-item-mutation.ts +0 -198
  222. package/server/service/check-item/check-item-query.ts +0 -62
  223. package/server/service/check-item/check-item.ts +0 -111
  224. package/server/service/check-item/index.ts +0 -7
@@ -0,0 +1,96 @@
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 checklist_1 = require("./checklist");
8
+ const checklist_type_1 = require("./checklist-type");
9
+ let ChecklistMutation = class ChecklistMutation {
10
+ async createChecklist(checklist, context) {
11
+ const { domain, user, tx } = context.state;
12
+ const result = await tx.getRepository(checklist_1.Checklist).save(Object.assign(Object.assign({}, checklist), { domain, creator: user, updater: user }));
13
+ return result;
14
+ }
15
+ async updateChecklist(id, patch, context) {
16
+ const { domain, user, tx } = context.state;
17
+ const repository = tx.getRepository(checklist_1.Checklist);
18
+ const checklist = await repository.findOne({
19
+ where: { id }
20
+ });
21
+ const result = await repository.save(Object.assign(Object.assign(Object.assign({}, checklist), patch), { updater: user }));
22
+ return result;
23
+ }
24
+ async updateMultipleChecklist(patches, context) {
25
+ const { domain, user, tx } = context.state;
26
+ let results = [];
27
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
28
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
29
+ const checklistRepo = tx.getRepository(checklist_1.Checklist);
30
+ if (_createRecords.length > 0) {
31
+ for (let i = 0; i < _createRecords.length; i++) {
32
+ const newRecord = _createRecords[i];
33
+ const result = await checklistRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
34
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
35
+ }
36
+ }
37
+ if (_updateRecords.length > 0) {
38
+ for (let i = 0; i < _updateRecords.length; i++) {
39
+ const updateRecord = _updateRecords[i];
40
+ const checklist = await checklistRepo.findOneBy({ id: updateRecord.id });
41
+ const result = await checklistRepo.save(Object.assign(Object.assign(Object.assign({}, checklist), updateRecord), { updater: user }));
42
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
43
+ }
44
+ }
45
+ return results;
46
+ }
47
+ async deleteChecklists(ids, context) {
48
+ const { domain, tx } = context.state;
49
+ await tx.getRepository(checklist_1.Checklist).softDelete({
50
+ id: (0, typeorm_1.In)(ids)
51
+ });
52
+ return true;
53
+ }
54
+ };
55
+ tslib_1.__decorate([
56
+ (0, type_graphql_1.Directive)('@transaction'),
57
+ (0, type_graphql_1.Mutation)(returns => checklist_1.Checklist, { description: 'To create new Checklist' }),
58
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('checklist')),
59
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", [checklist_type_1.NewChecklist, Object]),
62
+ tslib_1.__metadata("design:returntype", Promise)
63
+ ], ChecklistMutation.prototype, "createChecklist", null);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Directive)('@transaction'),
66
+ (0, type_graphql_1.Mutation)(returns => checklist_1.Checklist, { description: 'To modify Checklist information' }),
67
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
68
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
69
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
70
+ tslib_1.__metadata("design:type", Function),
71
+ tslib_1.__metadata("design:paramtypes", [String, checklist_type_1.ChecklistPatch, Object]),
72
+ tslib_1.__metadata("design:returntype", Promise)
73
+ ], ChecklistMutation.prototype, "updateChecklist", null);
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Directive)('@transaction'),
76
+ (0, type_graphql_1.Mutation)(returns => [checklist_1.Checklist], { description: "To modify multiple Checklists' information" }),
77
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [checklist_type_1.ChecklistPatch])),
78
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
79
+ tslib_1.__metadata("design:type", Function),
80
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
81
+ tslib_1.__metadata("design:returntype", Promise)
82
+ ], ChecklistMutation.prototype, "updateMultipleChecklist", null);
83
+ tslib_1.__decorate([
84
+ (0, type_graphql_1.Directive)('@transaction'),
85
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Checklists' }),
86
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
87
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
88
+ tslib_1.__metadata("design:type", Function),
89
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
90
+ tslib_1.__metadata("design:returntype", Promise)
91
+ ], ChecklistMutation.prototype, "deleteChecklists", null);
92
+ ChecklistMutation = tslib_1.__decorate([
93
+ (0, type_graphql_1.Resolver)(checklist_1.Checklist)
94
+ ], ChecklistMutation);
95
+ exports.ChecklistMutation = ChecklistMutation;
96
+ //# 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;AAC5B,2CAAuC;AACvC,qDAA+D;AAGxD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AAAN,KAAK,CAAC,eAAe,CAAmB,SAAuB,EAAS,OAAwB;QAC9F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,IAAI,iCAChD,SAAS,KACZ,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CACR,EAAU,EACP,KAAqB,EAC5B,OAAwB;QAE/B,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AFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,qBAAS,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;IAEhF,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,+BAAc;;wDAiBpC;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;IAE7F,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAc,CAAC,CAAC,CAAA;IACxC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gEAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAQzE;AA/FU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,iBAAiB,CAgG7B;AAhGY,8CAAiB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\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(@Arg('checklist') checklist: NewChecklist, @Ctx() context: ResolverContext): 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 multiple Checklists' })\n async deleteChecklists(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Checklist).softDelete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Checklist } from './checklist';
4
+ import { ChecklistList } from './checklist-type';
5
+ import { ChecklistItem } from '../checklist-item/checklist-item';
6
+ export declare class ChecklistQuery {
7
+ checklist(id: string, context: ResolverContext): Promise<Checklist>;
8
+ checklists(params: ListParam, context: ResolverContext): Promise<ChecklistList>;
9
+ checklistItems(checklist: Checklist): Promise<ChecklistItem[]>;
10
+ updater(checklist: Checklist): Promise<User>;
11
+ creator(checklist: Checklist): Promise<User>;
12
+ }
@@ -0,0 +1,83 @@
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 shell_1 = require("@things-factory/shell");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const checklist_1 = require("./checklist");
9
+ const checklist_type_1 = require("./checklist-type");
10
+ const checklist_item_1 = require("../checklist-item/checklist-item");
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
+ params,
22
+ repository: await (0, shell_1.getRepository)(checklist_1.Checklist),
23
+ searchables: ['name', 'description']
24
+ });
25
+ const [items, total] = await queryBuilder.getManyAndCount();
26
+ return { items, total };
27
+ }
28
+ async checklistItems(checklist) {
29
+ return await (0, shell_1.getRepository)(checklist_item_1.ChecklistItem)
30
+ .createQueryBuilder('ci')
31
+ .where('ci.checklist_id = :checklistId', { checklistId: checklist.id })
32
+ .orderBy('ci.sequence', 'ASC')
33
+ .getMany();
34
+ }
35
+ async updater(checklist) {
36
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checklist.updaterId });
37
+ }
38
+ async creator(checklist) {
39
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checklist.creatorId });
40
+ }
41
+ };
42
+ tslib_1.__decorate([
43
+ (0, type_graphql_1.Query)(returns => checklist_1.Checklist, { nullable: true, description: 'To fetch a Checklist' }),
44
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
45
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
46
+ tslib_1.__metadata("design:type", Function),
47
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
48
+ tslib_1.__metadata("design:returntype", Promise)
49
+ ], ChecklistQuery.prototype, "checklist", null);
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Query)(returns => checklist_type_1.ChecklistList, { description: 'To fetch multiple Checklists' }),
52
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
53
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], ChecklistQuery.prototype, "checklists", null);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.FieldResolver)(type => [checklist_item_1.ChecklistItem]),
60
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
61
+ tslib_1.__metadata("design:type", Function),
62
+ tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
63
+ tslib_1.__metadata("design:returntype", Promise)
64
+ ], ChecklistQuery.prototype, "checklistItems", null);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
67
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
68
+ tslib_1.__metadata("design:type", Function),
69
+ tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
70
+ tslib_1.__metadata("design:returntype", Promise)
71
+ ], ChecklistQuery.prototype, "updater", null);
72
+ tslib_1.__decorate([
73
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
74
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
75
+ tslib_1.__metadata("design:type", Function),
76
+ tslib_1.__metadata("design:paramtypes", [checklist_1.Checklist]),
77
+ tslib_1.__metadata("design:returntype", Promise)
78
+ ], ChecklistQuery.prototype, "creator", null);
79
+ ChecklistQuery = tslib_1.__decorate([
80
+ (0, type_graphql_1.Resolver)(checklist_1.Checklist)
81
+ ], ChecklistQuery);
82
+ exports.ChecklistQuery = ChecklistQuery;
83
+ //# 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,+CAAmF;AACnF,iDAA+F;AAC/F,yDAAgD;AAChD,2CAAuC;AACvC,qDAAgD;AAChD,qEAAgE;AAGzD,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,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,qBAAS,CAAC;YAC1C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KA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L,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,8BAAa,CAAC,CAAC;IACjB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;oDAMhD;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;AA1CU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,cAAc,CA2C1B;AA3CY,wCAAc","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Checklist } from './checklist'\nimport { ChecklistList } from './checklist-type'\nimport { ChecklistItem } from '../checklist-item/checklist-item'\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 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 => [ChecklistItem])\n async checklistItems(@Root() checklist: Checklist): Promise<ChecklistItem[]> {\n return await getRepository(ChecklistItem)\n .createQueryBuilder('ci')\n .where('ci.checklist_id = :checklistId', { checklistId: checklist.id })\n .orderBy('ci.sequence', 'ASC')\n .getMany()\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,18 @@
1
+ import { Checklist } from './checklist';
2
+ export declare class NewChecklist {
3
+ name: string;
4
+ description?: string;
5
+ active?: boolean;
6
+ params?: string;
7
+ }
8
+ export declare class ChecklistPatch {
9
+ id?: string;
10
+ name?: string;
11
+ description?: string;
12
+ active?: boolean;
13
+ cuFlag?: string;
14
+ }
15
+ export declare class ChecklistList {
16
+ items: Checklist[];
17
+ total: number;
18
+ }
@@ -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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AAU,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,31 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Task } from '@dssp/project';
3
+ import { ChecklistItem } from '../checklist-item/checklist-item';
4
+ import { BuildingInspection } from '../building-inspection/building-inspection';
5
+ export declare class Checklist {
6
+ readonly id: string;
7
+ name?: string;
8
+ documentNo?: string;
9
+ constructionType?: string;
10
+ constructionDetailType?: string;
11
+ location?: string;
12
+ inspectionDrawingType?: string;
13
+ inspectionParts?: string[];
14
+ constructionInsprctionDate?: Date;
15
+ supervisorInsprctionDate?: Date;
16
+ overallConstructorSignature?: string;
17
+ taskConstructorSignature?: string;
18
+ overallSupervisorySignature?: string;
19
+ taskSupervisorySignature?: string;
20
+ task?: Task;
21
+ taskId?: string;
22
+ checklistItems?: ChecklistItem[];
23
+ buildingInspection?: BuildingInspection;
24
+ createdAt?: Date;
25
+ updatedAt?: Date;
26
+ deletedAt?: Date;
27
+ creator?: User;
28
+ creatorId?: string;
29
+ updater?: User;
30
+ updaterId?: string;
31
+ }
@@ -0,0 +1,143 @@
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 project_1 = require("@dssp/project");
9
+ const checklist_item_1 = require("../checklist-item/checklist-item");
10
+ const building_inspection_1 = require("../building-inspection/building-inspection");
11
+ let Checklist = class Checklist {
12
+ };
13
+ tslib_1.__decorate([
14
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
15
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], Checklist.prototype, "id", void 0);
18
+ tslib_1.__decorate([
19
+ (0, typeorm_1.Column)({ nullable: true, comment: '이름' }),
20
+ (0, type_graphql_1.Field)({ nullable: true }),
21
+ tslib_1.__metadata("design:type", String)
22
+ ], Checklist.prototype, "name", void 0);
23
+ tslib_1.__decorate([
24
+ (0, typeorm_1.Column)({ nullable: true, comment: '문서 번호 동(4자리)-층(3자리)-시퀀스(6자리)' }),
25
+ (0, type_graphql_1.Field)({ nullable: true }),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], Checklist.prototype, "documentNo", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.Column)({ nullable: false, comment: '공종' }),
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], Checklist.prototype, "constructionType", void 0);
33
+ tslib_1.__decorate([
34
+ (0, typeorm_1.Column)({ nullable: false, comment: '세부 공종' }),
35
+ (0, type_graphql_1.Field)({ nullable: true }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], Checklist.prototype, "constructionDetailType", void 0);
38
+ tslib_1.__decorate([
39
+ (0, typeorm_1.Column)({ nullable: false, comment: '위치 (x동 x층)' }),
40
+ (0, type_graphql_1.Field)({ nullable: true }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], Checklist.prototype, "location", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)({ nullable: false, comment: '검측 도면 타입', default: '' }),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], Checklist.prototype, "inspectionDrawingType", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)('simple-array', { nullable: true, comment: '검측 부위' }),
50
+ (0, type_graphql_1.Field)(() => [String], { nullable: true }),
51
+ tslib_1.__metadata("design:type", Array)
52
+ ], Checklist.prototype, "inspectionParts", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true, comment: '시공자 점검일' }),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", Date)
57
+ ], Checklist.prototype, "constructionInsprctionDate", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true, comment: '감리자 점검일' }),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", Date)
62
+ ], Checklist.prototype, "supervisorInsprctionDate", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true, comment: '총괄 시공 책임자 사인' }),
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], Checklist.prototype, "overallConstructorSignature", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ nullable: true, comment: '공종별 시공 관리자 사인' }),
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], Checklist.prototype, "taskConstructorSignature", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.Column)({ nullable: true, comment: '총괄 감리 책임자 사인' }),
75
+ (0, type_graphql_1.Field)({ nullable: true }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], Checklist.prototype, "overallSupervisorySignature", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.Column)({ nullable: true, comment: '건축사보 (공종별 감리 관리자) 사인' }),
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], Checklist.prototype, "taskSupervisorySignature", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.ManyToOne)(() => project_1.Task),
85
+ (0, typeorm_1.JoinColumn)(),
86
+ (0, type_graphql_1.Field)(() => project_1.Task),
87
+ tslib_1.__metadata("design:type", project_1.Task)
88
+ ], Checklist.prototype, "task", void 0);
89
+ tslib_1.__decorate([
90
+ (0, typeorm_1.RelationId)((checklist) => checklist.task),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], Checklist.prototype, "taskId", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.OneToMany)(() => checklist_item_1.ChecklistItem, checklistItem => checklistItem.checklist),
95
+ (0, type_graphql_1.Field)(() => [checklist_item_1.ChecklistItem]),
96
+ tslib_1.__metadata("design:type", Array)
97
+ ], Checklist.prototype, "checklistItems", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_1.OneToOne)(() => building_inspection_1.BuildingInspection, buildingInspection => buildingInspection.checklist),
100
+ (0, type_graphql_1.Field)(() => building_inspection_1.BuildingInspection),
101
+ tslib_1.__metadata("design:type", building_inspection_1.BuildingInspection)
102
+ ], Checklist.prototype, "buildingInspection", void 0);
103
+ tslib_1.__decorate([
104
+ (0, typeorm_1.CreateDateColumn)(),
105
+ (0, type_graphql_1.Field)({ nullable: true }),
106
+ tslib_1.__metadata("design:type", Date)
107
+ ], Checklist.prototype, "createdAt", void 0);
108
+ tslib_1.__decorate([
109
+ (0, typeorm_1.UpdateDateColumn)(),
110
+ (0, type_graphql_1.Field)({ nullable: true }),
111
+ tslib_1.__metadata("design:type", Date)
112
+ ], Checklist.prototype, "updatedAt", void 0);
113
+ tslib_1.__decorate([
114
+ (0, typeorm_1.DeleteDateColumn)(),
115
+ (0, type_graphql_1.Field)({ nullable: true }),
116
+ tslib_1.__metadata("design:type", Date)
117
+ ], Checklist.prototype, "deletedAt", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
120
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
121
+ tslib_1.__metadata("design:type", auth_base_1.User)
122
+ ], Checklist.prototype, "creator", void 0);
123
+ tslib_1.__decorate([
124
+ (0, typeorm_1.RelationId)((checklist) => checklist.creator),
125
+ tslib_1.__metadata("design:type", String)
126
+ ], Checklist.prototype, "creatorId", void 0);
127
+ tslib_1.__decorate([
128
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
129
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
130
+ tslib_1.__metadata("design:type", auth_base_1.User)
131
+ ], Checklist.prototype, "updater", void 0);
132
+ tslib_1.__decorate([
133
+ (0, typeorm_1.RelationId)((checklist) => checklist.updater),
134
+ tslib_1.__metadata("design:type", String)
135
+ ], Checklist.prototype, "updaterId", void 0);
136
+ Checklist = tslib_1.__decorate([
137
+ (0, typeorm_1.Entity)({ comment: '체크리스트' }),
138
+ (0, typeorm_1.Index)('ix_checklist_0', (checklist) => [checklist.task], { where: '"deleted_at" IS NULL' }),
139
+ (0, typeorm_1.Index)('ix_checklist_1', (checklist) => [checklist.documentNo, checklist.createdAt], { where: '"deleted_at" IS NULL' }),
140
+ (0, type_graphql_1.ObjectType)()
141
+ ], Checklist);
142
+ exports.Checklist = Checklist;
143
+ //# sourceMappingURL=checklist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAsE;AAEtE,yDAAgD;AAChD,2CAAoC;AACpC,qEAAgE;AAChE,oFAA+E;AAMxE,IAAM,SAAS,GAAf,MAAM,SAAS;C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C,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;AApGP,SAAS;IAJrB,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC5B,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACtG,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACjI,IAAA,yBAAU,GAAE;GACA,SAAS,CAqGrB;AArGY,8BAAS","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n OneToOne,\n JoinColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Task } from '@dssp/project'\nimport { ChecklistItem } from '../checklist-item/checklist-item'\nimport { BuildingInspection } from '../building-inspection/building-inspection'\n\n@Entity({ comment: '체크리스트' })\n@Index('ix_checklist_0', (checklist: Checklist) => [checklist.task], { where: '\"deleted_at\" IS NULL' })\n@Index('ix_checklist_1', (checklist: Checklist) => [checklist.documentNo, checklist.createdAt], { where: '\"deleted_at\" IS NULL' })\n@ObjectType()\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: '문서 번호 동(4자리)-층(3자리)-시퀀스(6자리)' })\n @Field({ nullable: true })\n documentNo?: string\n\n @Column({ nullable: false, comment: '공종' })\n @Field({ nullable: true })\n constructionType?: string\n\n @Column({ nullable: false, comment: '세부 공종' })\n @Field({ nullable: true })\n constructionDetailType?: string\n\n @Column({ nullable: false, comment: '위치 (x동 x층)' })\n @Field({ nullable: true })\n location?: string\n\n @Column({ nullable: false, comment: '검측 도면 타입', default: '' })\n @Field({ nullable: true })\n inspectionDrawingType?: string\n\n @Column('simple-array', { nullable: true, comment: '검측 부위' })\n @Field(() => [String], { nullable: true })\n inspectionParts?: string[]\n\n @Column({ nullable: true, comment: '시공자 점검일' })\n @Field({ nullable: true })\n constructionInsprctionDate?: Date\n\n @Column({ nullable: true, comment: '감리자 점검일' })\n @Field({ nullable: true })\n supervisorInsprctionDate?: Date\n\n @Column({ nullable: true, comment: '총괄 시공 책임자 사인' })\n @Field({ nullable: true })\n overallConstructorSignature?: string\n\n @Column({ nullable: true, comment: '공종별 시공 관리자 사인' })\n @Field({ nullable: true })\n taskConstructorSignature?: 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 @ManyToOne(() => Task)\n @JoinColumn()\n @Field(() => Task)\n task?: Task\n\n @RelationId((checklist: Checklist) => checklist.task)\n taskId?: string\n\n // 체크리스트 아이템 정보 (하위 테이블 참조)\n @OneToMany(() => ChecklistItem, checklistItem => checklistItem.checklist)\n @Field(() => [ChecklistItem])\n checklistItems?: ChecklistItem[]\n\n // 검측 정보 (1:1 하위 테이블 참조)\n @OneToOne(() => BuildingInspection, buildingInspection => buildingInspection.checklist)\n @Field(() => BuildingInspection)\n buildingInspection?: BuildingInspection\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,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { Checklist } from './checklist';
3
+ import { ChecklistHistory } from './checklist-history';
4
+ export declare class ChecklistHistoryEntitySubscriber extends HistoryEntitySubscriber<Checklist, ChecklistHistory> {
5
+ get entity(): typeof Checklist;
6
+ get historyEntity(): typeof ChecklistHistory;
7
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChecklistHistoryEntitySubscriber = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const typeorm_history_1 = require("@operato/typeorm-history");
7
+ const checklist_1 = require("./checklist");
8
+ const checklist_history_1 = require("./checklist-history");
9
+ let ChecklistHistoryEntitySubscriber = class ChecklistHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
+ get entity() {
11
+ return checklist_1.Checklist;
12
+ }
13
+ get historyEntity() {
14
+ return checklist_history_1.ChecklistHistory;
15
+ }
16
+ };
17
+ ChecklistHistoryEntitySubscriber = tslib_1.__decorate([
18
+ (0, typeorm_1.EventSubscriber)()
19
+ ], ChecklistHistoryEntitySubscriber);
20
+ exports.ChecklistHistoryEntitySubscriber = ChecklistHistoryEntitySubscriber;
21
+ //# sourceMappingURL=event-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/checklist/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2CAAuC;AACvC,2DAAsD;AAG/C,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,yCAAoD;IACxG,IAAW,MAAM;QACf,OAAO,qBAAS,CAAA;IAClB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,oCAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AARY,gCAAgC;IAD5C,IAAA,yBAAe,GAAE;GACL,gCAAgC,CAQ5C;AARY,4EAAgC","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Checklist } from './checklist'\nimport { ChecklistHistory } from './checklist-history'\n\n@EventSubscriber()\nexport class ChecklistHistoryEntitySubscriber extends HistoryEntitySubscriber<Checklist, ChecklistHistory> {\n public get entity() {\n return Checklist\n }\n\n public get historyEntity() {\n return ChecklistHistory\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { Checklist } from './checklist';
2
+ import { ChecklistQuery } from './checklist-query';
3
+ import { ChecklistHistory } from './checklist-history';
4
+ import { ChecklistMutation } from './checklist-mutation';
5
+ import { ChecklistHistoryEntitySubscriber } from './event-subscriber';
6
+ export declare const entities: (typeof Checklist | typeof ChecklistHistory)[];
7
+ export declare const resolvers: (typeof ChecklistQuery | typeof ChecklistMutation)[];
8
+ export declare const subscribers: (typeof ChecklistHistoryEntitySubscriber)[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const checklist_1 = require("./checklist");
5
+ const checklist_query_1 = require("./checklist-query");
6
+ const checklist_history_1 = require("./checklist-history");
7
+ const checklist_mutation_1 = require("./checklist-mutation");
8
+ const event_subscriber_1 = require("./event-subscriber");
9
+ exports.entities = [checklist_1.Checklist, checklist_history_1.ChecklistHistory];
10
+ exports.resolvers = [checklist_query_1.ChecklistQuery, checklist_mutation_1.ChecklistMutation];
11
+ exports.subscribers = [event_subscriber_1.ChecklistHistoryEntitySubscriber];
12
+ //# 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,2DAAsD;AACtD,6DAAwD;AACxD,yDAAqE;AAExD,QAAA,QAAQ,GAAG,CAAC,qBAAS,EAAE,oCAAgB,CAAC,CAAA;AACxC,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA;AAC/C,QAAA,WAAW,GAAG,CAAC,mDAAgC,CAAC,CAAA","sourcesContent":["import { Checklist } from './checklist'\nimport { ChecklistQuery } from './checklist-query'\nimport { ChecklistHistory } from './checklist-history'\nimport { ChecklistMutation } from './checklist-mutation'\nimport { ChecklistHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [Checklist, ChecklistHistory]\nexport const resolvers = [ChecklistQuery, ChecklistMutation]\nexport const subscribers = [ChecklistHistoryEntitySubscriber]\n"]}
@@ -0,0 +1,2 @@
1
+ export declare class ChecklistItemMutation {
2
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChecklistItemMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const checklist_item_1 = require("./checklist-item");
7
+ let ChecklistItemMutation = class ChecklistItemMutation {
8
+ };
9
+ ChecklistItemMutation = tslib_1.__decorate([
10
+ (0, type_graphql_1.Resolver)(checklist_item_1.ChecklistItem)
11
+ ], ChecklistItemMutation);
12
+ exports.ChecklistItemMutation = ChecklistItemMutation;
13
+ //# sourceMappingURL=checklist-item-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist-item-mutation.js","sourceRoot":"","sources":["../../../server/service/checklist-item/checklist-item-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qDAAgD;AAGzC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,qBAAqB,CAAG;AAAxB,sDAAqB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { ChecklistItem } from './checklist-item'\n\n@Resolver(ChecklistItem)\nexport class ChecklistItemMutation {}\n"]}
@@ -0,0 +1,10 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { ChecklistItem } from './checklist-item';
4
+ import { ChecklistItemList } from './checklist-item-type';
5
+ export declare class ChecklistItemQuery {
6
+ checklistItem(id: string, context: ResolverContext): Promise<ChecklistItem>;
7
+ checklistItems(params: ListParam, context: ResolverContext): Promise<ChecklistItemList>;
8
+ updater(checklistItem: ChecklistItem): Promise<User>;
9
+ creator(checklistItem: ChecklistItem): Promise<User>;
10
+ }