@dssp/supervision 1.0.0-alpha.0 → 1.0.0-alpha.14

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 (288) hide show
  1. package/dist-client/pages/action-plan/action-plan-importer.js.map +1 -1
  2. package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
  3. package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
  4. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  6. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
  8. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  9. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -2
  10. package/dist-client/pages/building-inspection/building-inspection-list.js +2 -1
  11. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  12. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
  14. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  15. package/dist-client/pages/building-inspection/inspection-create-popup.js +8 -5
  16. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  17. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +46 -0
  18. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +930 -0
  19. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  20. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  21. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +736 -0
  22. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  23. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  24. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  25. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  26. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
  27. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
  28. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
  29. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  30. package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
  31. package/dist-client/pages/checklist/checklist-view.js +291 -185
  32. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  33. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
  34. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
  35. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  36. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  37. package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
  38. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  39. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +2 -2
  40. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
  41. package/dist-client/pages/issue/issue-importer.js.map +1 -1
  42. package/dist-client/pages/issue/issue-list-page.js.map +1 -1
  43. package/dist-client/pages/project-report/project-report-importer.js.map +1 -1
  44. package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
  45. package/dist-client/pages/supervisor/supervisor-importer.js.map +1 -1
  46. package/dist-client/pages/supervisor/supervisor-list-page.js.map +1 -1
  47. package/dist-client/route.d.ts +1 -1
  48. package/dist-client/route.js +3 -0
  49. package/dist-client/route.js.map +1 -1
  50. package/dist-client/stt/speech-to-text.d.ts +36 -0
  51. package/dist-client/stt/speech-to-text.js +89 -0
  52. package/dist-client/stt/speech-to-text.js.map +1 -0
  53. package/dist-client/stt/stt-utils.d.ts +28 -0
  54. package/dist-client/stt/stt-utils.js +146 -0
  55. package/dist-client/stt/stt-utils.js.map +1 -0
  56. package/dist-client/tsconfig.tsbuildinfo +1 -1
  57. package/dist-server/middlewares/index.js +1 -2
  58. package/dist-server/middlewares/index.js.map +1 -1
  59. package/dist-server/service/action-plan/action-plan-mutation.js +2 -2
  60. package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
  61. package/dist-server/service/action-plan/action-plan-query.js +2 -2
  62. package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
  63. package/dist-server/service/action-plan/action-plan-type.js +6 -6
  64. package/dist-server/service/action-plan/action-plan-type.js.map +1 -1
  65. package/dist-server/service/action-plan/action-plan.js +3 -3
  66. package/dist-server/service/action-plan/action-plan.js.map +1 -1
  67. package/dist-server/service/action-plan/index.d.ts +0 -1
  68. package/dist-server/service/action-plan/index.js +1 -2
  69. package/dist-server/service/action-plan/index.js.map +1 -1
  70. package/dist-server/service/building-inspection/building-inspection-history.js +2 -2
  71. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  72. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +1 -0
  73. package/dist-server/service/building-inspection/building-inspection-mutation.js +91 -14
  74. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  75. package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
  76. package/dist-server/service/building-inspection/building-inspection-query.js +33 -4
  77. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  78. package/dist-server/service/building-inspection/building-inspection-type.d.ts +10 -3
  79. package/dist-server/service/building-inspection/building-inspection-type.js +45 -20
  80. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  81. package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
  82. package/dist-server/service/building-inspection/building-inspection.js +43 -5
  83. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  84. package/dist-server/service/building-inspection/index.d.ts +2 -4
  85. package/dist-server/service/building-inspection/index.js +2 -4
  86. package/dist-server/service/building-inspection/index.js.map +1 -1
  87. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  88. package/dist-server/service/checklist/checklist-history.js +38 -2
  89. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  90. package/dist-server/service/checklist/checklist-mutation.js +2 -2
  91. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  92. package/dist-server/service/checklist/checklist-query.js +2 -2
  93. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  94. package/dist-server/service/checklist/checklist-type.js +6 -6
  95. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  96. package/dist-server/service/checklist/checklist.d.ts +19 -1
  97. package/dist-server/service/checklist/checklist.js +78 -7
  98. package/dist-server/service/checklist/checklist.js.map +1 -1
  99. package/dist-server/service/checklist/index.d.ts +0 -2
  100. package/dist-server/service/checklist/index.js +1 -3
  101. package/dist-server/service/checklist/index.js.map +1 -1
  102. package/dist-server/service/checklist-item/checklist-item-mutation.js +2 -2
  103. package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -1
  104. package/dist-server/service/checklist-item/checklist-item-query.js +2 -2
  105. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  106. package/dist-server/service/checklist-item/checklist-item-type.js +2 -2
  107. package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -1
  108. package/dist-server/service/checklist-item/checklist-item.js +3 -3
  109. package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
  110. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +2 -2
  111. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -1
  112. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +2 -2
  113. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  114. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +2 -2
  115. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -1
  116. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +6 -6
  117. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -1
  118. package/dist-server/service/checklist-item-comment/checklist-item-comment.js +2 -2
  119. package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -1
  120. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  121. package/dist-server/service/checklist-item-comment/index.js +1 -3
  122. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  123. package/dist-server/service/checklist-template/checklist-template-mutation.js +2 -2
  124. package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -1
  125. package/dist-server/service/checklist-template/checklist-template-query.js +2 -2
  126. package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
  127. package/dist-server/service/checklist-template/checklist-template-type.js +4 -4
  128. package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -1
  129. package/dist-server/service/checklist-template/checklist-template.js +2 -2
  130. package/dist-server/service/checklist-template/checklist-template.js.map +1 -1
  131. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +2 -2
  132. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
  133. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +2 -2
  134. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
  135. package/dist-server/service/checklist-template-item/checklist-template-item-type.js +4 -4
  136. package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
  137. package/dist-server/service/checklist-template-item/checklist-template-item.js +4 -6
  138. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  139. package/dist-server/service/checklist-type/checklist-type-mutation.js +2 -2
  140. package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -1
  141. package/dist-server/service/checklist-type/checklist-type-query.js +2 -2
  142. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
  143. package/dist-server/service/checklist-type/checklist-type-type.js +4 -4
  144. package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -1
  145. package/dist-server/service/checklist-type/checklist-type.js +3 -3
  146. package/dist-server/service/checklist-type/checklist-type.js.map +1 -1
  147. package/dist-server/service/index.d.ts +0 -1
  148. package/dist-server/service/index.js +1 -11
  149. package/dist-server/service/index.js.map +1 -1
  150. package/dist-server/service/issue/index.d.ts +0 -1
  151. package/dist-server/service/issue/index.js +1 -2
  152. package/dist-server/service/issue/index.js.map +1 -1
  153. package/dist-server/service/issue/issue-mutation.js +2 -2
  154. package/dist-server/service/issue/issue-mutation.js.map +1 -1
  155. package/dist-server/service/issue/issue-query.js +2 -2
  156. package/dist-server/service/issue/issue-query.js.map +1 -1
  157. package/dist-server/service/issue/issue-type.js +6 -6
  158. package/dist-server/service/issue/issue-type.js.map +1 -1
  159. package/dist-server/service/issue/issue.js +3 -3
  160. package/dist-server/service/issue/issue.js.map +1 -1
  161. package/dist-server/service/project-report/index.d.ts +0 -1
  162. package/dist-server/service/project-report/index.js +1 -2
  163. package/dist-server/service/project-report/index.js.map +1 -1
  164. package/dist-server/service/project-report/project-report-mutation.js +2 -2
  165. package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
  166. package/dist-server/service/project-report/project-report-query.js +2 -2
  167. package/dist-server/service/project-report/project-report-query.js.map +1 -1
  168. package/dist-server/service/project-report/project-report-type.js +6 -6
  169. package/dist-server/service/project-report/project-report-type.js.map +1 -1
  170. package/dist-server/service/project-report/project-report.js +3 -3
  171. package/dist-server/service/project-report/project-report.js.map +1 -1
  172. package/dist-server/service/supervisor/index.d.ts +0 -1
  173. package/dist-server/service/supervisor/index.js +1 -2
  174. package/dist-server/service/supervisor/index.js.map +1 -1
  175. package/dist-server/service/supervisor/supervisor-mutation.js +2 -2
  176. package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
  177. package/dist-server/service/supervisor/supervisor-query.js +2 -2
  178. package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
  179. package/dist-server/service/supervisor/supervisor-type.js +6 -6
  180. package/dist-server/service/supervisor/supervisor-type.js.map +1 -1
  181. package/dist-server/service/supervisor/supervisor.js +3 -3
  182. package/dist-server/service/supervisor/supervisor.js.map +1 -1
  183. package/dist-server/tsconfig.tsbuildinfo +1 -1
  184. package/package.json +13 -13
  185. package/things-factory.config.js +3 -1
  186. package/client/bootstrap.ts +0 -1
  187. package/client/index.ts +0 -0
  188. package/client/pages/action-plan/action-plan-importer.ts +0 -94
  189. package/client/pages/action-plan/action-plan-list-page.ts +0 -340
  190. package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
  191. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
  192. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
  193. package/client/pages/building-inspection/building-inspection-list.ts +0 -565
  194. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
  195. package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
  196. package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
  197. package/client/pages/checklist/attachment-list-popup.ts +0 -301
  198. package/client/pages/checklist/checklist-view.ts +0 -581
  199. package/client/pages/checklist/comment-list-popup.ts +0 -328
  200. package/client/pages/checklist/file-preview-popup.ts +0 -70
  201. package/client/pages/checklist-template/checklist-template-item.ts +0 -240
  202. package/client/pages/checklist-template/checklist-template-list.ts +0 -368
  203. package/client/pages/checklist-template/checklist-type-management.ts +0 -262
  204. package/client/pages/issue/issue-importer.ts +0 -94
  205. package/client/pages/issue/issue-list-page.ts +0 -340
  206. package/client/pages/project-report/project-report-importer.ts +0 -94
  207. package/client/pages/project-report/project-report-list-page.ts +0 -340
  208. package/client/pages/supervisor/supervisor-importer.ts +0 -94
  209. package/client/pages/supervisor/supervisor-list-page.ts +0 -340
  210. package/client/route.ts +0 -27
  211. package/client/tsconfig.json +0 -11
  212. package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
  213. package/dist-server/service/building-inspection/event-subscriber.js +0 -21
  214. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  215. package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
  216. package/dist-server/service/checklist/event-subscriber.js +0 -21
  217. package/dist-server/service/checklist/event-subscriber.js.map +0 -1
  218. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  219. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  220. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
  221. package/server/controllers/index.ts +0 -0
  222. package/server/index.ts +0 -4
  223. package/server/middlewares/index.ts +0 -3
  224. package/server/migrations/index.ts +0 -9
  225. package/server/routes.ts +0 -28
  226. package/server/service/action-plan/action-plan-mutation.ts +0 -198
  227. package/server/service/action-plan/action-plan-query.ts +0 -62
  228. package/server/service/action-plan/action-plan-type.ts +0 -61
  229. package/server/service/action-plan/action-plan.ts +0 -103
  230. package/server/service/action-plan/index.ts +0 -7
  231. package/server/service/building-inspection/building-inspection-history.ts +0 -72
  232. package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
  233. package/server/service/building-inspection/building-inspection-query.ts +0 -242
  234. package/server/service/building-inspection/building-inspection-type.ts +0 -145
  235. package/server/service/building-inspection/building-inspection.ts +0 -108
  236. package/server/service/building-inspection/event-subscriber.ts +0 -20
  237. package/server/service/building-inspection/index.ts +0 -11
  238. package/server/service/checklist/checklist-history.ts +0 -96
  239. package/server/service/checklist/checklist-mutation.ts +0 -103
  240. package/server/service/checklist/checklist-query.ts +0 -58
  241. package/server/service/checklist/checklist-type.ts +0 -49
  242. package/server/service/checklist/checklist.ts +0 -127
  243. package/server/service/checklist/event-subscriber.ts +0 -17
  244. package/server/service/checklist/index.ts +0 -9
  245. package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
  246. package/server/service/checklist-item/checklist-item-query.ts +0 -84
  247. package/server/service/checklist-item/checklist-item-type.ts +0 -12
  248. package/server/service/checklist-item/checklist-item.ts +0 -103
  249. package/server/service/checklist-item/index.ts +0 -7
  250. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
  251. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
  252. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
  253. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
  254. package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
  255. package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
  256. package/server/service/checklist-item-comment/index.ts +0 -9
  257. package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
  258. package/server/service/checklist-template/checklist-template-query.ts +0 -39
  259. package/server/service/checklist-template/checklist-template-type.ts +0 -23
  260. package/server/service/checklist-template/checklist-template.ts +0 -71
  261. package/server/service/checklist-template/index.ts +0 -6
  262. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
  263. package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
  264. package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
  265. package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
  266. package/server/service/checklist-template-item/index.ts +0 -6
  267. package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
  268. package/server/service/checklist-type/checklist-type-query.ts +0 -39
  269. package/server/service/checklist-type/checklist-type-type.ts +0 -26
  270. package/server/service/checklist-type/checklist-type.ts +0 -64
  271. package/server/service/checklist-type/index.ts +0 -6
  272. package/server/service/index.ts +0 -88
  273. package/server/service/issue/index.ts +0 -7
  274. package/server/service/issue/issue-mutation.ts +0 -198
  275. package/server/service/issue/issue-query.ts +0 -62
  276. package/server/service/issue/issue-type.ts +0 -61
  277. package/server/service/issue/issue.ts +0 -100
  278. package/server/service/project-report/index.ts +0 -7
  279. package/server/service/project-report/project-report-mutation.ts +0 -198
  280. package/server/service/project-report/project-report-query.ts +0 -62
  281. package/server/service/project-report/project-report-type.ts +0 -61
  282. package/server/service/project-report/project-report.ts +0 -113
  283. package/server/service/supervisor/index.ts +0 -7
  284. package/server/service/supervisor/supervisor-mutation.ts +0 -198
  285. package/server/service/supervisor/supervisor-query.ts +0 -62
  286. package/server/service/supervisor/supervisor-type.ts +0 -61
  287. package/server/service/supervisor/supervisor.ts +0 -108
  288. package/server/tsconfig.json +0 -10
@@ -1,84 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
2
- import { Attachment } from '@things-factory/attachment-base'
3
- import { getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
4
- import { User } from '@things-factory/auth-base'
5
- import { ChecklistItem } from './checklist-item'
6
- import { ChecklistItemList } from './checklist-item-type'
7
- import { ChecklistItemComment } from '../checklist-item-comment/checklist-item-comment'
8
- import { BuildingInspection } from '../building-inspection/building-inspection'
9
-
10
- @Resolver(ChecklistItem)
11
- export class ChecklistItemQuery {
12
- @Query(returns => ChecklistItem!, { nullable: true, description: 'To fetch a ChecklistItem' })
13
- async checklistItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ChecklistItem> {
14
- return await getRepository(ChecklistItem).findOne({
15
- where: { id }
16
- })
17
- }
18
-
19
- @Query(returns => ChecklistItemList, { description: 'To fetch multiple ChecklistItems' })
20
- async checklistItems(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ChecklistItemList> {
21
- const queryBuilder = getQueryBuilderFromListParams({
22
- params,
23
- repository: await getRepository(ChecklistItem),
24
- searchables: ['name', 'description']
25
- })
26
-
27
- const [items, total] = await queryBuilder.getManyAndCount()
28
-
29
- return { items, total }
30
- }
31
-
32
- @Query(returns => BuildingInspection, { description: 'BuildingInspection By ChecklistItemId' })
33
- async inspectionByChecklistItemId(checklistItemId: string): Promise<BuildingInspection> {
34
- return getRepository(BuildingInspection)
35
- .createQueryBuilder('bi')
36
- .innerJoin('checklists', 'c', 'bi.checklist_id = c.id')
37
- .innerJoin('checklist_items', 'ci', 'c.id = ci.checklist_id')
38
- .where('ci.id = :checklistItemId', { checklistItemId })
39
- .getOne()
40
- }
41
-
42
- @FieldResolver(type => [ChecklistItemComment])
43
- async checklistItemComments(@Root() checklistItem: ChecklistItem): Promise<ChecklistItemComment[]> {
44
- return await getRepository(ChecklistItemComment).findBy({ checklistItem: { id: checklistItem.id } })
45
- }
46
-
47
- @FieldResolver(type => Number)
48
- async checklistItemCommentCount(@Root() checklistItem: ChecklistItem): Promise<number> {
49
- return await getRepository(ChecklistItemComment).countBy({ checklistItem: { id: checklistItem.id } })
50
- }
51
-
52
- @FieldResolver(type => [Attachment])
53
- async checklistItemAttachments(@Root() checklistItem: ChecklistItem): Promise<Attachment[]> {
54
- return await getRepository(Attachment).find({
55
- where: {
56
- refType: ChecklistItem.name,
57
- refBy: checklistItem.id
58
- },
59
- order: {
60
- createdAt: 'DESC'
61
- }
62
- })
63
- }
64
-
65
- @FieldResolver(type => Number)
66
- async checklistItemAttachmentCount(@Root() checklistItem: ChecklistItem): Promise<number> {
67
- return await getRepository(Attachment).count({
68
- where: {
69
- refType: ChecklistItem.name,
70
- refBy: checklistItem.id
71
- }
72
- })
73
- }
74
-
75
- @FieldResolver(type => User)
76
- async updater(@Root() checklistItem: ChecklistItem): Promise<User> {
77
- return await getRepository(User).findOneBy({ id: checklistItem.updaterId })
78
- }
79
-
80
- @FieldResolver(type => User)
81
- async creator(@Root() checklistItem: ChecklistItem): Promise<User> {
82
- return await getRepository(User).findOneBy({ id: checklistItem.creatorId })
83
- }
84
- }
@@ -1,12 +0,0 @@
1
- import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
2
-
3
- import { ChecklistItem } from './checklist-item'
4
-
5
- @ObjectType()
6
- export class ChecklistItemList {
7
- @Field(type => [ChecklistItem])
8
- items: ChecklistItem[]
9
-
10
- @Field(type => Int)
11
- total: number
12
- }
@@ -1,103 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- DeleteDateColumn,
5
- Entity,
6
- Index,
7
- Column,
8
- RelationId,
9
- ManyToOne,
10
- OneToMany,
11
- PrimaryGeneratedColumn
12
- } from 'typeorm'
13
- import { ObjectType, Field, ID, Int, registerEnumType } from 'type-graphql'
14
-
15
- import { User } from '@things-factory/auth-base'
16
- import { Checklist } from '../checklist/checklist'
17
- import { ChecklistItemComment } from '../checklist-item-comment/checklist-item-comment'
18
-
19
- export enum ChecklistItemConfirmStatus {
20
- T = '적합',
21
- F = '부적합'
22
- }
23
-
24
- registerEnumType(ChecklistItemConfirmStatus, {
25
- name: 'ChecklistItemConfirmStatus',
26
- description: '적합 상태'
27
- })
28
-
29
- @Entity({ comment: '체크 리스트 항목' })
30
- @Index('ix_checklist_item_0', (checklistItem: ChecklistItem) => [checklistItem.checklist], { where: '"deleted_at" IS NULL' })
31
- @ObjectType()
32
- export class ChecklistItem {
33
- @PrimaryGeneratedColumn('uuid')
34
- @Field(type => ID)
35
- readonly id: string
36
-
37
- @Column({ nullable: true, comment: '시퀀스' })
38
- @Field(type => Int, { nullable: true })
39
- sequence?: number
40
-
41
- @Column({ nullable: false, comment: '구분 (텍스트)' })
42
- @Field({ nullable: false })
43
- mainType?: string
44
-
45
- @Column({ nullable: false, comment: '상세 구분 (텍스트)' })
46
- @Field({ nullable: false })
47
- detailType?: string
48
-
49
- @Column({ nullable: true, comment: '검사 항목' })
50
- @Field({ nullable: true })
51
- name?: string
52
-
53
- @Column({ nullable: true, comment: '검사 기준' })
54
- @Field({ nullable: true })
55
- inspctionCriteria?: string
56
-
57
- @Column({ nullable: true, comment: '시공 관리자 적합 여부 (T: 적합, F: 부적합)' })
58
- @Field({ nullable: true })
59
- constructionConfirmStatus?: ChecklistItemConfirmStatus
60
-
61
- @Column({ nullable: true, comment: '감리 관리자 적합 여부 (T: 적합, F: 부적합)' })
62
- @Field({ nullable: true })
63
- supervisoryConfirmStatus?: ChecklistItemConfirmStatus
64
-
65
- // 조치 사항 정보 (하위 테이블 참조)
66
- @OneToMany(() => ChecklistItemComment, checklistItemComment => checklistItemComment.checklistItem)
67
- @Field(() => [ChecklistItemComment])
68
- checklistItemComments?: ChecklistItemComment[]
69
-
70
- // 체크리스트 정보 (상위 테이블 참조)
71
- @ManyToOne(type => Checklist)
72
- @Field(type => Checklist, { nullable: true })
73
- checklist?: Checklist
74
-
75
- @RelationId((checklistItem: ChecklistItem) => checklistItem.checklist)
76
- checklistId?: string
77
-
78
- @CreateDateColumn()
79
- @Field({ nullable: true })
80
- createdAt?: Date
81
-
82
- @UpdateDateColumn()
83
- @Field({ nullable: true })
84
- updatedAt?: Date
85
-
86
- @DeleteDateColumn()
87
- @Field({ nullable: true })
88
- deletedAt?: Date
89
-
90
- @ManyToOne(type => User, { nullable: true })
91
- @Field(type => User, { nullable: true })
92
- creator?: User
93
-
94
- @RelationId((checklistItem: ChecklistItem) => checklistItem.creator)
95
- creatorId?: string
96
-
97
- @ManyToOne(type => User, { nullable: true })
98
- @Field(type => User, { nullable: true })
99
- updater?: User
100
-
101
- @RelationId((checklistItem: ChecklistItem) => checklistItem.updater)
102
- updaterId?: string
103
- }
@@ -1,7 +0,0 @@
1
- import { ChecklistItem } from './checklist-item'
2
- import { ChecklistItemQuery } from './checklist-item-query'
3
- import { ChecklistItemMutation } from './checklist-item-mutation'
4
-
5
- export const entities = [ChecklistItem]
6
- export const resolvers = [ChecklistItemQuery, ChecklistItemMutation]
7
- export const subscribers = []
@@ -1,69 +0,0 @@
1
- import { Field, ID, ObjectType } from 'type-graphql'
2
- import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'
3
- import { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'
4
- import { User } from '@things-factory/auth-base'
5
- import { config } from '@things-factory/env'
6
- import { ChecklistItemComment } from './checklist-item-comment'
7
- import { ChecklistItem } from '../checklist-item/checklist-item'
8
-
9
- const ORMCONFIG = config.get('ormconfig', {})
10
- const DATABASE_TYPE = ORMCONFIG.type
11
-
12
- @Entity()
13
- @Index('ix_checklist-item-comment_history_0', (checklistItemCommentHistory: ChecklistItemCommentHistory) => [
14
- checklistItemCommentHistory.originalId
15
- ])
16
- @Index('ix_checklist-item-comment_history_1', (checklistItemCommentHistory: ChecklistItemCommentHistory) => [
17
- checklistItemCommentHistory.checklistItem
18
- ])
19
- @ObjectType({ description: 'History Entity of ChecklistItemComment' })
20
- export class ChecklistItemCommentHistory implements HistoryEntityInterface<ChecklistItemComment> {
21
- @PrimaryGeneratedColumn('uuid')
22
- @Field(type => ID)
23
- readonly id: string
24
-
25
- @Column({ nullable: true, comment: '조치 사항 코멘트' })
26
- @Field({ nullable: true })
27
- comment?: string
28
-
29
- // 체크리스트 아이템 정보 (상위 테이블 참조)
30
- @ManyToOne(type => ChecklistItem)
31
- @Field(type => ChecklistItem, { nullable: true })
32
- checklistItem?: ChecklistItem
33
-
34
- @RelationId((checklistItemComment: ChecklistItemComment) => checklistItemComment.checklistItem)
35
- checklistItemId?: string
36
-
37
- @Column({ nullable: true })
38
- @Field({ nullable: true })
39
- createdAt?: Date
40
-
41
- @Column({ nullable: true })
42
- @Field({ nullable: true })
43
- deletedAt?: Date
44
-
45
- @ManyToOne(type => User, { nullable: true })
46
- @Field(type => User, { nullable: true })
47
- creator?: User
48
-
49
- @RelationId((checklistItemComment: ChecklistItemComment) => checklistItemComment.creator)
50
- creatorId?: string
51
-
52
- @HistoryOriginalIdColumn()
53
- public originalId!: string
54
-
55
- @HistoryActionColumn({
56
- nullable: false,
57
- type:
58
- DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
59
- ? 'enum'
60
- : DATABASE_TYPE == 'oracle'
61
- ? 'varchar2'
62
- : DATABASE_TYPE == 'mssql'
63
- ? 'nvarchar'
64
- : 'varchar',
65
- enum: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? HistoryActionType : undefined,
66
- length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32
67
- })
68
- public action!: HistoryActionType
69
- }
@@ -1,80 +0,0 @@
1
- import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
- import { getRepository } from '@things-factory/shell'
3
- import { ChecklistItemComment } from './checklist-item-comment'
4
- import { NewChecklistItemComment, ChecklistItemCommentPatch } from './checklist-item-comment-type'
5
- import { BuildingInspectionStatus } from '../building-inspection/building-inspection'
6
- import { ChecklistItemQuery } from '../checklist-item/checklist-item-query'
7
-
8
- @Resolver(ChecklistItemComment)
9
- export class ChecklistItemCommentMutation {
10
- @Directive('@transaction')
11
- @Mutation(returns => ChecklistItemComment, { description: 'To create new ChecklistItemComment' })
12
- async createChecklistItemComment(
13
- @Arg('checklistItemComment') checklistItemComment: NewChecklistItemComment,
14
- @Ctx() context: ResolverContext
15
- ): Promise<ChecklistItemComment> {
16
- const { user, tx } = context.state
17
- const { comment, checklistItemId } = checklistItemComment
18
-
19
- // 합격 상태인지 체크
20
- const checklistItemQuery = new ChecklistItemQuery()
21
- const inspection = await checklistItemQuery.inspectionByChecklistItemId(checklistItemId)
22
- if (inspection.status === BuildingInspectionStatus.PASS) {
23
- throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')
24
- }
25
-
26
- const result = await getRepository(ChecklistItemComment, tx).save({
27
- comment,
28
- checklistItem: { id: checklistItemId },
29
- createdAt: new Date(),
30
- creator: user,
31
- updater: user
32
- })
33
-
34
- return result
35
- }
36
-
37
- @Directive('@transaction')
38
- @Mutation(returns => ChecklistItemComment, { description: 'To modify ChecklistItemComment information' })
39
- async updateChecklistItemComment(
40
- @Arg('id') id: string,
41
- @Arg('patch') patch: ChecklistItemCommentPatch,
42
- @Ctx() context: ResolverContext
43
- ): Promise<ChecklistItemComment> {
44
- const { user, tx } = context.state
45
-
46
- const repository = getRepository(ChecklistItemComment, tx)
47
- const checklistItemComment = await repository.findOne({
48
- where: { id }
49
- })
50
-
51
- const result = await repository.save({
52
- ...checklistItemComment,
53
- ...patch,
54
- updater: user
55
- })
56
-
57
- return result
58
- }
59
-
60
- @Directive('@transaction')
61
- @Mutation(returns => Boolean, { description: 'To delete ChecklistItemComment' })
62
- async deleteChecklistItemComment(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
63
- const { tx } = context.state
64
- const repository = getRepository(ChecklistItemComment, tx)
65
- const checklistItemComment = await repository.findOne({
66
- where: { id }
67
- })
68
-
69
- // 합격 상태인지 체크
70
- const checklistItemQuery = new ChecklistItemQuery()
71
- const inspection = await checklistItemQuery.inspectionByChecklistItemId(checklistItemComment.checklistItemId)
72
- if (inspection.status === BuildingInspectionStatus.PASS) {
73
- throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')
74
- }
75
-
76
- await repository.softDelete({ id })
77
-
78
- return true
79
- }
80
- }
@@ -1,36 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Arg, Ctx } from 'type-graphql'
2
- import { getRepository, Pagination } from '@things-factory/shell'
3
- import { User } from '@things-factory/auth-base'
4
- import { ChecklistItemComment } from './checklist-item-comment'
5
-
6
- @Resolver(ChecklistItemComment)
7
- export class ChecklistItemCommentQuery {
8
- @Query(returns => [ChecklistItemComment], { description: 'To fetch multiple ChecklistItemComments' })
9
- async checklistItemComments(
10
- @Arg('checklistItemId') checklistItemId: string,
11
- @Arg('pagination') pagination: Pagination,
12
- @Ctx() context: ResolverContext
13
- ): Promise<ChecklistItemComment[]> {
14
- const { limit, page } = pagination
15
-
16
- // 페이지네이션을 위한 offset 계산
17
- const offset = (page - 1) * limit
18
-
19
- // 코멘트와 총 개수를 가져오는 쿼리
20
- const items = await getRepository(ChecklistItemComment)
21
- .createQueryBuilder('cic')
22
- .innerJoin('cic.checklistItem', 'ci')
23
- .where('cic.checklistItem = :checklistItemId', { checklistItemId })
24
- .skip(offset)
25
- .take(limit)
26
- .orderBy('cic.createdAt', 'DESC')
27
- .getMany()
28
-
29
- return items
30
- }
31
-
32
- @FieldResolver(type => User)
33
- async creator(@Root() checklistItemComment: ChecklistItemComment): Promise<User> {
34
- return checklistItemComment.creatorId && (await getRepository(User).findOneBy({ id: checklistItemComment.creatorId }))
35
- }
36
- }
@@ -1,32 +0,0 @@
1
- import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
- import { ChecklistItemComment } from './checklist-item-comment'
3
-
4
- @InputType()
5
- export class NewChecklistItemComment {
6
- @Field({ nullable: true })
7
- comment?: string
8
-
9
- @Field({ nullable: true })
10
- checklistItemId?: string
11
- }
12
-
13
- @InputType()
14
- export class ChecklistItemCommentPatch {
15
- @Field(type => ID, { nullable: true })
16
- id?: string
17
-
18
- @Field({ nullable: true })
19
- comment?: string
20
-
21
- @Field({ nullable: true })
22
- checklistItemId?: string
23
- }
24
-
25
- @ObjectType()
26
- export class ChecklistItemCommentList {
27
- @Field(type => [ChecklistItemComment])
28
- items: ChecklistItemComment[]
29
-
30
- @Field(type => Int)
31
- total: number
32
- }
@@ -1,56 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- DeleteDateColumn,
5
- Entity,
6
- Index,
7
- Column,
8
- RelationId,
9
- ManyToOne,
10
- PrimaryGeneratedColumn
11
- } from 'typeorm'
12
- import { ObjectType, Field, ID } from 'type-graphql'
13
- import { User } from '@things-factory/auth-base'
14
- import { ChecklistItem } from '../checklist-item/checklist-item'
15
-
16
- @Entity()
17
- @Index(
18
- 'ix_checklist_item_comment_0',
19
- (checklistItemComment: ChecklistItemComment) => [checklistItemComment.checklistItem, checklistItemComment.createdAt],
20
- {
21
- where: '"deleted_at" IS NULL'
22
- }
23
- )
24
- @ObjectType({ description: 'Entity for ChecklistItemComment' })
25
- export class ChecklistItemComment {
26
- @PrimaryGeneratedColumn('uuid')
27
- @Field(type => ID)
28
- readonly id: string
29
-
30
- @Column({ nullable: true, comment: '조치 사항 코멘트' })
31
- @Field({ nullable: true })
32
- comment?: string
33
-
34
- // 체크리스트 아이템 정보 (상위 테이블 참조)
35
- @ManyToOne(type => ChecklistItem)
36
- @Field(type => ChecklistItem, { nullable: true })
37
- checklistItem?: ChecklistItem
38
-
39
- @RelationId((checklistItemComment: ChecklistItemComment) => checklistItemComment.checklistItem)
40
- checklistItemId?: string
41
-
42
- @CreateDateColumn()
43
- @Field({ nullable: true })
44
- createdAt?: Date
45
-
46
- @DeleteDateColumn()
47
- @Field({ nullable: true })
48
- deletedAt?: Date
49
-
50
- @ManyToOne(type => User, { nullable: true })
51
- @Field(type => User, { nullable: true })
52
- creator?: User
53
-
54
- @RelationId((checklistItemComment: ChecklistItemComment) => checklistItemComment.creator)
55
- creatorId?: string
56
- }
@@ -1,17 +0,0 @@
1
- import { EventSubscriber } from 'typeorm'
2
-
3
- import { HistoryEntitySubscriber } from '@operato/typeorm-history'
4
-
5
- import { ChecklistItemComment } from './checklist-item-comment'
6
- import { ChecklistItemCommentHistory } from './checklist-item-comment-history'
7
-
8
- @EventSubscriber()
9
- export class ChecklistItemCommentHistoryEntitySubscriber extends HistoryEntitySubscriber<ChecklistItemComment, ChecklistItemCommentHistory> {
10
- public get entity() {
11
- return ChecklistItemComment
12
- }
13
-
14
- public get historyEntity() {
15
- return ChecklistItemCommentHistory
16
- }
17
- }
@@ -1,9 +0,0 @@
1
- import { ChecklistItemComment } from './checklist-item-comment'
2
- import { ChecklistItemCommentHistory } from './checklist-item-comment-history'
3
- import { ChecklistItemCommentHistoryEntitySubscriber } from './event-subscriber'
4
- import { ChecklistItemCommentQuery } from './checklist-item-comment-query'
5
- import { ChecklistItemCommentMutation } from './checklist-item-comment-mutation'
6
-
7
- export const entities = [ChecklistItemComment, ChecklistItemCommentHistory]
8
- export const resolvers = [ChecklistItemCommentQuery, ChecklistItemCommentMutation]
9
- export const subscribers = [ChecklistItemCommentHistoryEntitySubscriber]
@@ -1,66 +0,0 @@
1
- import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
- import { In } from 'typeorm'
3
- import { ChecklistTemplate } from './checklist-template'
4
- import { ChecklistTemplatePatch } from './checklist-template-type'
5
-
6
- @Resolver(ChecklistTemplate)
7
- export class ChecklistTemplateMutation {
8
- @Directive('@transaction')
9
- @Mutation(returns => [ChecklistTemplate], { description: "To modify multiple ChecklistTemplates' information" })
10
- async updateMultipleChecklistTemplate(
11
- @Arg('patches', type => [ChecklistTemplatePatch]) patches: ChecklistTemplatePatch[],
12
- @Ctx() context: ResolverContext
13
- ): Promise<ChecklistTemplate[]> {
14
- const { domain, user, tx } = context.state
15
-
16
- let results = []
17
- const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
18
- const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
19
- const checklistTemplateRepo = tx.getRepository(ChecklistTemplate)
20
-
21
- if (_createRecords.length > 0) {
22
- for (let i = 0; i < _createRecords.length; i++) {
23
- const newRecord = _createRecords[i]
24
-
25
- const result = await checklistTemplateRepo.save({
26
- ...newRecord,
27
- domain,
28
- creator: user,
29
- updater: user
30
- })
31
-
32
- results.push({ ...result, cuFlag: '+' })
33
- }
34
- }
35
-
36
- if (_updateRecords.length > 0) {
37
- for (let i = 0; i < _updateRecords.length; i++) {
38
- const updateRecord = _updateRecords[i]
39
- const checklistTemplate = await checklistTemplateRepo.findOneBy({ id: updateRecord.id })
40
-
41
- const result = await checklistTemplateRepo.save({
42
- ...checklistTemplate,
43
- ...updateRecord,
44
- updater: user
45
- })
46
-
47
- results.push({ ...result, cuFlag: 'M' })
48
- }
49
- }
50
-
51
- return results
52
- }
53
-
54
- @Directive('@transaction')
55
- @Mutation(returns => Boolean, { description: 'To delete multiple ChecklistTemplates' })
56
- async deleteChecklistTemplates(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {
57
- const { domain, tx } = context.state
58
-
59
- await tx.getRepository(ChecklistTemplate).delete({
60
- domain: { id: domain.id },
61
- id: In(ids)
62
- })
63
-
64
- return true
65
- }
66
- }
@@ -1,39 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Ctx } from 'type-graphql'
2
- import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
- import { User } from '@things-factory/auth-base'
4
- import { ChecklistTemplate } from './checklist-template'
5
- import { ChecklistTemplateList } from './checklist-template-type'
6
-
7
- @Resolver(ChecklistTemplate)
8
- export class ChecklistTemplateQuery {
9
- @Query(returns => ChecklistTemplateList, { description: 'To fetch multiple ChecklistTemplates' })
10
- async checklistTemplates(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ChecklistTemplateList> {
11
- const { domain } = context.state
12
-
13
- const queryBuilder = getQueryBuilderFromListParams({
14
- domain,
15
- params,
16
- repository: await getRepository(ChecklistTemplate),
17
- searchables: ['name']
18
- })
19
-
20
- const [items, total] = await queryBuilder.getManyAndCount()
21
-
22
- return { items, total }
23
- }
24
-
25
- @FieldResolver(type => Domain)
26
- async domain(@Root() checklistTemplate: ChecklistTemplate): Promise<Domain> {
27
- return await getRepository(Domain).findOneBy({ id: checklistTemplate.domainId })
28
- }
29
-
30
- @FieldResolver(type => User)
31
- async updater(@Root() checklistTemplate: ChecklistTemplate): Promise<User> {
32
- return await getRepository(User).findOneBy({ id: checklistTemplate.updaterId })
33
- }
34
-
35
- @FieldResolver(type => User)
36
- async creator(@Root() checklistTemplate: ChecklistTemplate): Promise<User> {
37
- return await getRepository(User).findOneBy({ id: checklistTemplate.creatorId })
38
- }
39
- }
@@ -1,23 +0,0 @@
1
- import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
- import { ChecklistTemplate } from './checklist-template'
3
-
4
- @InputType()
5
- export class ChecklistTemplatePatch {
6
- @Field(type => ID, { nullable: true })
7
- id?: string
8
-
9
- @Field({ nullable: true })
10
- name?: string
11
-
12
- @Field({ nullable: true })
13
- cuFlag?: string
14
- }
15
-
16
- @ObjectType()
17
- export class ChecklistTemplateList {
18
- @Field(type => [ChecklistTemplate])
19
- items: ChecklistTemplate[]
20
-
21
- @Field(type => Int)
22
- total: number
23
- }