@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,235 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingInspectionQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const attachment_base_1 = require("@things-factory/attachment-base");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const building_inspection_1 = require("./building-inspection");
9
+ const building_inspection_type_1 = require("./building-inspection-type");
10
+ const building_complex_1 = require("@dssp/building-complex");
11
+ const checklist_1 = require("../checklist/checklist");
12
+ const project_1 = require("@dssp/project");
13
+ let BuildingInspectionQuery = class BuildingInspectionQuery {
14
+ async buildingInspection(id, context) {
15
+ return await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection).findOne({
16
+ where: { id }
17
+ });
18
+ }
19
+ async buildingInspections(params, context) {
20
+ const { domain } = context.state;
21
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
22
+ params,
23
+ repository: await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection),
24
+ searchables: ['name']
25
+ });
26
+ const [items, total] = await queryBuilder.getManyAndCount();
27
+ return { items, total };
28
+ }
29
+ async buildingInspectionsOfProject(params, context) {
30
+ const { domain } = context.state;
31
+ const { projectId, limit } = params;
32
+ const queryBuilder = (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
33
+ .createQueryBuilder('bi')
34
+ .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')
35
+ .innerJoin('buildings', 'b', 'bl.building_id = b.id')
36
+ .innerJoin('building_complexes', 'bc', 'b.building_complex_id = bc.id')
37
+ .innerJoin('projects', 'p', 'bc.id = p.building_complex_id')
38
+ .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')
39
+ .where('p.domain = :domain', { domain: domain.id })
40
+ .andWhere('p.id = :projectId', { projectId })
41
+ .orderBy('bi.created_at', 'DESC');
42
+ if (limit) {
43
+ queryBuilder.limit(limit);
44
+ }
45
+ const [items, total] = await queryBuilder.getManyAndCount();
46
+ return { items, total };
47
+ }
48
+ async projectByBuildingLevelId(buildingLevelId, context) {
49
+ const queryBuilder = (0, shell_1.getRepository)(project_1.Project)
50
+ .createQueryBuilder('p')
51
+ .innerJoin('building_complexes', 'bc', 'p.building_complex_id = bc.id')
52
+ .innerJoin('buildings', 'b', 'b.building_complex_id = bc.id')
53
+ .innerJoin('building_levels', 'bl', 'bl.building_id = b.id')
54
+ .where('bl.id = :buildingLevelId', { buildingLevelId });
55
+ const result = await queryBuilder.getOne();
56
+ return result;
57
+ }
58
+ async buildingInspectionsOfBuildingLevel(params, context) {
59
+ const { buildingLevelId, limit } = params;
60
+ const queryBuilder = (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
61
+ .createQueryBuilder('bi')
62
+ .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')
63
+ .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')
64
+ .where('bl.id = :buildingLevelId', { buildingLevelId })
65
+ .orderBy('bi.updated_at', 'DESC');
66
+ if (limit) {
67
+ queryBuilder.limit(limit);
68
+ }
69
+ const [items, total] = await queryBuilder.getManyAndCount();
70
+ return { items, total };
71
+ }
72
+ // 층 별로 검수 개수 써머리
73
+ async buildingInspectionSummaryOfBuildingLevel(buildingLevelId, context) {
74
+ const buildingInspectionSummary = await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
75
+ .createQueryBuilder('bi')
76
+ .select(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)
77
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)
78
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
79
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
80
+ .where('bi.building_level_id = :buildingLevelId', { buildingLevelId })
81
+ .groupBy('bi.building_level_id')
82
+ .getRawOne();
83
+ return {
84
+ wait: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.wait) || 0,
85
+ request: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.request) || 0,
86
+ pass: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.pass) || 0,
87
+ fail: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.fail) || 0
88
+ };
89
+ }
90
+ // 층 별로 검수 개수 써머리
91
+ async buildingInspectionSummary(buildingLevel) {
92
+ const buildingInspectionSummary = await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
93
+ .createQueryBuilder('bi')
94
+ .select(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)
95
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)
96
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
97
+ .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
98
+ .where('bi.building_level_id = :buildingLevelId', { buildingLevelId: buildingLevel.id })
99
+ .groupBy('bi.building_level_id')
100
+ .getRawOne();
101
+ return {
102
+ wait: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.wait) || 0,
103
+ request: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.request) || 0,
104
+ pass: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.pass) || 0,
105
+ fail: (buildingInspectionSummary === null || buildingInspectionSummary === void 0 ? void 0 : buildingInspectionSummary.fail) || 0
106
+ };
107
+ }
108
+ async buildingInspectionSummaryOfProject(projectId, context) {
109
+ const { domain } = context.state;
110
+ const result = await (0, shell_1.getRepository)(project_1.Project)
111
+ .createQueryBuilder('p')
112
+ .select(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)
113
+ .addSelect(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)
114
+ .addSelect(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
115
+ .addSelect(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
116
+ .innerJoin('p.buildingComplex', 'bc')
117
+ .innerJoin('bc.buildings', 'b')
118
+ .innerJoin('b.buildingLevels', 'bl')
119
+ .leftJoin('building_inspections', 'bi', 'bi.building_level_id = bl.id AND bi.deleted_at IS NULL')
120
+ .where('p.domain = :domain', { domain: domain.id })
121
+ .andWhere('p.id = :projectId', { projectId })
122
+ .groupBy('p.id')
123
+ .getRawOne();
124
+ return {
125
+ wait: result.wait || 0,
126
+ request: result.request || 0,
127
+ pass: result.pass || 0,
128
+ fail: result.fail || 0
129
+ };
130
+ }
131
+ async checklist(buildingInspection) {
132
+ return await (0, shell_1.getRepository)(checklist_1.Checklist).findOneBy({ id: buildingInspection.checklistId });
133
+ }
134
+ async buildingLevel(buildingInspection) {
135
+ return await (0, shell_1.getRepository)(building_complex_1.BuildingLevel).findOneBy({ id: buildingInspection.buildingLevelId });
136
+ }
137
+ async attatchments(buildingInspection) {
138
+ const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).find({
139
+ where: {
140
+ refType: building_inspection_1.BuildingInspection.name,
141
+ refBy: buildingInspection.id
142
+ }
143
+ });
144
+ return attachment;
145
+ }
146
+ };
147
+ tslib_1.__decorate([
148
+ (0, type_graphql_1.Query)(returns => building_inspection_1.BuildingInspection, { nullable: true, description: 'To fetch a BuildingInspection' }),
149
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
150
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
151
+ tslib_1.__metadata("design:type", Function),
152
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
153
+ tslib_1.__metadata("design:returntype", Promise)
154
+ ], BuildingInspectionQuery.prototype, "buildingInspection", null);
155
+ tslib_1.__decorate([
156
+ (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' }),
157
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
158
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
159
+ tslib_1.__metadata("design:type", Function),
160
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
161
+ tslib_1.__metadata("design:returntype", Promise)
162
+ ], BuildingInspectionQuery.prototype, "buildingInspections", null);
163
+ tslib_1.__decorate([
164
+ (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' }),
165
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('params')),
166
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
167
+ tslib_1.__metadata("design:type", Function),
168
+ tslib_1.__metadata("design:paramtypes", [building_inspection_type_1.BuildingInspectionsOfProject, Object]),
169
+ tslib_1.__metadata("design:returntype", Promise)
170
+ ], BuildingInspectionQuery.prototype, "buildingInspectionsOfProject", null);
171
+ tslib_1.__decorate([
172
+ (0, type_graphql_1.Query)(returns => project_1.Project, { description: 'To fetch Project' }),
173
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('buildingLevelId')),
174
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
175
+ tslib_1.__metadata("design:type", Function),
176
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
177
+ tslib_1.__metadata("design:returntype", Promise)
178
+ ], BuildingInspectionQuery.prototype, "projectByBuildingLevelId", null);
179
+ tslib_1.__decorate([
180
+ (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' }),
181
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('params')),
182
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
183
+ tslib_1.__metadata("design:type", Function),
184
+ tslib_1.__metadata("design:paramtypes", [building_inspection_type_1.BuildingInspectionsOfBuildingLevel, Object]),
185
+ tslib_1.__metadata("design:returntype", Promise)
186
+ ], BuildingInspectionQuery.prototype, "buildingInspectionsOfBuildingLevel", null);
187
+ tslib_1.__decorate([
188
+ (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionSummary, { nullable: true, description: 'To fetch a BuildingInspection Summary' }),
189
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('buildingLevelId')),
190
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
191
+ tslib_1.__metadata("design:type", Function),
192
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
193
+ tslib_1.__metadata("design:returntype", Promise)
194
+ ], BuildingInspectionQuery.prototype, "buildingInspectionSummaryOfBuildingLevel", null);
195
+ tslib_1.__decorate([
196
+ (0, type_graphql_1.FieldResolver)(type => building_inspection_type_1.BuildingInspectionSummary),
197
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
198
+ tslib_1.__metadata("design:type", Function),
199
+ tslib_1.__metadata("design:paramtypes", [building_complex_1.BuildingLevel]),
200
+ tslib_1.__metadata("design:returntype", Promise)
201
+ ], BuildingInspectionQuery.prototype, "buildingInspectionSummary", null);
202
+ tslib_1.__decorate([
203
+ (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionSummary, { description: '프로젝트의 검측상태 별 카운트' }),
204
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('projectId')),
205
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
206
+ tslib_1.__metadata("design:type", Function),
207
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
208
+ tslib_1.__metadata("design:returntype", Promise)
209
+ ], BuildingInspectionQuery.prototype, "buildingInspectionSummaryOfProject", null);
210
+ tslib_1.__decorate([
211
+ (0, type_graphql_1.FieldResolver)(type => checklist_1.Checklist),
212
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
213
+ tslib_1.__metadata("design:type", Function),
214
+ tslib_1.__metadata("design:paramtypes", [building_inspection_1.BuildingInspection]),
215
+ tslib_1.__metadata("design:returntype", Promise)
216
+ ], BuildingInspectionQuery.prototype, "checklist", null);
217
+ tslib_1.__decorate([
218
+ (0, type_graphql_1.FieldResolver)(type => building_complex_1.BuildingLevel),
219
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
220
+ tslib_1.__metadata("design:type", Function),
221
+ tslib_1.__metadata("design:paramtypes", [building_inspection_1.BuildingInspection]),
222
+ tslib_1.__metadata("design:returntype", Promise)
223
+ ], BuildingInspectionQuery.prototype, "buildingLevel", null);
224
+ tslib_1.__decorate([
225
+ (0, type_graphql_1.FieldResolver)(type => [attachment_base_1.Attachment]),
226
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
227
+ tslib_1.__metadata("design:type", Function),
228
+ tslib_1.__metadata("design:paramtypes", [building_inspection_1.BuildingInspection]),
229
+ tslib_1.__metadata("design:returntype", Promise)
230
+ ], BuildingInspectionQuery.prototype, "attatchments", null);
231
+ BuildingInspectionQuery = tslib_1.__decorate([
232
+ (0, type_graphql_1.Resolver)(building_inspection_1.BuildingInspection)
233
+ ], BuildingInspectionQuery);
234
+ exports.BuildingInspectionQuery = BuildingInspectionQuery;
235
+ //# sourceMappingURL=building-inspection-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building-inspection-query.js","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I,GAAE,CAAA;;6CAAqB,wCAAkB;;2DAQhE;AAzLU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CA0LnC;AA1LY,0DAAuB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Arg, Args, Ctx } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { getRepository, getQueryBuilderFromListParams, ListParam } from '@things-factory/shell'\nimport { BuildingInspection, BuildingInspectionStatus } from './building-inspection'\nimport {\n BuildingInspectionList,\n BuildingInspectionsOfBuildingLevel,\n BuildingInspectionsOfProject,\n BuildingInspectionSummary\n} from './building-inspection-type'\nimport { BuildingLevel } from '@dssp/building-complex'\nimport { Checklist } from '../checklist/checklist'\nimport { Project } from '@dssp/project'\n\n@Resolver(BuildingInspection)\nexport class BuildingInspectionQuery {\n @Query(returns => BuildingInspection!, { nullable: true, description: 'To fetch a BuildingInspection' })\n async buildingInspection(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<BuildingInspection> {\n return await getRepository(BuildingInspection).findOne({\n where: { id }\n })\n }\n\n @Query(returns => BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' })\n async buildingInspections(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<BuildingInspectionList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(BuildingInspection),\n searchables: ['name']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' })\n async buildingInspectionsOfProject(\n @Arg('params') params: BuildingInspectionsOfProject,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionList> {\n const { domain } = context.state\n const { projectId, limit } = params\n\n const queryBuilder = getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')\n .innerJoin('buildings', 'b', 'bl.building_id = b.id')\n .innerJoin('building_complexes', 'bc', 'b.building_complex_id = bc.id')\n .innerJoin('projects', 'p', 'bc.id = p.building_complex_id')\n .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')\n .where('p.domain = :domain', { domain: domain.id })\n .andWhere('p.id = :projectId', { projectId })\n .orderBy('bi.created_at', 'DESC')\n\n if (limit) {\n queryBuilder.limit(limit)\n }\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => Project!, { description: 'To fetch Project' })\n async projectByBuildingLevelId(\n @Arg('buildingLevelId') buildingLevelId: string,\n @Ctx() context: ResolverContext\n ): Promise<Project> {\n const queryBuilder = getRepository(Project)\n .createQueryBuilder('p')\n .innerJoin('building_complexes', 'bc', 'p.building_complex_id = bc.id')\n .innerJoin('buildings', 'b', 'b.building_complex_id = bc.id')\n .innerJoin('building_levels', 'bl', 'bl.building_id = b.id')\n .where('bl.id = :buildingLevelId', { buildingLevelId })\n\n const result = await queryBuilder.getOne()\n\n return result\n }\n\n @Query(returns => BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' })\n async buildingInspectionsOfBuildingLevel(\n @Arg('params') params: BuildingInspectionsOfBuildingLevel,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionList> {\n const { buildingLevelId, limit } = params\n\n const queryBuilder = getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')\n .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')\n .where('bl.id = :buildingLevelId', { buildingLevelId })\n .orderBy('bi.updated_at', 'DESC')\n\n if (limit) {\n queryBuilder.limit(limit)\n }\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n // 층 별로 검수 개수 써머리\n @Query(returns => BuildingInspectionSummary!, { nullable: true, description: 'To fetch a BuildingInspection Summary' })\n async buildingInspectionSummaryOfBuildingLevel(\n @Arg('buildingLevelId') buildingLevelId: string,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionSummary> {\n const buildingInspectionSummary = await getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .select(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)\n .where('bi.building_level_id = :buildingLevelId', { buildingLevelId })\n .groupBy('bi.building_level_id')\n .getRawOne()\n\n return {\n wait: buildingInspectionSummary?.wait || 0,\n request: buildingInspectionSummary?.request || 0,\n pass: buildingInspectionSummary?.pass || 0,\n fail: buildingInspectionSummary?.fail || 0\n }\n }\n\n // 층 별로 검수 개수 써머리\n @FieldResolver(type => BuildingInspectionSummary)\n async buildingInspectionSummary(@Root() buildingLevel: BuildingLevel): Promise<BuildingInspectionSummary> {\n const buildingInspectionSummary = await getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .select(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)\n .addSelect(`COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)\n .where('bi.building_level_id = :buildingLevelId', { buildingLevelId: buildingLevel.id })\n .groupBy('bi.building_level_id')\n .getRawOne()\n\n return {\n wait: buildingInspectionSummary?.wait || 0,\n request: buildingInspectionSummary?.request || 0,\n pass: buildingInspectionSummary?.pass || 0,\n fail: buildingInspectionSummary?.fail || 0\n }\n }\n\n @Query(returns => BuildingInspectionSummary, { description: '프로젝트의 검측상태 별 카운트' })\n async buildingInspectionSummaryOfProject(\n @Arg('projectId') projectId: string,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionSummary> {\n const { domain } = context.state\n\n const result = await getRepository(Project)\n .createQueryBuilder('p')\n .select(`COUNT(CASE WHEN bi.status = '${BuildingInspectionStatus.WAIT}' THEN 1 ELSE NULL END) AS wait`)\n .addSelect(`COUNT(CASE WHEN bi.status = '${BuildingInspectionStatus.REQUEST}' THEN 1 ELSE NULL END) AS request`)\n .addSelect(`COUNT(CASE WHEN bi.status = '${BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)\n .addSelect(`COUNT(CASE WHEN bi.status = '${BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)\n .innerJoin('p.buildingComplex', 'bc')\n .innerJoin('bc.buildings', 'b')\n .innerJoin('b.buildingLevels', 'bl')\n .leftJoin('building_inspections', 'bi', 'bi.building_level_id = bl.id AND bi.deleted_at IS NULL')\n .where('p.domain = :domain', { domain: domain.id })\n .andWhere('p.id = :projectId', { projectId })\n .groupBy('p.id')\n .getRawOne()\n\n return {\n wait: result.wait || 0,\n request: result.request || 0,\n pass: result.pass || 0,\n fail: result.fail || 0\n }\n }\n\n @FieldResolver(type => Checklist)\n async checklist(@Root() buildingInspection: BuildingInspection): Promise<Checklist> {\n return await getRepository(Checklist).findOneBy({ id: buildingInspection.checklistId })\n }\n\n @FieldResolver(type => BuildingLevel)\n async buildingLevel(@Root() buildingInspection: BuildingInspection): Promise<BuildingLevel> {\n return await getRepository(BuildingLevel).findOneBy({ id: buildingInspection.buildingLevelId })\n }\n\n @FieldResolver(type => [Attachment])\n async attatchments(@Root() buildingInspection: BuildingInspection): Promise<Attachment[] | undefined> {\n const attachment: Attachment[] = await getRepository(Attachment).find({\n where: {\n refType: BuildingInspection.name,\n refBy: buildingInspection.id\n }\n })\n return attachment\n }\n}\n"]}
@@ -0,0 +1,60 @@
1
+ import { BuildingInspection } from './building-inspection';
2
+ declare class ChecklistInputType {
3
+ name: string;
4
+ constructionType: string;
5
+ constructionDetailType: string;
6
+ location?: string;
7
+ inspectionDrawingType?: string;
8
+ inspectionParts?: string[];
9
+ }
10
+ declare class ChecklistItemInputType {
11
+ name: string;
12
+ mainType: string;
13
+ detailType: string;
14
+ inspctionCriteria: string;
15
+ }
16
+ export declare class NewBuildingInspection {
17
+ buildingLevelId: string;
18
+ checklist: ChecklistInputType;
19
+ checklistItem: ChecklistItemInputType[];
20
+ }
21
+ declare class ChecklistSubmitInputType {
22
+ id: string;
23
+ overallConstructorSignature?: string;
24
+ taskConstructorSignature?: string;
25
+ overallSupervisorySignature?: string;
26
+ taskSupervisorySignature?: string;
27
+ }
28
+ declare class ChecklistItemSubmitInputType {
29
+ id: string;
30
+ constructionConfirmStatus?: string;
31
+ supervisoryConfirmStatus?: string;
32
+ }
33
+ export declare class UpdateBuildingInspectionSubmitType {
34
+ id: string;
35
+ checklist: ChecklistSubmitInputType;
36
+ checklistItem: ChecklistItemSubmitInputType[];
37
+ }
38
+ export declare class UpdateBuildingInspectionDrawingMarker {
39
+ id: string;
40
+ drawingMarker?: string;
41
+ }
42
+ export declare class BuildingInspectionsOfProject {
43
+ projectId: string;
44
+ limit: number;
45
+ }
46
+ export declare class BuildingInspectionsOfBuildingLevel {
47
+ buildingLevelId: string;
48
+ limit: number;
49
+ }
50
+ export declare class BuildingInspectionSummary {
51
+ wait: number;
52
+ request: number;
53
+ pass: number;
54
+ fail: number;
55
+ }
56
+ export declare class BuildingInspectionList {
57
+ items: BuildingInspection[];
58
+ total: number;
59
+ }
60
+ export {};
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingInspectionList = exports.BuildingInspectionSummary = exports.BuildingInspectionsOfBuildingLevel = exports.BuildingInspectionsOfProject = exports.UpdateBuildingInspectionDrawingMarker = exports.UpdateBuildingInspectionSubmitType = exports.NewBuildingInspection = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const building_inspection_1 = require("./building-inspection");
7
+ let ChecklistInputType = class ChecklistInputType {
8
+ };
9
+ tslib_1.__decorate([
10
+ (0, type_graphql_1.Field)({ nullable: false }),
11
+ tslib_1.__metadata("design:type", String)
12
+ ], ChecklistInputType.prototype, "name", void 0);
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ nullable: false }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], ChecklistInputType.prototype, "constructionType", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: false }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], ChecklistInputType.prototype, "constructionDetailType", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: false }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], ChecklistInputType.prototype, "location", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: false }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], ChecklistInputType.prototype, "inspectionDrawingType", void 0);
29
+ tslib_1.__decorate([
30
+ (0, type_graphql_1.Field)(type => [String], { nullable: false }),
31
+ tslib_1.__metadata("design:type", Array)
32
+ ], ChecklistInputType.prototype, "inspectionParts", void 0);
33
+ ChecklistInputType = tslib_1.__decorate([
34
+ (0, type_graphql_1.InputType)()
35
+ ], ChecklistInputType);
36
+ let ChecklistItemInputType = class ChecklistItemInputType {
37
+ };
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Field)({ nullable: false }),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], ChecklistItemInputType.prototype, "name", void 0);
42
+ tslib_1.__decorate([
43
+ (0, type_graphql_1.Field)({ nullable: false }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], ChecklistItemInputType.prototype, "mainType", void 0);
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Field)({ nullable: false }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], ChecklistItemInputType.prototype, "detailType", void 0);
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Field)({ nullable: true }),
52
+ tslib_1.__metadata("design:type", String)
53
+ ], ChecklistItemInputType.prototype, "inspctionCriteria", void 0);
54
+ ChecklistItemInputType = tslib_1.__decorate([
55
+ (0, type_graphql_1.InputType)()
56
+ ], ChecklistItemInputType);
57
+ let NewBuildingInspection = class NewBuildingInspection {
58
+ };
59
+ tslib_1.__decorate([
60
+ (0, type_graphql_1.Field)({ nullable: false }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], NewBuildingInspection.prototype, "buildingLevelId", void 0);
63
+ tslib_1.__decorate([
64
+ (0, type_graphql_1.Field)(type => ChecklistInputType, { nullable: false }),
65
+ tslib_1.__metadata("design:type", ChecklistInputType)
66
+ ], NewBuildingInspection.prototype, "checklist", void 0);
67
+ tslib_1.__decorate([
68
+ (0, type_graphql_1.Field)(type => [ChecklistItemInputType], { nullable: false }),
69
+ tslib_1.__metadata("design:type", Array)
70
+ ], NewBuildingInspection.prototype, "checklistItem", void 0);
71
+ NewBuildingInspection = tslib_1.__decorate([
72
+ (0, type_graphql_1.InputType)()
73
+ ], NewBuildingInspection);
74
+ exports.NewBuildingInspection = NewBuildingInspection;
75
+ let ChecklistSubmitInputType = class ChecklistSubmitInputType {
76
+ };
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Field)({ nullable: false }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], ChecklistSubmitInputType.prototype, "id", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)({ nullable: true }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], ChecklistSubmitInputType.prototype, "overallConstructorSignature", void 0);
85
+ tslib_1.__decorate([
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ tslib_1.__metadata("design:type", String)
88
+ ], ChecklistSubmitInputType.prototype, "taskConstructorSignature", void 0);
89
+ tslib_1.__decorate([
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], ChecklistSubmitInputType.prototype, "overallSupervisorySignature", void 0);
93
+ tslib_1.__decorate([
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ tslib_1.__metadata("design:type", String)
96
+ ], ChecklistSubmitInputType.prototype, "taskSupervisorySignature", void 0);
97
+ ChecklistSubmitInputType = tslib_1.__decorate([
98
+ (0, type_graphql_1.InputType)()
99
+ ], ChecklistSubmitInputType);
100
+ let ChecklistItemSubmitInputType = class ChecklistItemSubmitInputType {
101
+ };
102
+ tslib_1.__decorate([
103
+ (0, type_graphql_1.Field)({ nullable: false }),
104
+ tslib_1.__metadata("design:type", String)
105
+ ], ChecklistItemSubmitInputType.prototype, "id", void 0);
106
+ tslib_1.__decorate([
107
+ (0, type_graphql_1.Field)({ nullable: true }),
108
+ tslib_1.__metadata("design:type", String)
109
+ ], ChecklistItemSubmitInputType.prototype, "constructionConfirmStatus", void 0);
110
+ tslib_1.__decorate([
111
+ (0, type_graphql_1.Field)({ nullable: true }),
112
+ tslib_1.__metadata("design:type", String)
113
+ ], ChecklistItemSubmitInputType.prototype, "supervisoryConfirmStatus", void 0);
114
+ ChecklistItemSubmitInputType = tslib_1.__decorate([
115
+ (0, type_graphql_1.InputType)()
116
+ ], ChecklistItemSubmitInputType);
117
+ let UpdateBuildingInspectionSubmitType = class UpdateBuildingInspectionSubmitType {
118
+ };
119
+ tslib_1.__decorate([
120
+ (0, type_graphql_1.Field)({ nullable: false }),
121
+ tslib_1.__metadata("design:type", String)
122
+ ], UpdateBuildingInspectionSubmitType.prototype, "id", void 0);
123
+ tslib_1.__decorate([
124
+ (0, type_graphql_1.Field)(type => ChecklistSubmitInputType, { nullable: false }),
125
+ tslib_1.__metadata("design:type", ChecklistSubmitInputType)
126
+ ], UpdateBuildingInspectionSubmitType.prototype, "checklist", void 0);
127
+ tslib_1.__decorate([
128
+ (0, type_graphql_1.Field)(type => [ChecklistItemSubmitInputType], { nullable: false }),
129
+ tslib_1.__metadata("design:type", Array)
130
+ ], UpdateBuildingInspectionSubmitType.prototype, "checklistItem", void 0);
131
+ UpdateBuildingInspectionSubmitType = tslib_1.__decorate([
132
+ (0, type_graphql_1.InputType)()
133
+ ], UpdateBuildingInspectionSubmitType);
134
+ exports.UpdateBuildingInspectionSubmitType = UpdateBuildingInspectionSubmitType;
135
+ let UpdateBuildingInspectionDrawingMarker = class UpdateBuildingInspectionDrawingMarker {
136
+ };
137
+ tslib_1.__decorate([
138
+ (0, type_graphql_1.Field)({ nullable: false }),
139
+ tslib_1.__metadata("design:type", String)
140
+ ], UpdateBuildingInspectionDrawingMarker.prototype, "id", void 0);
141
+ tslib_1.__decorate([
142
+ (0, type_graphql_1.Field)(type => String, { nullable: true }),
143
+ tslib_1.__metadata("design:type", String)
144
+ ], UpdateBuildingInspectionDrawingMarker.prototype, "drawingMarker", void 0);
145
+ UpdateBuildingInspectionDrawingMarker = tslib_1.__decorate([
146
+ (0, type_graphql_1.InputType)()
147
+ ], UpdateBuildingInspectionDrawingMarker);
148
+ exports.UpdateBuildingInspectionDrawingMarker = UpdateBuildingInspectionDrawingMarker;
149
+ let BuildingInspectionsOfProject = class BuildingInspectionsOfProject {
150
+ };
151
+ tslib_1.__decorate([
152
+ (0, type_graphql_1.Field)({ nullable: false }),
153
+ tslib_1.__metadata("design:type", String)
154
+ ], BuildingInspectionsOfProject.prototype, "projectId", void 0);
155
+ tslib_1.__decorate([
156
+ (0, type_graphql_1.Field)({ nullable: true }),
157
+ tslib_1.__metadata("design:type", Number)
158
+ ], BuildingInspectionsOfProject.prototype, "limit", void 0);
159
+ BuildingInspectionsOfProject = tslib_1.__decorate([
160
+ (0, type_graphql_1.InputType)()
161
+ ], BuildingInspectionsOfProject);
162
+ exports.BuildingInspectionsOfProject = BuildingInspectionsOfProject;
163
+ let BuildingInspectionsOfBuildingLevel = class BuildingInspectionsOfBuildingLevel {
164
+ };
165
+ tslib_1.__decorate([
166
+ (0, type_graphql_1.Field)({ nullable: false }),
167
+ tslib_1.__metadata("design:type", String)
168
+ ], BuildingInspectionsOfBuildingLevel.prototype, "buildingLevelId", void 0);
169
+ tslib_1.__decorate([
170
+ (0, type_graphql_1.Field)({ nullable: true }),
171
+ tslib_1.__metadata("design:type", Number)
172
+ ], BuildingInspectionsOfBuildingLevel.prototype, "limit", void 0);
173
+ BuildingInspectionsOfBuildingLevel = tslib_1.__decorate([
174
+ (0, type_graphql_1.InputType)()
175
+ ], BuildingInspectionsOfBuildingLevel);
176
+ exports.BuildingInspectionsOfBuildingLevel = BuildingInspectionsOfBuildingLevel;
177
+ let BuildingInspectionSummary = class BuildingInspectionSummary {
178
+ };
179
+ tslib_1.__decorate([
180
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '검측 대기 수' }),
181
+ tslib_1.__metadata("design:type", Number)
182
+ ], BuildingInspectionSummary.prototype, "wait", void 0);
183
+ tslib_1.__decorate([
184
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '검측 요청 수' }),
185
+ tslib_1.__metadata("design:type", Number)
186
+ ], BuildingInspectionSummary.prototype, "request", void 0);
187
+ tslib_1.__decorate([
188
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '검측 통과 수' }),
189
+ tslib_1.__metadata("design:type", Number)
190
+ ], BuildingInspectionSummary.prototype, "pass", void 0);
191
+ tslib_1.__decorate([
192
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '검측 실패 수' }),
193
+ tslib_1.__metadata("design:type", Number)
194
+ ], BuildingInspectionSummary.prototype, "fail", void 0);
195
+ BuildingInspectionSummary = tslib_1.__decorate([
196
+ (0, type_graphql_1.ObjectType)()
197
+ ], BuildingInspectionSummary);
198
+ exports.BuildingInspectionSummary = BuildingInspectionSummary;
199
+ let BuildingInspectionList = class BuildingInspectionList {
200
+ };
201
+ tslib_1.__decorate([
202
+ (0, type_graphql_1.Field)(type => [building_inspection_1.BuildingInspection]),
203
+ tslib_1.__metadata("design:type", Array)
204
+ ], BuildingInspectionList.prototype, "items", void 0);
205
+ tslib_1.__decorate([
206
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
207
+ tslib_1.__metadata("design:type", Number)
208
+ ], BuildingInspectionList.prototype, "total", void 0);
209
+ BuildingInspectionList = tslib_1.__decorate([
210
+ (0, type_graphql_1.ObjectType)()
211
+ ], BuildingInspectionList);
212
+ exports.BuildingInspectionList = BuildingInspectionList;
213
+ //# sourceMappingURL=building-inspection-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building-inspection-type.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,+DAAoF;AAGpF,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAkBvB,CAAA;AAjBC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACf;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4DACH;AAExB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kEACG;AAE9B;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;oDACV;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iEACG;AAE9B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;2DACnB;AAjBtB,kBAAkB;IADvB,IAAA,wBAAS,GAAE;GACN,kBAAkB,CAkBvB;AAGD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAY3B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EA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B,CAAC,CAAC;;qDACT;AAE3B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;AALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC;AANY,wDAAsB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { BuildingInspection, BuildingInspectionStatus } from './building-inspection'\n\n@InputType()\nclass ChecklistInputType {\n @Field({ nullable: false })\n name: string\n\n @Field({ nullable: false })\n constructionType: string\n\n @Field({ nullable: false })\n constructionDetailType: string\n\n @Field({ nullable: false })\n location?: string\n\n @Field({ nullable: false })\n inspectionDrawingType?: string\n\n @Field(type => [String], { nullable: false })\n inspectionParts?: string[]\n}\n\n@InputType()\nclass ChecklistItemInputType {\n @Field({ nullable: false })\n name: string\n\n @Field({ nullable: false })\n mainType: string\n\n @Field({ nullable: false })\n detailType: string\n\n @Field({ nullable: true })\n inspctionCriteria: string\n}\n\n@InputType()\nexport class NewBuildingInspection {\n @Field({ nullable: false })\n buildingLevelId: string\n\n @Field(type => ChecklistInputType, { nullable: false })\n checklist: ChecklistInputType\n\n @Field(type => [ChecklistItemInputType], { nullable: false })\n checklistItem: ChecklistItemInputType[]\n}\n\n@InputType()\nclass ChecklistSubmitInputType {\n @Field({ nullable: false })\n id: string\n\n @Field({ nullable: true })\n overallConstructorSignature?: string\n\n @Field({ nullable: true })\n taskConstructorSignature?: string\n\n @Field({ nullable: true })\n overallSupervisorySignature?: string\n\n @Field({ nullable: true })\n taskSupervisorySignature?: string\n}\n\n@InputType()\nclass ChecklistItemSubmitInputType {\n @Field({ nullable: false })\n id: string\n\n @Field({ nullable: true })\n constructionConfirmStatus?: string\n\n @Field({ nullable: true })\n supervisoryConfirmStatus?: string\n}\n\n@InputType()\nexport class UpdateBuildingInspectionSubmitType {\n @Field({ nullable: false })\n id: string\n\n @Field(type => ChecklistSubmitInputType, { nullable: false })\n checklist: ChecklistSubmitInputType\n\n @Field(type => [ChecklistItemSubmitInputType], { nullable: false })\n checklistItem: ChecklistItemSubmitInputType[]\n}\n@InputType()\nexport class UpdateBuildingInspectionDrawingMarker {\n @Field({ nullable: false })\n id: string\n\n @Field(type => String, { nullable: true })\n drawingMarker?: string\n}\n\n@InputType()\nexport class BuildingInspectionsOfProject {\n @Field({ nullable: false })\n projectId: string\n\n @Field({ nullable: true })\n limit: number\n}\n\n@InputType()\nexport class BuildingInspectionsOfBuildingLevel {\n @Field({ nullable: false })\n buildingLevelId: string\n\n @Field({ nullable: true })\n limit: number\n}\n\n@ObjectType()\nexport class BuildingInspectionSummary {\n @Field(type => Int, { description: '검측 대기 수' })\n wait: number\n\n @Field(type => Int, { description: '검측 요청 수' })\n request: number\n\n @Field(type => Int, { description: '검측 통과 수' })\n pass: number\n\n @Field(type => Int, { description: '검측 실패 수' })\n fail: number\n}\n\n@ObjectType()\nexport class BuildingInspectionList {\n @Field(type => [BuildingInspection])\n items: BuildingInspection[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { BuildingLevel } from '@dssp/building-complex';
3
+ import { Checklist } from '../checklist/checklist';
4
+ export declare enum BuildingInspectionStatus {
5
+ WAIT = "WAIT",
6
+ REQUEST = "REQUEST",
7
+ PASS = "PASS",
8
+ FAIL = "FAIL"
9
+ }
10
+ export declare class BuildingInspection {
11
+ readonly id: string;
12
+ status?: BuildingInspectionStatus;
13
+ requestDate?: Date;
14
+ drawingMarker?: string;
15
+ buildingLevel?: BuildingLevel;
16
+ buildingLevelId?: string;
17
+ checklist?: Checklist;
18
+ checklistId?: string;
19
+ createdAt?: Date;
20
+ updatedAt?: Date;
21
+ deletedAt?: Date;
22
+ creator?: User;
23
+ creatorId?: string;
24
+ updater?: User;
25
+ updaterId?: string;
26
+ }