@dssp/project 0.0.8 → 0.0.10

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 (286) hide show
  1. package/client/pages/project/project-detail.ts +109 -30
  2. package/client/pages/project/project-list.ts +46 -10
  3. package/client/pages/project/project-schedule-list.ts +11 -3
  4. package/client/pages/project/project-schedule.ts +111 -312
  5. package/client/pages/project/project-setting-list.ts +11 -3
  6. package/client/pages/resource/construction-detail-type-popup.ts +201 -0
  7. package/client/pages/resource/construction-type-management.ts +40 -39
  8. package/client/pages/resource/inspection-drawing-type-management.ts +210 -0
  9. package/client/pages/resource/inspection-part-popup.ts +201 -0
  10. package/client/pages/resource/manager-management.ts +0 -27
  11. package/client/pages/{checklist/checklist-importer.ts → resource/resource-importer.ts} +11 -8
  12. package/client/pages/{checklist/checklist-list-page.ts → resource/resource-list-page.ts} +41 -25
  13. package/client/pages/resource/worker-type-management.ts +3 -37
  14. package/client/pages/task-resource/task-resource-importer.ts +97 -0
  15. package/client/pages/task-resource/task-resource-list-page.ts +356 -0
  16. package/client/route.ts +13 -1
  17. package/dist-client/pages/project/project-detail.d.ts +5 -1
  18. package/dist-client/pages/project/project-detail.js +123 -40
  19. package/dist-client/pages/project/project-detail.js.map +1 -1
  20. package/dist-client/pages/project/project-list.d.ts +33 -7
  21. package/dist-client/pages/project/project-list.js +26 -11
  22. package/dist-client/pages/project/project-list.js.map +1 -1
  23. package/dist-client/pages/project/project-schedule-list.js +11 -3
  24. package/dist-client/pages/project/project-schedule-list.js.map +1 -1
  25. package/dist-client/pages/project/project-schedule.d.ts +5 -1
  26. package/dist-client/pages/project/project-schedule.js +117 -306
  27. package/dist-client/pages/project/project-schedule.js.map +1 -1
  28. package/dist-client/pages/project/project-setting-list.js +11 -3
  29. package/dist-client/pages/project/project-setting-list.js.map +1 -1
  30. package/dist-client/pages/resource/construction-detail-type-popup.d.ts +2 -0
  31. package/dist-client/pages/resource/construction-detail-type-popup.js +197 -0
  32. package/dist-client/pages/resource/construction-detail-type-popup.js.map +1 -0
  33. package/dist-client/pages/resource/construction-type-management.d.ts +12 -0
  34. package/dist-client/pages/resource/construction-type-management.js +30 -38
  35. package/dist-client/pages/resource/construction-type-management.js.map +1 -1
  36. package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +34 -0
  37. package/dist-client/pages/resource/inspection-drawing-type-management.js +198 -0
  38. package/dist-client/pages/resource/inspection-drawing-type-management.js.map +1 -0
  39. package/dist-client/pages/resource/inspection-part-popup.d.ts +2 -0
  40. package/dist-client/pages/resource/inspection-part-popup.js +197 -0
  41. package/dist-client/pages/resource/inspection-part-popup.js.map +1 -0
  42. package/dist-client/pages/resource/manager-management.js +0 -27
  43. package/dist-client/pages/resource/manager-management.js.map +1 -1
  44. package/dist-client/pages/{checklist/checklist-importer.d.ts → resource/resource-importer.d.ts} +2 -2
  45. package/dist-client/pages/{checklist/checklist-importer.js → resource/resource-importer.js} +10 -10
  46. package/dist-client/pages/resource/resource-importer.js.map +1 -0
  47. package/dist-client/pages/{checklist/checklist-list-page.d.ts → resource/resource-list-page.d.ts} +6 -6
  48. package/dist-client/pages/{checklist/checklist-list-page.js → resource/resource-list-page.js} +41 -32
  49. package/dist-client/pages/resource/resource-list-page.js.map +1 -0
  50. package/dist-client/pages/resource/worker-type-management.d.ts +7 -1
  51. package/dist-client/pages/resource/worker-type-management.js +3 -45
  52. package/dist-client/pages/resource/worker-type-management.js.map +1 -1
  53. package/dist-client/pages/task-resource/task-resource-importer.d.ts +10 -0
  54. package/dist-client/pages/task-resource/task-resource-importer.js +101 -0
  55. package/dist-client/pages/task-resource/task-resource-importer.js.map +1 -0
  56. package/dist-client/pages/task-resource/task-resource-list-page.d.ts +63 -0
  57. package/dist-client/pages/task-resource/task-resource-list-page.js +332 -0
  58. package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -0
  59. package/dist-client/route.d.ts +1 -1
  60. package/dist-client/route.js +9 -0
  61. package/dist-client/route.js.map +1 -1
  62. package/dist-client/tsconfig.tsbuildinfo +1 -1
  63. package/dist-server/controllers/import-task.d.ts +19 -0
  64. package/dist-server/controllers/import-task.js +104 -0
  65. package/dist-server/controllers/import-task.js.map +1 -0
  66. package/dist-server/index.d.ts +1 -0
  67. package/dist-server/index.js +1 -0
  68. package/dist-server/index.js.map +1 -1
  69. package/dist-server/migrations/1723861466413-seed-roles.d.ts +5 -0
  70. package/dist-server/migrations/1723861466413-seed-roles.js +117 -0
  71. package/dist-server/migrations/1723861466413-seed-roles.js.map +1 -0
  72. package/dist-server/migrations/1723861466414-seed-codes.d.ts +5 -0
  73. package/dist-server/migrations/1723861466414-seed-codes.js +132 -0
  74. package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -0
  75. package/dist-server/migrations/1723861476419-seed-resources.d.ts +5 -0
  76. package/dist-server/migrations/1723861476419-seed-resources.js +57 -0
  77. package/dist-server/migrations/1723861476419-seed-resources.js.map +1 -0
  78. package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +5 -0
  79. package/dist-server/migrations/1723861478420-seed-/bsample-project.js +68 -0
  80. package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +1 -0
  81. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +5 -0
  82. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +189 -0
  83. package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +1 -0
  84. package/dist-server/migrations/index.d.ts +1 -0
  85. package/dist-server/migrations/index.js +12 -0
  86. package/dist-server/migrations/index.js.map +1 -0
  87. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +6 -0
  88. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +56 -0
  89. package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +1 -0
  90. package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +9 -0
  91. package/dist-server/service/construction-detail-type/construction-detail-type-query.js +53 -0
  92. package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +1 -0
  93. package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +11 -0
  94. package/dist-server/service/construction-detail-type/construction-detail-type-type.js +43 -0
  95. package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +1 -0
  96. package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +15 -0
  97. package/dist-server/service/construction-detail-type/construction-detail-type.js +69 -0
  98. package/dist-server/service/construction-detail-type/construction-detail-type.js.map +1 -0
  99. package/dist-server/service/construction-detail-type/index.d.ts +5 -0
  100. package/dist-server/service/construction-detail-type/index.js +9 -0
  101. package/dist-server/service/construction-detail-type/index.js.map +1 -0
  102. package/dist-server/service/construction-type/construction-type-query.d.ts +2 -0
  103. package/dist-server/service/construction-type/construction-type-query.js +14 -0
  104. package/dist-server/service/construction-type/construction-type-query.js.map +1 -1
  105. package/dist-server/service/construction-type/construction-type.d.ts +2 -0
  106. package/dist-server/service/construction-type/construction-type.js +6 -0
  107. package/dist-server/service/construction-type/construction-type.js.map +1 -1
  108. package/dist-server/service/index.d.ts +7 -5
  109. package/dist-server/service/index.js +21 -10
  110. package/dist-server/service/index.js.map +1 -1
  111. package/dist-server/service/inspection-drawing-type/index.d.ts +5 -0
  112. package/dist-server/service/inspection-drawing-type/index.js +9 -0
  113. package/dist-server/service/inspection-drawing-type/index.js.map +1 -0
  114. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +6 -0
  115. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +64 -0
  116. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +1 -0
  117. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +12 -0
  118. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +83 -0
  119. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -0
  120. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +10 -0
  121. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +39 -0
  122. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +1 -0
  123. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +16 -0
  124. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +72 -0
  125. package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +1 -0
  126. package/dist-server/service/inspection-part/index.d.ts +5 -0
  127. package/dist-server/service/inspection-part/index.js +9 -0
  128. package/dist-server/service/inspection-part/index.js.map +1 -0
  129. package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +6 -0
  130. package/dist-server/service/inspection-part/inspection-part-mutation.js +55 -0
  131. package/dist-server/service/inspection-part/inspection-part-mutation.js.map +1 -0
  132. package/dist-server/service/inspection-part/inspection-part-query.d.ts +10 -0
  133. package/dist-server/service/inspection-part/inspection-part-query.js +66 -0
  134. package/dist-server/service/inspection-part/inspection-part-query.js.map +1 -0
  135. package/dist-server/service/inspection-part/inspection-part-type.d.ts +11 -0
  136. package/dist-server/service/inspection-part/inspection-part-type.js +43 -0
  137. package/dist-server/service/inspection-part/inspection-part-type.js.map +1 -0
  138. package/dist-server/service/inspection-part/inspection-part.d.ts +15 -0
  139. package/dist-server/service/inspection-part/inspection-part.js +69 -0
  140. package/dist-server/service/inspection-part/inspection-part.js.map +1 -0
  141. package/dist-server/service/project/index.d.ts +0 -2
  142. package/dist-server/service/project/index.js +1 -3
  143. package/dist-server/service/project/index.js.map +1 -1
  144. package/dist-server/service/project/project-query.d.ts +7 -5
  145. package/dist-server/service/project/project-query.js +34 -38
  146. package/dist-server/service/project/project-query.js.map +1 -1
  147. package/dist-server/service/project/project-type.d.ts +3 -6
  148. package/dist-server/service/project/project-type.js +25 -35
  149. package/dist-server/service/project/project-type.js.map +1 -1
  150. package/dist-server/service/project/project.d.ts +3 -2
  151. package/dist-server/service/project/project.js +10 -10
  152. package/dist-server/service/project/project.js.map +1 -1
  153. package/dist-server/service/resource/index.d.ts +6 -0
  154. package/dist-server/service/resource/index.js +10 -0
  155. package/dist-server/service/resource/index.js.map +1 -0
  156. package/dist-server/service/resource/resource-mutation.d.ts +10 -0
  157. package/dist-server/service/resource/resource-mutation.js +132 -0
  158. package/dist-server/service/resource/resource-mutation.js.map +1 -0
  159. package/dist-server/service/resource/resource-query.d.ts +11 -0
  160. package/dist-server/service/{checklist/checklist-query.js → resource/resource-query.js} +33 -38
  161. package/dist-server/service/resource/resource-query.js.map +1 -0
  162. package/dist-server/service/resource/resource-type.d.ts +17 -0
  163. package/dist-server/service/resource/resource-type.js +65 -0
  164. package/dist-server/service/resource/resource-type.js.map +1 -0
  165. package/dist-server/service/resource/resource.d.ts +24 -0
  166. package/dist-server/service/resource/resource.js +93 -0
  167. package/dist-server/service/resource/resource.js.map +1 -0
  168. package/dist-server/service/task/task-mutation.js +6 -0
  169. package/dist-server/service/task/task-mutation.js.map +1 -1
  170. package/dist-server/service/task/task-query.d.ts +9 -1
  171. package/dist-server/service/task/task-query.js +142 -20
  172. package/dist-server/service/task/task-query.js.map +1 -1
  173. package/dist-server/service/task/task-type.d.ts +13 -0
  174. package/dist-server/service/task/task-type.js +57 -12
  175. package/dist-server/service/task/task-type.js.map +1 -1
  176. package/dist-server/service/task/task.d.ts +12 -5
  177. package/dist-server/service/task/task.js +51 -16
  178. package/dist-server/service/task/task.js.map +1 -1
  179. package/dist-server/service/task-resource/index.d.ts +6 -0
  180. package/dist-server/service/task-resource/index.js +10 -0
  181. package/dist-server/service/task-resource/index.js.map +1 -0
  182. package/dist-server/service/task-resource/task-resource-mutation.d.ts +10 -0
  183. package/dist-server/service/task-resource/task-resource-mutation.js +132 -0
  184. package/dist-server/service/task-resource/task-resource-mutation.js.map +1 -0
  185. package/dist-server/service/task-resource/task-resource-query.d.ts +7 -0
  186. package/dist-server/service/task-resource/task-resource-query.js +50 -0
  187. package/dist-server/service/task-resource/task-resource-query.js.map +1 -0
  188. package/dist-server/service/task-resource/task-resource-type.d.ts +17 -0
  189. package/dist-server/service/task-resource/task-resource-type.js +65 -0
  190. package/dist-server/service/task-resource/task-resource-type.js.map +1 -0
  191. package/dist-server/service/task-resource/task-resource.d.ts +13 -0
  192. package/dist-server/service/task-resource/task-resource.js +59 -0
  193. package/dist-server/service/task-resource/task-resource.js.map +1 -0
  194. package/dist-server/tsconfig.tsbuildinfo +1 -1
  195. package/helps/project/checklist-type-detail.md +160 -0
  196. package/helps/project/checklist-type.md +160 -0
  197. package/helps/project/task-resource.md +160 -0
  198. package/package.json +11 -7
  199. package/server/controllers/import-task.ts +140 -0
  200. package/server/index.ts +1 -0
  201. package/server/migrations/1723861466413-seed-roles.ts +128 -0
  202. package/server/migrations/1723861466414-seed-codes.ts +139 -0
  203. package/server/migrations/1723861476419-seed-resources.ts +62 -0
  204. package/server/migrations/1723861478420-seed-/bsample-project.ts +87 -0
  205. package/server/migrations/1723861478421-seed-/bsample-tasks.ts +194 -0
  206. package/server/migrations/index.ts +9 -0
  207. package/server/service/construction-detail-type/construction-detail-type-mutation.ts +57 -0
  208. package/server/service/construction-detail-type/construction-detail-type-query.ts +31 -0
  209. package/server/service/construction-detail-type/construction-detail-type-type.ts +26 -0
  210. package/server/service/construction-detail-type/construction-detail-type.ts +52 -0
  211. package/server/service/construction-detail-type/index.ts +6 -0
  212. package/server/service/construction-type/construction-type-query.ts +9 -0
  213. package/server/service/construction-type/construction-type.ts +8 -2
  214. package/server/service/index.ts +24 -11
  215. package/server/service/inspection-drawing-type/index.ts +6 -0
  216. package/server/service/inspection-drawing-type/inspection-drawing-type-mutation.ts +69 -0
  217. package/server/service/inspection-drawing-type/inspection-drawing-type-query.ts +55 -0
  218. package/server/service/inspection-drawing-type/inspection-drawing-type-type.ts +23 -0
  219. package/server/service/inspection-drawing-type/inspection-drawing-type.ts +68 -0
  220. package/server/service/inspection-part/index.ts +6 -0
  221. package/server/service/inspection-part/inspection-part-mutation.ts +52 -0
  222. package/server/service/inspection-part/inspection-part-query.ts +41 -0
  223. package/server/service/inspection-part/inspection-part-type.ts +26 -0
  224. package/server/service/inspection-part/inspection-part.ts +51 -0
  225. package/server/service/project/index.ts +0 -2
  226. package/server/service/project/project-query.ts +30 -38
  227. package/server/service/project/project-type.ts +22 -27
  228. package/server/service/project/project.ts +11 -12
  229. package/server/service/resource/index.ts +7 -0
  230. package/server/service/resource/resource-mutation.ts +137 -0
  231. package/server/service/resource/resource-query.ts +50 -0
  232. package/server/service/resource/resource-type.ts +41 -0
  233. package/server/service/resource/resource.ts +82 -0
  234. package/server/service/task/task-mutation.ts +8 -9
  235. package/server/service/task/task-query.ts +135 -22
  236. package/server/service/task/task-type.ts +41 -15
  237. package/server/service/task/task.ts +44 -15
  238. package/server/service/task-resource/index.ts +7 -0
  239. package/server/service/task-resource/task-resource-mutation.ts +140 -0
  240. package/server/service/task-resource/task-resource-query.ts +36 -0
  241. package/server/service/task-resource/task-resource-type.ts +41 -0
  242. package/server/service/task-resource/task-resource.ts +51 -0
  243. package/things-factory.config.js +1 -0
  244. package/translations/en.json +15 -1
  245. package/translations/ko.json +9 -5
  246. package/dist-client/pages/checklist/checklist-importer.js.map +0 -1
  247. package/dist-client/pages/checklist/checklist-list-page.js.map +0 -1
  248. package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
  249. package/dist-server/service/check-item/check-item-mutation.js +0 -129
  250. package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
  251. package/dist-server/service/check-item/check-item-query.d.ts +0 -11
  252. package/dist-server/service/check-item/check-item-query.js +0 -86
  253. package/dist-server/service/check-item/check-item-query.js.map +0 -1
  254. package/dist-server/service/check-item/check-item-type.d.ts +0 -18
  255. package/dist-server/service/check-item/check-item-type.js +0 -69
  256. package/dist-server/service/check-item/check-item-type.js.map +0 -1
  257. package/dist-server/service/check-item/check-item.d.ts +0 -18
  258. package/dist-server/service/check-item/check-item.js +0 -84
  259. package/dist-server/service/check-item/check-item.js.map +0 -1
  260. package/dist-server/service/check-item/index.d.ts +0 -5
  261. package/dist-server/service/check-item/index.js +0 -9
  262. package/dist-server/service/check-item/index.js.map +0 -1
  263. package/dist-server/service/checklist/checklist-mutation.d.ts +0 -10
  264. package/dist-server/service/checklist/checklist-mutation.js +0 -129
  265. package/dist-server/service/checklist/checklist-mutation.js.map +0 -1
  266. package/dist-server/service/checklist/checklist-query.d.ts +0 -11
  267. package/dist-server/service/checklist/checklist-query.js.map +0 -1
  268. package/dist-server/service/checklist/checklist-type.d.ts +0 -18
  269. package/dist-server/service/checklist/checklist-type.js +0 -69
  270. package/dist-server/service/checklist/checklist-type.js.map +0 -1
  271. package/dist-server/service/checklist/checklist.d.ts +0 -26
  272. package/dist-server/service/checklist/checklist.js +0 -120
  273. package/dist-server/service/checklist/checklist.js.map +0 -1
  274. package/dist-server/service/checklist/index.d.ts +0 -5
  275. package/dist-server/service/checklist/index.js +0 -9
  276. package/dist-server/service/checklist/index.js.map +0 -1
  277. package/server/service/check-item/check-item-mutation.ts +0 -142
  278. package/server/service/check-item/check-item-query.ts +0 -56
  279. package/server/service/check-item/check-item-type.ts +0 -49
  280. package/server/service/check-item/check-item.ts +0 -74
  281. package/server/service/check-item/index.ts +0 -6
  282. package/server/service/checklist/checklist-mutation.ts +0 -142
  283. package/server/service/checklist/checklist-query.ts +0 -56
  284. package/server/service/checklist/checklist-type.ts +0 -49
  285. package/server/service/checklist/checklist.ts +0 -105
  286. package/server/service/checklist/index.ts +0 -6
@@ -1 +1,15 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "아이디",
3
+ "label.gantt-task-section": "섹션",
4
+ "label.gantt-task-title": "제목",
5
+ "label.gantt-task-type": "유형",
6
+ "label.gantt-task-start-date": "시작 날짜",
7
+ "label.gantt-task-end-date": "종료 날짜",
8
+ "label.gantt-task-tags": "태그",
9
+ "label.gantt-task-progress": "진행 상황",
10
+ "label.gantt-task-previous": "이전",
11
+ "label.gantt-task-resources": "자원",
12
+ "label.gantt-task-duration": "기간",
13
+ "label.gantt-resource-type": "유형",
14
+ "label.gantt-resource-allocated": "할당"
15
+ }
@@ -1,9 +1,13 @@
1
1
  {
2
+ "button.project_create": "프로젝트 생성",
3
+ "label.gantt-task-title": "작업명",
4
+ "label.gantt-task-start-date": "시작 날짜",
5
+ "label.gantt-task-resources": "자원",
6
+ "label.gantt-task-duration": "기간",
7
+ "label.gantt-resource-type": "유형",
8
+ "label.gantt-resource-allocated": "할당",
9
+ "label.project_name": "프로젝트 이름",
2
10
  "title.project_create": "프로젝트 생성",
3
11
  "title.project_update": "프로젝트 수정",
4
- "title.project_setting_list": "프로젝트 설정 리스트",
5
-
6
- "label.project_name": "프로젝트 이름",
7
-
8
- "button.project_create": "프로젝트 생성"
12
+ "title.project_setting_list": "프로젝트 설정 리스트"
9
13
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-importer.js","sourceRoot":"","sources":["../../../client/pages/checklist/checklist-importer.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAY,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAAjD;;QA0BmB,eAAU,GAAU,EAAE,CAAA;QACtB,YAAO,GAAG;YACzB,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAgCH,CAAC;IA9BC,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBACd;YACN,OAAO,EAAE,IAAI,CAAC,UAAU;SACzB;;;;6CAIoC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAEzF,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,IAAI;;QAChB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3C,CAAC,CAAA;QAEF,IAAI,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAhFM,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;qDAA+B;AACvC;IAAC,KAAK,EAAE;;kDAuBP","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\n\nexport class ChecklistImporter extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-grist {\n flex: 1;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n\n md-elevated-button {\n margin-left: var(--margin-default);\n }\n `\n ]\n\n @state() private checklists: any[] = []\n @state() private columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.checklists\n }}\n ></ox-grist>\n\n <div class=\"button-container\">\n <md-elevated-button raised @click=\"${this.save.bind(this)}\">${i18next.t('button.save')}</md-elevated-button>\n </div>\n `\n }\n\n private async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importChecklists($checklists: [ChecklistPatch!]!) {\n importChecklists(checklists: $checklists)\n }\n `,\n variables: { checklists: this.checklists }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"checklist-list-page.js","sourceRoot":"","sources":["../../../client/pages/checklist/checklist-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,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,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAA;QAEvE,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACnC,IAAI,OAAO,GAAG,EAAE,CAAA;YAChB,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;gBAClC,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;aAClC;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,OAAO;QACjC,MAAM,KAAK,GAAG,SAAS,CACrB,IAAI,CAAA;;wBAEc,OAAO;sBACT,GAAG,EAAE;YACf,OAAO,CAAC,IAAI,EAAE,CAAA;YACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;SAC3C,CACF,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC,CAAA;IACH,CAAC;;AA5TM,wBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAQD;IAAC,KAAK,EAAE;;sDAAyB;AACjC;IAAC,KAAK,EAAE;;+CAA4E;AAEpF;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gDAAA;AAC5C;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAA0B,OAAO;yDAAA;AA1B/C,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8T7B;SA9TY,iBAAiB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup, OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\n\nimport { ChecklistImporter } from './checklist-importer'\n\n@customElement('checklist-list-page')\nexport class ChecklistListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'checklist-importer': ChecklistImporter\n }\n }\n\n @state() private gristConfig: any\n @state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n @query('#sorter-control') private sortersControl!: OxPopup\n\n get context() {\n return {\n title: i18next.t('title.checklist list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'project/checklist',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this.updateChecklist.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this.deleteChecklist.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.checklist list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n\n <div id=\"sorters\">\n Sort\n <md-icon\n @click=${e => {\n const target = e.currentTarget\n this.sortersControl.open({\n right: 0,\n top: target.offsetTop + target.offsetHeight\n })\n }}\n >expand_more</md-icon\n >\n <ox-popup id=\"sorter-control\">\n <ox-sorters-control> </ox-sorters-control>\n </ox-popup>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: checklists(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n private async deleteChecklist() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteChecklists(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n private async updateChecklist() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ChecklistPatch!]!) {\n updateMultipleChecklist(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n private async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(checklist => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = checklist[field]\n }\n\n return tempObj\n })\n }\n\n private async importHandler(records) {\n const popup = openPopup(\n html`\n <checklist-importer\n .checklists=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></checklist-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import checklist')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { CheckItem } from './check-item';
2
- import { NewCheckItem, CheckItemPatch } from './check-item-type';
3
- export declare class CheckItemMutation {
4
- createCheckItem(checkItem: NewCheckItem, context: ResolverContext): Promise<CheckItem>;
5
- updateCheckItem(id: string, patch: CheckItemPatch, context: ResolverContext): Promise<CheckItem>;
6
- updateMultipleCheckItem(patches: CheckItemPatch[], context: ResolverContext): Promise<CheckItem[]>;
7
- deleteCheckItem(id: string, context: ResolverContext): Promise<boolean>;
8
- deleteCheckItems(ids: string[], context: ResolverContext): Promise<boolean>;
9
- importCheckItems(checkItems: CheckItemPatch[], context: ResolverContext): Promise<boolean>;
10
- }
@@ -1,129 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckItemMutation = 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 check_item_1 = require("./check-item");
9
- const check_item_type_1 = require("./check-item-type");
10
- let CheckItemMutation = class CheckItemMutation {
11
- async createCheckItem(checkItem, context) {
12
- const { domain, user, tx } = context.state;
13
- const result = await tx.getRepository(check_item_1.CheckItem).save(Object.assign(Object.assign({}, checkItem), { domain, creator: user, updater: user }));
14
- return result;
15
- }
16
- async updateCheckItem(id, patch, context) {
17
- const { domain, user, tx } = context.state;
18
- const repository = tx.getRepository(check_item_1.CheckItem);
19
- const checkItem = await repository.findOne({
20
- where: { id }
21
- });
22
- const result = await repository.save(Object.assign(Object.assign(Object.assign({}, checkItem), patch), { updater: user }));
23
- return result;
24
- }
25
- async updateMultipleCheckItem(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 checkItemRepo = tx.getRepository(check_item_1.CheckItem);
31
- if (_createRecords.length > 0) {
32
- for (let i = 0; i < _createRecords.length; i++) {
33
- const newRecord = _createRecords[i];
34
- const result = await checkItemRepo.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 checkItem = await checkItemRepo.findOneBy({ id: updateRecord.id });
42
- const result = await checkItemRepo.save(Object.assign(Object.assign(Object.assign({}, checkItem), updateRecord), { updater: user }));
43
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
44
- }
45
- }
46
- return results;
47
- }
48
- async deleteCheckItem(id, context) {
49
- const { domain, tx } = context.state;
50
- await tx.getRepository(check_item_1.CheckItem).delete({ id });
51
- await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
52
- return true;
53
- }
54
- async deleteCheckItems(ids, context) {
55
- const { domain, tx } = context.state;
56
- await tx.getRepository(check_item_1.CheckItem).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 importCheckItems(checkItems, context) {
63
- const { domain, tx } = context.state;
64
- await Promise.all(checkItems.map(async (checkItem) => {
65
- const createdCheckItem = await tx.getRepository(check_item_1.CheckItem).save(Object.assign({ domain }, checkItem));
66
- }));
67
- return true;
68
- }
69
- };
70
- tslib_1.__decorate([
71
- (0, type_graphql_1.Directive)('@transaction'),
72
- (0, type_graphql_1.Mutation)(returns => check_item_1.CheckItem, { description: 'To create new CheckItem' }),
73
- tslib_1.__param(0, (0, type_graphql_1.Arg)('checkItem')),
74
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
75
- tslib_1.__metadata("design:type", Function),
76
- tslib_1.__metadata("design:paramtypes", [check_item_type_1.NewCheckItem, Object]),
77
- tslib_1.__metadata("design:returntype", Promise)
78
- ], CheckItemMutation.prototype, "createCheckItem", null);
79
- tslib_1.__decorate([
80
- (0, type_graphql_1.Directive)('@transaction'),
81
- (0, type_graphql_1.Mutation)(returns => check_item_1.CheckItem, { description: 'To modify CheckItem information' }),
82
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
83
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
84
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
85
- tslib_1.__metadata("design:type", Function),
86
- tslib_1.__metadata("design:paramtypes", [String, check_item_type_1.CheckItemPatch, Object]),
87
- tslib_1.__metadata("design:returntype", Promise)
88
- ], CheckItemMutation.prototype, "updateCheckItem", null);
89
- tslib_1.__decorate([
90
- (0, type_graphql_1.Directive)('@transaction'),
91
- (0, type_graphql_1.Mutation)(returns => [check_item_1.CheckItem], { description: "To modify multiple CheckItems' information" }),
92
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [check_item_type_1.CheckItemPatch])),
93
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
94
- tslib_1.__metadata("design:type", Function),
95
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
96
- tslib_1.__metadata("design:returntype", Promise)
97
- ], CheckItemMutation.prototype, "updateMultipleCheckItem", null);
98
- tslib_1.__decorate([
99
- (0, type_graphql_1.Directive)('@transaction'),
100
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete CheckItem' }),
101
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
102
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
103
- tslib_1.__metadata("design:type", Function),
104
- tslib_1.__metadata("design:paramtypes", [String, Object]),
105
- tslib_1.__metadata("design:returntype", Promise)
106
- ], CheckItemMutation.prototype, "deleteCheckItem", null);
107
- tslib_1.__decorate([
108
- (0, type_graphql_1.Directive)('@transaction'),
109
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple CheckItems' }),
110
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
112
- tslib_1.__metadata("design:type", Function),
113
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
114
- tslib_1.__metadata("design:returntype", Promise)
115
- ], CheckItemMutation.prototype, "deleteCheckItems", null);
116
- tslib_1.__decorate([
117
- (0, type_graphql_1.Directive)('@transaction'),
118
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple CheckItems' }),
119
- tslib_1.__param(0, (0, type_graphql_1.Arg)('checkItems', type => [check_item_type_1.CheckItemPatch])),
120
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
121
- tslib_1.__metadata("design:type", Function),
122
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
123
- tslib_1.__metadata("design:returntype", Promise)
124
- ], CheckItemMutation.prototype, "importCheckItems", null);
125
- CheckItemMutation = tslib_1.__decorate([
126
- (0, type_graphql_1.Resolver)(check_item_1.CheckItem)
127
- ], CheckItemMutation);
128
- exports.CheckItemMutation = CheckItemMutation;
129
- //# sourceMappingURL=check-item-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-item-mutation.js","sourceRoot":"","sources":["../../../server/service/check-item/check-item-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,6CAAwC;AACxC,uDAAgE;AAGzD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AA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,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAE5E,mBAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,gCAAc,CAAC,CAAC,CAAA;IAC3C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAWP;AAnIU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,iBAAiB,CAoI7B;AApIY,8CAAiB","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 { CheckItem } from './check-item'\nimport { NewCheckItem, CheckItemPatch } from './check-item-type'\n\n@Resolver(CheckItem)\nexport class CheckItemMutation {\n @Directive('@transaction')\n @Mutation(returns => CheckItem, { description: 'To create new CheckItem' })\n async createCheckItem(\n @Arg('checkItem') checkItem: NewCheckItem,\n @Ctx() context: ResolverContext\n ): Promise<CheckItem> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(CheckItem).save({\n ...checkItem,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => CheckItem, { description: 'To modify CheckItem information' })\n async updateCheckItem(\n @Arg('id') id: string,\n @Arg('patch') patch: CheckItemPatch,\n @Ctx() context: ResolverContext\n ): Promise<CheckItem> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(CheckItem)\n const checkItem = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...checkItem,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [CheckItem], { description: \"To modify multiple CheckItems' information\" })\n async updateMultipleCheckItem(\n @Arg('patches', type => [CheckItemPatch]) patches: CheckItemPatch[],\n @Ctx() context: ResolverContext\n ): Promise<CheckItem[]> {\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 checkItemRepo = tx.getRepository(CheckItem)\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 checkItemRepo.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 checkItem = await checkItemRepo.findOneBy({ id: updateRecord.id })\n\n const result = await checkItemRepo.save({\n ...checkItem,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete CheckItem' })\n async deleteCheckItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CheckItem).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple CheckItems' })\n async deleteCheckItems(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CheckItem).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple CheckItems' })\n async importCheckItems(\n @Arg('checkItems', type => [CheckItemPatch]) checkItems: CheckItemPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n checkItems.map(async (checkItem: CheckItemPatch) => {\n const createdCheckItem: CheckItem = await tx.getRepository(CheckItem).save({ domain, ...checkItem })\n })\n )\n\n return true\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- import { ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { CheckItem } from './check-item';
4
- import { CheckItemList } from './check-item-type';
5
- export declare class CheckItemQuery {
6
- checkItem(id: string, context: ResolverContext): Promise<CheckItem>;
7
- checkItems(params: ListParam, context: ResolverContext): Promise<CheckItemList>;
8
- thumbnail(checkItem: CheckItem): Promise<string | undefined>;
9
- updater(checkItem: CheckItem): Promise<User>;
10
- creator(checkItem: CheckItem): Promise<User>;
11
- }
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckItemQuery = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const attachment_base_1 = require("@things-factory/attachment-base");
7
- const shell_1 = require("@things-factory/shell");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- const check_item_1 = require("./check-item");
10
- const check_item_type_1 = require("./check-item-type");
11
- let CheckItemQuery = class CheckItemQuery {
12
- async checkItem(id, context) {
13
- const { domain } = context.state;
14
- return await (0, shell_1.getRepository)(check_item_1.CheckItem).findOne({
15
- where: { id }
16
- });
17
- }
18
- async checkItems(params, context) {
19
- const { domain } = context.state;
20
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
21
- domain,
22
- params,
23
- repository: await (0, shell_1.getRepository)(check_item_1.CheckItem),
24
- searchables: ['name', 'description']
25
- });
26
- const [items, total] = await queryBuilder.getManyAndCount();
27
- return { items, total };
28
- }
29
- async thumbnail(checkItem) {
30
- const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
31
- where: {
32
- refType: check_item_1.CheckItem.name,
33
- refBy: checkItem.id
34
- }
35
- });
36
- return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
37
- }
38
- async updater(checkItem) {
39
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checkItem.updaterId });
40
- }
41
- async creator(checkItem) {
42
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: checkItem.creatorId });
43
- }
44
- };
45
- tslib_1.__decorate([
46
- (0, type_graphql_1.Query)(returns => check_item_1.CheckItem, { nullable: true, description: 'To fetch a CheckItem' }),
47
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
48
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
49
- tslib_1.__metadata("design:type", Function),
50
- tslib_1.__metadata("design:paramtypes", [String, Object]),
51
- tslib_1.__metadata("design:returntype", Promise)
52
- ], CheckItemQuery.prototype, "checkItem", null);
53
- tslib_1.__decorate([
54
- (0, type_graphql_1.Query)(returns => check_item_type_1.CheckItemList, { description: 'To fetch multiple CheckItems' }),
55
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
56
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
57
- tslib_1.__metadata("design:type", Function),
58
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
59
- tslib_1.__metadata("design:returntype", Promise)
60
- ], CheckItemQuery.prototype, "checkItems", null);
61
- tslib_1.__decorate([
62
- (0, type_graphql_1.FieldResolver)(type => String),
63
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
64
- tslib_1.__metadata("design:type", Function),
65
- tslib_1.__metadata("design:paramtypes", [check_item_1.CheckItem]),
66
- tslib_1.__metadata("design:returntype", Promise)
67
- ], CheckItemQuery.prototype, "thumbnail", null);
68
- tslib_1.__decorate([
69
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
70
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
71
- tslib_1.__metadata("design:type", Function),
72
- tslib_1.__metadata("design:paramtypes", [check_item_1.CheckItem]),
73
- tslib_1.__metadata("design:returntype", Promise)
74
- ], CheckItemQuery.prototype, "updater", null);
75
- tslib_1.__decorate([
76
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
77
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
78
- tslib_1.__metadata("design:type", Function),
79
- tslib_1.__metadata("design:paramtypes", [check_item_1.CheckItem]),
80
- tslib_1.__metadata("design:returntype", Promise)
81
- ], CheckItemQuery.prototype, "creator", null);
82
- CheckItemQuery = tslib_1.__decorate([
83
- (0, type_graphql_1.Resolver)(check_item_1.CheckItem)
84
- ], CheckItemQuery);
85
- exports.CheckItemQuery = CheckItemQuery;
86
- //# sourceMappingURL=check-item-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-item-query.js","sourceRoot":"","sources":["../../../server/service/check-item/check-item-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,6CAAwC;AACxC,uDAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAY,EAAU,EAAS,OAAwB;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,sBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CAAS,MAAiB,EAAS,OAAwB;QACzE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,sBAAS,CAAC;YAC1C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,C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AA;;6CAAY,sBAAS;;+CAS3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,sBAAS;;6CAEzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,sBAAS;;6CAEzC;AA9CU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,cAAc,CA+C1B;AA/CY,wCAAc","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { CheckItem } from './check-item'\nimport { CheckItemList } from './check-item-type'\n\n@Resolver(CheckItem)\nexport class CheckItemQuery {\n @Query(returns => CheckItem!, { nullable: true, description: 'To fetch a CheckItem' })\n async checkItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<CheckItem> {\n const { domain } = context.state\n\n return await getRepository(CheckItem).findOne({\n where: { id }\n })\n }\n\n @Query(returns => CheckItemList, { description: 'To fetch multiple CheckItems' })\n async checkItems(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<CheckItemList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(CheckItem),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() checkItem: CheckItem): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n refType: CheckItem.name,\n refBy: checkItem.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => User)\n async updater(@Root() checkItem: CheckItem): Promise<User> {\n return await getRepository(User).findOneBy({ id: checkItem.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() checkItem: CheckItem): Promise<User> {\n return await getRepository(User).findOneBy({ id: checkItem.creatorId })\n }\n}\n"]}
@@ -1,18 +0,0 @@
1
- import { CheckItem } from './check-item';
2
- export declare class NewCheckItem {
3
- name: string;
4
- description?: string;
5
- active?: boolean;
6
- params?: string;
7
- }
8
- export declare class CheckItemPatch {
9
- id?: string;
10
- name?: string;
11
- description?: string;
12
- active?: boolean;
13
- cuFlag?: string;
14
- }
15
- export declare class CheckItemList {
16
- items: CheckItem[];
17
- total: number;
18
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckItemList = exports.CheckItemPatch = exports.NewCheckItem = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const check_item_1 = require("./check-item");
7
- let NewCheckItem = class NewCheckItem {
8
- };
9
- tslib_1.__decorate([
10
- (0, type_graphql_1.Field)(),
11
- tslib_1.__metadata("design:type", String)
12
- ], NewCheckItem.prototype, "name", void 0);
13
- tslib_1.__decorate([
14
- (0, type_graphql_1.Field)({ nullable: true }),
15
- tslib_1.__metadata("design:type", String)
16
- ], NewCheckItem.prototype, "description", void 0);
17
- tslib_1.__decorate([
18
- (0, type_graphql_1.Field)({ nullable: true }),
19
- tslib_1.__metadata("design:type", Boolean)
20
- ], NewCheckItem.prototype, "active", void 0);
21
- tslib_1.__decorate([
22
- (0, type_graphql_1.Field)({ nullable: true }),
23
- tslib_1.__metadata("design:type", String)
24
- ], NewCheckItem.prototype, "params", void 0);
25
- NewCheckItem = tslib_1.__decorate([
26
- (0, type_graphql_1.InputType)()
27
- ], NewCheckItem);
28
- exports.NewCheckItem = NewCheckItem;
29
- let CheckItemPatch = class CheckItemPatch {
30
- };
31
- tslib_1.__decorate([
32
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
33
- tslib_1.__metadata("design:type", String)
34
- ], CheckItemPatch.prototype, "id", void 0);
35
- tslib_1.__decorate([
36
- (0, type_graphql_1.Field)({ nullable: true }),
37
- tslib_1.__metadata("design:type", String)
38
- ], CheckItemPatch.prototype, "name", void 0);
39
- tslib_1.__decorate([
40
- (0, type_graphql_1.Field)({ nullable: true }),
41
- tslib_1.__metadata("design:type", String)
42
- ], CheckItemPatch.prototype, "description", void 0);
43
- tslib_1.__decorate([
44
- (0, type_graphql_1.Field)({ nullable: true }),
45
- tslib_1.__metadata("design:type", Boolean)
46
- ], CheckItemPatch.prototype, "active", void 0);
47
- tslib_1.__decorate([
48
- (0, type_graphql_1.Field)({ nullable: true }),
49
- tslib_1.__metadata("design:type", String)
50
- ], CheckItemPatch.prototype, "cuFlag", void 0);
51
- CheckItemPatch = tslib_1.__decorate([
52
- (0, type_graphql_1.InputType)()
53
- ], CheckItemPatch);
54
- exports.CheckItemPatch = CheckItemPatch;
55
- let CheckItemList = class CheckItemList {
56
- };
57
- tslib_1.__decorate([
58
- (0, type_graphql_1.Field)(type => [check_item_1.CheckItem]),
59
- tslib_1.__metadata("design:type", Array)
60
- ], CheckItemList.prototype, "items", void 0);
61
- tslib_1.__decorate([
62
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
63
- tslib_1.__metadata("design:type", Number)
64
- ], CheckItemList.prototype, "total", void 0);
65
- CheckItemList = tslib_1.__decorate([
66
- (0, type_graphql_1.ObjectType)()
67
- ], CheckItemList);
68
- exports.CheckItemList = CheckItemList;
69
- //# sourceMappingURL=check-item-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-item-type.js","sourceRoot":"","sources":["../../../server/service/check-item/check-item-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,6CAAwC;AAGjC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAYxB,CAAA;AAXC;IAAC,IAAA,oBAAK,GAAE;;0CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;AAXJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAYxB;AAZY,oCAAY;AAelB,IAAM,cAAc,GAApB,MAAM,cAAc;CAe1B,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAdJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAe1B;AAfY,wCAAc;AAkBpB,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAS,CAAC,CAAC;;4CACT;AAElB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;AALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { CheckItem } from './check-item'\n\n@InputType()\nexport class NewCheckItem {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class CheckItemPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class CheckItemList {\n @Field(type => [CheckItem])\n items: CheckItem[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,18 +0,0 @@
1
- import { User } from '@things-factory/auth-base';
2
- import { Checklist } from '../checklist/checklist';
3
- export declare class CheckItem {
4
- readonly id: string;
5
- name?: string;
6
- result?: boolean;
7
- reference?: string;
8
- measuresToBeTaken?: string;
9
- checklist?: Checklist;
10
- checklistId?: string;
11
- createdAt?: Date;
12
- updatedAt?: Date;
13
- deletedAt?: Date;
14
- creator?: User;
15
- creatorId?: string;
16
- updater?: User;
17
- updaterId?: string;
18
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckItem = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const type_graphql_1 = require("type-graphql");
7
- const auth_base_1 = require("@things-factory/auth-base");
8
- const checklist_1 = require("../checklist/checklist");
9
- let CheckItem = class CheckItem {
10
- };
11
- tslib_1.__decorate([
12
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
13
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
14
- tslib_1.__metadata("design:type", String)
15
- ], CheckItem.prototype, "id", void 0);
16
- tslib_1.__decorate([
17
- (0, typeorm_1.Column)({ nullable: true, comment: '검사 항목' }),
18
- (0, type_graphql_1.Field)({ nullable: true }),
19
- tslib_1.__metadata("design:type", String)
20
- ], CheckItem.prototype, "name", void 0);
21
- tslib_1.__decorate([
22
- (0, typeorm_1.Column)({ nullable: true, comment: '검사 결과 (true: 적합, false: 부적합)' }),
23
- (0, type_graphql_1.Field)({ nullable: true }),
24
- tslib_1.__metadata("design:type", Boolean)
25
- ], CheckItem.prototype, "result", void 0);
26
- tslib_1.__decorate([
27
- (0, typeorm_1.Column)({ nullable: true, comment: '기준, 참고 사항 이미지' }),
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
- tslib_1.__metadata("design:type", String)
30
- ], CheckItem.prototype, "reference", void 0);
31
- tslib_1.__decorate([
32
- (0, typeorm_1.Column)({ nullable: true, comment: '조치 사항' }),
33
- (0, type_graphql_1.Field)({ nullable: true }),
34
- tslib_1.__metadata("design:type", String)
35
- ], CheckItem.prototype, "measuresToBeTaken", void 0);
36
- tslib_1.__decorate([
37
- (0, typeorm_1.ManyToOne)(type => checklist_1.Checklist),
38
- (0, type_graphql_1.Field)({ nullable: true }),
39
- tslib_1.__metadata("design:type", checklist_1.Checklist)
40
- ], CheckItem.prototype, "checklist", void 0);
41
- tslib_1.__decorate([
42
- (0, typeorm_1.RelationId)((checkItem) => checkItem.checklist),
43
- tslib_1.__metadata("design:type", String)
44
- ], CheckItem.prototype, "checklistId", void 0);
45
- tslib_1.__decorate([
46
- (0, typeorm_1.CreateDateColumn)(),
47
- (0, type_graphql_1.Field)({ nullable: true }),
48
- tslib_1.__metadata("design:type", Date)
49
- ], CheckItem.prototype, "createdAt", void 0);
50
- tslib_1.__decorate([
51
- (0, typeorm_1.UpdateDateColumn)(),
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- tslib_1.__metadata("design:type", Date)
54
- ], CheckItem.prototype, "updatedAt", void 0);
55
- tslib_1.__decorate([
56
- (0, typeorm_1.DeleteDateColumn)(),
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- tslib_1.__metadata("design:type", Date)
59
- ], CheckItem.prototype, "deletedAt", void 0);
60
- tslib_1.__decorate([
61
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
62
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
63
- tslib_1.__metadata("design:type", auth_base_1.User)
64
- ], CheckItem.prototype, "creator", void 0);
65
- tslib_1.__decorate([
66
- (0, typeorm_1.RelationId)((checkItem) => checkItem.creator),
67
- tslib_1.__metadata("design:type", String)
68
- ], CheckItem.prototype, "creatorId", void 0);
69
- tslib_1.__decorate([
70
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
71
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
72
- tslib_1.__metadata("design:type", auth_base_1.User)
73
- ], CheckItem.prototype, "updater", void 0);
74
- tslib_1.__decorate([
75
- (0, typeorm_1.RelationId)((checkItem) => checkItem.updater),
76
- tslib_1.__metadata("design:type", String)
77
- ], CheckItem.prototype, "updaterId", void 0);
78
- CheckItem = tslib_1.__decorate([
79
- (0, typeorm_1.Entity)(),
80
- (0, typeorm_1.Index)('ix_check_item_0', (checkItem) => [checkItem.checklist], { where: '"deleted_at" IS NULL' }),
81
- (0, type_graphql_1.ObjectType)({ description: '체크 리스트 항목' })
82
- ], CheckItem);
83
- exports.CheckItem = CheckItem;
84
- //# sourceMappingURL=check-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-item.js","sourceRoot":"","sources":["../../../server/service/check-item/check-item.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAoD;AAEpD,yDAAgD;AAChD,sDAAkD;AAK3C,IAAM,SAAS,GAAf,MAAM,SAAS;CAsDrB,CAAA;AArDC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACC;AAEnB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC5C,IAAA,oBAAK,E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EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;0CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;0CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AArDP,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAC5G,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;GAC5B,SAAS,CAsDrB;AAtDY,8BAAS","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Checklist } from '../checklist/checklist'\n\n@Entity()\n@Index('ix_check_item_0', (checkItem: CheckItem) => [checkItem.checklist], { where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: '체크 리스트 항목' })\nexport class CheckItem {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, comment: '검사 항목' })\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true, comment: '검사 결과 (true: 적합, false: 부적합)' })\n @Field({ nullable: true })\n result?: boolean\n\n @Column({ nullable: true, comment: '기준, 참고 사항 이미지' })\n @Field({ nullable: true })\n reference?: string\n\n @Column({ nullable: true, comment: '조치 사항' })\n @Field({ nullable: true })\n measuresToBeTaken?: string\n\n // 체크리스트 정보 (상위 테이블 참조)\n @ManyToOne(type => Checklist)\n @Field({ nullable: true })\n checklist?: Checklist\n\n @RelationId((checkItem: CheckItem) => checkItem.checklist)\n checklistId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((checkItem: CheckItem) => checkItem.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((checkItem: CheckItem) => checkItem.updater)\n updaterId?: string\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { CheckItem } from './check-item';
2
- import { CheckItemQuery } from './check-item-query';
3
- import { CheckItemMutation } from './check-item-mutation';
4
- export declare const entities: (typeof CheckItem)[];
5
- export declare const resolvers: (typeof CheckItemQuery | typeof CheckItemMutation)[];
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const check_item_1 = require("./check-item");
5
- const check_item_query_1 = require("./check-item-query");
6
- const check_item_mutation_1 = require("./check-item-mutation");
7
- exports.entities = [check_item_1.CheckItem];
8
- exports.resolvers = [check_item_query_1.CheckItemQuery, check_item_mutation_1.CheckItemMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/check-item/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,yDAAmD;AACnD,+DAAyD;AAE5C,QAAA,QAAQ,GAAG,CAAC,sBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,iCAAc,EAAE,uCAAiB,CAAC,CAAA","sourcesContent":["import { CheckItem } from './check-item'\nimport { CheckItemQuery } from './check-item-query'\nimport { CheckItemMutation } from './check-item-mutation'\n\nexport const entities = [CheckItem]\nexport const resolvers = [CheckItemQuery, CheckItemMutation]\n"]}
@@ -1,10 +0,0 @@
1
- import { Checklist } from './checklist';
2
- import { NewChecklist, ChecklistPatch } from './checklist-type';
3
- export declare class ChecklistMutation {
4
- createChecklist(checklist: NewChecklist, context: ResolverContext): Promise<Checklist>;
5
- updateChecklist(id: string, patch: ChecklistPatch, context: ResolverContext): Promise<Checklist>;
6
- updateMultipleChecklist(patches: ChecklistPatch[], context: ResolverContext): Promise<Checklist[]>;
7
- deleteChecklist(id: string, context: ResolverContext): Promise<boolean>;
8
- deleteChecklists(ids: string[], context: ResolverContext): Promise<boolean>;
9
- importChecklists(checklists: ChecklistPatch[], context: ResolverContext): Promise<boolean>;
10
- }