@dssp/supervision 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (217) hide show
  1. package/dist-client/graphql/building-inspection.d.ts +1 -0
  2. package/dist-client/graphql/building-inspection.js +100 -0
  3. package/dist-client/graphql/building-inspection.js.map +1 -0
  4. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +9 -0
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +130 -72
  6. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +1 -0
  8. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +77 -14
  9. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  10. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +18 -2
  11. package/dist-client/pages/building-inspection/building-inspection-list.js +360 -28
  12. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +31 -9
  14. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  15. package/dist-client/pages/building-inspection/component/daily-worklog-popup.d.ts +27 -0
  16. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js +542 -0
  17. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js.map +1 -0
  18. package/dist-client/pages/building-inspection/component/image-preview-popup.d.ts +15 -0
  19. package/dist-client/pages/building-inspection/component/image-preview-popup.js +351 -0
  20. package/dist-client/pages/building-inspection/component/image-preview-popup.js.map +1 -0
  21. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +20 -0
  22. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +432 -0
  23. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -0
  24. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +30 -0
  25. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +479 -0
  26. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -0
  27. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.d.ts +27 -0
  28. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js +401 -0
  29. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js.map +1 -0
  30. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +2 -1
  31. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +39 -17
  32. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  33. package/dist-client/pages/building-inspection/inspection-create-popup.js +22 -9
  34. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  35. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +60 -0
  36. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +1132 -0
  37. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  38. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  39. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +740 -0
  40. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  41. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.d.ts +19 -0
  42. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js +205 -0
  43. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js.map +1 -0
  44. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  45. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  46. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  47. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
  48. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
  49. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
  50. package/dist-client/pages/checklist/attachment-list-popup.d.ts +1 -0
  51. package/dist-client/pages/checklist/attachment-list-popup.js +250 -67
  52. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  53. package/dist-client/pages/checklist/checklist-view.d.ts +7 -0
  54. package/dist-client/pages/checklist/checklist-view.js +363 -185
  55. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  56. package/dist-client/pages/checklist/comment-list-popup.js +14 -3
  57. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
  58. package/dist-client/pages/checklist/file-preview-popup.js +0 -1
  59. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
  60. package/dist-client/pages/checklist/inspection-info-popup.d.ts +50 -0
  61. package/dist-client/pages/checklist/inspection-info-popup.js +684 -0
  62. package/dist-client/pages/checklist/inspection-info-popup.js.map +1 -0
  63. package/dist-client/pages/checklist/inspection-tab-popup.d.ts +18 -0
  64. package/dist-client/pages/checklist/inspection-tab-popup.js +196 -0
  65. package/dist-client/pages/checklist/inspection-tab-popup.js.map +1 -0
  66. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  67. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  68. package/dist-client/pages/checklist-template/checklist-template-list.js +2 -2
  69. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  70. package/dist-client/route.d.ts +1 -1
  71. package/dist-client/route.js +3 -0
  72. package/dist-client/route.js.map +1 -1
  73. package/dist-client/stt/speech-to-text.d.ts +36 -0
  74. package/dist-client/stt/speech-to-text.js +89 -0
  75. package/dist-client/stt/speech-to-text.js.map +1 -0
  76. package/dist-client/stt/stt-utils.d.ts +28 -0
  77. package/dist-client/stt/stt-utils.js +146 -0
  78. package/dist-client/stt/stt-utils.js.map +1 -0
  79. package/dist-client/tsconfig.tsbuildinfo +1 -1
  80. package/dist-server/service/action-plan/index.d.ts +0 -1
  81. package/dist-server/service/action-plan/index.js +1 -2
  82. package/dist-server/service/action-plan/index.js.map +1 -1
  83. package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -0
  84. package/dist-server/service/building-inspection/building-inspection-history.js +5 -0
  85. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  86. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +3 -3
  87. package/dist-server/service/building-inspection/building-inspection-mutation.js +145 -34
  88. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  89. package/dist-server/service/building-inspection/building-inspection-query.d.ts +3 -4
  90. package/dist-server/service/building-inspection/building-inspection-query.js +46 -30
  91. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  92. package/dist-server/service/building-inspection/building-inspection-type.d.ts +28 -9
  93. package/dist-server/service/building-inspection/building-inspection-type.js +96 -17
  94. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  95. package/dist-server/service/building-inspection/building-inspection.d.ts +13 -0
  96. package/dist-server/service/building-inspection/building-inspection.js +55 -2
  97. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  98. package/dist-server/service/building-inspection/index.d.ts +5 -8
  99. package/dist-server/service/building-inspection/index.js +11 -6
  100. package/dist-server/service/building-inspection/index.js.map +1 -1
  101. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +6 -0
  102. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +56 -0
  103. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
  104. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +16 -0
  105. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +171 -0
  106. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
  107. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +23 -0
  108. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +90 -0
  109. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
  110. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +33 -0
  111. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +132 -0
  112. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
  113. package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
  114. package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
  115. package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
  116. package/dist-server/service/building-inspection-history/building-inspection-history-query.d.ts +16 -0
  117. package/dist-server/service/building-inspection-history/building-inspection-history-query.js +120 -0
  118. package/dist-server/service/building-inspection-history/building-inspection-history-query.js.map +1 -0
  119. package/dist-server/service/building-inspection-history/building-inspection-history-type.d.ts +5 -0
  120. package/dist-server/service/building-inspection-history/building-inspection-history-type.js +21 -0
  121. package/dist-server/service/building-inspection-history/building-inspection-history-type.js.map +1 -0
  122. package/dist-server/service/building-inspection-history/building-inspection-history.d.ts +34 -0
  123. package/dist-server/service/building-inspection-history/building-inspection-history.js +157 -0
  124. package/dist-server/service/building-inspection-history/building-inspection-history.js.map +1 -0
  125. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.d.ts +1 -1
  126. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.js +1 -1
  127. package/dist-server/service/building-inspection-history/event-subscriber.js.map +1 -0
  128. package/dist-server/service/building-inspection-history/index.d.ts +6 -0
  129. package/dist-server/service/building-inspection-history/index.js +10 -0
  130. package/dist-server/service/building-inspection-history/index.js.map +1 -0
  131. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  132. package/dist-server/service/checklist/checklist-history.js +36 -0
  133. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  134. package/dist-server/service/checklist/checklist-mutation.d.ts +0 -5
  135. package/dist-server/service/checklist/checklist-mutation.js +1 -67
  136. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  137. package/dist-server/service/checklist/checklist-query.d.ts +6 -0
  138. package/dist-server/service/checklist/checklist-query.js +63 -0
  139. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  140. package/dist-server/service/checklist/checklist-type.d.ts +0 -13
  141. package/dist-server/service/checklist/checklist-type.js +1 -49
  142. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  143. package/dist-server/service/checklist/checklist.d.ts +38 -3
  144. package/dist-server/service/checklist/checklist.js +131 -15
  145. package/dist-server/service/checklist/checklist.js.map +1 -1
  146. package/dist-server/service/checklist/event-subscriber.d.ts +2 -2
  147. package/dist-server/service/checklist/event-subscriber.js +2 -2
  148. package/dist-server/service/checklist/event-subscriber.js.map +1 -1
  149. package/dist-server/service/checklist/index.d.ts +1 -4
  150. package/dist-server/service/checklist/index.js +2 -5
  151. package/dist-server/service/checklist/index.js.map +1 -1
  152. package/dist-server/service/checklist-history/checklist-history-query.d.ts +11 -0
  153. package/dist-server/service/checklist-history/checklist-history-query.js +77 -0
  154. package/dist-server/service/checklist-history/checklist-history-query.js.map +1 -0
  155. package/dist-server/service/checklist-history/checklist-history-type.d.ts +5 -0
  156. package/dist-server/service/checklist-history/checklist-history-type.js +21 -0
  157. package/dist-server/service/checklist-history/checklist-history-type.js.map +1 -0
  158. package/dist-server/service/checklist-history/checklist-history.d.ts +50 -0
  159. package/dist-server/service/checklist-history/checklist-history.js +239 -0
  160. package/dist-server/service/checklist-history/checklist-history.js.map +1 -0
  161. package/dist-server/service/checklist-history/event-subscriber.d.ts +7 -0
  162. package/dist-server/service/checklist-history/event-subscriber.js +21 -0
  163. package/dist-server/service/checklist-history/event-subscriber.js.map +1 -0
  164. package/dist-server/service/checklist-history/index.d.ts +6 -0
  165. package/dist-server/service/checklist-history/index.js +10 -0
  166. package/dist-server/service/checklist-history/index.js.map +1 -0
  167. package/dist-server/service/checklist-item/checklist-item-query.d.ts +1 -1
  168. package/dist-server/service/checklist-item/checklist-item-query.js +5 -3
  169. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  170. package/dist-server/service/checklist-item/index.d.ts +0 -1
  171. package/dist-server/service/checklist-item/index.js +1 -2
  172. package/dist-server/service/checklist-item/index.js.map +1 -1
  173. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +1 -0
  174. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +33 -6
  175. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  176. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  177. package/dist-server/service/checklist-item-comment/index.js +1 -3
  178. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  179. package/dist-server/service/checklist-item-history/checklist-item-history-query.d.ts +16 -0
  180. package/dist-server/service/checklist-item-history/checklist-item-history-query.js +123 -0
  181. package/dist-server/service/checklist-item-history/checklist-item-history-query.js.map +1 -0
  182. package/dist-server/service/checklist-item-history/checklist-item-history-type.d.ts +5 -0
  183. package/dist-server/service/checklist-item-history/checklist-item-history-type.js +21 -0
  184. package/dist-server/service/checklist-item-history/checklist-item-history-type.js.map +1 -0
  185. package/dist-server/service/checklist-item-history/checklist-item-history.d.ts +25 -0
  186. package/dist-server/service/checklist-item-history/checklist-item-history.js +123 -0
  187. package/dist-server/service/checklist-item-history/checklist-item-history.js.map +1 -0
  188. package/dist-server/service/checklist-item-history/event-subscriber.d.ts +7 -0
  189. package/dist-server/service/checklist-item-history/event-subscriber.js +21 -0
  190. package/dist-server/service/checklist-item-history/event-subscriber.js.map +1 -0
  191. package/dist-server/service/checklist-item-history/index.d.ts +6 -0
  192. package/dist-server/service/checklist-item-history/index.js +10 -0
  193. package/dist-server/service/checklist-item-history/index.js.map +1 -0
  194. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -4
  195. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  196. package/dist-server/service/index.d.ts +4 -2
  197. package/dist-server/service/index.js +22 -13
  198. package/dist-server/service/index.js.map +1 -1
  199. package/dist-server/service/issue/index.d.ts +0 -1
  200. package/dist-server/service/issue/index.js +1 -2
  201. package/dist-server/service/issue/index.js.map +1 -1
  202. package/dist-server/service/project-report/index.d.ts +0 -1
  203. package/dist-server/service/project-report/index.js +1 -2
  204. package/dist-server/service/project-report/index.js.map +1 -1
  205. package/dist-server/service/project-report/project-report.d.ts +0 -2
  206. package/dist-server/service/project-report/project-report.js +0 -6
  207. package/dist-server/service/project-report/project-report.js.map +1 -1
  208. package/dist-server/service/supervisor/index.d.ts +0 -1
  209. package/dist-server/service/supervisor/index.js +1 -2
  210. package/dist-server/service/supervisor/index.js.map +1 -1
  211. package/dist-server/tsconfig.tsbuildinfo +1 -1
  212. package/package.json +13 -13
  213. package/things-factory.config.js +3 -1
  214. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  215. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  216. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  217. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
@@ -9,11 +9,13 @@ const building_inspection_1 = require("./building-inspection");
9
9
  const building_inspection_type_1 = require("./building-inspection-type");
10
10
  const building_complex_1 = require("@dssp/building-complex");
11
11
  const checklist_1 = require("../checklist/checklist");
12
- const project_1 = require("@dssp/project");
12
+ const env_1 = require("@things-factory/env");
13
+ const auth_base_1 = require("@things-factory/auth-base");
14
+ const projectType = env_1.config.get('projectType', building_inspection_1.ProjectType.DSSP);
13
15
  let BuildingInspectionQuery = class BuildingInspectionQuery {
14
16
  async buildingInspection(id, context) {
15
17
  return await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection).findOne({
16
- where: { id }
18
+ where: { id, projectType }
17
19
  });
18
20
  }
19
21
  async buildingInspections(params, context) {
@@ -22,7 +24,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
22
24
  params,
23
25
  repository: await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection),
24
26
  searchables: ['name']
25
- });
27
+ }).andWhere('project_type = :projectType', { projectType });
26
28
  const [items, total] = await queryBuilder.getManyAndCount();
27
29
  return { items, total };
28
30
  }
@@ -37,6 +39,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
37
39
  .innerJoin('projects', 'p', 'bc.id = p.building_complex_id')
38
40
  .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')
39
41
  .where('p.domain = :domain', { domain: domain.id })
42
+ .andWhere('bi.project_type = :projectType', { projectType })
40
43
  .andWhere('p.id = :projectId', { projectId })
41
44
  .orderBy('bi.created_at', 'DESC');
42
45
  if (limit) {
@@ -45,24 +48,21 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
45
48
  const [items, total] = await queryBuilder.getManyAndCount();
46
49
  return { items, total };
47
50
  }
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
51
  async buildingInspectionsOfBuildingLevel(params, context) {
59
- const { buildingLevelId, limit } = params;
52
+ const { buildingLevelId, limit, startDate, endDate } = params;
60
53
  const queryBuilder = (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
61
54
  .createQueryBuilder('bi')
62
55
  .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')
63
56
  .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')
64
57
  .where('bl.id = :buildingLevelId', { buildingLevelId })
58
+ .andWhere('bi.project_type = :projectType', { projectType })
65
59
  .orderBy('bi.updated_at', 'DESC');
60
+ if (startDate) {
61
+ queryBuilder.andWhere('bi.request_date >= :startDate', { startDate });
62
+ }
63
+ if (endDate) {
64
+ queryBuilder.andWhere('bi.request_date <= :endDate', { endDate });
65
+ }
66
66
  if (limit) {
67
67
  queryBuilder.limit(limit);
68
68
  }
@@ -78,6 +78,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
78
78
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
79
79
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
80
80
  .where('bi.building_level_id = :buildingLevelId', { buildingLevelId })
81
+ .andWhere('bi.project_type = :projectType', { projectType })
81
82
  .groupBy('bi.building_level_id')
82
83
  .getRawOne();
83
84
  return {
@@ -98,6 +99,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
98
99
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
99
100
  .where('bi.building_level_id = :buildingLevelId', { buildingLevelId })
100
101
  .andWhere('bi.request_date BETWEEN :startDate AND :endDate', { startDate, endDate })
102
+ .andWhere('bi.project_type = :projectType', { projectType })
101
103
  .groupBy('bi.building_level_id')
102
104
  .addGroupBy('bi.request_date')
103
105
  .getRawMany();
@@ -112,6 +114,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
112
114
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
113
115
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
114
116
  .where('bi.building_level_id = :buildingLevelId', { buildingLevelId: buildingLevel.id })
117
+ .andWhere('bi.project_type = :projectType', { projectType })
115
118
  .groupBy('bi.building_level_id')
116
119
  .getRawOne();
117
120
  return {
@@ -123,18 +126,19 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
123
126
  }
124
127
  async buildingInspectionSummaryOfProject(projectId, context) {
125
128
  const { domain } = context.state;
126
- const result = await (0, shell_1.getRepository)(project_1.Project)
127
- .createQueryBuilder('p')
129
+ const result = await (0, shell_1.getRepository)(building_inspection_1.BuildingInspection)
130
+ .createQueryBuilder('bi')
128
131
  .select(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.WAIT}' OR bi.status='${building_inspection_1.BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`)
129
132
  .addSelect(`COUNT(CASE WHEN bi.status='${building_inspection_1.BuildingInspectionStatus.REQUEST}' OR bi.status='${building_inspection_1.BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`)
130
133
  .addSelect(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.PASS}' THEN 1 ELSE NULL END) AS pass`)
131
134
  .addSelect(`COUNT(CASE WHEN bi.status = '${building_inspection_1.BuildingInspectionStatus.FAIL}' THEN 1 ELSE NULL END) AS fail`)
132
- .innerJoin('p.buildingComplex', 'bc')
133
- .innerJoin('bc.buildings', 'b')
134
- .innerJoin('b.buildingLevels', 'bl')
135
- .leftJoin('building_inspections', 'bi', 'bi.building_level_id = bl.id AND bi.deleted_at IS NULL')
135
+ .innerJoin('building_levels', 'bl', 'bi.building_level_id = bl.id')
136
+ .innerJoin('buildings', 'b', 'bl.building_id = b.id')
137
+ .innerJoin('building_complexes', 'bc', 'b.building_complex_id = bc.id')
138
+ .innerJoin('projects', 'p', 'bc.id = p.building_complex_id')
136
139
  .where('p.domain = :domain', { domain: domain.id })
137
140
  .andWhere('p.id = :projectId', { projectId })
141
+ .andWhere('bi.project_type = :projectType', { projectType })
138
142
  .groupBy('p.id')
139
143
  .getRawOne();
140
144
  return {
@@ -150,7 +154,7 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
150
154
  async buildingLevel(buildingInspection) {
151
155
  return await (0, shell_1.getRepository)(building_complex_1.BuildingLevel).findOneBy({ id: buildingInspection.buildingLevelId });
152
156
  }
153
- async attatchments(buildingInspection) {
157
+ async attachments(buildingInspection) {
154
158
  const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).find({
155
159
  where: {
156
160
  refType: building_inspection_1.BuildingInspection.name,
@@ -159,6 +163,19 @@ let BuildingInspectionQuery = class BuildingInspectionQuery {
159
163
  });
160
164
  return attachment;
161
165
  }
166
+ async manager(buildingInspection) {
167
+ const queryBuilder = (0, shell_1.getRepository)(auth_base_1.User)
168
+ .createQueryBuilder('u')
169
+ .select('m.id', 'id')
170
+ .addSelect('m.phone', 'phone')
171
+ .addSelect('m.position', 'position')
172
+ .addSelect('u.id', 'userId')
173
+ .addSelect('u.name', 'name')
174
+ .addSelect('u.updated_at', 'updatedAt')
175
+ .leftJoin('managers', 'm', 'u.id = m.user_id')
176
+ .where('u.id = :userId', { userId: buildingInspection.managerId });
177
+ return await queryBuilder.getRawOne();
178
+ }
162
179
  };
163
180
  exports.BuildingInspectionQuery = BuildingInspectionQuery;
164
181
  tslib_1.__decorate([
@@ -185,14 +202,6 @@ tslib_1.__decorate([
185
202
  tslib_1.__metadata("design:paramtypes", [building_inspection_type_1.BuildingInspectionsOfProject, Object]),
186
203
  tslib_1.__metadata("design:returntype", Promise)
187
204
  ], BuildingInspectionQuery.prototype, "buildingInspectionsOfProject", null);
188
- tslib_1.__decorate([
189
- (0, type_graphql_1.Query)(returns => project_1.Project, { description: 'To fetch Project' }),
190
- tslib_1.__param(0, (0, type_graphql_1.Arg)('buildingLevelId')),
191
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
192
- tslib_1.__metadata("design:type", Function),
193
- tslib_1.__metadata("design:paramtypes", [String, Object]),
194
- tslib_1.__metadata("design:returntype", Promise)
195
- ], BuildingInspectionQuery.prototype, "projectByBuildingLevelId", null);
196
205
  tslib_1.__decorate([
197
206
  (0, type_graphql_1.Query)(returns => building_inspection_type_1.BuildingInspectionList, { description: 'To fetch multiple BuildingInspections' }),
198
207
  tslib_1.__param(0, (0, type_graphql_1.Arg)('params')),
@@ -254,7 +263,14 @@ tslib_1.__decorate([
254
263
  tslib_1.__metadata("design:type", Function),
255
264
  tslib_1.__metadata("design:paramtypes", [building_inspection_1.BuildingInspection]),
256
265
  tslib_1.__metadata("design:returntype", Promise)
257
- ], BuildingInspectionQuery.prototype, "attatchments", null);
266
+ ], BuildingInspectionQuery.prototype, "attachments", null);
267
+ tslib_1.__decorate([
268
+ (0, type_graphql_1.FieldResolver)(type => building_inspection_type_1.ProjectManagerOutput),
269
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
270
+ tslib_1.__metadata("design:type", Function),
271
+ tslib_1.__metadata("design:paramtypes", [building_inspection_1.BuildingInspection]),
272
+ tslib_1.__metadata("design:returntype", Promise)
273
+ ], BuildingInspectionQuery.prototype, "manager", null);
258
274
  exports.BuildingInspectionQuery = BuildingInspectionQuery = tslib_1.__decorate([
259
275
  (0, type_graphql_1.Resolver)(building_inspection_1.BuildingInspection)
260
276
  ], BuildingInspectionQuery);
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-query.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAA+F;AAC/F,+DAAoF;AACpF,yEAKmC;AACnC,6DAAsD;AACtD,sDAAkD;AAClD,2CAAuC;AAGhC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,kBAAkB,CAAY,EAAU,EAAS,OAAwB;QAC7E,OAAO,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,OAAO,CAAC;YACrD,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,mBAAmB,CAAS,MAAiB,EAAS,OAAwB;QAClF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,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AAE,uCAAuC,EAAE,CAAC;IAEtH,mBAAA,IAAA,kBAAG,EAAC,iBAAiB,CAAC,CAAA;IACtB,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,EAAC,SAAS,CAAC,CAAA;IACd,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4FAoBP;AAIK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oDAAyB,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,gCAAa;;wEAqBnE;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oDAAyB,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAE9E,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iFA6BP;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAS,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;wDAE7D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gCAAa,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;4DAEjE;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;2DAQhE;kCAjOU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CAkOnC","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(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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 @Query(returns => [BuildingInspectionSummary]!, { nullable: true, description: 'To fetch a BuildingInspection Summary' })\n async buildingInspectionDateSummaryOfLevelAndPeriod(\n @Arg('buildingLevelId') buildingLevelId: string,\n @Arg('startDate') startDate: string,\n @Arg('endDate') endDate: string,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionSummary[]> {\n const buildingInspectionSummary = await getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .select(`TO_CHAR(bi.request_date, 'YYYY-MM-DD') AS \"requestDate\"`)\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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 .andWhere('bi.request_date BETWEEN :startDate AND :endDate', { startDate, endDate })\n .groupBy('bi.building_level_id')\n .addGroupBy('bi.request_date')\n .getRawMany()\n\n return buildingInspectionSummary\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(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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"]}
1
+ {"version":3,"file":"building-inspection-query.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAA+F;AAC/F,+DAAiG;AACjG,yEAMmC;AACnC,6DAAsD;AACtD,sDAAkD;AAClD,6CAA4C;AAC5C,yDAAgD;AAEhD,MAAM,WAAW,GAAG,YAAM,CAAC,GAAG,CAAC,aAAa,EAAE,iCAAW,CAAC,IAAI,CAAC,CAAA;AAGxD,IAAM,uBAAuB,GAA7B,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B,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,gCAAa;;wEAsBnE;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oDAAyB,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAE9E,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iFA8BP;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAS,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;wDAE7D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gCAAa,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;4DAEjE;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,CAAC;IACjB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;0DAS/D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,+CAAoB,CAAC;IAC7B,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAa3D;kCA/OU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CAgPnC","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, ProjectType } from './building-inspection'\nimport {\n BuildingInspectionList,\n BuildingInspectionsOfBuildingLevel,\n BuildingInspectionsOfProject,\n BuildingInspectionSummary,\n ProjectManagerOutput\n} from './building-inspection-type'\nimport { BuildingLevel } from '@dssp/building-complex'\nimport { Checklist } from '../checklist/checklist'\nimport { config } from '@things-factory/env'\nimport { User } from '@things-factory/auth-base'\n\nconst projectType = config.get('projectType', ProjectType.DSSP)\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, projectType }\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 }).andWhere('project_type = :projectType', { projectType })\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('bi.project_type = :projectType', { projectType })\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 => 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, startDate, endDate } = 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 .andWhere('bi.project_type = :projectType', { projectType })\n .orderBy('bi.updated_at', 'DESC')\n\n if (startDate) {\n queryBuilder.andWhere('bi.request_date >= :startDate', { startDate })\n }\n\n if (endDate) {\n queryBuilder.andWhere('bi.request_date <= :endDate', { endDate })\n }\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(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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 .andWhere('bi.project_type = :projectType', { projectType })\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 @Query(returns => [BuildingInspectionSummary]!, { nullable: true, description: 'To fetch a BuildingInspection Summary' })\n async buildingInspectionDateSummaryOfLevelAndPeriod(\n @Arg('buildingLevelId') buildingLevelId: string,\n @Arg('startDate') startDate: string,\n @Arg('endDate') endDate: string,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspectionSummary[]> {\n const buildingInspectionSummary = await getRepository(BuildingInspection)\n .createQueryBuilder('bi')\n .select(`TO_CHAR(bi.request_date, 'YYYY-MM-DD') AS \"requestDate\"`)\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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 .andWhere('bi.request_date BETWEEN :startDate AND :endDate', { startDate, endDate })\n .andWhere('bi.project_type = :projectType', { projectType })\n .groupBy('bi.building_level_id')\n .addGroupBy('bi.request_date')\n .getRawMany()\n\n return buildingInspectionSummary\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(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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 .andWhere('bi.project_type = :projectType', { projectType })\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(BuildingInspection)\n .createQueryBuilder('bi')\n .select(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.WAIT}' OR bi.status='${BuildingInspectionStatus.OVERALL_WAIT}' THEN 1 ELSE NULL END) AS wait`\n )\n .addSelect(\n `COUNT(CASE WHEN bi.status='${BuildingInspectionStatus.REQUEST}' OR bi.status='${BuildingInspectionStatus.OVERALL_REQUEST}' THEN 1 ELSE NULL END) AS request`\n )\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('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 .where('p.domain = :domain', { domain: domain.id })\n .andWhere('p.id = :projectId', { projectId })\n .andWhere('bi.project_type = :projectType', { projectType })\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 attachments(@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\n return attachment\n }\n\n @FieldResolver(type => ProjectManagerOutput)\n async manager(@Root() buildingInspection: BuildingInspection): Promise<ProjectManagerOutput> {\n const queryBuilder = getRepository(User)\n .createQueryBuilder('u')\n .select('m.id', 'id')\n .addSelect('m.phone', 'phone')\n .addSelect('m.position', 'position')\n .addSelect('u.id', 'userId')\n .addSelect('u.name', 'name')\n .addSelect('u.updated_at', 'updatedAt')\n .leftJoin('managers', 'm', 'u.id = m.user_id')\n .where('u.id = :userId', { userId: buildingInspection.managerId })\n\n return await queryBuilder.getRawOne()\n }\n}\n"]}
@@ -1,43 +1,53 @@
1
1
  import { BuildingInspection } from './building-inspection';
2
- declare class ChecklistInputType {
2
+ import { InspectionResultStatus, InspectionResultType } from '../checklist/checklist';
3
+ export declare class ChecklistInputType {
3
4
  name: string;
4
- constructionType: string;
5
- constructionDetailType: string;
5
+ constructionType?: string;
6
+ constructionDetailType?: string;
6
7
  location?: string;
7
8
  inspectionDrawingType?: string;
8
9
  inspectionParts?: string[];
9
10
  }
10
- declare class ChecklistItemInputType {
11
+ export declare class ChecklistItemInputType {
11
12
  name: string;
12
13
  mainType: string;
13
14
  detailType: string;
14
15
  inspctionCriteria: string;
15
16
  }
16
17
  export declare class NewBuildingInspection {
17
- buildingLevelId: string;
18
+ buildingLevelId?: string;
18
19
  checklist: ChecklistInputType;
19
20
  checklistItem: ChecklistItemInputType[];
21
+ cellX?: number;
22
+ cellY?: number;
23
+ managerId?: string;
20
24
  }
21
- declare class ChecklistSubmitInputType {
25
+ export declare class ChecklistSubmitInputType {
22
26
  id: string;
23
27
  overallConstructorSignature?: string;
24
28
  taskConstructorSignature?: string;
25
29
  overallSupervisorySignature?: string;
26
30
  taskSupervisorySignature?: string;
31
+ inspectionRequestMemo?: string;
32
+ inspectionResultMemo?: string;
33
+ inspectionResultStatus?: InspectionResultStatus;
34
+ inspectionResultType?: InspectionResultType;
27
35
  }
28
- declare class ChecklistItemSubmitInputType {
36
+ export declare class ChecklistItemSubmitInputType {
29
37
  id: string;
30
38
  constructionConfirmStatus?: string;
31
39
  supervisoryConfirmStatus?: string;
32
40
  }
33
41
  export declare class UpdateBuildingInspectionSubmitType {
34
42
  id: string;
43
+ memo?: string;
35
44
  checklist: ChecklistSubmitInputType;
36
45
  checklistItem: ChecklistItemSubmitInputType[];
37
46
  }
38
- export declare class UpdateBuildingInspectionDrawingMarker {
47
+ export declare class UpdateBuildingInspection {
39
48
  id: string;
40
49
  drawingMarker?: string;
50
+ memo?: string;
41
51
  }
42
52
  export declare class BuildingInspectionsOfProject {
43
53
  projectId: string;
@@ -46,6 +56,8 @@ export declare class BuildingInspectionsOfProject {
46
56
  export declare class BuildingInspectionsOfBuildingLevel {
47
57
  buildingLevelId: string;
48
58
  limit: number;
59
+ startDate?: string;
60
+ endDate?: string;
49
61
  }
50
62
  export declare class BuildingInspectionSummary {
51
63
  requestDate?: string;
@@ -58,4 +70,11 @@ export declare class BuildingInspectionList {
58
70
  items: BuildingInspection[];
59
71
  total: number;
60
72
  }
61
- export {};
73
+ export declare class ProjectManagerOutput {
74
+ id?: string;
75
+ phone?: string;
76
+ position?: string;
77
+ userId?: string;
78
+ name?: string;
79
+ updatedAt?: string;
80
+ }
@@ -1,40 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildingInspectionList = exports.BuildingInspectionSummary = exports.BuildingInspectionsOfBuildingLevel = exports.BuildingInspectionsOfProject = exports.UpdateBuildingInspectionDrawingMarker = exports.UpdateBuildingInspectionSubmitType = exports.NewBuildingInspection = void 0;
3
+ exports.ProjectManagerOutput = exports.BuildingInspectionList = exports.BuildingInspectionSummary = exports.BuildingInspectionsOfBuildingLevel = exports.BuildingInspectionsOfProject = exports.UpdateBuildingInspection = exports.UpdateBuildingInspectionSubmitType = exports.ChecklistItemSubmitInputType = exports.ChecklistSubmitInputType = exports.NewBuildingInspection = exports.ChecklistItemInputType = exports.ChecklistInputType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const building_inspection_1 = require("./building-inspection");
7
+ const checklist_1 = require("../checklist/checklist");
7
8
  let ChecklistInputType = class ChecklistInputType {
8
9
  };
10
+ exports.ChecklistInputType = ChecklistInputType;
9
11
  tslib_1.__decorate([
10
12
  (0, type_graphql_1.Field)({ nullable: false }),
11
13
  tslib_1.__metadata("design:type", String)
12
14
  ], ChecklistInputType.prototype, "name", void 0);
13
15
  tslib_1.__decorate([
14
- (0, type_graphql_1.Field)({ nullable: false }),
16
+ (0, type_graphql_1.Field)({ nullable: true }),
15
17
  tslib_1.__metadata("design:type", String)
16
18
  ], ChecklistInputType.prototype, "constructionType", void 0);
17
19
  tslib_1.__decorate([
18
- (0, type_graphql_1.Field)({ nullable: false }),
20
+ (0, type_graphql_1.Field)({ nullable: true }),
19
21
  tslib_1.__metadata("design:type", String)
20
22
  ], ChecklistInputType.prototype, "constructionDetailType", void 0);
21
23
  tslib_1.__decorate([
22
- (0, type_graphql_1.Field)({ nullable: false }),
24
+ (0, type_graphql_1.Field)({ nullable: true }),
23
25
  tslib_1.__metadata("design:type", String)
24
26
  ], ChecklistInputType.prototype, "location", void 0);
25
27
  tslib_1.__decorate([
26
- (0, type_graphql_1.Field)({ nullable: false }),
28
+ (0, type_graphql_1.Field)({ nullable: true }),
27
29
  tslib_1.__metadata("design:type", String)
28
30
  ], ChecklistInputType.prototype, "inspectionDrawingType", void 0);
29
31
  tslib_1.__decorate([
30
- (0, type_graphql_1.Field)(type => [String], { nullable: false }),
32
+ (0, type_graphql_1.Field)(type => [String], { nullable: true }),
31
33
  tslib_1.__metadata("design:type", Array)
32
34
  ], ChecklistInputType.prototype, "inspectionParts", void 0);
33
- ChecklistInputType = tslib_1.__decorate([
35
+ exports.ChecklistInputType = ChecklistInputType = tslib_1.__decorate([
34
36
  (0, type_graphql_1.InputType)()
35
37
  ], ChecklistInputType);
36
38
  let ChecklistItemInputType = class ChecklistItemInputType {
37
39
  };
40
+ exports.ChecklistItemInputType = ChecklistItemInputType;
38
41
  tslib_1.__decorate([
39
42
  (0, type_graphql_1.Field)({ nullable: false }),
40
43
  tslib_1.__metadata("design:type", String)
@@ -51,14 +54,14 @@ tslib_1.__decorate([
51
54
  (0, type_graphql_1.Field)({ nullable: true }),
52
55
  tslib_1.__metadata("design:type", String)
53
56
  ], ChecklistItemInputType.prototype, "inspctionCriteria", void 0);
54
- ChecklistItemInputType = tslib_1.__decorate([
57
+ exports.ChecklistItemInputType = ChecklistItemInputType = tslib_1.__decorate([
55
58
  (0, type_graphql_1.InputType)()
56
59
  ], ChecklistItemInputType);
57
60
  let NewBuildingInspection = class NewBuildingInspection {
58
61
  };
59
62
  exports.NewBuildingInspection = NewBuildingInspection;
60
63
  tslib_1.__decorate([
61
- (0, type_graphql_1.Field)({ nullable: false }),
64
+ (0, type_graphql_1.Field)({ nullable: true }),
62
65
  tslib_1.__metadata("design:type", String)
63
66
  ], NewBuildingInspection.prototype, "buildingLevelId", void 0);
64
67
  tslib_1.__decorate([
@@ -69,11 +72,24 @@ tslib_1.__decorate([
69
72
  (0, type_graphql_1.Field)(type => [ChecklistItemInputType], { nullable: false }),
70
73
  tslib_1.__metadata("design:type", Array)
71
74
  ], NewBuildingInspection.prototype, "checklistItem", void 0);
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Field)({ nullable: true }),
77
+ tslib_1.__metadata("design:type", Number)
78
+ ], NewBuildingInspection.prototype, "cellX", void 0);
79
+ tslib_1.__decorate([
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", Number)
82
+ ], NewBuildingInspection.prototype, "cellY", void 0);
83
+ tslib_1.__decorate([
84
+ (0, type_graphql_1.Field)({ nullable: true }),
85
+ tslib_1.__metadata("design:type", String)
86
+ ], NewBuildingInspection.prototype, "managerId", void 0);
72
87
  exports.NewBuildingInspection = NewBuildingInspection = tslib_1.__decorate([
73
88
  (0, type_graphql_1.InputType)()
74
89
  ], NewBuildingInspection);
75
90
  let ChecklistSubmitInputType = class ChecklistSubmitInputType {
76
91
  };
92
+ exports.ChecklistSubmitInputType = ChecklistSubmitInputType;
77
93
  tslib_1.__decorate([
78
94
  (0, type_graphql_1.Field)({ nullable: false }),
79
95
  tslib_1.__metadata("design:type", String)
@@ -94,11 +110,28 @@ tslib_1.__decorate([
94
110
  (0, type_graphql_1.Field)({ nullable: true }),
95
111
  tslib_1.__metadata("design:type", String)
96
112
  ], ChecklistSubmitInputType.prototype, "taskSupervisorySignature", void 0);
97
- ChecklistSubmitInputType = tslib_1.__decorate([
113
+ tslib_1.__decorate([
114
+ (0, type_graphql_1.Field)({ nullable: true }),
115
+ tslib_1.__metadata("design:type", String)
116
+ ], ChecklistSubmitInputType.prototype, "inspectionRequestMemo", void 0);
117
+ tslib_1.__decorate([
118
+ (0, type_graphql_1.Field)({ nullable: true }),
119
+ tslib_1.__metadata("design:type", String)
120
+ ], ChecklistSubmitInputType.prototype, "inspectionResultMemo", void 0);
121
+ tslib_1.__decorate([
122
+ (0, type_graphql_1.Field)({ nullable: true }),
123
+ tslib_1.__metadata("design:type", String)
124
+ ], ChecklistSubmitInputType.prototype, "inspectionResultStatus", void 0);
125
+ tslib_1.__decorate([
126
+ (0, type_graphql_1.Field)({ nullable: true }),
127
+ tslib_1.__metadata("design:type", String)
128
+ ], ChecklistSubmitInputType.prototype, "inspectionResultType", void 0);
129
+ exports.ChecklistSubmitInputType = ChecklistSubmitInputType = tslib_1.__decorate([
98
130
  (0, type_graphql_1.InputType)()
99
131
  ], ChecklistSubmitInputType);
100
132
  let ChecklistItemSubmitInputType = class ChecklistItemSubmitInputType {
101
133
  };
134
+ exports.ChecklistItemSubmitInputType = ChecklistItemSubmitInputType;
102
135
  tslib_1.__decorate([
103
136
  (0, type_graphql_1.Field)({ nullable: false }),
104
137
  tslib_1.__metadata("design:type", String)
@@ -111,7 +144,7 @@ tslib_1.__decorate([
111
144
  (0, type_graphql_1.Field)({ nullable: true }),
112
145
  tslib_1.__metadata("design:type", String)
113
146
  ], ChecklistItemSubmitInputType.prototype, "supervisoryConfirmStatus", void 0);
114
- ChecklistItemSubmitInputType = tslib_1.__decorate([
147
+ exports.ChecklistItemSubmitInputType = ChecklistItemSubmitInputType = tslib_1.__decorate([
115
148
  (0, type_graphql_1.InputType)()
116
149
  ], ChecklistItemSubmitInputType);
117
150
  let UpdateBuildingInspectionSubmitType = class UpdateBuildingInspectionSubmitType {
@@ -121,6 +154,10 @@ tslib_1.__decorate([
121
154
  (0, type_graphql_1.Field)({ nullable: false }),
122
155
  tslib_1.__metadata("design:type", String)
123
156
  ], UpdateBuildingInspectionSubmitType.prototype, "id", void 0);
157
+ tslib_1.__decorate([
158
+ (0, type_graphql_1.Field)({ nullable: true }),
159
+ tslib_1.__metadata("design:type", String)
160
+ ], UpdateBuildingInspectionSubmitType.prototype, "memo", void 0);
124
161
  tslib_1.__decorate([
125
162
  (0, type_graphql_1.Field)(type => ChecklistSubmitInputType, { nullable: false }),
126
163
  tslib_1.__metadata("design:type", ChecklistSubmitInputType)
@@ -132,20 +169,24 @@ tslib_1.__decorate([
132
169
  exports.UpdateBuildingInspectionSubmitType = UpdateBuildingInspectionSubmitType = tslib_1.__decorate([
133
170
  (0, type_graphql_1.InputType)()
134
171
  ], UpdateBuildingInspectionSubmitType);
135
- let UpdateBuildingInspectionDrawingMarker = class UpdateBuildingInspectionDrawingMarker {
172
+ let UpdateBuildingInspection = class UpdateBuildingInspection {
136
173
  };
137
- exports.UpdateBuildingInspectionDrawingMarker = UpdateBuildingInspectionDrawingMarker;
174
+ exports.UpdateBuildingInspection = UpdateBuildingInspection;
138
175
  tslib_1.__decorate([
139
176
  (0, type_graphql_1.Field)({ nullable: false }),
140
177
  tslib_1.__metadata("design:type", String)
141
- ], UpdateBuildingInspectionDrawingMarker.prototype, "id", void 0);
178
+ ], UpdateBuildingInspection.prototype, "id", void 0);
179
+ tslib_1.__decorate([
180
+ (0, type_graphql_1.Field)(type => String, { nullable: true }),
181
+ tslib_1.__metadata("design:type", String)
182
+ ], UpdateBuildingInspection.prototype, "drawingMarker", void 0);
142
183
  tslib_1.__decorate([
143
184
  (0, type_graphql_1.Field)(type => String, { nullable: true }),
144
185
  tslib_1.__metadata("design:type", String)
145
- ], UpdateBuildingInspectionDrawingMarker.prototype, "drawingMarker", void 0);
146
- exports.UpdateBuildingInspectionDrawingMarker = UpdateBuildingInspectionDrawingMarker = tslib_1.__decorate([
186
+ ], UpdateBuildingInspection.prototype, "memo", void 0);
187
+ exports.UpdateBuildingInspection = UpdateBuildingInspection = tslib_1.__decorate([
147
188
  (0, type_graphql_1.InputType)()
148
- ], UpdateBuildingInspectionDrawingMarker);
189
+ ], UpdateBuildingInspection);
149
190
  let BuildingInspectionsOfProject = class BuildingInspectionsOfProject {
150
191
  };
151
192
  exports.BuildingInspectionsOfProject = BuildingInspectionsOfProject;
@@ -171,6 +212,14 @@ tslib_1.__decorate([
171
212
  (0, type_graphql_1.Field)({ nullable: true }),
172
213
  tslib_1.__metadata("design:type", Number)
173
214
  ], BuildingInspectionsOfBuildingLevel.prototype, "limit", void 0);
215
+ tslib_1.__decorate([
216
+ (0, type_graphql_1.Field)({ nullable: true }),
217
+ tslib_1.__metadata("design:type", String)
218
+ ], BuildingInspectionsOfBuildingLevel.prototype, "startDate", void 0);
219
+ tslib_1.__decorate([
220
+ (0, type_graphql_1.Field)({ nullable: true }),
221
+ tslib_1.__metadata("design:type", String)
222
+ ], BuildingInspectionsOfBuildingLevel.prototype, "endDate", void 0);
174
223
  exports.BuildingInspectionsOfBuildingLevel = BuildingInspectionsOfBuildingLevel = tslib_1.__decorate([
175
224
  (0, type_graphql_1.InputType)()
176
225
  ], BuildingInspectionsOfBuildingLevel);
@@ -214,4 +263,34 @@ tslib_1.__decorate([
214
263
  exports.BuildingInspectionList = BuildingInspectionList = tslib_1.__decorate([
215
264
  (0, type_graphql_1.ObjectType)()
216
265
  ], BuildingInspectionList);
266
+ let ProjectManagerOutput = class ProjectManagerOutput {
267
+ };
268
+ exports.ProjectManagerOutput = ProjectManagerOutput;
269
+ tslib_1.__decorate([
270
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
271
+ tslib_1.__metadata("design:type", String)
272
+ ], ProjectManagerOutput.prototype, "id", void 0);
273
+ tslib_1.__decorate([
274
+ (0, type_graphql_1.Field)({ nullable: true }),
275
+ tslib_1.__metadata("design:type", String)
276
+ ], ProjectManagerOutput.prototype, "phone", void 0);
277
+ tslib_1.__decorate([
278
+ (0, type_graphql_1.Field)({ nullable: true }),
279
+ tslib_1.__metadata("design:type", String)
280
+ ], ProjectManagerOutput.prototype, "position", void 0);
281
+ tslib_1.__decorate([
282
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
283
+ tslib_1.__metadata("design:type", String)
284
+ ], ProjectManagerOutput.prototype, "userId", void 0);
285
+ tslib_1.__decorate([
286
+ (0, type_graphql_1.Field)({ nullable: true }),
287
+ tslib_1.__metadata("design:type", String)
288
+ ], ProjectManagerOutput.prototype, "name", void 0);
289
+ tslib_1.__decorate([
290
+ (0, type_graphql_1.Field)({ nullable: true }),
291
+ tslib_1.__metadata("design:type", String)
292
+ ], ProjectManagerOutput.prototype, "updatedAt", void 0);
293
+ exports.ProjectManagerOutput = ProjectManagerOutput = tslib_1.__decorate([
294
+ (0, type_graphql_1.ObjectType)()
295
+ ], ProjectManagerOutput);
217
296
  //# sourceMappingURL=building-inspection-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-type.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,+DAA0D;AAG1D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAkBvB,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACf;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4DACH;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kEACG;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;oDACV;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iEACG;AAG9B;IADC,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,sBAA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AC;;uDACnC;oCAdD,yBAAyB;IADrC,IAAA,yBAAU,GAAE;GACA,yBAAyB,CAerC;AAGM,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AANY,wDAAsB;AAEjC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC;;qDACT;AAG3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;iCALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC","sourcesContent":["import { ObjectType, Field, InputType, Int } from 'type-graphql'\nimport { BuildingInspection } 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 => String, { nullable: true, description: '요청일자' })\n requestDate?: string\n\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"]}
1
+ {"version":3,"file":"building-inspection-type.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,+DAA0D;AAC1D,sDAAqF;AAG9E,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAkB9B,CAAA;AAlBY,gDAAkB;AAE7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACf;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACD;AAGzB;IADC,I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AE,CAAC;;uDACnC;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;uDACnC;oCAdD,yBAAyB;IADrC,IAAA,yBAAU,GAAE;GACA,yBAAyB,CAerC;AAGM,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AANY,wDAAsB;AAEjC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC;;qDACT;AAG3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;iCALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAkBhC,CAAA;AAlBY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACZ;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;oDACH;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;+BAjBP,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAkBhC","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { BuildingInspection } from './building-inspection'\nimport { InspectionResultStatus, InspectionResultType } from '../checklist/checklist'\n\n@InputType()\nexport class ChecklistInputType {\n @Field({ nullable: false })\n name: string\n\n @Field({ nullable: true })\n constructionType?: string\n\n @Field({ nullable: true })\n constructionDetailType?: string\n\n @Field({ nullable: true })\n location?: string\n\n @Field({ nullable: true })\n inspectionDrawingType?: string\n\n @Field(type => [String], { nullable: true })\n inspectionParts?: string[]\n}\n\n@InputType()\nexport class 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: true })\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 @Field({ nullable: true })\n cellX?: number\n\n @Field({ nullable: true })\n cellY?: number\n\n @Field({ nullable: true })\n managerId?: string\n}\n\n@InputType()\nexport class 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 @Field({ nullable: true })\n inspectionRequestMemo?: string\n\n @Field({ nullable: true })\n inspectionResultMemo?: string\n\n @Field({ nullable: true })\n inspectionResultStatus?: InspectionResultStatus\n\n @Field({ nullable: true })\n inspectionResultType?: InspectionResultType\n}\n\n@InputType()\nexport class 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({ nullable: true })\n memo?: 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 UpdateBuildingInspection {\n @Field({ nullable: false })\n id: string\n\n @Field(type => String, { nullable: true })\n drawingMarker?: string\n\n @Field(type => String, { nullable: true })\n memo?: 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 @Field({ nullable: true })\n startDate?: string\n\n @Field({ nullable: true })\n endDate?: string\n}\n\n@ObjectType()\nexport class BuildingInspectionSummary {\n @Field(type => String, { nullable: true, description: '요청일자' })\n requestDate?: string\n\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\n@ObjectType()\nexport class ProjectManagerOutput {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field({ nullable: true })\n position?: string\n\n @Field(type => ID)\n userId?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n updatedAt?: string\n}\n"]}