@dssp/project 1.0.0-y.0 → 1.0.0

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 (318) hide show
  1. package/package.json +15 -15
  2. package/dist-client/bootstrap.d.ts +0 -0
  3. package/dist-client/bootstrap.js +0 -2
  4. package/dist-client/bootstrap.js.map +0 -1
  5. package/dist-client/index.d.ts +0 -1
  6. package/dist-client/index.js +0 -2
  7. package/dist-client/index.js.map +0 -1
  8. package/dist-client/pages/lib/chatbot-widget.d.ts +0 -53
  9. package/dist-client/pages/lib/chatbot-widget.js +0 -631
  10. package/dist-client/pages/lib/chatbot-widget.js.map +0 -1
  11. package/dist-client/pages/lib/select2-component.d.ts +0 -23
  12. package/dist-client/pages/lib/select2-component.js +0 -181
  13. package/dist-client/pages/lib/select2-component.js.map +0 -1
  14. package/dist-client/pages/lib/waether.d.ts +0 -7
  15. package/dist-client/pages/lib/waether.js +0 -156
  16. package/dist-client/pages/lib/waether.js.map +0 -1
  17. package/dist-client/pages/project/component/pagenation.d.ts +0 -18
  18. package/dist-client/pages/project/component/pagenation.js +0 -142
  19. package/dist-client/pages/project/component/pagenation.js.map +0 -1
  20. package/dist-client/pages/project/component/project-update-header.d.ts +0 -1
  21. package/dist-client/pages/project/component/project-update-header.js +0 -121
  22. package/dist-client/pages/project/component/project-update-header.js.map +0 -1
  23. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +0 -1
  24. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +0 -309
  25. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +0 -1
  26. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +0 -1
  27. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +0 -357
  28. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +0 -1
  29. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +0 -1
  30. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +0 -681
  31. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +0 -1
  32. package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +0 -32
  33. package/dist-client/pages/project/popup/checklist/task-checklist-view.js +0 -621
  34. package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +0 -1
  35. package/dist-client/pages/project/popup/popup-plan-export.d.ts +0 -10
  36. package/dist-client/pages/project/popup/popup-plan-export.js +0 -242
  37. package/dist-client/pages/project/popup/popup-plan-export.js.map +0 -1
  38. package/dist-client/pages/project/popup/popup-plan-upload.d.ts +0 -13
  39. package/dist-client/pages/project/popup/popup-plan-upload.js +0 -265
  40. package/dist-client/pages/project/popup/popup-plan-upload.js.map +0 -1
  41. package/dist-client/pages/project/popup/popup-project-create.d.ts +0 -12
  42. package/dist-client/pages/project/popup/popup-project-create.js +0 -152
  43. package/dist-client/pages/project/popup/popup-project-create.js.map +0 -1
  44. package/dist-client/pages/project/popup/popup-task-upload.d.ts +0 -9
  45. package/dist-client/pages/project/popup/popup-task-upload.js +0 -105
  46. package/dist-client/pages/project/popup/popup-task-upload.js.map +0 -1
  47. package/dist-client/pages/project/project-completed-list.d.ts +0 -23
  48. package/dist-client/pages/project/project-completed-list.js +0 -322
  49. package/dist-client/pages/project/project-completed-list.js.map +0 -1
  50. package/dist-client/pages/project/project-detail.d.ts +0 -41
  51. package/dist-client/pages/project/project-detail.js +0 -959
  52. package/dist-client/pages/project/project-detail.js.map +0 -1
  53. package/dist-client/pages/project/project-list.d.ts +0 -185
  54. package/dist-client/pages/project/project-list.js +0 -402
  55. package/dist-client/pages/project/project-list.js.map +0 -1
  56. package/dist-client/pages/project/project-plan-management.d.ts +0 -33
  57. package/dist-client/pages/project/project-plan-management.js +0 -487
  58. package/dist-client/pages/project/project-plan-management.js.map +0 -1
  59. package/dist-client/pages/project/project-setting-list.d.ts +0 -29
  60. package/dist-client/pages/project/project-setting-list.js +0 -431
  61. package/dist-client/pages/project/project-setting-list.js.map +0 -1
  62. package/dist-client/pages/project/project-task-list.d.ts +0 -18
  63. package/dist-client/pages/project/project-task-list.js +0 -306
  64. package/dist-client/pages/project/project-task-list.js.map +0 -1
  65. package/dist-client/pages/project/project-task.d.ts +0 -51
  66. package/dist-client/pages/project/project-task.js +0 -686
  67. package/dist-client/pages/project/project-task.js.map +0 -1
  68. package/dist-client/pages/project/project-update.d.ts +0 -47
  69. package/dist-client/pages/project/project-update.js +0 -1197
  70. package/dist-client/pages/project/project-update.js.map +0 -1
  71. package/dist-client/pages/resource/construction-detail-type-popup.d.ts +0 -2
  72. package/dist-client/pages/resource/construction-detail-type-popup.js +0 -197
  73. package/dist-client/pages/resource/construction-detail-type-popup.js.map +0 -1
  74. package/dist-client/pages/resource/construction-type-management.d.ts +0 -34
  75. package/dist-client/pages/resource/construction-type-management.js +0 -200
  76. package/dist-client/pages/resource/construction-type-management.js.map +0 -1
  77. package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +0 -48
  78. package/dist-client/pages/resource/inspection-drawing-type-management.js +0 -234
  79. package/dist-client/pages/resource/inspection-drawing-type-management.js.map +0 -1
  80. package/dist-client/pages/resource/inspection-part-popup.d.ts +0 -2
  81. package/dist-client/pages/resource/inspection-part-popup.js +0 -197
  82. package/dist-client/pages/resource/inspection-part-popup.js.map +0 -1
  83. package/dist-client/pages/resource/resource-importer.d.ts +0 -10
  84. package/dist-client/pages/resource/resource-importer.js +0 -101
  85. package/dist-client/pages/resource/resource-importer.js.map +0 -1
  86. package/dist-client/pages/resource/resource-list-page.d.ts +0 -63
  87. package/dist-client/pages/resource/resource-list-page.js +0 -332
  88. package/dist-client/pages/resource/resource-list-page.js.map +0 -1
  89. package/dist-client/pages/resource/worker-type-management.d.ts +0 -34
  90. package/dist-client/pages/resource/worker-type-management.js +0 -180
  91. package/dist-client/pages/resource/worker-type-management.js.map +0 -1
  92. package/dist-client/pages/task/task-importer.d.ts +0 -10
  93. package/dist-client/pages/task/task-importer.js +0 -101
  94. package/dist-client/pages/task/task-importer.js.map +0 -1
  95. package/dist-client/pages/task/task-list-page.d.ts +0 -63
  96. package/dist-client/pages/task/task-list-page.js +0 -323
  97. package/dist-client/pages/task/task-list-page.js.map +0 -1
  98. package/dist-client/pages/task-resource/task-resource-importer.d.ts +0 -10
  99. package/dist-client/pages/task-resource/task-resource-importer.js +0 -101
  100. package/dist-client/pages/task-resource/task-resource-importer.js.map +0 -1
  101. package/dist-client/pages/task-resource/task-resource-list-page.d.ts +0 -63
  102. package/dist-client/pages/task-resource/task-resource-list-page.js +0 -332
  103. package/dist-client/pages/task-resource/task-resource-list-page.js.map +0 -1
  104. package/dist-client/route.d.ts +0 -1
  105. package/dist-client/route.js +0 -44
  106. package/dist-client/route.js.map +0 -1
  107. package/dist-client/tsconfig.tsbuildinfo +0 -1
  108. package/dist-server/controllers/export-tasks.d.ts +0 -7
  109. package/dist-server/controllers/export-tasks.js +0 -29
  110. package/dist-server/controllers/export-tasks.js.map +0 -1
  111. package/dist-server/controllers/import-task.d.ts +0 -3
  112. package/dist-server/controllers/import-task.js +0 -113
  113. package/dist-server/controllers/import-task.js.map +0 -1
  114. package/dist-server/controllers/index.d.ts +0 -0
  115. package/dist-server/controllers/index.js +0 -1
  116. package/dist-server/controllers/index.js.map +0 -1
  117. package/dist-server/controllers/parse-excel.d.ts +0 -2
  118. package/dist-server/controllers/parse-excel.js +0 -74
  119. package/dist-server/controllers/parse-excel.js.map +0 -1
  120. package/dist-server/controllers/types.d.ts +0 -18
  121. package/dist-server/controllers/types.js +0 -3
  122. package/dist-server/controllers/types.js.map +0 -1
  123. package/dist-server/index.d.ts +0 -3
  124. package/dist-server/index.js +0 -7
  125. package/dist-server/index.js.map +0 -1
  126. package/dist-server/middlewares/index.d.ts +0 -1
  127. package/dist-server/middlewares/index.js +0 -7
  128. package/dist-server/middlewares/index.js.map +0 -1
  129. package/dist-server/migrations/1723861466413-seed-roles.d.ts +0 -5
  130. package/dist-server/migrations/1723861466413-seed-roles.js +0 -117
  131. package/dist-server/migrations/1723861466413-seed-roles.js.map +0 -1
  132. package/dist-server/migrations/1723861466414-seed-codes.d.ts +0 -5
  133. package/dist-server/migrations/1723861466414-seed-codes.js +0 -150
  134. package/dist-server/migrations/1723861466414-seed-codes.js.map +0 -1
  135. package/dist-server/migrations/1723861476419-seed-resources.d.ts +0 -5
  136. package/dist-server/migrations/1723861476419-seed-resources.js +0 -57
  137. package/dist-server/migrations/1723861476419-seed-resources.js.map +0 -1
  138. package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +0 -5
  139. package/dist-server/migrations/1723861478420-seed-/bsample-project.js +0 -68
  140. package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +0 -1
  141. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +0 -5
  142. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +0 -189
  143. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +0 -1
  144. package/dist-server/migrations/index.d.ts +0 -1
  145. package/dist-server/migrations/index.js +0 -12
  146. package/dist-server/migrations/index.js.map +0 -1
  147. package/dist-server/routes.d.ts +0 -1
  148. package/dist-server/routes.js +0 -105
  149. package/dist-server/routes.js.map +0 -1
  150. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +0 -6
  151. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +0 -56
  152. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +0 -1
  153. package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +0 -9
  154. package/dist-server/service/construction-detail-type/construction-detail-type-query.js +0 -53
  155. package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +0 -1
  156. package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +0 -11
  157. package/dist-server/service/construction-detail-type/construction-detail-type-type.js +0 -43
  158. package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +0 -1
  159. package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +0 -15
  160. package/dist-server/service/construction-detail-type/construction-detail-type.js +0 -69
  161. package/dist-server/service/construction-detail-type/construction-detail-type.js.map +0 -1
  162. package/dist-server/service/construction-detail-type/index.d.ts +0 -5
  163. package/dist-server/service/construction-detail-type/index.js +0 -9
  164. package/dist-server/service/construction-detail-type/index.js.map +0 -1
  165. package/dist-server/service/construction-type/construction-type-mutation.d.ts +0 -6
  166. package/dist-server/service/construction-type/construction-type-mutation.js +0 -64
  167. package/dist-server/service/construction-type/construction-type-mutation.js.map +0 -1
  168. package/dist-server/service/construction-type/construction-type-query.d.ts +0 -13
  169. package/dist-server/service/construction-type/construction-type-query.js +0 -92
  170. package/dist-server/service/construction-type/construction-type-query.js.map +0 -1
  171. package/dist-server/service/construction-type/construction-type-type.d.ts +0 -11
  172. package/dist-server/service/construction-type/construction-type-type.js +0 -43
  173. package/dist-server/service/construction-type/construction-type-type.js.map +0 -1
  174. package/dist-server/service/construction-type/construction-type.d.ts +0 -18
  175. package/dist-server/service/construction-type/construction-type.js +0 -83
  176. package/dist-server/service/construction-type/construction-type.js.map +0 -1
  177. package/dist-server/service/construction-type/index.d.ts +0 -5
  178. package/dist-server/service/construction-type/index.js +0 -9
  179. package/dist-server/service/construction-type/index.js.map +0 -1
  180. package/dist-server/service/index.d.ts +0 -15
  181. package/dist-server/service/index.js +0 -59
  182. package/dist-server/service/index.js.map +0 -1
  183. package/dist-server/service/inspection-drawing-type/index.d.ts +0 -5
  184. package/dist-server/service/inspection-drawing-type/index.js +0 -9
  185. package/dist-server/service/inspection-drawing-type/index.js.map +0 -1
  186. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +0 -6
  187. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +0 -64
  188. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +0 -1
  189. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +0 -12
  190. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +0 -83
  191. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +0 -1
  192. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +0 -10
  193. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +0 -39
  194. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +0 -1
  195. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +0 -16
  196. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +0 -72
  197. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +0 -1
  198. package/dist-server/service/inspection-part/index.d.ts +0 -5
  199. package/dist-server/service/inspection-part/index.js +0 -9
  200. package/dist-server/service/inspection-part/index.js.map +0 -1
  201. package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +0 -6
  202. package/dist-server/service/inspection-part/inspection-part-mutation.js +0 -55
  203. package/dist-server/service/inspection-part/inspection-part-mutation.js.map +0 -1
  204. package/dist-server/service/inspection-part/inspection-part-query.d.ts +0 -10
  205. package/dist-server/service/inspection-part/inspection-part-query.js +0 -66
  206. package/dist-server/service/inspection-part/inspection-part-query.js.map +0 -1
  207. package/dist-server/service/inspection-part/inspection-part-type.d.ts +0 -11
  208. package/dist-server/service/inspection-part/inspection-part-type.js +0 -43
  209. package/dist-server/service/inspection-part/inspection-part-type.js.map +0 -1
  210. package/dist-server/service/inspection-part/inspection-part.d.ts +0 -15
  211. package/dist-server/service/inspection-part/inspection-part.js +0 -69
  212. package/dist-server/service/inspection-part/inspection-part.js.map +0 -1
  213. package/dist-server/service/manager/index.d.ts +0 -7
  214. package/dist-server/service/manager/index.js +0 -11
  215. package/dist-server/service/manager/index.js.map +0 -1
  216. package/dist-server/service/manager/manager-mutation.d.ts +0 -5
  217. package/dist-server/service/manager/manager-mutation.js +0 -39
  218. package/dist-server/service/manager/manager-mutation.js.map +0 -1
  219. package/dist-server/service/manager/manager-query.d.ts +0 -4
  220. package/dist-server/service/manager/manager-query.js +0 -39
  221. package/dist-server/service/manager/manager-query.js.map +0 -1
  222. package/dist-server/service/manager/manager-type.d.ts +0 -15
  223. package/dist-server/service/manager/manager-type.js +0 -62
  224. package/dist-server/service/manager/manager-type.js.map +0 -1
  225. package/dist-server/service/manager/manager.d.ts +0 -8
  226. package/dist-server/service/manager/manager.js +0 -41
  227. package/dist-server/service/manager/manager.js.map +0 -1
  228. package/dist-server/service/project/index.d.ts +0 -5
  229. package/dist-server/service/project/index.js +0 -9
  230. package/dist-server/service/project/index.js.map +0 -1
  231. package/dist-server/service/project/project-mutation.d.ts +0 -12
  232. package/dist-server/service/project/project-mutation.js +0 -339
  233. package/dist-server/service/project/project-mutation.js.map +0 -1
  234. package/dist-server/service/project/project-query.d.ts +0 -23
  235. package/dist-server/service/project/project-query.js +0 -215
  236. package/dist-server/service/project/project-query.js.map +0 -1
  237. package/dist-server/service/project/project-type.d.ts +0 -36
  238. package/dist-server/service/project/project-type.js +0 -128
  239. package/dist-server/service/project/project-type.js.map +0 -1
  240. package/dist-server/service/project/project.d.ts +0 -52
  241. package/dist-server/service/project/project.js +0 -190
  242. package/dist-server/service/project/project.js.map +0 -1
  243. package/dist-server/service/resource/index.d.ts +0 -6
  244. package/dist-server/service/resource/index.js +0 -10
  245. package/dist-server/service/resource/index.js.map +0 -1
  246. package/dist-server/service/resource/resource-mutation.d.ts +0 -10
  247. package/dist-server/service/resource/resource-mutation.js +0 -132
  248. package/dist-server/service/resource/resource-mutation.js.map +0 -1
  249. package/dist-server/service/resource/resource-query.d.ts +0 -11
  250. package/dist-server/service/resource/resource-query.js +0 -81
  251. package/dist-server/service/resource/resource-query.js.map +0 -1
  252. package/dist-server/service/resource/resource-type.d.ts +0 -17
  253. package/dist-server/service/resource/resource-type.js +0 -65
  254. package/dist-server/service/resource/resource-type.js.map +0 -1
  255. package/dist-server/service/resource/resource.d.ts +0 -24
  256. package/dist-server/service/resource/resource.js +0 -93
  257. package/dist-server/service/resource/resource.js.map +0 -1
  258. package/dist-server/service/task/index.d.ts +0 -5
  259. package/dist-server/service/task/index.js +0 -9
  260. package/dist-server/service/task/index.js.map +0 -1
  261. package/dist-server/service/task/task-mutation.d.ts +0 -10
  262. package/dist-server/service/task/task-mutation.js +0 -135
  263. package/dist-server/service/task/task-mutation.js.map +0 -1
  264. package/dist-server/service/task/task-query.d.ts +0 -21
  265. package/dist-server/service/task/task-query.js +0 -219
  266. package/dist-server/service/task/task-query.js.map +0 -1
  267. package/dist-server/service/task/task-type.d.ts +0 -31
  268. package/dist-server/service/task/task-type.js +0 -114
  269. package/dist-server/service/task/task-type.js.map +0 -1
  270. package/dist-server/service/task/task.d.ts +0 -35
  271. package/dist-server/service/task/task.js +0 -151
  272. package/dist-server/service/task/task.js.map +0 -1
  273. package/dist-server/service/task-checklist-binding/index.d.ts +0 -5
  274. package/dist-server/service/task-checklist-binding/index.js +0 -9
  275. package/dist-server/service/task-checklist-binding/index.js.map +0 -1
  276. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +0 -5
  277. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +0 -186
  278. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +0 -1
  279. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +0 -8
  280. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +0 -61
  281. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +0 -1
  282. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +0 -15
  283. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +0 -57
  284. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +0 -1
  285. package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +0 -22
  286. package/dist-server/service/task-checklist-binding/task-checklist-binding.js +0 -106
  287. package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +0 -1
  288. package/dist-server/service/task-resource/index.d.ts +0 -6
  289. package/dist-server/service/task-resource/index.js +0 -10
  290. package/dist-server/service/task-resource/index.js.map +0 -1
  291. package/dist-server/service/task-resource/task-resource-mutation.d.ts +0 -10
  292. package/dist-server/service/task-resource/task-resource-mutation.js +0 -132
  293. package/dist-server/service/task-resource/task-resource-mutation.js.map +0 -1
  294. package/dist-server/service/task-resource/task-resource-query.d.ts +0 -7
  295. package/dist-server/service/task-resource/task-resource-query.js +0 -50
  296. package/dist-server/service/task-resource/task-resource-query.js.map +0 -1
  297. package/dist-server/service/task-resource/task-resource-type.d.ts +0 -17
  298. package/dist-server/service/task-resource/task-resource-type.js +0 -65
  299. package/dist-server/service/task-resource/task-resource-type.js.map +0 -1
  300. package/dist-server/service/task-resource/task-resource.d.ts +0 -13
  301. package/dist-server/service/task-resource/task-resource.js +0 -59
  302. package/dist-server/service/task-resource/task-resource.js.map +0 -1
  303. package/dist-server/service/worker-type/index.d.ts +0 -5
  304. package/dist-server/service/worker-type/index.js +0 -9
  305. package/dist-server/service/worker-type/index.js.map +0 -1
  306. package/dist-server/service/worker-type/worker-type-mutation.d.ts +0 -6
  307. package/dist-server/service/worker-type/worker-type-mutation.js +0 -64
  308. package/dist-server/service/worker-type/worker-type-mutation.js.map +0 -1
  309. package/dist-server/service/worker-type/worker-type-query.d.ts +0 -11
  310. package/dist-server/service/worker-type/worker-type-query.js +0 -78
  311. package/dist-server/service/worker-type/worker-type-query.js.map +0 -1
  312. package/dist-server/service/worker-type/worker-type-type.d.ts +0 -11
  313. package/dist-server/service/worker-type/worker-type-type.js +0 -43
  314. package/dist-server/service/worker-type/worker-type-type.js.map +0 -1
  315. package/dist-server/service/worker-type/worker-type.d.ts +0 -16
  316. package/dist-server/service/worker-type/worker-type.js +0 -77
  317. package/dist-server/service/worker-type/worker-type.js.map +0 -1
  318. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-mutation.js","sourceRoot":"","sources":["../../../server/service/resource/resource-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAs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;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDASxE;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,6BAAa,CAAC,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAWP;2BAhIU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAiI5B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Resource } from './resource'\nimport { NewResource, ResourcePatch } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Resource, { description: 'To create new Resource' })\n async createResource(@Arg('resource') resource: NewResource, @Ctx() context: ResolverContext): Promise<Resource> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Resource).save({\n ...resource,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Resource, { description: 'To modify Resource information' })\n async updateResource(\n @Arg('id') id: string,\n @Arg('patch') patch: ResourcePatch,\n @Ctx() context: ResolverContext\n ): Promise<Resource> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Resource)\n const resource = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...resource,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [Resource], { description: \"To modify multiple Resources' information\" })\n async updateMultipleResource(\n @Arg('patches', type => [ResourcePatch]) patches: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Resource[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const resourceRepo = tx.getRepository(Resource)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await resourceRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const resource = await resourceRepo.findOneBy({ id: updateRecord.id })\n\n const result = await resourceRepo.save({\n ...resource,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete Resource' })\n async deleteResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Resource).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Resources' })\n async deleteResources(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Resource).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple Resources' })\n async importResources(\n @Arg('resources', type => [ResourcePatch]) resources: ResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n resources.map(async (resource: ResourcePatch) => {\n const createdResource: Resource = await tx.getRepository(Resource).save({ domain, ...resource })\n })\n )\n\n return true\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- import { Domain, ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { Resource } from './resource';
4
- import { ResourceList } from './resource-type';
5
- export declare class ResourceQuery {
6
- resource(id: string, context: ResolverContext): Promise<Resource>;
7
- resources(params: ListParam, context: ResolverContext): Promise<ResourceList>;
8
- domain(resource: Resource): Promise<Domain>;
9
- updater(resource: Resource): Promise<User>;
10
- creator(resource: Resource): Promise<User>;
11
- }
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceQuery = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const auth_base_1 = require("@things-factory/auth-base");
8
- const resource_1 = require("./resource");
9
- const resource_type_1 = require("./resource-type");
10
- let ResourceQuery = class ResourceQuery {
11
- async resource(id, context) {
12
- const { domain } = context.state;
13
- return await (0, shell_1.getRepository)(resource_1.Resource).findOne({
14
- where: { domain: { id: domain.id }, id }
15
- });
16
- }
17
- async resources(params, context) {
18
- const { domain } = context.state;
19
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
- domain,
21
- params,
22
- repository: await (0, shell_1.getRepository)(resource_1.Resource),
23
- searchables: ['name', 'description']
24
- });
25
- const [items, total] = await queryBuilder.getManyAndCount();
26
- return { items, total };
27
- }
28
- async domain(resource) {
29
- return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: resource.domainId });
30
- }
31
- async updater(resource) {
32
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: resource.updaterId });
33
- }
34
- async creator(resource) {
35
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: resource.creatorId });
36
- }
37
- };
38
- exports.ResourceQuery = ResourceQuery;
39
- tslib_1.__decorate([
40
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
41
- (0, type_graphql_1.Query)(returns => resource_1.Resource, { nullable: true, description: 'To fetch a Resource' }),
42
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
43
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
44
- tslib_1.__metadata("design:type", Function),
45
- tslib_1.__metadata("design:paramtypes", [String, Object]),
46
- tslib_1.__metadata("design:returntype", Promise)
47
- ], ResourceQuery.prototype, "resource", null);
48
- tslib_1.__decorate([
49
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
50
- (0, type_graphql_1.Query)(returns => resource_type_1.ResourceList, { description: 'To fetch multiple Resources' }),
51
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
52
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
53
- tslib_1.__metadata("design:type", Function),
54
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
55
- tslib_1.__metadata("design:returntype", Promise)
56
- ], ResourceQuery.prototype, "resources", null);
57
- tslib_1.__decorate([
58
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
59
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
60
- tslib_1.__metadata("design:type", Function),
61
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
62
- tslib_1.__metadata("design:returntype", Promise)
63
- ], ResourceQuery.prototype, "domain", null);
64
- tslib_1.__decorate([
65
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
66
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
67
- tslib_1.__metadata("design:type", Function),
68
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
69
- tslib_1.__metadata("design:returntype", Promise)
70
- ], ResourceQuery.prototype, "updater", null);
71
- tslib_1.__decorate([
72
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
73
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
74
- tslib_1.__metadata("design:type", Function),
75
- tslib_1.__metadata("design:paramtypes", [resource_1.Resource]),
76
- tslib_1.__metadata("design:returntype", Promise)
77
- ], ResourceQuery.prototype, "creator", null);
78
- exports.ResourceQuery = ResourceQuery = tslib_1.__decorate([
79
- (0, type_graphql_1.Resolver)(resource_1.Resource)
80
- ], ResourceQuery);
81
- //# sourceMappingURL=resource-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-query.js","sourceRoot":"","sources":["../../../server/service/resource/resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAqC;AACrC,mDAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAA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C1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAY,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC9D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;8CAaxC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;wBAzCU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CA0CzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Resource } from './resource'\nimport { ResourceList } from './resource-type'\n\n@Resolver(Resource)\nexport class ResourceQuery {\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Resource!, { nullable: true, description: 'To fetch a Resource' })\n async resource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Resource> {\n const { domain } = context.state\n\n return await getRepository(Resource).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ResourceList, { description: 'To fetch multiple Resources' })\n async resources(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ResourceList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Resource),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() resource: Resource): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: resource.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() resource: Resource): Promise<User> {\n return await getRepository(User).findOneBy({ id: resource.creatorId })\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { Resource, ResourceType } from './resource';
2
- export declare class NewResource {
3
- name: string;
4
- type: ResourceType;
5
- unit: string;
6
- }
7
- export declare class ResourcePatch {
8
- id?: string;
9
- name?: string;
10
- type?: ResourceType;
11
- unit?: string;
12
- cuFlag?: string;
13
- }
14
- export declare class ResourceList {
15
- items: Resource[];
16
- total: number;
17
- }
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceList = exports.ResourcePatch = exports.NewResource = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const resource_1 = require("./resource");
7
- let NewResource = class NewResource {
8
- };
9
- exports.NewResource = NewResource;
10
- tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
12
- tslib_1.__metadata("design:type", String)
13
- ], NewResource.prototype, "name", void 0);
14
- tslib_1.__decorate([
15
- (0, type_graphql_1.Field)(type => resource_1.ResourceType),
16
- tslib_1.__metadata("design:type", String)
17
- ], NewResource.prototype, "type", void 0);
18
- tslib_1.__decorate([
19
- (0, type_graphql_1.Field)(),
20
- tslib_1.__metadata("design:type", String)
21
- ], NewResource.prototype, "unit", void 0);
22
- exports.NewResource = NewResource = tslib_1.__decorate([
23
- (0, type_graphql_1.InputType)()
24
- ], NewResource);
25
- let ResourcePatch = class ResourcePatch {
26
- };
27
- exports.ResourcePatch = ResourcePatch;
28
- tslib_1.__decorate([
29
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
30
- tslib_1.__metadata("design:type", String)
31
- ], ResourcePatch.prototype, "id", void 0);
32
- tslib_1.__decorate([
33
- (0, type_graphql_1.Field)({ nullable: true }),
34
- tslib_1.__metadata("design:type", String)
35
- ], ResourcePatch.prototype, "name", void 0);
36
- tslib_1.__decorate([
37
- (0, type_graphql_1.Field)(type => resource_1.ResourceType, { nullable: true }),
38
- tslib_1.__metadata("design:type", String)
39
- ], ResourcePatch.prototype, "type", void 0);
40
- tslib_1.__decorate([
41
- (0, type_graphql_1.Field)({ nullable: true }),
42
- tslib_1.__metadata("design:type", String)
43
- ], ResourcePatch.prototype, "unit", void 0);
44
- tslib_1.__decorate([
45
- (0, type_graphql_1.Field)({ nullable: true }),
46
- tslib_1.__metadata("design:type", String)
47
- ], ResourcePatch.prototype, "cuFlag", void 0);
48
- exports.ResourcePatch = ResourcePatch = tslib_1.__decorate([
49
- (0, type_graphql_1.InputType)()
50
- ], ResourcePatch);
51
- let ResourceList = class ResourceList {
52
- };
53
- exports.ResourceList = ResourceList;
54
- tslib_1.__decorate([
55
- (0, type_graphql_1.Field)(type => [resource_1.Resource]),
56
- tslib_1.__metadata("design:type", Array)
57
- ], ResourceList.prototype, "items", void 0);
58
- tslib_1.__decorate([
59
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
60
- tslib_1.__metadata("design:type", Number)
61
- ], ResourceList.prototype, "total", void 0);
62
- exports.ResourceList = ResourceList = tslib_1.__decorate([
63
- (0, type_graphql_1.ObjectType)()
64
- ], ResourceList);
65
- //# sourceMappingURL=resource-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-type.js","sourceRoot":"","sources":["../../../server/service/resource/resource-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;AATY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,CAAC;;yCACV;AAGlB;IADC,IAAA,oBAAK,GAAE;;yCACI;sBARD,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CASvB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import { InputType, Field, ID, ObjectType, Int } from 'type-graphql'\nimport { Resource, ResourceType } from './resource'\n\n@InputType()\nexport class NewResource {\n @Field()\n name: string\n\n @Field(type => ResourceType)\n type: ResourceType\n\n @Field()\n unit: string\n}\n\n@InputType()\nexport class ResourcePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ResourceType, { nullable: true })\n type?: ResourceType\n\n @Field({ nullable: true })\n unit?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ResourceList {\n @Field(type => [Resource])\n items: Resource[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,24 +0,0 @@
1
- import { Domain } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { TaskResource } from '../task-resource/task-resource';
4
- export declare enum ResourceType {
5
- HUMAN = "HUMAN",
6
- MATERIAL = "MATERIAL",
7
- EQUIPMENT = "EQUIPMENT"
8
- }
9
- export declare class Resource {
10
- readonly id: string;
11
- domain?: Domain;
12
- domainId?: string;
13
- name?: string;
14
- type: ResourceType;
15
- unit: string;
16
- createdAt?: Date;
17
- updatedAt?: Date;
18
- deletedAt?: Date;
19
- creator?: User;
20
- creatorId?: string;
21
- updater?: User;
22
- updaterId?: string;
23
- taskResources?: TaskResource[];
24
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Resource = exports.ResourceType = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const type_graphql_1 = require("type-graphql");
7
- const shell_1 = require("@things-factory/shell");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- const task_resource_1 = require("../task-resource/task-resource");
10
- var ResourceType;
11
- (function (ResourceType) {
12
- ResourceType["HUMAN"] = "HUMAN";
13
- ResourceType["MATERIAL"] = "MATERIAL";
14
- ResourceType["EQUIPMENT"] = "EQUIPMENT";
15
- })(ResourceType || (exports.ResourceType = ResourceType = {}));
16
- (0, type_graphql_1.registerEnumType)(ResourceType, {
17
- name: 'ResourceType',
18
- description: '자원 유형'
19
- });
20
- let Resource = class Resource {
21
- };
22
- exports.Resource = Resource;
23
- tslib_1.__decorate([
24
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
25
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
26
- tslib_1.__metadata("design:type", String)
27
- ], Resource.prototype, "id", void 0);
28
- tslib_1.__decorate([
29
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
30
- (0, type_graphql_1.Field)({ nullable: true }),
31
- tslib_1.__metadata("design:type", shell_1.Domain)
32
- ], Resource.prototype, "domain", void 0);
33
- tslib_1.__decorate([
34
- (0, typeorm_1.RelationId)((resource) => resource.domain),
35
- tslib_1.__metadata("design:type", String)
36
- ], Resource.prototype, "domainId", void 0);
37
- tslib_1.__decorate([
38
- (0, typeorm_1.Column)({ nullable: false, comment: '자원 이름' }),
39
- (0, type_graphql_1.Field)({ nullable: false }),
40
- tslib_1.__metadata("design:type", String)
41
- ], Resource.prototype, "name", void 0);
42
- tslib_1.__decorate([
43
- (0, typeorm_1.Column)({ nullable: false, default: ResourceType.HUMAN, comment: '자원 유형' }),
44
- (0, type_graphql_1.Field)({ nullable: false }),
45
- tslib_1.__metadata("design:type", String)
46
- ], Resource.prototype, "type", void 0);
47
- tslib_1.__decorate([
48
- (0, typeorm_1.Column)({ nullable: false, comment: '단위 (예: man/day, kg, hour 등)' }),
49
- (0, type_graphql_1.Field)({ nullable: false }),
50
- tslib_1.__metadata("design:type", String)
51
- ], Resource.prototype, "unit", void 0);
52
- tslib_1.__decorate([
53
- (0, typeorm_1.CreateDateColumn)(),
54
- (0, type_graphql_1.Field)({ nullable: true }),
55
- tslib_1.__metadata("design:type", Date)
56
- ], Resource.prototype, "createdAt", void 0);
57
- tslib_1.__decorate([
58
- (0, typeorm_1.UpdateDateColumn)(),
59
- (0, type_graphql_1.Field)({ nullable: true }),
60
- tslib_1.__metadata("design:type", Date)
61
- ], Resource.prototype, "updatedAt", void 0);
62
- tslib_1.__decorate([
63
- (0, typeorm_1.DeleteDateColumn)(),
64
- (0, type_graphql_1.Field)({ nullable: true }),
65
- tslib_1.__metadata("design:type", Date)
66
- ], Resource.prototype, "deletedAt", void 0);
67
- tslib_1.__decorate([
68
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
69
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
70
- tslib_1.__metadata("design:type", auth_base_1.User)
71
- ], Resource.prototype, "creator", void 0);
72
- tslib_1.__decorate([
73
- (0, typeorm_1.RelationId)((resource) => resource.creator),
74
- tslib_1.__metadata("design:type", String)
75
- ], Resource.prototype, "creatorId", void 0);
76
- tslib_1.__decorate([
77
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
78
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
79
- tslib_1.__metadata("design:type", auth_base_1.User)
80
- ], Resource.prototype, "updater", void 0);
81
- tslib_1.__decorate([
82
- (0, typeorm_1.RelationId)((resource) => resource.updater),
83
- tslib_1.__metadata("design:type", String)
84
- ], Resource.prototype, "updaterId", void 0);
85
- tslib_1.__decorate([
86
- (0, typeorm_1.OneToMany)(() => task_resource_1.TaskResource, taskResource => taskResource.resource),
87
- tslib_1.__metadata("design:type", Array)
88
- ], Resource.prototype, "taskResources", void 0);
89
- exports.Resource = Resource = tslib_1.__decorate([
90
- (0, typeorm_1.Entity)(),
91
- (0, type_graphql_1.ObjectType)({ description: '자원' })
92
- ], Resource);
93
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../server/service/resource/resource.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAsE;AACtE,iDAA8C;AAC9C,yDAAgD;AAChD,kEAA6D;AAE7D,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAA,+BAAgB,EA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AE,IAAI,EAAE,CAAC;sCACd,IAAI;2CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;2CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAGlB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;;+CACvC;mBAnDnB,QAAQ;IAFpB,IAAA,gBAAM,GAAE;IACR,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;GACrB,QAAQ,CAoDpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Column,\n PrimaryGeneratedColumn,\n ManyToOne,\n RelationId,\n OneToMany\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaskResource } from '../task-resource/task-resource'\n\nexport enum ResourceType {\n HUMAN = 'HUMAN',\n MATERIAL = 'MATERIAL',\n EQUIPMENT = 'EQUIPMENT'\n}\n\nregisterEnumType(ResourceType, {\n name: 'ResourceType',\n description: '자원 유형'\n})\n\n@Entity()\n@ObjectType({ description: '자원' })\nexport class Resource {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((resource: Resource) => resource.domain)\n domainId?: string\n\n @Column({ nullable: false, comment: '자원 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: false, default: ResourceType.HUMAN, comment: '자원 유형' })\n @Field({ nullable: false })\n type: ResourceType\n\n @Column({ nullable: false, comment: '단위 (예: man/day, kg, hour 등)' })\n @Field({ nullable: false })\n unit: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((resource: Resource) => resource.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((resource: Resource) => resource.updater)\n updaterId?: string\n\n @OneToMany(() => TaskResource, taskResource => taskResource.resource)\n taskResources?: TaskResource[]\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { Task } from './task';
2
- import { TaskQuery } from './task-query';
3
- import { TaskMutation } from './task-mutation';
4
- export declare const entities: (typeof Task)[];
5
- export declare const resolvers: (typeof TaskQuery | typeof TaskMutation)[];
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const task_1 = require("./task");
5
- const task_query_1 = require("./task-query");
6
- const task_mutation_1 = require("./task-mutation");
7
- exports.entities = [task_1.Task];
8
- exports.resolvers = [task_query_1.TaskQuery, task_mutation_1.TaskMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/task/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,6CAAwC;AACxC,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,WAAI,CAAC,CAAA;AACjB,QAAA,SAAS,GAAG,CAAC,sBAAS,EAAE,4BAAY,CAAC,CAAA","sourcesContent":["import { Task } from './task'\nimport { TaskQuery } from './task-query'\nimport { TaskMutation } from './task-mutation'\n\nexport const entities = [Task]\nexport const resolvers = [TaskQuery, TaskMutation]\n"]}
@@ -1,10 +0,0 @@
1
- import { Task } from './task';
2
- import { NewTask, TaskPatch } from './task-type';
3
- export declare class TaskMutation {
4
- createTask(task: NewTask, context: ResolverContext): Promise<Task>;
5
- updateTask(id: string, patch: TaskPatch, context: ResolverContext): Promise<Task>;
6
- updateMultipleTask(patches: TaskPatch[], context: ResolverContext): Promise<Task[]>;
7
- deleteTask(id: string, context: ResolverContext): Promise<boolean>;
8
- deleteTasks(ids: string[], context: ResolverContext): Promise<boolean>;
9
- importTasks(tasks: TaskPatch[], context: ResolverContext): Promise<boolean>;
10
- }
@@ -1,135 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TaskMutation = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const typeorm_1 = require("typeorm");
7
- const attachment_base_1 = require("@things-factory/attachment-base");
8
- const task_1 = require("./task");
9
- const task_type_1 = require("./task-type");
10
- let TaskMutation = class TaskMutation {
11
- async createTask(task, context) {
12
- const { domain, user, tx } = context.state;
13
- const result = await tx.getRepository(task_1.Task).save(Object.assign(Object.assign({}, task), { domain, creator: user, updater: user }));
14
- return result;
15
- }
16
- async updateTask(id, patch, context) {
17
- const { domain, user, tx } = context.state;
18
- const repository = tx.getRepository(task_1.Task);
19
- const task = await repository.findOne({
20
- where: { id }
21
- });
22
- const result = await repository.save(Object.assign(Object.assign(Object.assign({}, task), patch), { updater: user }));
23
- return result;
24
- }
25
- async updateMultipleTask(patches, context) {
26
- const { domain, user, tx } = context.state;
27
- let results = [];
28
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
29
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
30
- const taskRepo = tx.getRepository(task_1.Task);
31
- if (_createRecords.length > 0) {
32
- for (let i = 0; i < _createRecords.length; i++) {
33
- const newRecord = _createRecords[i];
34
- const result = await taskRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
35
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
36
- }
37
- }
38
- if (_updateRecords.length > 0) {
39
- for (let i = 0; i < _updateRecords.length; i++) {
40
- const updateRecord = _updateRecords[i];
41
- const task = await taskRepo.findOneBy({ id: updateRecord.id });
42
- const result = await taskRepo.save(Object.assign(Object.assign(Object.assign({}, task), updateRecord), { updater: user }));
43
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
44
- }
45
- }
46
- return results;
47
- }
48
- async deleteTask(id, context) {
49
- const { domain, tx } = context.state;
50
- await tx.getRepository(task_1.Task).delete({ id });
51
- await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
52
- return true;
53
- }
54
- async deleteTasks(ids, context) {
55
- const { domain, tx } = context.state;
56
- await tx.getRepository(task_1.Task).delete({
57
- id: (0, typeorm_1.In)(ids)
58
- });
59
- await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
60
- return true;
61
- }
62
- async importTasks(tasks, context) {
63
- const { domain, tx } = context.state;
64
- await Promise.all(tasks.map(async (task) => {
65
- const createdTask = await tx.getRepository(task_1.Task).save(Object.assign({ domain }, task));
66
- }));
67
- return true;
68
- }
69
- };
70
- exports.TaskMutation = TaskMutation;
71
- tslib_1.__decorate([
72
- (0, type_graphql_1.Directive)('@transaction'),
73
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
74
- (0, type_graphql_1.Mutation)(returns => task_1.Task, { description: 'To create new Task' }),
75
- tslib_1.__param(0, (0, type_graphql_1.Arg)('task')),
76
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
77
- tslib_1.__metadata("design:type", Function),
78
- tslib_1.__metadata("design:paramtypes", [task_type_1.NewTask, Object]),
79
- tslib_1.__metadata("design:returntype", Promise)
80
- ], TaskMutation.prototype, "createTask", null);
81
- tslib_1.__decorate([
82
- (0, type_graphql_1.Directive)('@transaction'),
83
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
84
- (0, type_graphql_1.Mutation)(returns => task_1.Task, { description: 'To modify Task information' }),
85
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
86
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
87
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
88
- tslib_1.__metadata("design:type", Function),
89
- tslib_1.__metadata("design:paramtypes", [String, task_type_1.TaskPatch, Object]),
90
- tslib_1.__metadata("design:returntype", Promise)
91
- ], TaskMutation.prototype, "updateTask", null);
92
- tslib_1.__decorate([
93
- (0, type_graphql_1.Directive)('@transaction'),
94
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
95
- (0, type_graphql_1.Mutation)(returns => [task_1.Task], { description: "To modify multiple Tasks' information" }),
96
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [task_type_1.TaskPatch])),
97
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
98
- tslib_1.__metadata("design:type", Function),
99
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
100
- tslib_1.__metadata("design:returntype", Promise)
101
- ], TaskMutation.prototype, "updateMultipleTask", null);
102
- tslib_1.__decorate([
103
- (0, type_graphql_1.Directive)('@transaction'),
104
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
105
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Task' }),
106
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
107
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
108
- tslib_1.__metadata("design:type", Function),
109
- tslib_1.__metadata("design:paramtypes", [String, Object]),
110
- tslib_1.__metadata("design:returntype", Promise)
111
- ], TaskMutation.prototype, "deleteTask", null);
112
- tslib_1.__decorate([
113
- (0, type_graphql_1.Directive)('@transaction'),
114
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
115
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Tasks' }),
116
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
117
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
118
- tslib_1.__metadata("design:type", Function),
119
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
120
- tslib_1.__metadata("design:returntype", Promise)
121
- ], TaskMutation.prototype, "deleteTasks", null);
122
- tslib_1.__decorate([
123
- (0, type_graphql_1.Directive)('@transaction'),
124
- (0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
125
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Tasks' }),
126
- tslib_1.__param(0, (0, type_graphql_1.Arg)('tasks', type => [task_type_1.TaskPatch])),
127
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
128
- tslib_1.__metadata("design:type", Function),
129
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
130
- tslib_1.__metadata("design:returntype", Promise)
131
- ], TaskMutation.prototype, "importTasks", null);
132
- exports.TaskMutation = TaskMutation = tslib_1.__decorate([
133
- (0, type_graphql_1.Resolver)(task_1.Task)
134
- ], TaskMutation);
135
- //# sourceMappingURL=task-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-mutation.js","sourceRoot":"","sources":["../../../server/service/task/task-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,iCAA6B;AAC7B,2CAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAIjB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAa,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAC,IAAI,iCAC3C,IAAI,KACP,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAgB,KAAgB,EAAS,OAAwB;QACrG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAA;QACzC,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACpC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,+CAC/B,IAAI,GACJ,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,kBAAkB,CACe,OAAoB,EAClD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KA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,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8CAO7C;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAUpE;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC,CAAA;IAAsB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAU9E;uBA5HU,YAAY;IADxB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,YAAY,CA6HxB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { Task } from './task'\nimport { NewTask, TaskPatch } from './task-type'\n\n@Resolver(Task)\nexport class TaskMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Task, { description: 'To create new Task' })\n async createTask(@Arg('task') task: NewTask, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Task).save({\n ...task,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Task, { description: 'To modify Task information' })\n async updateTask(@Arg('id') id: string, @Arg('patch') patch: TaskPatch, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Task)\n const task = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...task,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [Task], { description: \"To modify multiple Tasks' information\" })\n async updateMultipleTask(\n @Arg('patches', type => [TaskPatch]) patches: TaskPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Task[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const taskRepo = tx.getRepository(Task)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await taskRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const task = await taskRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taskRepo.save({\n ...task,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete Task' })\n async deleteTask(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple Tasks' })\n async deleteTasks(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple Tasks' })\n async importTasks(@Arg('tasks', type => [TaskPatch]) tasks: TaskPatch[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n tasks.map(async (task: TaskPatch) => {\n const createdTask: Task = await tx.getRepository(Task).save({ domain, ...task })\n })\n )\n\n return true\n }\n}\n"]}
@@ -1,21 +0,0 @@
1
- import { ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { Task } from './task';
4
- import { TaskList } from './task-type';
5
- import { TaskResource } from '../task-resource/task-resource';
6
- import { TaskChecklistBinding } from '../task-checklist-binding/task-checklist-binding';
7
- export declare class DigestedResource {
8
- type?: string;
9
- allocated?: number;
10
- }
11
- export declare class TaskQuery {
12
- task(id: string, context: ResolverContext): Promise<Task>;
13
- tasks(params: ListParam, context: ResolverContext): Promise<TaskList>;
14
- length(task: Task): Promise<string | undefined>;
15
- children(task: Task, params: ListParam, context: ResolverContext): Promise<Task[]>;
16
- taskResources(task: Task): Promise<TaskResource[]>;
17
- resources(task: Task): Promise<DigestedResource[]>;
18
- taskChecklistBinding(task: Task): Promise<TaskChecklistBinding>;
19
- updater(task: Task): Promise<User>;
20
- creator(task: Task): Promise<User>;
21
- }