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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist-client/pages/action-plan/action-plan-importer.js.map +1 -1
  2. package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
  3. package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
  4. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  6. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
  8. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  9. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -2
  10. package/dist-client/pages/building-inspection/building-inspection-list.js +2 -1
  11. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  12. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
  14. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  15. package/dist-client/pages/building-inspection/inspection-create-popup.js +8 -5
  16. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  17. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +46 -0
  18. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +930 -0
  19. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  20. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  21. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +736 -0
  22. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  23. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  24. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  25. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  26. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
  27. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
  28. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
  29. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  30. package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
  31. package/dist-client/pages/checklist/checklist-view.js +291 -185
  32. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  33. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
  34. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
  35. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  36. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  37. package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
  38. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  39. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +2 -2
  40. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
  41. package/dist-client/pages/issue/issue-importer.js.map +1 -1
  42. package/dist-client/pages/issue/issue-list-page.js.map +1 -1
  43. package/dist-client/pages/project-report/project-report-importer.js.map +1 -1
  44. package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
  45. package/dist-client/pages/supervisor/supervisor-importer.js.map +1 -1
  46. package/dist-client/pages/supervisor/supervisor-list-page.js.map +1 -1
  47. package/dist-client/route.d.ts +1 -1
  48. package/dist-client/route.js +3 -0
  49. package/dist-client/route.js.map +1 -1
  50. package/dist-client/stt/speech-to-text.d.ts +36 -0
  51. package/dist-client/stt/speech-to-text.js +89 -0
  52. package/dist-client/stt/speech-to-text.js.map +1 -0
  53. package/dist-client/stt/stt-utils.d.ts +28 -0
  54. package/dist-client/stt/stt-utils.js +146 -0
  55. package/dist-client/stt/stt-utils.js.map +1 -0
  56. package/dist-client/tsconfig.tsbuildinfo +1 -1
  57. package/dist-server/middlewares/index.js +1 -2
  58. package/dist-server/middlewares/index.js.map +1 -1
  59. package/dist-server/service/action-plan/action-plan-mutation.js +2 -2
  60. package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
  61. package/dist-server/service/action-plan/action-plan-query.js +2 -2
  62. package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
  63. package/dist-server/service/action-plan/action-plan-type.js +6 -6
  64. package/dist-server/service/action-plan/action-plan-type.js.map +1 -1
  65. package/dist-server/service/action-plan/action-plan.js +3 -3
  66. package/dist-server/service/action-plan/action-plan.js.map +1 -1
  67. package/dist-server/service/action-plan/index.d.ts +0 -1
  68. package/dist-server/service/action-plan/index.js +1 -2
  69. package/dist-server/service/action-plan/index.js.map +1 -1
  70. package/dist-server/service/building-inspection/building-inspection-history.js +2 -2
  71. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  72. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +1 -0
  73. package/dist-server/service/building-inspection/building-inspection-mutation.js +91 -14
  74. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  75. package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
  76. package/dist-server/service/building-inspection/building-inspection-query.js +33 -4
  77. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  78. package/dist-server/service/building-inspection/building-inspection-type.d.ts +10 -3
  79. package/dist-server/service/building-inspection/building-inspection-type.js +45 -20
  80. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  81. package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
  82. package/dist-server/service/building-inspection/building-inspection.js +43 -5
  83. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  84. package/dist-server/service/building-inspection/index.d.ts +2 -4
  85. package/dist-server/service/building-inspection/index.js +2 -4
  86. package/dist-server/service/building-inspection/index.js.map +1 -1
  87. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  88. package/dist-server/service/checklist/checklist-history.js +38 -2
  89. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  90. package/dist-server/service/checklist/checklist-mutation.js +2 -2
  91. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  92. package/dist-server/service/checklist/checklist-query.js +2 -2
  93. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  94. package/dist-server/service/checklist/checklist-type.js +6 -6
  95. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  96. package/dist-server/service/checklist/checklist.d.ts +19 -1
  97. package/dist-server/service/checklist/checklist.js +78 -7
  98. package/dist-server/service/checklist/checklist.js.map +1 -1
  99. package/dist-server/service/checklist/index.d.ts +0 -2
  100. package/dist-server/service/checklist/index.js +1 -3
  101. package/dist-server/service/checklist/index.js.map +1 -1
  102. package/dist-server/service/checklist-item/checklist-item-mutation.js +2 -2
  103. package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -1
  104. package/dist-server/service/checklist-item/checklist-item-query.js +2 -2
  105. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  106. package/dist-server/service/checklist-item/checklist-item-type.js +2 -2
  107. package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -1
  108. package/dist-server/service/checklist-item/checklist-item.js +3 -3
  109. package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
  110. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +2 -2
  111. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -1
  112. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +2 -2
  113. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  114. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +2 -2
  115. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -1
  116. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +6 -6
  117. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -1
  118. package/dist-server/service/checklist-item-comment/checklist-item-comment.js +2 -2
  119. package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -1
  120. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  121. package/dist-server/service/checklist-item-comment/index.js +1 -3
  122. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  123. package/dist-server/service/checklist-template/checklist-template-mutation.js +2 -2
  124. package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -1
  125. package/dist-server/service/checklist-template/checklist-template-query.js +2 -2
  126. package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
  127. package/dist-server/service/checklist-template/checklist-template-type.js +4 -4
  128. package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -1
  129. package/dist-server/service/checklist-template/checklist-template.js +2 -2
  130. package/dist-server/service/checklist-template/checklist-template.js.map +1 -1
  131. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +2 -2
  132. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
  133. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +2 -2
  134. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
  135. package/dist-server/service/checklist-template-item/checklist-template-item-type.js +4 -4
  136. package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
  137. package/dist-server/service/checklist-template-item/checklist-template-item.js +4 -6
  138. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  139. package/dist-server/service/checklist-type/checklist-type-mutation.js +2 -2
  140. package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -1
  141. package/dist-server/service/checklist-type/checklist-type-query.js +2 -2
  142. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
  143. package/dist-server/service/checklist-type/checklist-type-type.js +4 -4
  144. package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -1
  145. package/dist-server/service/checklist-type/checklist-type.js +3 -3
  146. package/dist-server/service/checklist-type/checklist-type.js.map +1 -1
  147. package/dist-server/service/index.d.ts +0 -1
  148. package/dist-server/service/index.js +1 -11
  149. package/dist-server/service/index.js.map +1 -1
  150. package/dist-server/service/issue/index.d.ts +0 -1
  151. package/dist-server/service/issue/index.js +1 -2
  152. package/dist-server/service/issue/index.js.map +1 -1
  153. package/dist-server/service/issue/issue-mutation.js +2 -2
  154. package/dist-server/service/issue/issue-mutation.js.map +1 -1
  155. package/dist-server/service/issue/issue-query.js +2 -2
  156. package/dist-server/service/issue/issue-query.js.map +1 -1
  157. package/dist-server/service/issue/issue-type.js +6 -6
  158. package/dist-server/service/issue/issue-type.js.map +1 -1
  159. package/dist-server/service/issue/issue.js +3 -3
  160. package/dist-server/service/issue/issue.js.map +1 -1
  161. package/dist-server/service/project-report/index.d.ts +0 -1
  162. package/dist-server/service/project-report/index.js +1 -2
  163. package/dist-server/service/project-report/index.js.map +1 -1
  164. package/dist-server/service/project-report/project-report-mutation.js +2 -2
  165. package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
  166. package/dist-server/service/project-report/project-report-query.js +2 -2
  167. package/dist-server/service/project-report/project-report-query.js.map +1 -1
  168. package/dist-server/service/project-report/project-report-type.js +6 -6
  169. package/dist-server/service/project-report/project-report-type.js.map +1 -1
  170. package/dist-server/service/project-report/project-report.js +3 -3
  171. package/dist-server/service/project-report/project-report.js.map +1 -1
  172. package/dist-server/service/supervisor/index.d.ts +0 -1
  173. package/dist-server/service/supervisor/index.js +1 -2
  174. package/dist-server/service/supervisor/index.js.map +1 -1
  175. package/dist-server/service/supervisor/supervisor-mutation.js +2 -2
  176. package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
  177. package/dist-server/service/supervisor/supervisor-query.js +2 -2
  178. package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
  179. package/dist-server/service/supervisor/supervisor-type.js +6 -6
  180. package/dist-server/service/supervisor/supervisor-type.js.map +1 -1
  181. package/dist-server/service/supervisor/supervisor.js +3 -3
  182. package/dist-server/service/supervisor/supervisor.js.map +1 -1
  183. package/dist-server/tsconfig.tsbuildinfo +1 -1
  184. package/package.json +13 -13
  185. package/things-factory.config.js +3 -1
  186. package/client/bootstrap.ts +0 -1
  187. package/client/index.ts +0 -0
  188. package/client/pages/action-plan/action-plan-importer.ts +0 -94
  189. package/client/pages/action-plan/action-plan-list-page.ts +0 -340
  190. package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
  191. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
  192. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
  193. package/client/pages/building-inspection/building-inspection-list.ts +0 -565
  194. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
  195. package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
  196. package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
  197. package/client/pages/checklist/attachment-list-popup.ts +0 -301
  198. package/client/pages/checklist/checklist-view.ts +0 -581
  199. package/client/pages/checklist/comment-list-popup.ts +0 -328
  200. package/client/pages/checklist/file-preview-popup.ts +0 -70
  201. package/client/pages/checklist-template/checklist-template-item.ts +0 -240
  202. package/client/pages/checklist-template/checklist-template-list.ts +0 -368
  203. package/client/pages/checklist-template/checklist-type-management.ts +0 -262
  204. package/client/pages/issue/issue-importer.ts +0 -94
  205. package/client/pages/issue/issue-list-page.ts +0 -340
  206. package/client/pages/project-report/project-report-importer.ts +0 -94
  207. package/client/pages/project-report/project-report-list-page.ts +0 -340
  208. package/client/pages/supervisor/supervisor-importer.ts +0 -94
  209. package/client/pages/supervisor/supervisor-list-page.ts +0 -340
  210. package/client/route.ts +0 -27
  211. package/client/tsconfig.json +0 -11
  212. package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
  213. package/dist-server/service/building-inspection/event-subscriber.js +0 -21
  214. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  215. package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
  216. package/dist-server/service/checklist/event-subscriber.js +0 -21
  217. package/dist-server/service/checklist/event-subscriber.js.map +0 -1
  218. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  219. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  220. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
  221. package/server/controllers/index.ts +0 -0
  222. package/server/index.ts +0 -4
  223. package/server/middlewares/index.ts +0 -3
  224. package/server/migrations/index.ts +0 -9
  225. package/server/routes.ts +0 -28
  226. package/server/service/action-plan/action-plan-mutation.ts +0 -198
  227. package/server/service/action-plan/action-plan-query.ts +0 -62
  228. package/server/service/action-plan/action-plan-type.ts +0 -61
  229. package/server/service/action-plan/action-plan.ts +0 -103
  230. package/server/service/action-plan/index.ts +0 -7
  231. package/server/service/building-inspection/building-inspection-history.ts +0 -72
  232. package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
  233. package/server/service/building-inspection/building-inspection-query.ts +0 -242
  234. package/server/service/building-inspection/building-inspection-type.ts +0 -145
  235. package/server/service/building-inspection/building-inspection.ts +0 -108
  236. package/server/service/building-inspection/event-subscriber.ts +0 -20
  237. package/server/service/building-inspection/index.ts +0 -11
  238. package/server/service/checklist/checklist-history.ts +0 -96
  239. package/server/service/checklist/checklist-mutation.ts +0 -103
  240. package/server/service/checklist/checklist-query.ts +0 -58
  241. package/server/service/checklist/checklist-type.ts +0 -49
  242. package/server/service/checklist/checklist.ts +0 -127
  243. package/server/service/checklist/event-subscriber.ts +0 -17
  244. package/server/service/checklist/index.ts +0 -9
  245. package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
  246. package/server/service/checklist-item/checklist-item-query.ts +0 -84
  247. package/server/service/checklist-item/checklist-item-type.ts +0 -12
  248. package/server/service/checklist-item/checklist-item.ts +0 -103
  249. package/server/service/checklist-item/index.ts +0 -7
  250. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
  251. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
  252. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
  253. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
  254. package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
  255. package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
  256. package/server/service/checklist-item-comment/index.ts +0 -9
  257. package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
  258. package/server/service/checklist-template/checklist-template-query.ts +0 -39
  259. package/server/service/checklist-template/checklist-template-type.ts +0 -23
  260. package/server/service/checklist-template/checklist-template.ts +0 -71
  261. package/server/service/checklist-template/index.ts +0 -6
  262. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
  263. package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
  264. package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
  265. package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
  266. package/server/service/checklist-template-item/index.ts +0 -6
  267. package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
  268. package/server/service/checklist-type/checklist-type-query.ts +0 -39
  269. package/server/service/checklist-type/checklist-type-type.ts +0 -26
  270. package/server/service/checklist-type/checklist-type.ts +0 -64
  271. package/server/service/checklist-type/index.ts +0 -6
  272. package/server/service/index.ts +0 -88
  273. package/server/service/issue/index.ts +0 -7
  274. package/server/service/issue/issue-mutation.ts +0 -198
  275. package/server/service/issue/issue-query.ts +0 -62
  276. package/server/service/issue/issue-type.ts +0 -61
  277. package/server/service/issue/issue.ts +0 -100
  278. package/server/service/project-report/index.ts +0 -7
  279. package/server/service/project-report/project-report-mutation.ts +0 -198
  280. package/server/service/project-report/project-report-query.ts +0 -62
  281. package/server/service/project-report/project-report-type.ts +0 -61
  282. package/server/service/project-report/project-report.ts +0 -113
  283. package/server/service/supervisor/index.ts +0 -7
  284. package/server/service/supervisor/supervisor-mutation.ts +0 -198
  285. package/server/service/supervisor/supervisor-query.ts +0 -62
  286. package/server/service/supervisor/supervisor-type.ts +0 -61
  287. package/server/service/supervisor/supervisor.ts +0 -108
  288. package/server/tsconfig.json +0 -10
@@ -1,61 +0,0 @@
1
- import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
2
- import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
3
- import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
4
-
5
- import { ObjectRef, ScalarObject } from '@things-factory/shell'
6
-
7
- import { ProjectReport, ProjectReportStatus } from './project-report'
8
-
9
- @InputType()
10
- export class NewProjectReport {
11
- @Field()
12
- name: string
13
-
14
- @Field({ nullable: true })
15
- description?: string
16
-
17
- @Field(type => ProjectReportStatus, { nullable: true })
18
- state?: ProjectReportStatus
19
-
20
- @Field({ nullable: true })
21
- active?: boolean
22
-
23
- @Field({ nullable: true })
24
- params?: string
25
-
26
- @Field(type => GraphQLUpload, { nullable: true })
27
- thumbnail?: FileUpload
28
- }
29
-
30
- @InputType()
31
- export class ProjectReportPatch {
32
- @Field(type => ID, { nullable: true })
33
- id?: string
34
-
35
- @Field({ nullable: true })
36
- name?: string
37
-
38
- @Field({ nullable: true })
39
- description?: string
40
-
41
- @Field(type => ProjectReportStatus, { nullable: true })
42
- state?: ProjectReportStatus
43
-
44
- @Field({ nullable: true })
45
- active?: boolean
46
-
47
- @Field(type => GraphQLUpload, { nullable: true })
48
- thumbnail?: FileUpload
49
-
50
- @Field({ nullable: true })
51
- cuFlag?: string
52
- }
53
-
54
- @ObjectType()
55
- export class ProjectReportList {
56
- @Field(type => [ProjectReport])
57
- items: ProjectReport[]
58
-
59
- @Field(type => Int)
60
- total: number
61
- }
@@ -1,113 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- DeleteDateColumn,
5
- Entity,
6
- Index,
7
- Column,
8
- RelationId,
9
- ManyToOne,
10
- PrimaryGeneratedColumn,
11
- VersionColumn
12
- } from 'typeorm'
13
- import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
14
-
15
- import { Domain } from '@things-factory/shell'
16
- import { User } from '@things-factory/auth-base'
17
- import { Project } from '@dssp/project'
18
-
19
- import { Supervisor } from '../supervisor/supervisor'
20
-
21
- export enum ProjectReportStatus {
22
- STATUS_A = 'STATUS_A',
23
- STATUS_B = 'STATUS_B'
24
- }
25
-
26
- registerEnumType(ProjectReportStatus, {
27
- name: 'ProjectReportStatus',
28
- description: 'state enumeration of a projectReport'
29
- })
30
-
31
- @Entity()
32
- @Index('ix_project_report_0', (projectReport: ProjectReport) => [projectReport.domain, projectReport.name], {
33
- unique: true,
34
- where: '"deleted_at" IS NULL'
35
- })
36
- @ObjectType({ description: 'Entity for ProjectReport' })
37
- export class ProjectReport {
38
- @PrimaryGeneratedColumn('uuid')
39
- @Field(type => ID)
40
- readonly id: string
41
-
42
- @ManyToOne(type => Domain)
43
- @Field({ nullable: true })
44
- domain?: Domain
45
-
46
- @RelationId((projectReport: ProjectReport) => projectReport.domain)
47
- domainId?: string
48
-
49
- @Column()
50
- @Field({ nullable: true })
51
- name?: string
52
-
53
- @Column({ nullable: true })
54
- @Field({ nullable: true })
55
- description?: string
56
-
57
- @Column({ nullable: true })
58
- @Field({ nullable: true })
59
- active?: boolean
60
-
61
- @Column({ nullable: true })
62
- @Field({ nullable: true })
63
- state?: ProjectReportStatus
64
-
65
- @Column({ nullable: true })
66
- @Field({ nullable: true })
67
- params?: string
68
-
69
- @Column({ nullable: true })
70
- @Field({ nullable: true })
71
- content?: string
72
-
73
- @Column({ nullable: true })
74
- @Field({ nullable: true })
75
- date?: Date
76
-
77
- @Field(() => Project)
78
- @ManyToOne(() => Project)
79
- project?: Project
80
-
81
- @Field(() => Supervisor)
82
- @ManyToOne(() => Supervisor, supervisor => supervisor.reports)
83
- supervisor: Supervisor
84
-
85
- @CreateDateColumn()
86
- @Field({ nullable: true })
87
- createdAt?: Date
88
-
89
- @UpdateDateColumn()
90
- @Field({ nullable: true })
91
- updatedAt?: Date
92
-
93
- @DeleteDateColumn()
94
- @Field({ nullable: true })
95
- deletedAt?: Date
96
-
97
- @ManyToOne(type => User, { nullable: true })
98
- @Field(type => User, { nullable: true })
99
- creator?: User
100
-
101
- @RelationId((projectReport: ProjectReport) => projectReport.creator)
102
- creatorId?: string
103
-
104
- @ManyToOne(type => User, { nullable: true })
105
- @Field(type => User, { nullable: true })
106
- updater?: User
107
-
108
- @RelationId((projectReport: ProjectReport) => projectReport.updater)
109
- updaterId?: string
110
-
111
- @Field(type => String, { nullable: true })
112
- thumbnail?: string
113
- }
@@ -1,7 +0,0 @@
1
- import { Supervisor } from './supervisor'
2
- import { SupervisorQuery } from './supervisor-query'
3
- import { SupervisorMutation } from './supervisor-mutation'
4
-
5
- export const entities = [Supervisor]
6
- export const resolvers = [SupervisorQuery, SupervisorMutation]
7
- export const subscribers = []
@@ -1,198 +0,0 @@
1
- import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'
5
-
6
- import { Supervisor } from './supervisor'
7
- import { NewSupervisor, SupervisorPatch } from './supervisor-type'
8
-
9
- @Resolver(Supervisor)
10
- export class SupervisorMutation {
11
- @Directive('@transaction')
12
- @Mutation(returns => Supervisor, { description: 'To create new Supervisor' })
13
- async createSupervisor(@Arg('supervisor') supervisor: NewSupervisor, @Ctx() context: ResolverContext): Promise<Supervisor> {
14
- const { domain, user, tx } = context.state
15
-
16
- const result = await tx.getRepository(Supervisor).save({
17
- ...supervisor,
18
- domain,
19
- creator: user,
20
- updater: user
21
- })
22
-
23
- if (supervisor.thumbnail) {
24
- await createAttachment(
25
- null,
26
- {
27
- attachment: {
28
- file: supervisor.thumbnail,
29
- refType: Supervisor.name,
30
- refBy: result.id
31
- }
32
- },
33
- context
34
- )
35
- }
36
-
37
- return result
38
- }
39
-
40
- @Directive('@transaction')
41
- @Mutation(returns => Supervisor, { description: 'To modify Supervisor information' })
42
- async updateSupervisor(
43
- @Arg('id') id: string,
44
- @Arg('patch') patch: SupervisorPatch,
45
- @Ctx() context: ResolverContext
46
- ): Promise<Supervisor> {
47
- const { domain, user, tx } = context.state
48
-
49
- const repository = tx.getRepository(Supervisor)
50
- const supervisor = await repository.findOne({
51
- where: { domain: { id: domain.id }, id }
52
- })
53
-
54
- const result = await repository.save({
55
- ...supervisor,
56
- ...patch,
57
- updater: user
58
- })
59
-
60
- if (patch.thumbnail) {
61
- await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)
62
- await createAttachment(
63
- null,
64
- {
65
- attachment: {
66
- file: patch.thumbnail,
67
- refType: Supervisor.name,
68
- refBy: result.id
69
- }
70
- },
71
- context
72
- )
73
- }
74
-
75
- return result
76
- }
77
-
78
- @Directive('@transaction')
79
- @Mutation(returns => [Supervisor], { description: "To modify multiple Supervisors' information" })
80
- async updateMultipleSupervisor(
81
- @Arg('patches', type => [SupervisorPatch]) patches: SupervisorPatch[],
82
- @Ctx() context: ResolverContext
83
- ): Promise<Supervisor[]> {
84
- const { domain, user, tx } = context.state
85
-
86
- let results = []
87
- const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
88
- const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
89
- const supervisorRepo = tx.getRepository(Supervisor)
90
-
91
- if (_createRecords.length > 0) {
92
- for (let i = 0; i < _createRecords.length; i++) {
93
- const newRecord = _createRecords[i]
94
-
95
- const result = await supervisorRepo.save({
96
- ...newRecord,
97
- domain,
98
- creator: user,
99
- updater: user
100
- })
101
-
102
- if (newRecord.thumbnail) {
103
- await createAttachment(
104
- null,
105
- {
106
- attachment: {
107
- file: newRecord.thumbnail,
108
- refType: Supervisor.name,
109
- refBy: result.id
110
- }
111
- },
112
- context
113
- )
114
- }
115
-
116
- results.push({ ...result, cuFlag: '+' })
117
- }
118
- }
119
-
120
- if (_updateRecords.length > 0) {
121
- for (let i = 0; i < _updateRecords.length; i++) {
122
- const updateRecord = _updateRecords[i]
123
- const supervisor = await supervisorRepo.findOneBy({ id: updateRecord.id })
124
-
125
- const result = await supervisorRepo.save({
126
- ...supervisor,
127
- ...updateRecord,
128
- updater: user
129
- })
130
-
131
- if (updateRecord.thumbnail) {
132
- await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)
133
- await createAttachment(
134
- null,
135
- {
136
- attachment: {
137
- file: updateRecord.thumbnail,
138
- refType: Supervisor.name,
139
- refBy: result.id
140
- }
141
- },
142
- context
143
- )
144
- }
145
-
146
- results.push({ ...result, cuFlag: 'M' })
147
- }
148
- }
149
-
150
- return results
151
- }
152
-
153
- @Directive('@transaction')
154
- @Mutation(returns => Boolean, { description: 'To delete Supervisor' })
155
- async deleteSupervisor(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
156
- const { domain, tx } = context.state
157
-
158
- await tx.getRepository(Supervisor).delete({ domain: { id: domain.id }, id })
159
- await deleteAttachmentsByRef(null, { refBys: [id] }, context)
160
-
161
- return true
162
- }
163
-
164
- @Directive('@transaction')
165
- @Mutation(returns => Boolean, { description: 'To delete multiple Supervisors' })
166
- async deleteSupervisors(
167
- @Arg('ids', type => [String]) ids: string[],
168
- @Ctx() context: ResolverContext
169
- ): Promise<boolean> {
170
- const { domain, tx } = context.state
171
-
172
- await tx.getRepository(Supervisor).delete({
173
- domain: { id: domain.id },
174
- id: In(ids)
175
- })
176
-
177
- await deleteAttachmentsByRef(null, { refBys: ids }, context)
178
-
179
- return true
180
- }
181
-
182
- @Directive('@transaction')
183
- @Mutation(returns => Boolean, { description: 'To import multiple Supervisors' })
184
- async importSupervisors(
185
- @Arg('supervisors', type => [SupervisorPatch]) supervisors: SupervisorPatch[],
186
- @Ctx() context: ResolverContext
187
- ): Promise<boolean> {
188
- const { domain, tx } = context.state
189
-
190
- await Promise.all(
191
- supervisors.map(async (supervisor: SupervisorPatch) => {
192
- const createdSupervisor: Supervisor = await tx.getRepository(Supervisor).save({ domain, ...supervisor })
193
- })
194
- )
195
-
196
- return true
197
- }
198
- }
@@ -1,62 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
2
- import { Attachment } from '@things-factory/attachment-base'
3
- import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
4
- import { User } from '@things-factory/auth-base'
5
- import { Supervisor } from './supervisor'
6
- import { SupervisorList } from './supervisor-type'
7
-
8
- @Resolver(Supervisor)
9
- export class SupervisorQuery {
10
- @Query(returns => Supervisor!, { nullable: true, description: 'To fetch a Supervisor' })
11
- async supervisor(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Supervisor> {
12
- const { domain } = context.state
13
-
14
- return await getRepository(Supervisor).findOne({
15
- where: { domain: { id: domain.id }, id }
16
- })
17
- }
18
-
19
- @Query(returns => SupervisorList, { description: 'To fetch multiple Supervisors' })
20
- async supervisors(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<SupervisorList> {
21
- const { domain } = context.state
22
-
23
- const queryBuilder = getQueryBuilderFromListParams({
24
- domain,
25
- params,
26
- repository: await getRepository(Supervisor),
27
- searchables: ['name', 'description']
28
- })
29
-
30
- const [items, total] = await queryBuilder.getManyAndCount()
31
-
32
- return { items, total }
33
- }
34
-
35
- @FieldResolver(type => String)
36
- async thumbnail(@Root() supervisor: Supervisor): Promise<string | undefined> {
37
- const attachment: Attachment = await getRepository(Attachment).findOne({
38
- where: {
39
- domain: { id: supervisor.domainId },
40
- refType: Supervisor.name,
41
- refBy: supervisor.id
42
- }
43
- })
44
-
45
- return attachment?.fullpath
46
- }
47
-
48
- @FieldResolver(type => Domain)
49
- async domain(@Root() supervisor: Supervisor): Promise<Domain> {
50
- return await getRepository(Domain).findOneBy({ id: supervisor.domainId })
51
- }
52
-
53
- @FieldResolver(type => User)
54
- async updater(@Root() supervisor: Supervisor): Promise<User> {
55
- return await getRepository(User).findOneBy({ id: supervisor.updaterId })
56
- }
57
-
58
- @FieldResolver(type => User)
59
- async creator(@Root() supervisor: Supervisor): Promise<User> {
60
- return await getRepository(User).findOneBy({ id: supervisor.creatorId })
61
- }
62
- }
@@ -1,61 +0,0 @@
1
- import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
2
- import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
3
- import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
4
-
5
- import { ObjectRef, ScalarObject } from '@things-factory/shell'
6
-
7
- import { Supervisor, SupervisorStatus } from './supervisor'
8
-
9
- @InputType()
10
- export class NewSupervisor {
11
- @Field()
12
- name: string
13
-
14
- @Field({ nullable: true })
15
- description?: string
16
-
17
- @Field(type => SupervisorStatus, { nullable: true })
18
- state?: SupervisorStatus
19
-
20
- @Field({ nullable: true })
21
- active?: boolean
22
-
23
- @Field({ nullable: true })
24
- params?: string
25
-
26
- @Field(type => GraphQLUpload, { nullable: true })
27
- thumbnail?: FileUpload
28
- }
29
-
30
- @InputType()
31
- export class SupervisorPatch {
32
- @Field(type => ID, { nullable: true })
33
- id?: string
34
-
35
- @Field({ nullable: true })
36
- name?: string
37
-
38
- @Field({ nullable: true })
39
- description?: string
40
-
41
- @Field(type => SupervisorStatus, { nullable: true })
42
- state?: SupervisorStatus
43
-
44
- @Field({ nullable: true })
45
- active?: boolean
46
-
47
- @Field(type => GraphQLUpload, { nullable: true })
48
- thumbnail?: FileUpload
49
-
50
- @Field({ nullable: true })
51
- cuFlag?: string
52
- }
53
-
54
- @ObjectType()
55
- export class SupervisorList {
56
- @Field(type => [Supervisor])
57
- items: Supervisor[]
58
-
59
- @Field(type => Int)
60
- total: number
61
- }
@@ -1,108 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- DeleteDateColumn,
5
- Entity,
6
- Index,
7
- Column,
8
- RelationId,
9
- ManyToOne,
10
- OneToMany,
11
- PrimaryGeneratedColumn,
12
- VersionColumn
13
- } from 'typeorm'
14
- import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
15
-
16
- import { Domain } from '@things-factory/shell'
17
- import { User } from '@things-factory/auth-base'
18
- import { ProjectReport } from '../project-report/project-report'
19
-
20
- export enum SupervisorStatus {
21
- STATUS_A = 'STATUS_A',
22
- STATUS_B = 'STATUS_B'
23
- }
24
-
25
- registerEnumType(SupervisorStatus, {
26
- name: 'SupervisorStatus',
27
- description: 'state enumeration of a supervisor'
28
- })
29
-
30
- @Entity()
31
- @Index('ix_supervisor_0', (supervisor: Supervisor) => [supervisor.domain, supervisor.name], {
32
- unique: true,
33
- where: '"deleted_at" IS NULL'
34
- })
35
- @ObjectType({ description: 'Entity for Supervisor' })
36
- export class Supervisor {
37
- @PrimaryGeneratedColumn('uuid')
38
- @Field(type => ID)
39
- readonly id: string
40
-
41
- @ManyToOne(type => Domain)
42
- @Field({ nullable: true })
43
- domain?: Domain
44
-
45
- @RelationId((supervisor: Supervisor) => supervisor.domain)
46
- domainId?: string
47
-
48
- @Column()
49
- @Field({ nullable: true })
50
- name?: string
51
-
52
- @Column({ nullable: true })
53
- @Field({ nullable: true })
54
- description?: string
55
-
56
- @Column({ nullable: true })
57
- @Field({ nullable: true })
58
- active?: boolean
59
-
60
- @Column({ nullable: true })
61
- @Field({ nullable: true })
62
- state?: SupervisorStatus
63
-
64
- @Column({ nullable: true })
65
- @Field({ nullable: true })
66
- params?: string
67
-
68
- @Column({ nullable: true })
69
- @Field({ nullable: true })
70
- email: string
71
-
72
- @Column({ nullable: true })
73
- @Field({ nullable: true })
74
- phoneNumber: string
75
-
76
- @Field(() => [ProjectReport])
77
- @OneToMany(() => ProjectReport, report => report.supervisor)
78
- reports: ProjectReport[]
79
-
80
- @CreateDateColumn()
81
- @Field({ nullable: true })
82
- createdAt?: Date
83
-
84
- @UpdateDateColumn()
85
- @Field({ nullable: true })
86
- updatedAt?: Date
87
-
88
- @DeleteDateColumn()
89
- @Field({ nullable: true })
90
- deletedAt?: Date
91
-
92
- @ManyToOne(type => User, { nullable: true })
93
- @Field(type => User, { nullable: true })
94
- creator?: User
95
-
96
- @RelationId((supervisor: Supervisor) => supervisor.creator)
97
- creatorId?: string
98
-
99
- @ManyToOne(type => User, { nullable: true })
100
- @Field(type => User, { nullable: true })
101
- updater?: User
102
-
103
- @RelationId((supervisor: Supervisor) => supervisor.updater)
104
- updaterId?: string
105
-
106
- @Field(type => String, { nullable: true })
107
- thumbnail?: string
108
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig-base.json",
3
- "compilerOptions": {
4
- "strict": false,
5
- "module": "commonjs",
6
- "outDir": "../dist-server",
7
- "baseUrl": "./"
8
- },
9
- "include": ["./**/*"]
10
- }