@dssp/supervision 0.0.9 → 0.0.11

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 +227 -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 +463 -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 +22 -0
  12. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +228 -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 +468 -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 +9 -0
  49. package/dist-server/service/building-inspection/building-inspection-mutation.js +227 -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 +60 -0
  55. package/dist-server/service/building-inspection/building-inspection-type.js +213 -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 +26 -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 +239 -0
  163. package/server/service/building-inspection/building-inspection-query.ts +202 -0
  164. package/server/service/building-inspection/building-inspection-type.ts +142 -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 +60 -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,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingInspection = exports.BuildingInspectionStatus = 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 building_complex_1 = require("@dssp/building-complex");
9
+ const checklist_1 = require("../checklist/checklist");
10
+ var BuildingInspectionStatus;
11
+ (function (BuildingInspectionStatus) {
12
+ BuildingInspectionStatus["WAIT"] = "WAIT";
13
+ BuildingInspectionStatus["REQUEST"] = "REQUEST";
14
+ BuildingInspectionStatus["PASS"] = "PASS";
15
+ BuildingInspectionStatus["FAIL"] = "FAIL";
16
+ })(BuildingInspectionStatus = exports.BuildingInspectionStatus || (exports.BuildingInspectionStatus = {}));
17
+ (0, type_graphql_1.registerEnumType)(BuildingInspectionStatus, {
18
+ name: 'BuildingInspectionStatus',
19
+ description: '검측 상태'
20
+ });
21
+ let BuildingInspection = class BuildingInspection {
22
+ };
23
+ tslib_1.__decorate([
24
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
25
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], BuildingInspection.prototype, "id", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.Column)({
30
+ nullable: false,
31
+ comment: '상태(WAIT: 검측 대기, REQUEST: 검측 요청, PASS: 합격, FAIL: 불합격)',
32
+ default: 'WAIT'
33
+ }),
34
+ (0, type_graphql_1.Field)({ nullable: true }),
35
+ tslib_1.__metadata("design:type", String)
36
+ ], BuildingInspection.prototype, "status", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.Column)({ nullable: false, comment: '검측 요청일' }),
39
+ (0, type_graphql_1.Field)({ nullable: true }),
40
+ tslib_1.__metadata("design:type", Date)
41
+ ], BuildingInspection.prototype, "requestDate", void 0);
42
+ tslib_1.__decorate([
43
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: '도면 마커' }),
44
+ (0, type_graphql_1.Field)(type => String, { nullable: true }),
45
+ tslib_1.__metadata("design:type", String)
46
+ ], BuildingInspection.prototype, "drawingMarker", void 0);
47
+ tslib_1.__decorate([
48
+ (0, typeorm_1.ManyToOne)(type => building_complex_1.BuildingLevel),
49
+ (0, type_graphql_1.Field)(() => building_complex_1.BuildingLevel, { nullable: true }),
50
+ tslib_1.__metadata("design:type", building_complex_1.BuildingLevel)
51
+ ], BuildingInspection.prototype, "buildingLevel", void 0);
52
+ tslib_1.__decorate([
53
+ (0, typeorm_1.RelationId)((buildingInspection) => buildingInspection.buildingLevel),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], BuildingInspection.prototype, "buildingLevelId", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.OneToOne)(type => checklist_1.Checklist),
58
+ (0, typeorm_1.JoinColumn)(),
59
+ (0, type_graphql_1.Field)(() => checklist_1.Checklist, { nullable: true }),
60
+ tslib_1.__metadata("design:type", checklist_1.Checklist)
61
+ ], BuildingInspection.prototype, "checklist", void 0);
62
+ tslib_1.__decorate([
63
+ (0, typeorm_1.RelationId)((buildingInspection) => buildingInspection.checklist),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], BuildingInspection.prototype, "checklistId", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.CreateDateColumn)(),
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ tslib_1.__metadata("design:type", Date)
70
+ ], BuildingInspection.prototype, "createdAt", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.UpdateDateColumn)(),
73
+ (0, type_graphql_1.Field)({ nullable: true }),
74
+ tslib_1.__metadata("design:type", Date)
75
+ ], BuildingInspection.prototype, "updatedAt", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.DeleteDateColumn)(),
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ tslib_1.__metadata("design:type", Date)
80
+ ], BuildingInspection.prototype, "deletedAt", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
83
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
84
+ tslib_1.__metadata("design:type", auth_base_1.User)
85
+ ], BuildingInspection.prototype, "creator", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.RelationId)((buildingInspection) => buildingInspection.creator),
88
+ tslib_1.__metadata("design:type", String)
89
+ ], BuildingInspection.prototype, "creatorId", void 0);
90
+ tslib_1.__decorate([
91
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
92
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
93
+ tslib_1.__metadata("design:type", auth_base_1.User)
94
+ ], BuildingInspection.prototype, "updater", void 0);
95
+ tslib_1.__decorate([
96
+ (0, typeorm_1.RelationId)((buildingInspection) => buildingInspection.updater),
97
+ tslib_1.__metadata("design:type", String)
98
+ ], BuildingInspection.prototype, "updaterId", void 0);
99
+ BuildingInspection = tslib_1.__decorate([
100
+ (0, typeorm_1.Entity)({ comment: '시공 검측 (층별 도면의 검측 리스트)' }),
101
+ (0, typeorm_1.Index)('ix_building_inspection_0', (buildingInspection) => [buildingInspection.buildingLevel], {
102
+ where: '"deleted_at" IS NULL'
103
+ }),
104
+ (0, typeorm_1.Index)('ix_building_inspection_1', (buildingInspection) => [buildingInspection.checklist], {
105
+ where: '"deleted_at" IS NULL'
106
+ }),
107
+ (0, typeorm_1.Index)('ix_building_inspection_2', (buildingInspection) => [buildingInspection.requestDate], {
108
+ where: '"deleted_at" IS NULL'
109
+ }),
110
+ (0, type_graphql_1.ObjectType)()
111
+ ], BuildingInspection);
112
+ exports.BuildingInspection = BuildingInspection;
113
+ //# sourceMappingURL=building-inspection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building-inspection.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,yDAAgD;AAChD,6DAAsD;AACtD,sDAAkD;AAElD,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,+CAAmB,CAAA;IACnB,yCAAa,CAAA;IACb,yCAAa,CAAA;AACf,CAAC,EALW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAKnC;AAED,IAAA,+BAAgB,EAAC,wBAAwB,EAAE;IACzC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,OAAO;CACrB,CAAC,CAAA;AAaK,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CA+D9B,CAAA;AA9DC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAEnB;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,sDAAsD;QAC/D,OAAO,EAAE,MAAM;KAChB,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACO;AAEjC;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC9C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACZ,IAAI;uDAAA;AAElB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACjE,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yD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,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;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;mDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AA9DP,kBAAkB;IAX9B,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;IAC5C,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAE;QACjH,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE;QAC7G,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE;QAC/G,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,yBAAU,GAAE;GACA,kBAAkB,CA+D9B;AA/DY,gDAAkB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToOne,\n PrimaryGeneratedColumn,\n JoinColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { BuildingLevel } from '@dssp/building-complex'\nimport { Checklist } from '../checklist/checklist'\n\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n REQUEST = 'REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\n\nregisterEnumType(BuildingInspectionStatus, {\n name: 'BuildingInspectionStatus',\n description: '검측 상태'\n})\n\n@Entity({ comment: '시공 검측 (층별 도면의 검측 리스트)' })\n@Index('ix_building_inspection_0', (buildingInspection: BuildingInspection) => [buildingInspection.buildingLevel], {\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_building_inspection_1', (buildingInspection: BuildingInspection) => [buildingInspection.checklist], {\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_building_inspection_2', (buildingInspection: BuildingInspection) => [buildingInspection.requestDate], {\n where: '\"deleted_at\" IS NULL'\n})\n@ObjectType()\nexport class BuildingInspection {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({\n nullable: false,\n comment: '상태(WAIT: 검측 대기, REQUEST: 검측 요청, PASS: 합격, FAIL: 불합격)',\n default: 'WAIT'\n })\n @Field({ nullable: true })\n status?: BuildingInspectionStatus\n\n @Column({ nullable: false, comment: '검측 요청일' })\n @Field({ nullable: true })\n requestDate?: Date\n\n @Column({ type: 'simple-json', nullable: true, comment: '도면 마커' })\n @Field(type => String, { nullable: true })\n drawingMarker?: string\n\n // 층 정보 (1:1 상위 테이블 참조)\n @ManyToOne(type => BuildingLevel)\n @Field(() => BuildingLevel, { nullable: true })\n buildingLevel?: BuildingLevel\n\n @RelationId((buildingInspection: BuildingInspection) => buildingInspection.buildingLevel)\n buildingLevelId?: string\n\n // 체크리스트 (1:1 상위 테이블 참조)\n @OneToOne(type => Checklist)\n @JoinColumn()\n @Field(() => Checklist, { nullable: true })\n checklist?: Checklist\n\n @RelationId((buildingInspection: BuildingInspection) => buildingInspection.checklist)\n checklistId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((buildingInspection: BuildingInspection) => buildingInspection.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((buildingInspection: BuildingInspection) => buildingInspection.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { BuildingInspection } from './building-inspection';
3
+ import { BuildingInspectionHistory } from './building-inspection-history';
4
+ export declare class BuildingInspectionHistoryEntitySubscriber extends HistoryEntitySubscriber<BuildingInspection, BuildingInspectionHistory> {
5
+ get entity(): typeof BuildingInspection;
6
+ get historyEntity(): typeof BuildingInspectionHistory;
7
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingInspectionHistoryEntitySubscriber = 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 building_inspection_1 = require("./building-inspection");
8
+ const building_inspection_history_1 = require("./building-inspection-history");
9
+ let BuildingInspectionHistoryEntitySubscriber = class BuildingInspectionHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
+ get entity() {
11
+ return building_inspection_1.BuildingInspection;
12
+ }
13
+ get historyEntity() {
14
+ return building_inspection_history_1.BuildingInspectionHistory;
15
+ }
16
+ };
17
+ BuildingInspectionHistoryEntitySubscriber = tslib_1.__decorate([
18
+ (0, typeorm_1.EventSubscriber)()
19
+ ], BuildingInspectionHistoryEntitySubscriber);
20
+ exports.BuildingInspectionHistoryEntitySubscriber = BuildingInspectionHistoryEntitySubscriber;
21
+ //# sourceMappingURL=event-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/building-inspection/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,+DAA0D;AAC1D,+EAAyE;AAGlE,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,yCAG9D;IACC,IAAW,MAAM;QACf,OAAO,wCAAkB,CAAA;IAC3B,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,uDAAyB,CAAA;IAClC,CAAC;CACF,CAAA;AAXY,yCAAyC;IADrD,IAAA,yBAAe,GAAE;GACL,yCAAyC,CAWrD;AAXY,8FAAyC","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { BuildingInspection } from './building-inspection'\nimport { BuildingInspectionHistory } from './building-inspection-history'\n\n@EventSubscriber()\nexport class BuildingInspectionHistoryEntitySubscriber extends HistoryEntitySubscriber<\n BuildingInspection,\n BuildingInspectionHistory\n> {\n public get entity() {\n return BuildingInspection\n }\n\n public get historyEntity() {\n return BuildingInspectionHistory\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { BuildingInspection, BuildingInspectionStatus } from './building-inspection';
2
+ import { BuildingInspectionQuery } from './building-inspection-query';
3
+ import { BuildingInspectionMutation } from './building-inspection-mutation';
4
+ import { BuildingInspectionSummary } from './building-inspection-type';
5
+ import { BuildingInspectionHistory } from './building-inspection-history';
6
+ import { BuildingInspectionHistoryEntitySubscriber } from './event-subscriber';
7
+ export declare const entities: (typeof BuildingInspection | typeof BuildingInspectionHistory)[];
8
+ export declare const resolvers: (typeof BuildingInspectionQuery | typeof BuildingInspectionMutation)[];
9
+ export declare const subscribers: (typeof BuildingInspectionHistoryEntitySubscriber)[];
10
+ export declare const types: (typeof BuildingInspectionStatus | typeof BuildingInspectionSummary)[];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.types = exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const building_inspection_1 = require("./building-inspection");
5
+ const building_inspection_query_1 = require("./building-inspection-query");
6
+ const building_inspection_mutation_1 = require("./building-inspection-mutation");
7
+ const building_inspection_type_1 = require("./building-inspection-type");
8
+ const building_inspection_history_1 = require("./building-inspection-history");
9
+ const event_subscriber_1 = require("./event-subscriber");
10
+ exports.entities = [building_inspection_1.BuildingInspection, building_inspection_history_1.BuildingInspectionHistory];
11
+ exports.resolvers = [building_inspection_query_1.BuildingInspectionQuery, building_inspection_mutation_1.BuildingInspectionMutation];
12
+ exports.subscribers = [event_subscriber_1.BuildingInspectionHistoryEntitySubscriber];
13
+ exports.types = [building_inspection_1.BuildingInspectionStatus, building_inspection_type_1.BuildingInspectionSummary];
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/building-inspection/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoF;AACpF,2EAAqE;AACrE,iFAA2E;AAC3E,yEAAsE;AACtE,+EAAyE;AACzE,yDAA8E;AAEjE,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,uDAAyB,CAAC,CAAA;AAC1D,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA;AACjE,QAAA,WAAW,GAAG,CAAC,4DAAyC,CAAC,CAAA;AACzD,QAAA,KAAK,GAAG,CAAC,8CAAwB,EAAE,oDAAyB,CAAC,CAAA","sourcesContent":["import { BuildingInspection, BuildingInspectionStatus } from './building-inspection'\nimport { BuildingInspectionQuery } from './building-inspection-query'\nimport { BuildingInspectionMutation } from './building-inspection-mutation'\nimport { BuildingInspectionSummary } from './building-inspection-type'\nimport { BuildingInspectionHistory } from './building-inspection-history'\nimport { BuildingInspectionHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [BuildingInspection, BuildingInspectionHistory]\nexport const resolvers = [BuildingInspectionQuery, BuildingInspectionMutation]\nexport const subscribers = [BuildingInspectionHistoryEntitySubscriber]\nexport const types = [BuildingInspectionStatus, BuildingInspectionSummary]\n"]}
@@ -0,0 +1,24 @@
1
+ import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Checklist } from './checklist';
4
+ export declare class ChecklistHistory implements HistoryEntityInterface<Checklist> {
5
+ readonly id: string;
6
+ name?: string;
7
+ documentNo?: string;
8
+ constructionType?: string;
9
+ constructionDetailType?: string;
10
+ location?: string;
11
+ inspectionDrawingType?: string;
12
+ inspectionParts?: string[];
13
+ constructionInspectionDate?: Date;
14
+ supervisorInspectionDate?: Date;
15
+ overallConstructorSignature?: string;
16
+ taskConstructorSignature?: string;
17
+ overallSupervisorySignature?: string;
18
+ taskSupervisorySignature?: string;
19
+ createdAt?: Date;
20
+ creator?: User;
21
+ creatorId?: string;
22
+ originalId: string;
23
+ action: HistoryActionType;
24
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChecklistHistory = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const typeorm_history_1 = require("@operato/typeorm-history");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const env_1 = require("@things-factory/env");
10
+ const ORMCONFIG = env_1.config.get('ormconfig', {});
11
+ const DATABASE_TYPE = ORMCONFIG.type;
12
+ let ChecklistHistory = class ChecklistHistory {
13
+ };
14
+ tslib_1.__decorate([
15
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
16
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
17
+ tslib_1.__metadata("design:type", String)
18
+ ], ChecklistHistory.prototype, "id", void 0);
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.Column)({ nullable: true, comment: '이름' }),
21
+ (0, type_graphql_1.Field)({ nullable: true }),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], ChecklistHistory.prototype, "name", void 0);
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.Column)({ nullable: true, comment: '문서 번호 동(4자리)-층(3자리)-시퀀스(6자리)' }),
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], ChecklistHistory.prototype, "documentNo", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.Column)({ nullable: false, comment: '공종' }),
31
+ (0, type_graphql_1.Field)({ nullable: true }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], ChecklistHistory.prototype, "constructionType", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.Column)({ nullable: false, comment: '세부 공종' }),
36
+ (0, type_graphql_1.Field)({ nullable: true }),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], ChecklistHistory.prototype, "constructionDetailType", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.Column)({ nullable: false, comment: '위치 (x동 x층)' }),
41
+ (0, type_graphql_1.Field)({ nullable: true }),
42
+ tslib_1.__metadata("design:type", String)
43
+ ], ChecklistHistory.prototype, "location", void 0);
44
+ tslib_1.__decorate([
45
+ (0, typeorm_1.Column)({ nullable: false, comment: '검측 도면 타입', default: '' }),
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], ChecklistHistory.prototype, "inspectionDrawingType", void 0);
49
+ tslib_1.__decorate([
50
+ (0, typeorm_1.Column)('simple-array', { nullable: true, comment: '검측 부위' }),
51
+ (0, type_graphql_1.Field)(() => [String], { nullable: true }),
52
+ tslib_1.__metadata("design:type", Array)
53
+ ], ChecklistHistory.prototype, "inspectionParts", void 0);
54
+ tslib_1.__decorate([
55
+ (0, typeorm_1.Column)({ nullable: true, comment: '시공자 점검일' }),
56
+ (0, type_graphql_1.Field)({ nullable: true }),
57
+ tslib_1.__metadata("design:type", Date)
58
+ ], ChecklistHistory.prototype, "constructionInspectionDate", void 0);
59
+ tslib_1.__decorate([
60
+ (0, typeorm_1.Column)({ nullable: true, comment: '감리자 점검일' }),
61
+ (0, type_graphql_1.Field)({ nullable: true }),
62
+ tslib_1.__metadata("design:type", Date)
63
+ ], ChecklistHistory.prototype, "supervisorInspectionDate", void 0);
64
+ tslib_1.__decorate([
65
+ (0, typeorm_1.Column)({ nullable: true, comment: '총괄 시공 책임자 사인' }),
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], ChecklistHistory.prototype, "overallConstructorSignature", void 0);
69
+ tslib_1.__decorate([
70
+ (0, typeorm_1.Column)({ nullable: true, comment: '공종별 시공 관리자 사인' }),
71
+ (0, type_graphql_1.Field)({ nullable: true }),
72
+ tslib_1.__metadata("design:type", String)
73
+ ], ChecklistHistory.prototype, "taskConstructorSignature", void 0);
74
+ tslib_1.__decorate([
75
+ (0, typeorm_1.Column)({ nullable: true, comment: '총괄 감리 책임자 사인' }),
76
+ (0, type_graphql_1.Field)({ nullable: true }),
77
+ tslib_1.__metadata("design:type", String)
78
+ ], ChecklistHistory.prototype, "overallSupervisorySignature", void 0);
79
+ tslib_1.__decorate([
80
+ (0, typeorm_1.Column)({ nullable: true, comment: '건축사보 (공종별 감리 관리자) 사인' }),
81
+ (0, type_graphql_1.Field)({ nullable: true }),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], ChecklistHistory.prototype, "taskSupervisorySignature", void 0);
84
+ tslib_1.__decorate([
85
+ (0, typeorm_1.Column)({ nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ tslib_1.__metadata("design:type", Date)
88
+ ], ChecklistHistory.prototype, "createdAt", void 0);
89
+ tslib_1.__decorate([
90
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
91
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
92
+ tslib_1.__metadata("design:type", auth_base_1.User)
93
+ ], ChecklistHistory.prototype, "creator", void 0);
94
+ tslib_1.__decorate([
95
+ (0, typeorm_1.RelationId)((checklistHistory) => checklistHistory.creator),
96
+ tslib_1.__metadata("design:type", String)
97
+ ], ChecklistHistory.prototype, "creatorId", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_history_1.HistoryOriginalIdColumn)(),
100
+ tslib_1.__metadata("design:type", String)
101
+ ], ChecklistHistory.prototype, "originalId", void 0);
102
+ tslib_1.__decorate([
103
+ (0, typeorm_history_1.HistoryActionColumn)({
104
+ nullable: false,
105
+ type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
106
+ ? 'enum'
107
+ : DATABASE_TYPE == 'oracle'
108
+ ? 'varchar2'
109
+ : 'smallint',
110
+ enum: typeorm_history_1.HistoryActionType
111
+ }),
112
+ tslib_1.__metadata("design:type", String)
113
+ ], ChecklistHistory.prototype, "action", void 0);
114
+ ChecklistHistory = tslib_1.__decorate([
115
+ (0, typeorm_1.Entity)(),
116
+ (0, typeorm_1.Index)('ix_checklist_history_0', (checklistHistory) => [checklistHistory.originalId]),
117
+ (0, type_graphql_1.ObjectType)({ description: 'History Entity of Checklist' })
118
+ ], ChecklistHistory);
119
+ exports.ChecklistHistory = ChecklistHistory;
120
+ //# sourceMappingURL=checklist-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist-history.js","sourceRoot":"","sources":["../../../server/service/checklist/checklist-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAC9F,8DAAkI;AAClI,yDAAgD;AAChD,6CAA4C;AAG5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAK7B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAkF5B,CAAA;AAjFC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE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AC,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;iDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AAElB;IAAC,IAAA,yCAAuB,GAAE;;oDACA;AAE1B;IAAC,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;gDAC+B;AAjFtB,gBAAgB;IAH5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,gBAAkC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CAkF5B;AAlFY,4CAAgB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\nimport { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'\nimport { User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Checklist } from './checklist'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_checklist_history_0', (checklistHistory: ChecklistHistory) => [checklistHistory.originalId])\n@ObjectType({ description: 'History Entity of Checklist' })\nexport class ChecklistHistory implements HistoryEntityInterface<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 constructionInspectionDate?: Date\n\n @Column({ nullable: true, comment: '감리자 점검일' })\n @Field({ nullable: true })\n supervisorInspectionDate?: 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 @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((checklistHistory: ChecklistHistory) => checklistHistory.creator)\n creatorId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { Checklist } from './checklist';
2
+ import { NewChecklist, ChecklistPatch } from './checklist-type';
3
+ export declare class ChecklistMutation {
4
+ createChecklist(checklist: NewChecklist, context: ResolverContext): Promise<Checklist>;
5
+ updateChecklist(id: string, patch: ChecklistPatch, context: ResolverContext): Promise<Checklist>;
6
+ updateMultipleChecklist(patches: ChecklistPatch[], context: ResolverContext): Promise<Checklist[]>;
7
+ deleteChecklists(ids: string[], context: ResolverContext): Promise<boolean>;
8
+ }
@@ -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,GA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AAE,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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oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qBAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACrE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAM5C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC/D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;gDAYzC;AAGK;IADL,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
+ }