@things-factory/compliance 0.0.0-stage → 10.1.254

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 (356) hide show
  1. package/dist-client/bootstrap.d.ts +2 -0
  2. package/dist-client/bootstrap.js +28 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/components/compliance-case-form.d.ts +42 -0
  5. package/dist-client/components/compliance-case-form.js +313 -0
  6. package/dist-client/components/compliance-case-form.js.map +1 -0
  7. package/dist-client/components/compliance-case-sheet.d.ts +35 -0
  8. package/dist-client/components/compliance-case-sheet.js +335 -0
  9. package/dist-client/components/compliance-case-sheet.js.map +1 -0
  10. package/dist-client/components/compliance-my-inventions.d.ts +17 -0
  11. package/dist-client/components/compliance-my-inventions.js +133 -0
  12. package/dist-client/components/compliance-my-inventions.js.map +1 -0
  13. package/dist-client/components/compliance-my-privacy-requests.d.ts +34 -0
  14. package/dist-client/components/compliance-my-privacy-requests.js +232 -0
  15. package/dist-client/components/compliance-my-privacy-requests.js.map +1 -0
  16. package/dist-client/components/compliance-my-reports.d.ts +19 -0
  17. package/dist-client/components/compliance-my-reports.js +137 -0
  18. package/dist-client/components/compliance-my-reports.js.map +1 -0
  19. package/dist-client/components/guide-link.d.ts +13 -0
  20. package/dist-client/components/guide-link.js +55 -0
  21. package/dist-client/components/guide-link.js.map +1 -0
  22. package/dist-client/components/invention-report-form.d.ts +30 -0
  23. package/dist-client/components/invention-report-form.js +188 -0
  24. package/dist-client/components/invention-report-form.js.map +1 -0
  25. package/dist-client/components/legal-todo.d.ts +10 -0
  26. package/dist-client/components/legal-todo.js +43 -0
  27. package/dist-client/components/legal-todo.js.map +1 -0
  28. package/dist-client/components/my-trainings.d.ts +18 -0
  29. package/dist-client/components/my-trainings.js +149 -0
  30. package/dist-client/components/my-trainings.js.map +1 -0
  31. package/dist-client/components/regulation-form.d.ts +26 -0
  32. package/dist-client/components/regulation-form.js +161 -0
  33. package/dist-client/components/regulation-form.js.map +1 -0
  34. package/dist-client/components/seal-use-form.d.ts +47 -0
  35. package/dist-client/components/seal-use-form.js +300 -0
  36. package/dist-client/components/seal-use-form.js.map +1 -0
  37. package/dist-client/components/training-attendance-form.d.ts +37 -0
  38. package/dist-client/components/training-attendance-form.js +186 -0
  39. package/dist-client/components/training-attendance-form.js.map +1 -0
  40. package/dist-client/components/training-certificate-form.d.ts +41 -0
  41. package/dist-client/components/training-certificate-form.js +198 -0
  42. package/dist-client/components/training-certificate-form.js.map +1 -0
  43. package/dist-client/components/training-session-form.d.ts +39 -0
  44. package/dist-client/components/training-session-form.js +270 -0
  45. package/dist-client/components/training-session-form.js.map +1 -0
  46. package/dist-client/components/training-setting-form.d.ts +45 -0
  47. package/dist-client/components/training-setting-form.js +175 -0
  48. package/dist-client/components/training-setting-form.js.map +1 -0
  49. package/dist-client/index.d.ts +4 -0
  50. package/dist-client/index.js +8 -0
  51. package/dist-client/index.js.map +1 -0
  52. package/dist-client/legal-record/dispute-calendar-source.d.ts +1 -0
  53. package/dist-client/legal-record/dispute-calendar-source.js +51 -0
  54. package/dist-client/legal-record/dispute-calendar-source.js.map +1 -0
  55. package/dist-client/legal-record/legal-child-grid.d.ts +31 -0
  56. package/dist-client/legal-record/legal-child-grid.js +76 -0
  57. package/dist-client/legal-record/legal-child-grid.js.map +1 -0
  58. package/dist-client/legal-record/legal-codes.d.ts +3 -0
  59. package/dist-client/legal-record/legal-codes.js +5 -0
  60. package/dist-client/legal-record/legal-codes.js.map +1 -0
  61. package/dist-client/legal-record/legal-grid.d.ts +59 -0
  62. package/dist-client/legal-record/legal-grid.js +68 -0
  63. package/dist-client/legal-record/legal-grid.js.map +1 -0
  64. package/dist-client/legal-record/legal-record-files.d.ts +26 -0
  65. package/dist-client/legal-record/legal-record-files.js +162 -0
  66. package/dist-client/legal-record/legal-record-files.js.map +1 -0
  67. package/dist-client/pages/compliance-case-list.d.ts +35 -0
  68. package/dist-client/pages/compliance-case-list.js +112 -0
  69. package/dist-client/pages/compliance-case-list.js.map +1 -0
  70. package/dist-client/pages/dispute-list.d.ts +57 -0
  71. package/dist-client/pages/dispute-list.js +156 -0
  72. package/dist-client/pages/dispute-list.js.map +1 -0
  73. package/dist-client/pages/invention-list.d.ts +57 -0
  74. package/dist-client/pages/invention-list.js +166 -0
  75. package/dist-client/pages/invention-list.js.map +1 -0
  76. package/dist-client/pages/legal-registration-list.d.ts +63 -0
  77. package/dist-client/pages/legal-registration-list.js +206 -0
  78. package/dist-client/pages/legal-registration-list.js.map +1 -0
  79. package/dist-client/pages/privacy-record-list.d.ts +52 -0
  80. package/dist-client/pages/privacy-record-list.js +225 -0
  81. package/dist-client/pages/privacy-record-list.js.map +1 -0
  82. package/dist-client/pages/regulation-detail.d.ts +43 -0
  83. package/dist-client/pages/regulation-detail.js +370 -0
  84. package/dist-client/pages/regulation-detail.js.map +1 -0
  85. package/dist-client/pages/regulation-list.d.ts +52 -0
  86. package/dist-client/pages/regulation-list.js +144 -0
  87. package/dist-client/pages/regulation-list.js.map +1 -0
  88. package/dist-client/pages/regulations.d.ts +49 -0
  89. package/dist-client/pages/regulations.js +412 -0
  90. package/dist-client/pages/regulations.js.map +1 -0
  91. package/dist-client/pages/seal-use-list.d.ts +57 -0
  92. package/dist-client/pages/seal-use-list.js +168 -0
  93. package/dist-client/pages/seal-use-list.js.map +1 -0
  94. package/dist-client/pages/training-list.d.ts +51 -0
  95. package/dist-client/pages/training-list.js +333 -0
  96. package/dist-client/pages/training-list.js.map +1 -0
  97. package/dist-client/regulation/regulation-fragments.d.ts +1 -0
  98. package/dist-client/regulation/regulation-fragments.js +37 -0
  99. package/dist-client/regulation/regulation-fragments.js.map +1 -0
  100. package/dist-client/regulation/regulation-guide.d.ts +19 -0
  101. package/dist-client/regulation/regulation-guide.js +48 -0
  102. package/dist-client/regulation/regulation-guide.js.map +1 -0
  103. package/dist-client/route.d.ts +1 -0
  104. package/dist-client/route.js +36 -0
  105. package/dist-client/route.js.map +1 -0
  106. package/dist-client/training-words.d.ts +11 -0
  107. package/dist-client/training-words.js +11 -0
  108. package/dist-client/training-words.js.map +1 -0
  109. package/dist-client/tsconfig.tsbuildinfo +1 -0
  110. package/dist-client/words.d.ts +15 -0
  111. package/dist-client/words.js +20 -0
  112. package/dist-client/words.js.map +1 -0
  113. package/dist-server/activities/index.d.ts +6 -0
  114. package/dist-server/activities/index.js +35 -0
  115. package/dist-server/activities/index.js.map +1 -0
  116. package/dist-server/activities/legal-todo-activity-names.d.ts +1 -0
  117. package/dist-server/activities/legal-todo-activity-names.js +5 -0
  118. package/dist-server/activities/legal-todo-activity-names.js.map +1 -0
  119. package/dist-server/activities/legal-todo-activity.d.ts +37 -0
  120. package/dist-server/activities/legal-todo-activity.js +41 -0
  121. package/dist-server/activities/legal-todo-activity.js.map +1 -0
  122. package/dist-server/activities/regulation-activity-names.d.ts +1 -0
  123. package/dist-server/activities/regulation-activity-names.js +5 -0
  124. package/dist-server/activities/regulation-activity-names.js.map +1 -0
  125. package/dist-server/activities/regulation-activity.d.ts +48 -0
  126. package/dist-server/activities/regulation-activity.js +47 -0
  127. package/dist-server/activities/regulation-activity.js.map +1 -0
  128. package/dist-server/activities/seal-use-activity-names.d.ts +2 -0
  129. package/dist-server/activities/seal-use-activity-names.js +6 -0
  130. package/dist-server/activities/seal-use-activity-names.js.map +1 -0
  131. package/dist-server/activities/seal-use-activity.d.ts +48 -0
  132. package/dist-server/activities/seal-use-activity.js +47 -0
  133. package/dist-server/activities/seal-use-activity.js.map +1 -0
  134. package/dist-server/index.d.ts +2 -0
  135. package/dist-server/index.js +21 -0
  136. package/dist-server/index.js.map +1 -0
  137. package/dist-server/role-tasks.d.ts +2 -0
  138. package/dist-server/role-tasks.js +28 -0
  139. package/dist-server/role-tasks.js.map +1 -0
  140. package/dist-server/service/common/correction.d.ts +32 -0
  141. package/dist-server/service/common/correction.js +98 -0
  142. package/dist-server/service/common/correction.js.map +1 -0
  143. package/dist-server/service/common/employee-reader.d.ts +11 -0
  144. package/dist-server/service/common/employee-reader.js +46 -0
  145. package/dist-server/service/common/employee-reader.js.map +1 -0
  146. package/dist-server/service/common/legal-todo.d.ts +19 -0
  147. package/dist-server/service/common/legal-todo.js +37 -0
  148. package/dist-server/service/common/legal-todo.js.map +1 -0
  149. package/dist-server/service/compliance-case/compliance-case-mutation.d.ts +9 -0
  150. package/dist-server/service/compliance-case/compliance-case-mutation.js +73 -0
  151. package/dist-server/service/compliance-case/compliance-case-mutation.js.map +1 -0
  152. package/dist-server/service/compliance-case/compliance-case-query.d.ts +28 -0
  153. package/dist-server/service/compliance-case/compliance-case-query.js +212 -0
  154. package/dist-server/service/compliance-case/compliance-case-query.js.map +1 -0
  155. package/dist-server/service/compliance-case/compliance-case-rules.d.ts +71 -0
  156. package/dist-server/service/compliance-case/compliance-case-rules.js +111 -0
  157. package/dist-server/service/compliance-case/compliance-case-rules.js.map +1 -0
  158. package/dist-server/service/compliance-case/compliance-case-service.d.ts +76 -0
  159. package/dist-server/service/compliance-case/compliance-case-service.js +425 -0
  160. package/dist-server/service/compliance-case/compliance-case-service.js.map +1 -0
  161. package/dist-server/service/compliance-case/compliance-case-type.d.ts +56 -0
  162. package/dist-server/service/compliance-case/compliance-case-type.js +200 -0
  163. package/dist-server/service/compliance-case/compliance-case-type.js.map +1 -0
  164. package/dist-server/service/compliance-case/compliance-case.d.ts +76 -0
  165. package/dist-server/service/compliance-case/compliance-case.js +260 -0
  166. package/dist-server/service/compliance-case/compliance-case.js.map +1 -0
  167. package/dist-server/service/compliance-case/index.d.ts +7 -0
  168. package/dist-server/service/compliance-case/index.js +17 -0
  169. package/dist-server/service/compliance-case/index.js.map +1 -0
  170. package/dist-server/service/dispute/dispute-mutation.d.ts +9 -0
  171. package/dist-server/service/dispute/dispute-mutation.js +64 -0
  172. package/dist-server/service/dispute/dispute-mutation.js.map +1 -0
  173. package/dist-server/service/dispute/dispute-query.d.ts +16 -0
  174. package/dist-server/service/dispute/dispute-query.js +124 -0
  175. package/dist-server/service/dispute/dispute-query.js.map +1 -0
  176. package/dist-server/service/dispute/dispute-rules.d.ts +20 -0
  177. package/dist-server/service/dispute/dispute-rules.js +42 -0
  178. package/dist-server/service/dispute/dispute-rules.js.map +1 -0
  179. package/dist-server/service/dispute/dispute-service.d.ts +17 -0
  180. package/dist-server/service/dispute/dispute-service.js +96 -0
  181. package/dist-server/service/dispute/dispute-service.js.map +1 -0
  182. package/dist-server/service/dispute/dispute-type.d.ts +39 -0
  183. package/dist-server/service/dispute/dispute-type.js +149 -0
  184. package/dist-server/service/dispute/dispute-type.js.map +1 -0
  185. package/dist-server/service/dispute/dispute.d.ts +48 -0
  186. package/dist-server/service/dispute/dispute.js +198 -0
  187. package/dist-server/service/dispute/dispute.js.map +1 -0
  188. package/dist-server/service/dispute/index.d.ts +5 -0
  189. package/dist-server/service/dispute/index.js +9 -0
  190. package/dist-server/service/dispute/index.js.map +1 -0
  191. package/dist-server/service/index.d.ts +46 -0
  192. package/dist-server/service/index.js +112 -0
  193. package/dist-server/service/index.js.map +1 -0
  194. package/dist-server/service/invention/index.d.ts +5 -0
  195. package/dist-server/service/invention/index.js +9 -0
  196. package/dist-server/service/invention/index.js.map +1 -0
  197. package/dist-server/service/invention/invention-mutation.d.ts +10 -0
  198. package/dist-server/service/invention/invention-mutation.js +79 -0
  199. package/dist-server/service/invention/invention-mutation.js.map +1 -0
  200. package/dist-server/service/invention/invention-query.d.ts +18 -0
  201. package/dist-server/service/invention/invention-query.js +141 -0
  202. package/dist-server/service/invention/invention-query.js.map +1 -0
  203. package/dist-server/service/invention/invention-rules.d.ts +28 -0
  204. package/dist-server/service/invention/invention-rules.js +54 -0
  205. package/dist-server/service/invention/invention-rules.js.map +1 -0
  206. package/dist-server/service/invention/invention-service.d.ts +25 -0
  207. package/dist-server/service/invention/invention-service.js +176 -0
  208. package/dist-server/service/invention/invention-service.js.map +1 -0
  209. package/dist-server/service/invention/invention-type.d.ts +34 -0
  210. package/dist-server/service/invention/invention-type.js +129 -0
  211. package/dist-server/service/invention/invention-type.js.map +1 -0
  212. package/dist-server/service/invention/invention.d.ts +55 -0
  213. package/dist-server/service/invention/invention.js +214 -0
  214. package/dist-server/service/invention/invention.js.map +1 -0
  215. package/dist-server/service/legal-record/attachment-readers.d.ts +1 -0
  216. package/dist-server/service/legal-record/attachment-readers.js +27 -0
  217. package/dist-server/service/legal-record/attachment-readers.js.map +1 -0
  218. package/dist-server/service/legal-record/days.d.ts +7 -0
  219. package/dist-server/service/legal-record/days.js +26 -0
  220. package/dist-server/service/legal-record/days.js.map +1 -0
  221. package/dist-server/service/legal-record/legal-record-support.d.ts +24 -0
  222. package/dist-server/service/legal-record/legal-record-support.js +51 -0
  223. package/dist-server/service/legal-record/legal-record-support.js.map +1 -0
  224. package/dist-server/service/legal-registration/centre-change-subscriber.d.ts +9 -0
  225. package/dist-server/service/legal-registration/centre-change-subscriber.js +50 -0
  226. package/dist-server/service/legal-registration/centre-change-subscriber.js.map +1 -0
  227. package/dist-server/service/legal-registration/index.d.ts +7 -0
  228. package/dist-server/service/legal-registration/index.js +11 -0
  229. package/dist-server/service/legal-registration/index.js.map +1 -0
  230. package/dist-server/service/legal-registration/legal-registration-mutation.d.ts +10 -0
  231. package/dist-server/service/legal-registration/legal-registration-mutation.js +77 -0
  232. package/dist-server/service/legal-registration/legal-registration-mutation.js.map +1 -0
  233. package/dist-server/service/legal-registration/legal-registration-query.d.ts +26 -0
  234. package/dist-server/service/legal-registration/legal-registration-query.js +199 -0
  235. package/dist-server/service/legal-registration/legal-registration-query.js.map +1 -0
  236. package/dist-server/service/legal-registration/legal-registration-rules.d.ts +80 -0
  237. package/dist-server/service/legal-registration/legal-registration-rules.js +106 -0
  238. package/dist-server/service/legal-registration/legal-registration-rules.js.map +1 -0
  239. package/dist-server/service/legal-registration/legal-registration-service.d.ts +37 -0
  240. package/dist-server/service/legal-registration/legal-registration-service.js +248 -0
  241. package/dist-server/service/legal-registration/legal-registration-service.js.map +1 -0
  242. package/dist-server/service/legal-registration/legal-registration-type.d.ts +55 -0
  243. package/dist-server/service/legal-registration/legal-registration-type.js +207 -0
  244. package/dist-server/service/legal-registration/legal-registration-type.js.map +1 -0
  245. package/dist-server/service/legal-registration/legal-registration.d.ts +76 -0
  246. package/dist-server/service/legal-registration/legal-registration.js +311 -0
  247. package/dist-server/service/legal-registration/legal-registration.js.map +1 -0
  248. package/dist-server/service/privacy-record/index.d.ts +5 -0
  249. package/dist-server/service/privacy-record/index.js +9 -0
  250. package/dist-server/service/privacy-record/index.js.map +1 -0
  251. package/dist-server/service/privacy-record/privacy-record-mutation.d.ts +7 -0
  252. package/dist-server/service/privacy-record/privacy-record-mutation.js +56 -0
  253. package/dist-server/service/privacy-record/privacy-record-mutation.js.map +1 -0
  254. package/dist-server/service/privacy-record/privacy-record-query.d.ts +18 -0
  255. package/dist-server/service/privacy-record/privacy-record-query.js +131 -0
  256. package/dist-server/service/privacy-record/privacy-record-query.js.map +1 -0
  257. package/dist-server/service/privacy-record/privacy-record-rules.d.ts +52 -0
  258. package/dist-server/service/privacy-record/privacy-record-rules.js +91 -0
  259. package/dist-server/service/privacy-record/privacy-record-rules.js.map +1 -0
  260. package/dist-server/service/privacy-record/privacy-record-service.d.ts +33 -0
  261. package/dist-server/service/privacy-record/privacy-record-service.js +133 -0
  262. package/dist-server/service/privacy-record/privacy-record-service.js.map +1 -0
  263. package/dist-server/service/privacy-record/privacy-record-type.d.ts +40 -0
  264. package/dist-server/service/privacy-record/privacy-record-type.js +153 -0
  265. package/dist-server/service/privacy-record/privacy-record-type.js.map +1 -0
  266. package/dist-server/service/privacy-record/privacy-record.d.ts +69 -0
  267. package/dist-server/service/privacy-record/privacy-record.js +245 -0
  268. package/dist-server/service/privacy-record/privacy-record.js.map +1 -0
  269. package/dist-server/service/regulation/index.d.ts +5 -0
  270. package/dist-server/service/regulation/index.js +9 -0
  271. package/dist-server/service/regulation/index.js.map +1 -0
  272. package/dist-server/service/regulation/regulation-mutation.d.ts +15 -0
  273. package/dist-server/service/regulation/regulation-mutation.js +152 -0
  274. package/dist-server/service/regulation/regulation-mutation.js.map +1 -0
  275. package/dist-server/service/regulation/regulation-query.d.ts +10 -0
  276. package/dist-server/service/regulation/regulation-query.js +109 -0
  277. package/dist-server/service/regulation/regulation-query.js.map +1 -0
  278. package/dist-server/service/regulation/regulation-read.d.ts +21 -0
  279. package/dist-server/service/regulation/regulation-read.js +111 -0
  280. package/dist-server/service/regulation/regulation-read.js.map +1 -0
  281. package/dist-server/service/regulation/regulation-rules.d.ts +83 -0
  282. package/dist-server/service/regulation/regulation-rules.js +170 -0
  283. package/dist-server/service/regulation/regulation-rules.js.map +1 -0
  284. package/dist-server/service/regulation/regulation-service.d.ts +63 -0
  285. package/dist-server/service/regulation/regulation-service.js +365 -0
  286. package/dist-server/service/regulation/regulation-service.js.map +1 -0
  287. package/dist-server/service/regulation/regulation-type.d.ts +61 -0
  288. package/dist-server/service/regulation/regulation-type.js +226 -0
  289. package/dist-server/service/regulation/regulation-type.js.map +1 -0
  290. package/dist-server/service/regulation/regulation.d.ts +113 -0
  291. package/dist-server/service/regulation/regulation.js +382 -0
  292. package/dist-server/service/regulation/regulation.js.map +1 -0
  293. package/dist-server/service/seal-use/index.d.ts +5 -0
  294. package/dist-server/service/seal-use/index.js +9 -0
  295. package/dist-server/service/seal-use/index.js.map +1 -0
  296. package/dist-server/service/seal-use/seal-use-mutation.d.ts +8 -0
  297. package/dist-server/service/seal-use/seal-use-mutation.js +69 -0
  298. package/dist-server/service/seal-use/seal-use-mutation.js.map +1 -0
  299. package/dist-server/service/seal-use/seal-use-query.d.ts +14 -0
  300. package/dist-server/service/seal-use/seal-use-query.js +100 -0
  301. package/dist-server/service/seal-use/seal-use-query.js.map +1 -0
  302. package/dist-server/service/seal-use/seal-use-rules.d.ts +35 -0
  303. package/dist-server/service/seal-use/seal-use-rules.js +64 -0
  304. package/dist-server/service/seal-use/seal-use-rules.js.map +1 -0
  305. package/dist-server/service/seal-use/seal-use-service.d.ts +20 -0
  306. package/dist-server/service/seal-use/seal-use-service.js +168 -0
  307. package/dist-server/service/seal-use/seal-use-service.js.map +1 -0
  308. package/dist-server/service/seal-use/seal-use-type.d.ts +24 -0
  309. package/dist-server/service/seal-use/seal-use-type.js +93 -0
  310. package/dist-server/service/seal-use/seal-use-type.js.map +1 -0
  311. package/dist-server/service/seal-use/seal-use.d.ts +57 -0
  312. package/dist-server/service/seal-use/seal-use.js +181 -0
  313. package/dist-server/service/seal-use/seal-use.js.map +1 -0
  314. package/dist-server/service/training/index.d.ts +5 -0
  315. package/dist-server/service/training/index.js +9 -0
  316. package/dist-server/service/training/index.js.map +1 -0
  317. package/dist-server/service/training/training-checks.d.ts +20 -0
  318. package/dist-server/service/training/training-checks.js +56 -0
  319. package/dist-server/service/training/training-checks.js.map +1 -0
  320. package/dist-server/service/training/training-kinds.d.ts +24 -0
  321. package/dist-server/service/training/training-kinds.js +42 -0
  322. package/dist-server/service/training/training-kinds.js.map +1 -0
  323. package/dist-server/service/training/training-mutation.d.ts +14 -0
  324. package/dist-server/service/training/training-mutation.js +140 -0
  325. package/dist-server/service/training/training-mutation.js.map +1 -0
  326. package/dist-server/service/training/training-query.d.ts +21 -0
  327. package/dist-server/service/training/training-query.js +196 -0
  328. package/dist-server/service/training/training-query.js.map +1 -0
  329. package/dist-server/service/training/training-read.d.ts +5 -0
  330. package/dist-server/service/training/training-read.js +35 -0
  331. package/dist-server/service/training/training-read.js.map +1 -0
  332. package/dist-server/service/training/training-register.d.ts +1 -0
  333. package/dist-server/service/training/training-register.js +27 -0
  334. package/dist-server/service/training/training-register.js.map +1 -0
  335. package/dist-server/service/training/training-rules.d.ts +72 -0
  336. package/dist-server/service/training/training-rules.js +143 -0
  337. package/dist-server/service/training/training-rules.js.map +1 -0
  338. package/dist-server/service/training/training-service.d.ts +98 -0
  339. package/dist-server/service/training/training-service.js +455 -0
  340. package/dist-server/service/training/training-service.js.map +1 -0
  341. package/dist-server/service/training/training-type.d.ts +94 -0
  342. package/dist-server/service/training/training-type.js +352 -0
  343. package/dist-server/service/training/training-type.js.map +1 -0
  344. package/dist-server/service/training/training.d.ts +127 -0
  345. package/dist-server/service/training/training.js +448 -0
  346. package/dist-server/service/training/training.js.map +1 -0
  347. package/dist-server/tsconfig.tsbuildinfo +1 -0
  348. package/package.json +61 -4
  349. package/things-factory.config.js +19 -0
  350. package/translations/en.json +610 -0
  351. package/translations/es.json +610 -0
  352. package/translations/ja.json +610 -0
  353. package/translations/ko.json +610 -0
  354. package/translations/ms.json +610 -0
  355. package/translations/zh.json +610 -0
  356. package/README.md +0 -3
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entities = exports.ComplianceCorrection = void 0;
4
+ exports.recordCorrections = recordCorrections;
5
+ exports.correctionsOf = correctionsOf;
6
+ const tslib_1 = require("tslib");
7
+ const type_graphql_1 = require("type-graphql");
8
+ const typeorm_1 = require("typeorm");
9
+ const auth_base_1 = require("@things-factory/auth-base");
10
+ const shell_1 = require("@things-factory/shell");
11
+ /*
12
+ * 고친 기록 (ADR-0187 「그 밖의 법무 기록」) - the legal records are not deleted, and a value written on one is changed
13
+ * only with a row saying what it was, what it became, who changed it and when. Every record of the module keeps its
14
+ * corrections here, by its kind and id; who reads them is who reads that record.
15
+ */
16
+ let ComplianceCorrection = class ComplianceCorrection {
17
+ };
18
+ exports.ComplianceCorrection = ComplianceCorrection;
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], ComplianceCorrection.prototype, "id", void 0);
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
26
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
27
+ tslib_1.__metadata("design:type", shell_1.Domain)
28
+ ], ComplianceCorrection.prototype, "domain", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.RelationId)((row) => row.domain),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], ComplianceCorrection.prototype, "domainId", void 0);
33
+ tslib_1.__decorate([
34
+ (0, typeorm_1.Column)(),
35
+ (0, type_graphql_1.Field)({ description: 'The kind of record changed - ComplianceCase, PrivacyRequest, PrivacyIncident' }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], ComplianceCorrection.prototype, "subjectKind", void 0);
38
+ tslib_1.__decorate([
39
+ (0, typeorm_1.Column)(),
40
+ (0, type_graphql_1.Field)({ description: 'The id of the record changed' }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], ComplianceCorrection.prototype, "subjectId", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)(),
45
+ (0, type_graphql_1.Field)({ description: 'The field changed' }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], ComplianceCorrection.prototype, "field", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
50
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it was, as text' }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], ComplianceCorrection.prototype, "before", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
55
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it became, as text' }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], ComplianceCorrection.prototype, "after", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.CreateDateColumn)(),
60
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was changed' }),
61
+ tslib_1.__metadata("design:type", Date)
62
+ ], ComplianceCorrection.prototype, "createdAt", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
65
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed it' }),
66
+ tslib_1.__metadata("design:type", auth_base_1.User)
67
+ ], ComplianceCorrection.prototype, "creator", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.RelationId)((row) => row.creator),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], ComplianceCorrection.prototype, "creatorId", void 0);
72
+ exports.ComplianceCorrection = ComplianceCorrection = tslib_1.__decorate([
73
+ (0, typeorm_1.Entity)({ name: 'compliance_corrections' }),
74
+ (0, typeorm_1.Index)('ix_compliance_correction_0', (row) => [row.domain, row.subjectKind, row.subjectId]),
75
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for ComplianceCorrection - a value of a legal record changed after it was written: what it was and what it became' })
76
+ ], ComplianceCorrection);
77
+ const textOf = (value) => (value === undefined || value === null || value === '' ? null : value instanceof Date ? value.toISOString() : String(value));
78
+ /**
79
+ * Writes one correction for each of `fields` whose written value `after` changes. A value written for the first time
80
+ * - empty before - is no correction.
81
+ */
82
+ async function recordCorrections(tx, domain, user, subject, before, after, fields) {
83
+ const rows = fields
84
+ .filter(field => after[field] !== undefined)
85
+ .map(field => ({ field, before: textOf(before[field]), after: textOf(after[field]) }))
86
+ .filter(one => one.before !== null && one.before !== one.after);
87
+ if (!rows.length)
88
+ return 0;
89
+ const repository = tx.getRepository(ComplianceCorrection);
90
+ await repository.save(rows.map(one => repository.create({ domain, subjectKind: subject.kind, subjectId: subject.id, ...one, creator: user })));
91
+ return rows.length;
92
+ }
93
+ /** The corrections of one record, oldest first. */
94
+ async function correctionsOf(tx, domain, subject) {
95
+ return await tx.getRepository(ComplianceCorrection).find({ where: { domain: { id: domain.id }, subjectKind: subject.kind, subjectId: subject.id }, order: { createdAt: 'ASC' } });
96
+ }
97
+ exports.entities = [ComplianceCorrection];
98
+ //# sourceMappingURL=correction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correction.js","sourceRoot":"","sources":["../../../server/service/common/correction.ts"],"names":[],"mappings":";;;AAiEA,8CAiBC;AAGD,sCAEC;;AAvFD,+CAAoD;AACpD,qCAA+H;AAE/H,y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;AACjM,CAAC;AAEY,QAAA,QAAQ,GAAG,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, EntityManager, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n/*\n * 고친 기록 (ADR-0187 「그 밖의 법무 기록」) - the legal records are not deleted, and a value written on one is changed\n * only with a row saying what it was, what it became, who changed it and when. Every record of the module keeps its\n * corrections here, by its kind and id; who reads them is who reads that record.\n */\n\n@Entity({ name: 'compliance_corrections' })\n@Index('ix_compliance_correction_0', (row: ComplianceCorrection) => [row.domain, row.subjectKind, row.subjectId])\n@ObjectType({ description: 'Entity for ComplianceCorrection - a value of a legal record changed after it was written: what it was and what it became' })\nexport class ComplianceCorrection {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((row: ComplianceCorrection) => row.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'The kind of record changed - ComplianceCase, PrivacyRequest, PrivacyIncident' })\n subjectKind: string\n\n @Column()\n @Field({ description: 'The id of the record changed' })\n subjectId: string\n\n @Column()\n @Field({ description: 'The field changed' })\n field: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What it was, as text' })\n before?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What it became, as text' })\n after?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was changed' })\n createdAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed it' })\n creator?: User\n\n @RelationId((row: ComplianceCorrection) => row.creator)\n creatorId?: string\n}\n\nconst textOf = (value: unknown): string | null => (value === undefined || value === null || value === '' ? null : value instanceof Date ? value.toISOString() : String(value))\n\n/**\n * Writes one correction for each of `fields` whose written value `after` changes. A value written for the first time\n * - empty before - is no correction.\n */\nexport async function recordCorrections(\n tx: EntityManager,\n domain: Domain,\n user: User,\n subject: { kind: string; id: string },\n before: Record<string, any>,\n after: Record<string, any>,\n fields: readonly string[]\n): Promise<number> {\n const rows = fields\n .filter(field => after[field] !== undefined)\n .map(field => ({ field, before: textOf(before[field]), after: textOf(after[field]) }))\n .filter(one => one.before !== null && one.before !== one.after)\n if (!rows.length) return 0\n const repository = tx.getRepository(ComplianceCorrection)\n await repository.save(rows.map(one => repository.create({ domain, subjectKind: subject.kind, subjectId: subject.id, ...one, creator: user } as any)) as any)\n return rows.length\n}\n\n/** The corrections of one record, oldest first. */\nexport async function correctionsOf(tx: EntityManager, domain: { id: string }, subject: { kind: string; id: string }): Promise<ComplianceCorrection[]> {\n return await tx.getRepository(ComplianceCorrection).find({ where: { domain: { id: domain.id }, subjectKind: subject.kind, subjectId: subject.id } as any, order: { createdAt: 'ASC' } as any })\n}\n\nexport const entities = [ComplianceCorrection]\n"]}
@@ -0,0 +1,11 @@
1
+ import { Employee } from '@things-factory/organization';
2
+ /** The domain's calendar day - the one "today" every deadline of this module is counted from. */
3
+ export declare function todayIn(domain: {
4
+ timezone?: string | null;
5
+ }, now?: Date): string;
6
+ /** The request's employee record still working here, or nothing - asked once per request. */
7
+ export declare function workingEmployeeOf(context: any): Promise<Employee | null>;
8
+ /** The request's employee, refused for an account that is not one - a partner reads no company rule. */
9
+ export declare function requireWorkingEmployee(context: any): Promise<Employee>;
10
+ /** Whether the request holds `category` of this module (`regulation`, `compliance-case` ...) - asked once per request. */
11
+ export declare function holds(context: any, category: string, privilege?: 'query' | 'mutation'): Promise<boolean>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.todayIn = todayIn;
4
+ exports.workingEmployeeOf = workingEmployeeOf;
5
+ exports.requireWorkingEmployee = requireWorkingEmployee;
6
+ exports.holds = holds;
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const my_employee_js_1 = require("@things-factory/organization/dist-server/service/employee/my-employee.js");
9
+ const employee_profile_rules_js_1 = require("@things-factory/organization/dist-server/service/employee-profile/employee-profile-rules.js");
10
+ const shell_1 = require("@things-factory/shell");
11
+ /*
12
+ * Who reads the company's legal records (ADR-0187 decisions 7, 8, 21): an employee of the domain - an account tied to an
13
+ * `Employee` still working here - and the holders of the module's tasks. A partner, or an account with no employee
14
+ * record, is neither.
15
+ */
16
+ /** The domain's calendar day - the one "today" every deadline of this module is counted from. */
17
+ function todayIn(domain, now = new Date()) {
18
+ return (0, shell_1.calendarDay)(domain?.timezone, now);
19
+ }
20
+ /** The request's employee record still working here, or nothing - asked once per request. */
21
+ async function workingEmployeeOf(context) {
22
+ const state = context?.state ?? {};
23
+ if (state.__complianceEmployee === undefined) {
24
+ const today = state.domain ? todayIn(state.domain) : '';
25
+ state.__complianceEmployee = (await (0, my_employee_js_1.myEmployees)(context)).find(one => (0, employee_profile_rules_js_1.isActiveEmployee)(one, today)) ?? null;
26
+ }
27
+ return state.__complianceEmployee;
28
+ }
29
+ /** The request's employee, refused for an account that is not one - a partner reads no company rule. */
30
+ async function requireWorkingEmployee(context) {
31
+ const employee = await workingEmployeeOf(context);
32
+ if (!employee)
33
+ throw new shell_1.Refusal('compliance-employees-only', {}, 'only an employee of this company can do this');
34
+ return employee;
35
+ }
36
+ /** Whether the request holds `category` of this module (`regulation`, `compliance-case` ...) - asked once per request. */
37
+ async function holds(context, category, privilege = 'mutation') {
38
+ const state = context?.state ?? {};
39
+ const { domain, user, unsafeIP, prohibitedPrivileges } = state;
40
+ if (!domain || !user)
41
+ return false;
42
+ const key = `__compliance:${category}:${privilege}`;
43
+ state[key] ??= (0, auth_base_1.checkPermission)({ category, privilege, owner: true }, user, domain, unsafeIP, prohibitedPrivileges).then(Boolean);
44
+ return await state[key];
45
+ }
46
+ //# sourceMappingURL=employee-reader.js.map
@@ -0,0 +1 @@
1
+ {"version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B,EAAE,YAAkC,UAAU;IACtG,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,EAAE,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAA;IAC9D,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IAClC,MAAM,GAAG,GAAG,gBAAgB,QAAQ,IAAI,SAAS,EAAE,CAAA;IACnD,KAAK,CAAC,GAAG,CAAC,KAAK,IAAA,2BAAe,EAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACvI,OAAO,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { checkPermission } from '@things-factory/auth-base'\nimport { Employee } from '@things-factory/organization'\nimport { myEmployees } from '@things-factory/organization/dist-server/service/employee/my-employee.js'\nimport { isActiveEmployee } from '@things-factory/organization/dist-server/service/employee-profile/employee-profile-rules.js'\nimport { calendarDay, Refusal } from '@things-factory/shell'\n\n/*\n * Who reads the company's legal records (ADR-0187 decisions 7, 8, 21): an employee of the domain - an account tied to an\n * `Employee` still working here - and the holders of the module's tasks. A partner, or an account with no employee\n * record, is neither.\n */\n\n/** The domain's calendar day - the one \"today\" every deadline of this module is counted from. */\nexport function todayIn(domain: { timezone?: string | null }, now: Date = new Date()): string {\n return calendarDay(domain?.timezone, now)\n}\n\n/** The request's employee record still working here, or nothing - asked once per request. */\nexport async function workingEmployeeOf(context: any): Promise<Employee | null> {\n const state = context?.state ?? {}\n if (state.__complianceEmployee === undefined) {\n const today = state.domain ? todayIn(state.domain) : ''\n state.__complianceEmployee = (await myEmployees(context)).find(one => isActiveEmployee(one as any, today)) ?? null\n }\n return state.__complianceEmployee\n}\n\n/** The request's employee, refused for an account that is not one - a partner reads no company rule. */\nexport async function requireWorkingEmployee(context: any): Promise<Employee> {\n const employee = await workingEmployeeOf(context)\n if (!employee) throw new Refusal('compliance-employees-only', {}, 'only an employee of this company can do this')\n return employee\n}\n\n/** Whether the request holds `category` of this module (`regulation`, `compliance-case` ...) - asked once per request. */\nexport async function holds(context: any, category: string, privilege: 'query' | 'mutation' = 'mutation'): Promise<boolean> {\n const state = context?.state ?? {}\n const { domain, user, unsafeIP, prohibitedPrivileges } = state\n if (!domain || !user) return false\n const key = `__compliance:${category}:${privilege}`\n state[key] ??= checkPermission({ category, privilege, owner: true } as any, user, domain, unsafeIP, prohibitedPrivileges).then(Boolean)\n return await state[key]\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { EntityManager } from 'typeorm';
2
+ import { User } from '@things-factory/auth-base';
3
+ export interface LegalTodo {
4
+ /** The one asked. */
5
+ assignee: User;
6
+ /** 「성희롱 예방교육 이수 — 2026」. */
7
+ name: string;
8
+ /** 「2026-12-31 까지」 - what the to-do shows. */
9
+ headline: string;
10
+ /** The screen that records it - `regulations?tab=trainings`. */
11
+ address: string;
12
+ subjectKind: string;
13
+ subjectId: string;
14
+ dueAt?: Date | null;
15
+ }
16
+ /** Hands out one to-do; answers its instance id, or nothing where the domain has not installed the to-do. */
17
+ export declare function issueLegalTodo(tx: EntityManager, domain: any, todo: LegalTodo): Promise<string | null>;
18
+ /** Closes the to-do once what it asked is recorded - left alone when it is closed already. */
19
+ export declare function closeLegalTodo(tx: EntityManager, domain: any, instanceId: string | null | undefined, by: User, reason?: string): Promise<void>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issueLegalTodo = issueLegalTodo;
4
+ exports.closeLegalTodo = closeLegalTodo;
5
+ const typeorm_1 = require("typeorm");
6
+ const env_1 = require("@things-factory/env");
7
+ const translator_1 = require("@things-factory/i18n-base/translator");
8
+ const worklist_1 = require("@things-factory/worklist");
9
+ const legal_todo_activity_names_1 = require("../../activities/legal-todo-activity-names");
10
+ /** The to-do is issued as its own assignee: nobody else hands it out. worklist speaks its refusals through `t`. */
11
+ function contextOf(tx, domain, user) {
12
+ const t = (0, translator_1.translatorFor)(user.locale || 'ko');
13
+ return { state: { domain, user, tx }, t: (key, options) => t(key, options) };
14
+ }
15
+ /** Hands out one to-do; answers its instance id, or nothing where the domain has not installed the to-do. */
16
+ async function issueLegalTodo(tx, domain, todo) {
17
+ const activity = await tx.getRepository(worklist_1.Activity).findOne({ where: { domain: { id: domain.id }, name: legal_todo_activity_names_1.LEGAL_TODO_ACTIVITY } });
18
+ if (!activity) {
19
+ env_1.logger.warn(`[Compliance] ${domain.subdomain}: the activity "${legal_todo_activity_names_1.LEGAL_TODO_ACTIVITY}" is not installed - "${todo.name}" not handed out`);
20
+ return null;
21
+ }
22
+ const context = contextOf(tx, domain, todo.assignee);
23
+ const dueAt = todo.dueAt ?? undefined;
24
+ const input = { subjectKind: todo.subjectKind, subjectId: todo.subjectId, headline: todo.headline, address: todo.address };
25
+ const instance = await (0, worklist_1.issue)({ name: todo.name, description: todo.headline, activityId: activity.id, input, assignees: [], threadsMin: 0, dueAt }, context);
26
+ await (0, worklist_1.assign)({ id: instance.id, assignees: [todo.assignee.email], dueAt, reason: todo.name }, context);
27
+ return instance.id;
28
+ }
29
+ /** Closes the to-do once what it asked is recorded - left alone when it is closed already. */
30
+ async function closeLegalTodo(tx, domain, instanceId, by, reason = '기록함') {
31
+ if (!instanceId)
32
+ return;
33
+ const open = await tx.getRepository(worklist_1.ActivityThread).count({ where: { activityInstance: { id: instanceId }, state: (0, typeorm_1.In)(['assigned', 'started', 'unassigned']) } });
34
+ if (open)
35
+ await (0, worklist_1.abort)({ id: instanceId, reason }, contextOf(tx, domain, by));
36
+ }
37
+ //# sourceMappingURL=legal-todo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-todo.js","sourceRoot":"","sources":["../../../server/service/common/legal-todo.ts"],"names":[],"mappings":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translatorFor } from '@things-factory/i18n-base/translator'\nimport { abort, Activity, ActivityThread, assign, issue } from '@things-factory/worklist'\n\nimport { LEGAL_TODO_ACTIVITY } from '../../activities/legal-todo-activity-names'\n\n/*\n * Handing out a legal to-do and closing it (ADR-0187 decisions 18, 23 · ADR-0147 decision 9). The record it is about\n * keeps the instance id; recording what was asked closes it. Reminding one past its day is worklist's (ADR-0186).\n */\n\nexport interface LegalTodo {\n /** The one asked. */\n assignee: User\n /** 「성희롱 예방교육 이수 — 2026」. */\n name: string\n /** 「2026-12-31 까지」 - what the to-do shows. */\n headline: string\n /** The screen that records it - `regulations?tab=trainings`. */\n address: string\n subjectKind: string\n subjectId: string\n dueAt?: Date | null\n}\n\n/** The to-do is issued as its own assignee: nobody else hands it out. worklist speaks its refusals through `t`. */\nfunction contextOf(tx: EntityManager, domain: any, user: User) {\n const t = translatorFor(user.locale || 'ko')\n return { state: { domain, user, tx }, t: (key: string, options?: any) => t(key, options) } as any\n}\n\n/** Hands out one to-do; answers its instance id, or nothing where the domain has not installed the to-do. */\nexport async function issueLegalTodo(tx: EntityManager, domain: any, todo: LegalTodo): Promise<string | null> {\n const activity = await tx.getRepository(Activity).findOne({ where: { domain: { id: domain.id }, name: LEGAL_TODO_ACTIVITY } as any })\n if (!activity) {\n logger.warn(`[Compliance] ${domain.subdomain}: the activity \"${LEGAL_TODO_ACTIVITY}\" is not installed - \"${todo.name}\" not handed out`)\n return null\n }\n const context = contextOf(tx, domain, todo.assignee)\n const dueAt = todo.dueAt ?? undefined\n const input = { subjectKind: todo.subjectKind, subjectId: todo.subjectId, headline: todo.headline, address: todo.address }\n const instance = await issue({ name: todo.name, description: todo.headline, activityId: activity.id, input, assignees: [], threadsMin: 0, dueAt } as any, context)\n await assign({ id: instance.id, assignees: [todo.assignee.email], dueAt, reason: todo.name }, context)\n return instance.id\n}\n\n/** Closes the to-do once what it asked is recorded - left alone when it is closed already. */\nexport async function closeLegalTodo(tx: EntityManager, domain: any, instanceId: string | null | undefined, by: User, reason = '기록함'): Promise<void> {\n if (!instanceId) return\n const open = await tx.getRepository(ActivityThread).count({ where: { activityInstance: { id: instanceId }, state: In(['assigned', 'started', 'unassigned']) } as any })\n if (open) await abort({ id: instanceId, reason } as any, contextOf(tx, domain, by))\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { ComplianceCase, ComplianceCaseEntry } from './compliance-case';
3
+ import { ComplianceCaseHandling, ComplianceReportView, NewComplianceCase, NewComplianceCaseReport } from './compliance-case-type';
4
+ export declare class ComplianceCaseMutation {
5
+ reportComplianceCase(report: NewComplianceCaseReport, attach: FileUpload[], context: ResolverContext): Promise<ComplianceReportView>;
6
+ recordComplianceCase(input: NewComplianceCase, attach: FileUpload[], context: ResolverContext): Promise<ComplianceCase>;
7
+ handleComplianceCase(patch: ComplianceCaseHandling, context: ResolverContext): Promise<ComplianceCase>;
8
+ addComplianceCaseEntry(caseId: string, writtenOn: string, body: string, attach: FileUpload[], context: ResolverContext): Promise<ComplianceCaseEntry>;
9
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComplianceCaseMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const compliance_case_1 = require("./compliance-case");
9
+ const compliance_case_service_1 = require("./compliance-case-service");
10
+ const compliance_case_type_1 = require("./compliance-case-type");
11
+ /* Nothing of a case is deleted - there is no door for it. A value changed keeps a correction. */
12
+ let ComplianceCaseMutation = class ComplianceCaseMutation {
13
+ async reportComplianceCase(report, attach, context) {
14
+ return await (0, compliance_case_service_1.reportComplianceCase)(report, attach, context);
15
+ }
16
+ async recordComplianceCase(input, attach, context) {
17
+ return await (0, compliance_case_service_1.recordComplianceCase)(input, attach, context);
18
+ }
19
+ async handleComplianceCase(patch, context) {
20
+ return await (0, compliance_case_service_1.handleComplianceCase)(patch, context);
21
+ }
22
+ async addComplianceCaseEntry(caseId, writtenOn, body, attach, context) {
23
+ return await (0, compliance_case_service_1.addComplianceCaseEntry)(caseId, writtenOn, body, attach, context);
24
+ }
25
+ };
26
+ exports.ComplianceCaseMutation = ComplianceCaseMutation;
27
+ tslib_1.__decorate([
28
+ (0, type_graphql_1.Directive)('@transaction'),
29
+ (0, type_graphql_1.Mutation)(returns => compliance_case_type_1.ComplianceReportView, { description: 'To report workplace harassment or sexual harassment - an employee, of their own or of what they saw (ADR-0187 decision 21)' }),
30
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('report', type => compliance_case_type_1.NewComplianceCaseReport)),
31
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('attach', type => [GraphQLUpload_js_1.default], { nullable: true })),
32
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
33
+ tslib_1.__metadata("design:type", Function),
34
+ tslib_1.__metadata("design:paramtypes", [compliance_case_type_1.NewComplianceCaseReport, Array, Object]),
35
+ tslib_1.__metadata("design:returntype", Promise)
36
+ ], ComplianceCaseMutation.prototype, "reportComplianceCase", null);
37
+ tslib_1.__decorate([
38
+ (0, type_graphql_1.Directive)('@privilege(category: "compliance-case", privilege: "mutation", domainOwnerGranted: true)'),
39
+ (0, type_graphql_1.Directive)('@transaction'),
40
+ (0, type_graphql_1.Mutation)(returns => compliance_case_1.ComplianceCase, { description: 'To write down a report the case handler received another way' }),
41
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('case', type => compliance_case_type_1.NewComplianceCase)),
42
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('attach', type => [GraphQLUpload_js_1.default], { nullable: true })),
43
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
44
+ tslib_1.__metadata("design:type", Function),
45
+ tslib_1.__metadata("design:paramtypes", [compliance_case_type_1.NewComplianceCase, Array, Object]),
46
+ tslib_1.__metadata("design:returntype", Promise)
47
+ ], ComplianceCaseMutation.prototype, "recordComplianceCase", null);
48
+ tslib_1.__decorate([
49
+ (0, type_graphql_1.Directive)('@transaction'),
50
+ (0, type_graphql_1.Mutation)(returns => compliance_case_1.ComplianceCase, { description: 'To write the handling of a case - investigators, protection, finding, the result told, closing; for those who read all of it' }),
51
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patch', type => compliance_case_type_1.ComplianceCaseHandling)),
52
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
53
+ tslib_1.__metadata("design:type", Function),
54
+ tslib_1.__metadata("design:paramtypes", [compliance_case_type_1.ComplianceCaseHandling, Object]),
55
+ tslib_1.__metadata("design:returntype", Promise)
56
+ ], ComplianceCaseMutation.prototype, "handleComplianceCase", null);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Directive)('@transaction'),
59
+ (0, type_graphql_1.Mutation)(returns => compliance_case_1.ComplianceCaseEntry, { description: 'To add one entry to the investigation record of a case' }),
60
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('caseId')),
61
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('writtenOn', { description: 'YYYY-MM-DD' })),
62
+ tslib_1.__param(2, (0, type_graphql_1.Arg)('body')),
63
+ tslib_1.__param(3, (0, type_graphql_1.Arg)('attach', type => [GraphQLUpload_js_1.default], { nullable: true })),
64
+ tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [String, String, String, Array, Object]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], ComplianceCaseMutation.prototype, "addComplianceCaseEntry", null);
69
+ exports.ComplianceCaseMutation = ComplianceCaseMutation = tslib_1.__decorate([
70
+ (0, type_graphql_1.Resolver)(compliance_case_1.ComplianceCase),
71
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
72
+ ], ComplianceCaseMutation);
73
+ //# sourceMappingURL=compliance-case-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance-case-mutation.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-mutation.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAqF;AAErF,iDAAqD;AAErD,uDAAuE;AACvE,uEAAoI;AACpI,iEAAiI;AAEjI,iGAAiG;AAG1F,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAG3B,AAAN,KAAK,CAAC,oBAAoB,CACwB,MAA+B,EACnB,MAAoB,EACzE,OAAwB;QAE/B,OAAO,MAAM,IAAA,8CAAoB,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5D,CAAC;IAKK,AAAN,KAAK,CAAC,oBAAoB,CACgB,KAAwB,EACJ,MAAoB,EACzE,OAAwB;QAE/B,OAAO,MAAM,IAAA,8CAAoB,EAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAIK,AAAN,KAAK,CAAC,oBAAoB,CAA+C,KAA6B,EAAS,OAAwB;QACrI,OAAO,MAAM,IAAA,8CAAoB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAIK,AAAN,KAAK,CAAC,sBAAsB,CACX,MAAc,EACoB,SAAiB,EACrD,IAAY,EACmC,MAAoB,EACzE,OAAwB;QAE/B,OAAO,MAAM,IAAA,gDAAsB,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/E,CAAC;CACF,CAAA;AAvCY,wDAAsB;AAG3B;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,2CAAoB,EAAE,EAAE,WAAW,EAAE,4HAA4H,EAAE,CAAC;IAEtL,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,8CAAuB,CAAC,CAAA;IAC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E,WAAW,EAAE,YAAY,EAAE,CAAC,CAAA;IAC/C,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oEAGP;iCAtCU,sBAAsB;IAFlC,IAAA,uBAAQ,EAAC,gCAAc,CAAC;IACxB,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,sBAAsB,CAuClC","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Arg, Ctx, Directive, Mutation, Resolver, UseMiddleware } from 'type-graphql'\n\nimport { SpeakRefusals } from '@things-factory/shell'\n\nimport { ComplianceCase, ComplianceCaseEntry } from './compliance-case'\nimport { addComplianceCaseEntry, handleComplianceCase, recordComplianceCase, reportComplianceCase } from './compliance-case-service'\nimport { ComplianceCaseHandling, ComplianceReportView, NewComplianceCase, NewComplianceCaseReport } from './compliance-case-type'\n\n/* Nothing of a case is deleted - there is no door for it. A value changed keeps a correction. */\n@Resolver(ComplianceCase)\n@UseMiddleware(SpeakRefusals)\nexport class ComplianceCaseMutation {\n @Directive('@transaction')\n @Mutation(returns => ComplianceReportView, { description: 'To report workplace harassment or sexual harassment - an employee, of their own or of what they saw (ADR-0187 decision 21)' })\n async reportComplianceCase(\n @Arg('report', type => NewComplianceCaseReport) report: NewComplianceCaseReport,\n @Arg('attach', type => [GraphQLUpload], { nullable: true }) attach: FileUpload[],\n @Ctx() context: ResolverContext\n ): Promise<ComplianceReportView> {\n return await reportComplianceCase(report, attach, context)\n }\n\n @Directive('@privilege(category: \"compliance-case\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => ComplianceCase, { description: 'To write down a report the case handler received another way' })\n async recordComplianceCase(\n @Arg('case', type => NewComplianceCase) input: NewComplianceCase,\n @Arg('attach', type => [GraphQLUpload], { nullable: true }) attach: FileUpload[],\n @Ctx() context: ResolverContext\n ): Promise<ComplianceCase> {\n return await recordComplianceCase(input, attach, context)\n }\n\n @Directive('@transaction')\n @Mutation(returns => ComplianceCase, { description: 'To write the handling of a case - investigators, protection, finding, the result told, closing; for those who read all of it' })\n async handleComplianceCase(@Arg('patch', type => ComplianceCaseHandling) patch: ComplianceCaseHandling, @Ctx() context: ResolverContext): Promise<ComplianceCase> {\n return await handleComplianceCase(patch, context)\n }\n\n @Directive('@transaction')\n @Mutation(returns => ComplianceCaseEntry, { description: 'To add one entry to the investigation record of a case' })\n async addComplianceCaseEntry(\n @Arg('caseId') caseId: string,\n @Arg('writtenOn', { description: 'YYYY-MM-DD' }) writtenOn: string,\n @Arg('body') body: string,\n @Arg('attach', type => [GraphQLUpload], { nullable: true }) attach: FileUpload[],\n @Ctx() context: ResolverContext\n ): Promise<ComplianceCaseEntry> {\n return await addComplianceCaseEntry(caseId, writtenOn, body, attach, context)\n }\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import { Attachment } from '@things-factory/attachment-base';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Employee } from '@things-factory/organization';
4
+ import { ListParam } from '@things-factory/shell';
5
+ import { ComplianceCorrection } from '../common/correction';
6
+ import { ComplianceCase, ComplianceCaseEntry } from './compliance-case';
7
+ import { ComplianceCaseList, ComplianceCasePerson, ComplianceReportView } from './compliance-case-type';
8
+ export declare class ComplianceCaseQuery {
9
+ complianceCases(params: ListParam, context: ResolverContext): Promise<ComplianceCaseList>;
10
+ complianceCase(id: string, context: ResolverContext): Promise<ComplianceCase>;
11
+ myComplianceInvestigations(context: ResolverContext): Promise<ComplianceCase[]>;
12
+ myComplianceReports(context: ResolverContext): Promise<ComplianceReportView[]>;
13
+ complianceCaseHandlerLeft(accusedIds: string[], context: ResolverContext): Promise<boolean>;
14
+ complianceCasePeople(text: string, context: ResolverContext): Promise<ComplianceCasePerson[]>;
15
+ complianceCaseInvestigatorChoices(text: string, context: ResolverContext): Promise<ComplianceCasePerson[]>;
16
+ reporter(row: ComplianceCase): Promise<Employee | null>;
17
+ victim(row: ComplianceCase): Promise<Employee | null>;
18
+ accused(row: ComplianceCase): Promise<Employee[]>;
19
+ investigators(row: ComplianceCase): Promise<User[]>;
20
+ entries(row: ComplianceCase): Promise<ComplianceCaseEntry[]>;
21
+ attachments(row: ComplianceCase, context: ResolverContext): Promise<Attachment[]>;
22
+ corrections(row: ComplianceCase, context: ResolverContext): Promise<ComplianceCorrection[]>;
23
+ creator(row: ComplianceCase): Promise<User | null>;
24
+ }
25
+ export declare class ComplianceCaseEntryQuery {
26
+ attachments(row: ComplianceCaseEntry, context: ResolverContext): Promise<Attachment[]>;
27
+ creator(row: ComplianceCaseEntry): Promise<User | null>;
28
+ }
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComplianceCaseEntryQuery = exports.ComplianceCaseQuery = 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 auth_base_1 = require("@things-factory/auth-base");
8
+ const organization_1 = require("@things-factory/organization");
9
+ const shell_1 = require("@things-factory/shell");
10
+ const correction_1 = require("../common/correction");
11
+ const compliance_case_1 = require("./compliance-case");
12
+ const compliance_case_service_1 = require("./compliance-case-service");
13
+ const compliance_case_type_1 = require("./compliance-case-type");
14
+ /*
15
+ * The doors that hand out cases (ADR-0187 decision 21). The `ComplianceCase` type, investigation and all, is answered
16
+ * only by the doors that ask for the whole sight - the handlers' list, one case, an investigator's list; the reporter
17
+ * and the victim read `ComplianceReportView`, which has no field of the investigation.
18
+ */
19
+ let ComplianceCaseQuery = class ComplianceCaseQuery {
20
+ async complianceCases(params, context) {
21
+ return await (0, compliance_case_service_1.complianceCasesFor)(params, context);
22
+ }
23
+ async complianceCase(id, context) {
24
+ return await (0, compliance_case_service_1.complianceCaseFor)(id, context);
25
+ }
26
+ async myComplianceInvestigations(context) {
27
+ return await (0, compliance_case_service_1.myInvestigations)(context);
28
+ }
29
+ async myComplianceReports(context) {
30
+ return await (0, compliance_case_service_1.myComplianceReports)(context);
31
+ }
32
+ async complianceCaseHandlerLeft(accusedIds, context) {
33
+ return await (0, compliance_case_service_1.insideHandlerLeft)(accusedIds, context);
34
+ }
35
+ async complianceCasePeople(text, context) {
36
+ return await (0, compliance_case_service_1.casePeople)(text, context);
37
+ }
38
+ async complianceCaseInvestigatorChoices(text, context) {
39
+ return await (0, compliance_case_service_1.investigatorChoices)(text, context);
40
+ }
41
+ async reporter(row) {
42
+ return row.reporterId ? await (0, shell_1.getRepository)(organization_1.Employee).findOne({ where: { id: row.reporterId } }) : null;
43
+ }
44
+ async victim(row) {
45
+ return row.victimId ? await (0, shell_1.getRepository)(organization_1.Employee).findOne({ where: { id: row.victimId } }) : null;
46
+ }
47
+ async accused(row) {
48
+ return row.accused ?? (await (0, shell_1.getRepository)(compliance_case_1.ComplianceCase).findOne({ where: { id: row.id }, relations: ['accused'] }))?.accused ?? [];
49
+ }
50
+ async investigators(row) {
51
+ return row.investigators ?? (await (0, shell_1.getRepository)(compliance_case_1.ComplianceCase).findOne({ where: { id: row.id }, relations: ['investigators'] }))?.investigators ?? [];
52
+ }
53
+ async entries(row) {
54
+ return await (0, shell_1.getRepository)(compliance_case_1.ComplianceCaseEntry).find({ where: { complianceCase: { id: row.id } }, order: { writtenOn: 'ASC', createdAt: 'ASC' } });
55
+ }
56
+ async attachments(row, context) {
57
+ return await (0, shell_1.getRepository)(attachment_base_1.Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: compliance_case_service_1.CASE_REF_TYPE, refBy: row.id }, order: { createdAt: 'ASC' } });
58
+ }
59
+ async corrections(row, context) {
60
+ return await (0, correction_1.correctionsOf)((0, shell_1.getRepository)(compliance_case_1.ComplianceCase).manager, context.state.domain, { kind: compliance_case_service_1.CASE_REF_TYPE, id: row.id });
61
+ }
62
+ async creator(row) {
63
+ return row.creatorId ? await (0, shell_1.getRepository)(auth_base_1.User).findOne({ where: { id: row.creatorId } }) : null;
64
+ }
65
+ };
66
+ exports.ComplianceCaseQuery = ComplianceCaseQuery;
67
+ tslib_1.__decorate([
68
+ (0, type_graphql_1.Directive)('@privilege(category: "compliance-case", privilege: "query", domainOwnerGranted: true)'),
69
+ (0, type_graphql_1.Query)(returns => compliance_case_type_1.ComplianceCaseList, { description: '신고 사건 - the cases the handler reads; never one they are reported against (ADR-0187 decision 21)' }),
70
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
71
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], ComplianceCaseQuery.prototype, "complianceCases", null);
76
+ tslib_1.__decorate([
77
+ (0, type_graphql_1.Query)(returns => compliance_case_1.ComplianceCase, { description: 'One case, whole - for its handlers and its investigators, never one reported against' }),
78
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
79
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
80
+ tslib_1.__metadata("design:type", Function),
81
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
82
+ tslib_1.__metadata("design:returntype", Promise)
83
+ ], ComplianceCaseQuery.prototype, "complianceCase", null);
84
+ tslib_1.__decorate([
85
+ (0, type_graphql_1.Query)(returns => [compliance_case_1.ComplianceCase], { description: 'The cases the request investigates - an investigator who is no case handler reads them here' }),
86
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
87
+ tslib_1.__metadata("design:type", Function),
88
+ tslib_1.__metadata("design:paramtypes", [Object]),
89
+ tslib_1.__metadata("design:returntype", Promise)
90
+ ], ComplianceCaseQuery.prototype, "myComplianceInvestigations", null);
91
+ tslib_1.__decorate([
92
+ (0, type_graphql_1.Query)(returns => [compliance_case_type_1.ComplianceReportView], { description: 'The cases the request reported or that happened to them - their progress, protection and result' }),
93
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
94
+ tslib_1.__metadata("design:type", Function),
95
+ tslib_1.__metadata("design:paramtypes", [Object]),
96
+ tslib_1.__metadata("design:returntype", Promise)
97
+ ], ComplianceCaseQuery.prototype, "myComplianceReports", null);
98
+ tslib_1.__decorate([
99
+ (0, type_graphql_1.Query)(returns => Boolean, { description: 'Whether a case handler is left to take a report against these employees - false sends the reporter to the labour ministry' }),
100
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('accusedIds', type => [String])),
101
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
102
+ tslib_1.__metadata("design:type", Function),
103
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
104
+ tslib_1.__metadata("design:returntype", Promise)
105
+ ], ComplianceCaseQuery.prototype, "complianceCaseHandlerLeft", null);
106
+ tslib_1.__decorate([
107
+ (0, type_graphql_1.Query)(returns => [compliance_case_type_1.ComplianceCasePerson], { description: 'Employees still working here a report may name, found by name - for an employee making a report' }),
108
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('text')),
109
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
110
+ tslib_1.__metadata("design:type", Function),
111
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
112
+ tslib_1.__metadata("design:returntype", Promise)
113
+ ], ComplianceCaseQuery.prototype, "complianceCasePeople", null);
114
+ tslib_1.__decorate([
115
+ (0, type_graphql_1.Directive)('@privilege(category: "compliance-case", privilege: "mutation", domainOwnerGranted: true)'),
116
+ (0, type_graphql_1.Query)(returns => [compliance_case_type_1.ComplianceCasePerson], { description: 'Users of the domain a case handler may name as investigators, found by name or mail' }),
117
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('text')),
118
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
119
+ tslib_1.__metadata("design:type", Function),
120
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
121
+ tslib_1.__metadata("design:returntype", Promise)
122
+ ], ComplianceCaseQuery.prototype, "complianceCaseInvestigatorChoices", null);
123
+ tslib_1.__decorate([
124
+ (0, type_graphql_1.FieldResolver)(type => organization_1.Employee, { nullable: true }),
125
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
126
+ tslib_1.__metadata("design:type", Function),
127
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
128
+ tslib_1.__metadata("design:returntype", Promise)
129
+ ], ComplianceCaseQuery.prototype, "reporter", null);
130
+ tslib_1.__decorate([
131
+ (0, type_graphql_1.FieldResolver)(type => organization_1.Employee, { nullable: true }),
132
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
133
+ tslib_1.__metadata("design:type", Function),
134
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
135
+ tslib_1.__metadata("design:returntype", Promise)
136
+ ], ComplianceCaseQuery.prototype, "victim", null);
137
+ tslib_1.__decorate([
138
+ (0, type_graphql_1.FieldResolver)(type => [organization_1.Employee]),
139
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
140
+ tslib_1.__metadata("design:type", Function),
141
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
142
+ tslib_1.__metadata("design:returntype", Promise)
143
+ ], ComplianceCaseQuery.prototype, "accused", null);
144
+ tslib_1.__decorate([
145
+ (0, type_graphql_1.FieldResolver)(type => [auth_base_1.User]),
146
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
147
+ tslib_1.__metadata("design:type", Function),
148
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
149
+ tslib_1.__metadata("design:returntype", Promise)
150
+ ], ComplianceCaseQuery.prototype, "investigators", null);
151
+ tslib_1.__decorate([
152
+ (0, type_graphql_1.FieldResolver)(type => [compliance_case_1.ComplianceCaseEntry], { description: 'The investigation record, oldest first' }),
153
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
154
+ tslib_1.__metadata("design:type", Function),
155
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
156
+ tslib_1.__metadata("design:returntype", Promise)
157
+ ], ComplianceCaseQuery.prototype, "entries", null);
158
+ tslib_1.__decorate([
159
+ (0, type_graphql_1.FieldResolver)(type => [attachment_base_1.Attachment], { description: 'The files of the report' }),
160
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
161
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
162
+ tslib_1.__metadata("design:type", Function),
163
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase, Object]),
164
+ tslib_1.__metadata("design:returntype", Promise)
165
+ ], ComplianceCaseQuery.prototype, "attachments", null);
166
+ tslib_1.__decorate([
167
+ (0, type_graphql_1.FieldResolver)(type => [correction_1.ComplianceCorrection], { description: 'The values changed after they were written' }),
168
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
169
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
170
+ tslib_1.__metadata("design:type", Function),
171
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase, Object]),
172
+ tslib_1.__metadata("design:returntype", Promise)
173
+ ], ComplianceCaseQuery.prototype, "corrections", null);
174
+ tslib_1.__decorate([
175
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
176
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
177
+ tslib_1.__metadata("design:type", Function),
178
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCase]),
179
+ tslib_1.__metadata("design:returntype", Promise)
180
+ ], ComplianceCaseQuery.prototype, "creator", null);
181
+ exports.ComplianceCaseQuery = ComplianceCaseQuery = tslib_1.__decorate([
182
+ (0, type_graphql_1.Resolver)(compliance_case_1.ComplianceCase),
183
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
184
+ ], ComplianceCaseQuery);
185
+ let ComplianceCaseEntryQuery = class ComplianceCaseEntryQuery {
186
+ async attachments(row, context) {
187
+ return await (0, shell_1.getRepository)(attachment_base_1.Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: compliance_case_service_1.CASE_ENTRY_REF_TYPE, refBy: row.id }, order: { createdAt: 'ASC' } });
188
+ }
189
+ async creator(row) {
190
+ return row.creatorId ? await (0, shell_1.getRepository)(auth_base_1.User).findOne({ where: { id: row.creatorId } }) : null;
191
+ }
192
+ };
193
+ exports.ComplianceCaseEntryQuery = ComplianceCaseEntryQuery;
194
+ tslib_1.__decorate([
195
+ (0, type_graphql_1.FieldResolver)(type => [attachment_base_1.Attachment], { description: 'The files of the entry' }),
196
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
197
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
198
+ tslib_1.__metadata("design:type", Function),
199
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCaseEntry, Object]),
200
+ tslib_1.__metadata("design:returntype", Promise)
201
+ ], ComplianceCaseEntryQuery.prototype, "attachments", null);
202
+ tslib_1.__decorate([
203
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
204
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
205
+ tslib_1.__metadata("design:type", Function),
206
+ tslib_1.__metadata("design:paramtypes", [compliance_case_1.ComplianceCaseEntry]),
207
+ tslib_1.__metadata("design:returntype", Promise)
208
+ ], ComplianceCaseEntryQuery.prototype, "creator", null);
209
+ exports.ComplianceCaseEntryQuery = ComplianceCaseEntryQuery = tslib_1.__decorate([
210
+ (0, type_graphql_1.Resolver)(compliance_case_1.ComplianceCaseEntry)
211
+ ], ComplianceCaseEntryQuery);
212
+ //# sourceMappingURL=compliance-case-query.js.map