@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,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InventionReward = exports.InventionInventor = exports.Invention = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
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 legal_registration_1 = require("../legal-registration/legal-registration");
11
+ /**
12
+ * 직무발명 (ADR-0187 decision 24) - an invention an employee reports: who invented it, what it is, the day the company
13
+ * is to tell whether it succeeds to the right (reported + 4 months), what it decided and told, the patent filed and
14
+ * the rewards paid. Read by its inventors and by those who keep the records. Never deleted.
15
+ */
16
+ let Invention = class Invention {
17
+ };
18
+ exports.Invention = Invention;
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Its id' }),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], Invention.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, description: 'The domain it belongs to' }),
27
+ tslib_1.__metadata("design:type", shell_1.Domain)
28
+ ], Invention.prototype, "domain", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.RelationId)((row) => row.domain),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], Invention.prototype, "domainId", void 0);
33
+ tslib_1.__decorate([
34
+ (0, typeorm_1.Column)(),
35
+ (0, type_graphql_1.Field)({ description: 'Its title' }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], Invention.prototype, "title", void 0);
38
+ tslib_1.__decorate([
39
+ (0, typeorm_1.Column)({ type: 'text' }),
40
+ (0, type_graphql_1.Field)({ description: 'What the invention is' }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], Invention.prototype, "content", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)(),
45
+ (0, type_graphql_1.Field)({ description: 'YYYY-MM-DD it was reported' }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], Invention.prototype, "reportedOn", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)(),
50
+ (0, type_graphql_1.Field)({ description: 'YYYY-MM-DD the decision is to be told by - four months from the report' }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], Invention.prototype, "decisionDueOn", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true }),
55
+ (0, type_graphql_1.Field)({ nullable: true, description: 'SUCCEED or WAIVE - empty while undecided' }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], Invention.prototype, "decision", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD the inventors were told the decision' }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], Invention.prototype, "decisionToldOn", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.ManyToOne)(type => legal_registration_1.LegalRegistration, { nullable: true }),
65
+ (0, type_graphql_1.Field)(type => legal_registration_1.LegalRegistration, { nullable: true, description: 'The patent filed for it, on the ledger' }),
66
+ tslib_1.__metadata("design:type", legal_registration_1.LegalRegistration)
67
+ ], Invention.prototype, "filing", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.RelationId)((row) => row.filing),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], Invention.prototype, "filingId", void 0);
72
+ tslib_1.__decorate([
73
+ (0, typeorm_1.ManyToOne)(type => organization_1.Employee, { nullable: true }),
74
+ tslib_1.__metadata("design:type", organization_1.Employee)
75
+ ], Invention.prototype, "reporter", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.RelationId)((row) => row.reporter),
78
+ tslib_1.__metadata("design:type", String)
79
+ ], Invention.prototype, "reporterId", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
82
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], Invention.prototype, "notes", void 0);
85
+ tslib_1.__decorate([
86
+ (0, typeorm_1.CreateDateColumn)(),
87
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was written' }),
88
+ tslib_1.__metadata("design:type", Date)
89
+ ], Invention.prototype, "createdAt", void 0);
90
+ tslib_1.__decorate([
91
+ (0, typeorm_1.UpdateDateColumn)(),
92
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed' }),
93
+ tslib_1.__metadata("design:type", Date)
94
+ ], Invention.prototype, "updatedAt", void 0);
95
+ tslib_1.__decorate([
96
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
97
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
98
+ tslib_1.__metadata("design:type", auth_base_1.User)
99
+ ], Invention.prototype, "creator", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.RelationId)((row) => row.creator),
102
+ tslib_1.__metadata("design:type", String)
103
+ ], Invention.prototype, "creatorId", void 0);
104
+ tslib_1.__decorate([
105
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
106
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
107
+ tslib_1.__metadata("design:type", auth_base_1.User)
108
+ ], Invention.prototype, "updater", void 0);
109
+ tslib_1.__decorate([
110
+ (0, typeorm_1.RelationId)((row) => row.updater),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], Invention.prototype, "updaterId", void 0);
113
+ exports.Invention = Invention = tslib_1.__decorate([
114
+ (0, typeorm_1.Entity)({ name: 'compliance_inventions' }),
115
+ (0, typeorm_1.Index)('ix_compliance_invention_0', (row) => [row.domain, row.reportedOn]),
116
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Invention - an employee invention reported to the company' })
117
+ ], Invention);
118
+ /** 발명자 - one inventor of an invention. */
119
+ let InventionInventor = class InventionInventor {
120
+ };
121
+ exports.InventionInventor = InventionInventor;
122
+ tslib_1.__decorate([
123
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
124
+ tslib_1.__metadata("design:type", String)
125
+ ], InventionInventor.prototype, "id", void 0);
126
+ tslib_1.__decorate([
127
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
128
+ tslib_1.__metadata("design:type", shell_1.Domain)
129
+ ], InventionInventor.prototype, "domain", void 0);
130
+ tslib_1.__decorate([
131
+ (0, typeorm_1.ManyToOne)(type => Invention),
132
+ tslib_1.__metadata("design:type", Invention)
133
+ ], InventionInventor.prototype, "invention", void 0);
134
+ tslib_1.__decorate([
135
+ (0, typeorm_1.RelationId)((row) => row.invention),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], InventionInventor.prototype, "inventionId", void 0);
138
+ tslib_1.__decorate([
139
+ (0, typeorm_1.ManyToOne)(type => organization_1.Employee),
140
+ tslib_1.__metadata("design:type", organization_1.Employee)
141
+ ], InventionInventor.prototype, "employee", void 0);
142
+ tslib_1.__decorate([
143
+ (0, typeorm_1.RelationId)((row) => row.employee),
144
+ tslib_1.__metadata("design:type", String)
145
+ ], InventionInventor.prototype, "employeeId", void 0);
146
+ exports.InventionInventor = InventionInventor = tslib_1.__decorate([
147
+ (0, typeorm_1.Entity)({ name: 'compliance_invention_inventors' }),
148
+ (0, typeorm_1.Index)('ix_compliance_invention_inventor_0', (row) => [row.invention, row.employee], { unique: true })
149
+ ], InventionInventor);
150
+ /** 보상 - a reward paid for an invention (발명진흥법 §15); the payment itself is the payroll's or an expenditure's. */
151
+ let InventionReward = class InventionReward {
152
+ };
153
+ exports.InventionReward = InventionReward;
154
+ tslib_1.__decorate([
155
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
156
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Its id' }),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], InventionReward.prototype, "id", void 0);
159
+ tslib_1.__decorate([
160
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
161
+ tslib_1.__metadata("design:type", shell_1.Domain)
162
+ ], InventionReward.prototype, "domain", void 0);
163
+ tslib_1.__decorate([
164
+ (0, typeorm_1.ManyToOne)(type => Invention),
165
+ tslib_1.__metadata("design:type", Invention)
166
+ ], InventionReward.prototype, "invention", void 0);
167
+ tslib_1.__decorate([
168
+ (0, typeorm_1.RelationId)((row) => row.invention),
169
+ tslib_1.__metadata("design:type", String)
170
+ ], InventionReward.prototype, "inventionId", void 0);
171
+ tslib_1.__decorate([
172
+ (0, typeorm_1.Column)({ nullable: true }),
173
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it is for - 출원 보상, 등록 보상, 실시 보상' }),
174
+ tslib_1.__metadata("design:type", String)
175
+ ], InventionReward.prototype, "name", void 0);
176
+ tslib_1.__decorate([
177
+ (0, typeorm_1.Column)({ ...(0, shell_1.moneyColumn)() }),
178
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'The amount' }),
179
+ tslib_1.__metadata("design:type", Number)
180
+ ], InventionReward.prototype, "amount", void 0);
181
+ tslib_1.__decorate([
182
+ (0, typeorm_1.Column)({ nullable: true }),
183
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD it was paid' }),
184
+ tslib_1.__metadata("design:type", String)
185
+ ], InventionReward.prototype, "paidOn", void 0);
186
+ tslib_1.__decorate([
187
+ (0, typeorm_1.Column)({ nullable: true }),
188
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where it was paid - a payroll month or an expenditure request, as text' }),
189
+ tslib_1.__metadata("design:type", String)
190
+ ], InventionReward.prototype, "paymentLink", void 0);
191
+ tslib_1.__decorate([
192
+ (0, typeorm_1.CreateDateColumn)(),
193
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was written' }),
194
+ tslib_1.__metadata("design:type", Date)
195
+ ], InventionReward.prototype, "createdAt", void 0);
196
+ tslib_1.__decorate([
197
+ (0, typeorm_1.UpdateDateColumn)(),
198
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed' }),
199
+ tslib_1.__metadata("design:type", Date)
200
+ ], InventionReward.prototype, "updatedAt", void 0);
201
+ tslib_1.__decorate([
202
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
203
+ tslib_1.__metadata("design:type", auth_base_1.User)
204
+ ], InventionReward.prototype, "creator", void 0);
205
+ tslib_1.__decorate([
206
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
207
+ tslib_1.__metadata("design:type", auth_base_1.User)
208
+ ], InventionReward.prototype, "updater", void 0);
209
+ exports.InventionReward = InventionReward = tslib_1.__decorate([
210
+ (0, typeorm_1.Entity)({ name: 'compliance_invention_rewards' }),
211
+ (0, typeorm_1.Index)('ix_compliance_invention_reward_0', (row) => [row.invention]),
212
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InventionReward - a reward for an employee invention' })
213
+ ], InventionReward);
214
+ //# sourceMappingURL=invention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invention.js","sourceRoot":"","sources":["../../../server/service/invention/invention.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D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CAAC,GAAoB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACpF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;GAClF,eAAe,CA2C3B","sourcesContent":["import { Field, Float, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Employee } from '@things-factory/organization'\nimport { Domain, moneyColumn } from '@things-factory/shell'\n\nimport { LegalRegistration } from '../legal-registration/legal-registration'\n\n/**\n * 직무발명 (ADR-0187 decision 24) - an invention an employee reports: who invented it, what it is, the day the company\n * is to tell whether it succeeds to the right (reported + 4 months), what it decided and told, the patent filed and\n * the rewards paid. Read by its inventors and by those who keep the records. Never deleted.\n */\n@Entity({ name: 'compliance_inventions' })\n@Index('ix_compliance_invention_0', (row: Invention) => [row.domain, row.reportedOn])\n@ObjectType({ description: 'Entity for Invention - an employee invention reported to the company' })\nexport class Invention {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Its id' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain it belongs to' })\n domain?: Domain\n\n @RelationId((row: Invention) => row.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'Its title' })\n title: string\n\n @Column({ type: 'text' })\n @Field({ description: 'What the invention is' })\n content: string\n\n @Column()\n @Field({ description: 'YYYY-MM-DD it was reported' })\n reportedOn: string\n\n @Column()\n @Field({ description: 'YYYY-MM-DD the decision is to be told by - four months from the report' })\n decisionDueOn: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'SUCCEED or WAIVE - empty while undecided' })\n decision?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD the inventors were told the decision' })\n decisionToldOn?: string\n\n @ManyToOne(type => LegalRegistration, { nullable: true })\n @Field(type => LegalRegistration, { nullable: true, description: 'The patent filed for it, on the ledger' })\n filing?: LegalRegistration\n\n @RelationId((row: Invention) => row.filing)\n filingId?: string\n\n @ManyToOne(type => Employee, { nullable: true })\n reporter?: Employee\n\n @RelationId((row: Invention) => row.reporter)\n reporterId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When it was last changed' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who wrote it' })\n creator?: User\n\n @RelationId((row: Invention) => row.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed it' })\n updater?: User\n\n @RelationId((row: Invention) => row.updater)\n updaterId?: string\n}\n\n/** 발명자 - one inventor of an invention. */\n@Entity({ name: 'compliance_invention_inventors' })\n@Index('ix_compliance_invention_inventor_0', (row: InventionInventor) => [row.invention, row.employee], { unique: true })\nexport class InventionInventor {\n @PrimaryGeneratedColumn('uuid')\n readonly id: string\n\n @ManyToOne(type => Domain)\n domain?: Domain\n\n @ManyToOne(type => Invention)\n invention?: Invention\n\n @RelationId((row: InventionInventor) => row.invention)\n inventionId?: string\n\n @ManyToOne(type => Employee)\n employee?: Employee\n\n @RelationId((row: InventionInventor) => row.employee)\n employeeId?: string\n}\n\n/** 보상 - a reward paid for an invention (발명진흥법 §15); the payment itself is the payroll's or an expenditure's. */\n@Entity({ name: 'compliance_invention_rewards' })\n@Index('ix_compliance_invention_reward_0', (row: InventionReward) => [row.invention])\n@ObjectType({ description: 'Entity for InventionReward - a reward for an employee invention' })\nexport class InventionReward {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Its id' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n domain?: Domain\n\n @ManyToOne(type => Invention)\n invention?: Invention\n\n @RelationId((row: InventionReward) => row.invention)\n inventionId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'What it is for - 출원 보상, 등록 보상, 실시 보상' })\n name?: string\n\n @Column({ ...moneyColumn() })\n @Field(type => Float, { description: 'The amount' })\n amount: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD it was paid' })\n paidOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Where it was paid - a payroll month or an expenditure request, as text' })\n paymentLink?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When it was last changed' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n creator?: User\n\n @ManyToOne(type => User, { nullable: true })\n updater?: User\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function registerLegalRecordFiles(): void;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerLegalRecordFiles = registerLegalRecordFiles;
4
+ /*
5
+ * Who may open a file of the ledger, an invention or a dispute by its path - whoever may read the record (ADR-0187
6
+ * decisions 23-25). attachment-base has already checked the file is of the request's domain.
7
+ */
8
+ const attachment_base_1 = require("@things-factory/attachment-base");
9
+ const employee_reader_1 = require("../common/employee-reader");
10
+ const dispute_service_1 = require("../dispute/dispute-service");
11
+ const invention_service_1 = require("../invention/invention-service");
12
+ const legal_registration_service_1 = require("../legal-registration/legal-registration-service");
13
+ function registerLegalRecordFiles() {
14
+ (0, attachment_base_1.registerAttachmentReader)(legal_registration_service_1.LEGAL_REGISTRATION_REF_TYPE, (_attachment, context) => (0, employee_reader_1.holds)(context, legal_registration_service_1.LEGAL_REGISTRATION_CATEGORY, 'query'));
15
+ (0, attachment_base_1.registerAttachmentReader)(dispute_service_1.DISPUTE_REF_TYPE, (_attachment, context) => (0, employee_reader_1.holds)(context, dispute_service_1.DISPUTE_CATEGORY, 'query'));
16
+ (0, attachment_base_1.registerAttachmentReader)(invention_service_1.INVENTION_REF_TYPE, async (attachment, context) => {
17
+ if (!attachment.refBy)
18
+ return false;
19
+ try {
20
+ return !!(await (0, invention_service_1.visibleInvention)(attachment.refBy, context));
21
+ }
22
+ catch {
23
+ return false;
24
+ }
25
+ });
26
+ }
27
+ //# sourceMappingURL=attachment-readers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-readers.js","sourceRoot":"","sources":["../../../server/service/legal-record/attachment-readers.ts"],"names":[],"mappings":";;AAWA,4DAWC;AAtBD;;;GAGG;AACH,qEAA0E;AAE1E,+DAAiD;AACjD,gEAA+E;AAC/E,sEAAqF;AACrF,iGAA2H;AAE3H,SAAgB,wBAAwB;IACtC,IAAA,0CAAwB,EAAC,wDAA2B,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,uBAAK,EAAC,OAAO,EAAE,wDAA2B,EAAE,OAAO,CAAC,CAAC,CAAA;IACrI,IAAA,0CAAwB,EAAC,kCAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,uBAAK,EAAC,OAAO,EAAE,kCAAgB,EAAE,OAAO,CAAC,CAAC,CAAA;IAC/G,IAAA,0CAAwB,EAAC,sCAAkB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACzE,IAAI,CAAC,UAAU,CAAC,KAAK;YAAE,OAAO,KAAK,CAAA;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAgB,EAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/*\n * Who may open a file of the ledger, an invention or a dispute by its path - whoever may read the record (ADR-0187\n * decisions 23-25). attachment-base has already checked the file is of the request's domain.\n */\nimport { registerAttachmentReader } from '@things-factory/attachment-base'\n\nimport { holds } from '../common/employee-reader'\nimport { DISPUTE_CATEGORY, DISPUTE_REF_TYPE } from '../dispute/dispute-service'\nimport { INVENTION_REF_TYPE, visibleInvention } from '../invention/invention-service'\nimport { LEGAL_REGISTRATION_CATEGORY, LEGAL_REGISTRATION_REF_TYPE } from '../legal-registration/legal-registration-service'\n\nexport function registerLegalRecordFiles(): void {\n registerAttachmentReader(LEGAL_REGISTRATION_REF_TYPE, (_attachment, context) => holds(context, LEGAL_REGISTRATION_CATEGORY, 'query'))\n registerAttachmentReader(DISPUTE_REF_TYPE, (_attachment, context) => holds(context, DISPUTE_CATEGORY, 'query'))\n registerAttachmentReader(INVENTION_REF_TYPE, async (attachment, context) => {\n if (!attachment.refBy) return false\n try {\n return !!(await visibleInvention(attachment.refBy, context))\n } catch {\n return false\n }\n })\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export declare const DAY: RegExp;
2
+ /** Whether `value` is a 'YYYY-MM-DD' day. */
3
+ export declare const isDay: (value: unknown) => value is string;
4
+ /** `day` moved by `count` days. */
5
+ export declare function addDays(day: string, count: number): string;
6
+ /** `day` moved by `count` months, to the month's last day when the month is shorter - 4 months from 10-31 is 02-28. */
7
+ export declare function addMonths(day: string, count: number): string;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * Counting legal deadlines on 'YYYY-MM-DD' days (ADR-0187 decisions 23-25) - pure, in calendar days, no time of day.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isDay = exports.DAY = void 0;
7
+ exports.addDays = addDays;
8
+ exports.addMonths = addMonths;
9
+ exports.DAY = /^\d{4}-\d{2}-\d{2}$/;
10
+ /** Whether `value` is a 'YYYY-MM-DD' day. */
11
+ const isDay = (value) => typeof value === 'string' && exports.DAY.test(value);
12
+ exports.isDay = isDay;
13
+ /** `day` moved by `count` days. */
14
+ function addDays(day, count) {
15
+ const [year, month, date] = day.split('-').map(Number);
16
+ return new Date(Date.UTC(year, month - 1, date + count)).toISOString().slice(0, 10);
17
+ }
18
+ /** `day` moved by `count` months, to the month's last day when the month is shorter - 4 months from 10-31 is 02-28. */
19
+ function addMonths(day, count) {
20
+ const [year, month, date] = day.split('-').map(Number);
21
+ const target = new Date(Date.UTC(year, month - 1 + count, 1));
22
+ const last = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate();
23
+ target.setUTCDate(Math.min(date, last));
24
+ return target.toISOString().slice(0, 10);
25
+ }
26
+ //# sourceMappingURL=days.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"days.js","sourceRoot":"","sources":["../../../server/service/legal-record/days.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAQH,0BAGC;AAGD,8BAMC;AAlBY,QAAA,GAAG,GAAG,qBAAqB,CAAA;AAExC,6CAA6C;AACtC,MAAM,KAAK,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAAzF,QAAA,KAAK,SAAoF;AAEtG,mCAAmC;AACnC,SAAgB,OAAO,CAAC,GAAW,EAAE,KAAa;IAChD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACtD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AACrF,CAAC;AAED,uHAAuH;AACvH,SAAgB,SAAS,CAAC,GAAW,EAAE,KAAa;IAClD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACtD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;IAC7D,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAA;IAClG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IACvC,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["/*\n * Counting legal deadlines on 'YYYY-MM-DD' days (ADR-0187 decisions 23-25) - pure, in calendar days, no time of day.\n */\n\nexport const DAY = /^\\d{4}-\\d{2}-\\d{2}$/\n\n/** Whether `value` is a 'YYYY-MM-DD' day. */\nexport const isDay = (value: unknown): value is string => typeof value === 'string' && DAY.test(value)\n\n/** `day` moved by `count` days. */\nexport function addDays(day: string, count: number): string {\n const [year, month, date] = day.split('-').map(Number)\n return new Date(Date.UTC(year, month - 1, date + count)).toISOString().slice(0, 10)\n}\n\n/** `day` moved by `count` months, to the month's last day when the month is shorter - 4 months from 10-31 is 02-28. */\nexport function addMonths(day: string, count: number): string {\n const [year, month, date] = day.split('-').map(Number)\n const target = new Date(Date.UTC(year, month - 1 + count, 1))\n const last = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate()\n target.setUTCDate(Math.min(date, last))\n return target.toISOString().slice(0, 10)\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { EntityManager } from 'typeorm';
3
+ import { Attachment } from '@things-factory/attachment-base';
4
+ import { User } from '@things-factory/auth-base';
5
+ /**
6
+ * The accounts of the domain that hold `category` for writing - its owner and every role that grants it - in name
7
+ * order. A to-do nobody is named for goes to each of them.
8
+ */
9
+ export declare function holdersOf(tx: EntityManager, domain: {
10
+ id: string;
11
+ owner?: string | null;
12
+ }, category: string): Promise<User[]>;
13
+ /** The files of one record, oldest first. */
14
+ export declare function filesOf(tx: EntityManager, domain: {
15
+ id: string;
16
+ }, refType: string, refBy: string): Promise<Attachment[]>;
17
+ /** Hangs `files` on one record; answers its files after. */
18
+ export declare function attachFilesTo(refType: string, refBy: string, files: FileUpload[] | undefined, context: ResolverContext): Promise<Attachment[]>;
19
+ /** A trimmed text, or null for nothing. */
20
+ export declare const text: (value: unknown) => string;
21
+ /** The fields a patch carries, past its id and flag. */
22
+ export declare const fieldsOf: (patch: object) => string[];
23
+ /** The request's transaction, or the data source's manager for a query that runs outside one. */
24
+ export declare const managerOf: (context: ResolverContext) => EntityManager;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.managerOf = exports.fieldsOf = exports.text = void 0;
4
+ exports.holdersOf = holdersOf;
5
+ exports.filesOf = filesOf;
6
+ exports.attachFilesTo = attachFilesTo;
7
+ const attachment_base_1 = require("@things-factory/attachment-base");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const shell_1 = require("@things-factory/shell");
10
+ /*
11
+ * What the ledger of registrations, the employee inventions and the disputes share (ADR-0187 decisions 23-25): who a
12
+ * to-do goes to when nobody is in charge, and the files hung on a record. Files are attached, never taken off - a
13
+ * legal record keeps what it was shown.
14
+ */
15
+ /**
16
+ * The accounts of the domain that hold `category` for writing - its owner and every role that grants it - in name
17
+ * order. A to-do nobody is named for goes to each of them.
18
+ */
19
+ async function holdersOf(tx, domain, category) {
20
+ const users = await tx
21
+ .getRepository(auth_base_1.User)
22
+ .createQueryBuilder('user')
23
+ .innerJoin('user.domains', 'domain', 'domain.id = :domainId', { domainId: domain.id })
24
+ .orderBy('user.name')
25
+ .getMany();
26
+ const held = [];
27
+ for (const user of users)
28
+ if (user.id === domain.owner || (await auth_base_1.User.hasPrivilege('mutation', category, domain, user)))
29
+ held.push(user);
30
+ return held;
31
+ }
32
+ /** The files of one record, oldest first. */
33
+ async function filesOf(tx, domain, refType, refBy) {
34
+ return await tx.getRepository(attachment_base_1.Attachment).find({ where: { domain: { id: domain.id }, refType, refBy }, order: { createdAt: 'ASC' } });
35
+ }
36
+ /** Hangs `files` on one record; answers its files after. */
37
+ async function attachFilesTo(refType, refBy, files, context) {
38
+ for (const file of files ?? [])
39
+ await (0, attachment_base_1.createAttachment)(null, { attachment: { file, refType, refBy } }, context);
40
+ return await filesOf(context.state.tx, context.state.domain, refType, refBy);
41
+ }
42
+ /** A trimmed text, or null for nothing. */
43
+ const text = (value) => (typeof value === 'string' && value.trim() ? value.trim() : null);
44
+ exports.text = text;
45
+ /** The fields a patch carries, past its id and flag. */
46
+ const fieldsOf = (patch) => Object.keys(patch).filter(field => !['id', 'cuFlag'].includes(field) && patch[field] !== undefined);
47
+ exports.fieldsOf = fieldsOf;
48
+ /** The request's transaction, or the data source's manager for a query that runs outside one. */
49
+ const managerOf = (context) => context.state.tx ?? (0, shell_1.getRepository)(attachment_base_1.Attachment).manager;
50
+ exports.managerOf = managerOf;
51
+ //# sourceMappingURL=legal-record-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-record-support.js","sourceRoot":"","sources":["../../../server/service/legal-record/legal-record-support.ts"],"names":[],"mappings":";;;AAiBA,8BAUC;AAGD,0BAEC;AAGD,sCAGC;AAnCD,qEAA8E;AAC9E,yDAAgD;AAChD,iDAAqD;AAErD;;;;GAIG;AAEH;;;GAGG;AACI,KAAK,UAAU,SAAS,CAAC,EAAiB,EAAE,MAA6C,EAAE,QAAgB;IAChH,MAAM,KAAK,GAAG,MAAM,EAAE;SACnB,aAAa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AC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAC9E,CAAC;AAED,2CAA2C;AACpC,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAA5F,QAAA,IAAI,QAAwF;AAEzG,wDAAwD;AACjD,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAK,KAAa,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAA;AAA1I,QAAA,QAAQ,YAAkI;AAEvJ,iGAAiG;AAC1F,MAAM,SAAS,GAAG,CAAC,OAAwB,EAAiB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,IAAA,qBAAa,EAAC,4BAAU,CAAC,CAAC,OAAO,CAAA;AAA9G,QAAA,SAAS,aAAqG","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport { EntityManager } from 'typeorm'\n\nimport { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { getRepository } from '@things-factory/shell'\n\n/*\n * What the ledger of registrations, the employee inventions and the disputes share (ADR-0187 decisions 23-25): who a\n * to-do goes to when nobody is in charge, and the files hung on a record. Files are attached, never taken off - a\n * legal record keeps what it was shown.\n */\n\n/**\n * The accounts of the domain that hold `category` for writing - its owner and every role that grants it - in name\n * order. A to-do nobody is named for goes to each of them.\n */\nexport async function holdersOf(tx: EntityManager, domain: { id: string; owner?: string | null }, category: string): Promise<User[]> {\n const users = await tx\n .getRepository(User)\n .createQueryBuilder('user')\n .innerJoin('user.domains', 'domain', 'domain.id = :domainId', { domainId: domain.id })\n .orderBy('user.name')\n .getMany()\n const held: User[] = []\n for (const user of users) if (user.id === domain.owner || (await User.hasPrivilege('mutation', category, domain as any, user))) held.push(user)\n return held\n}\n\n/** The files of one record, oldest first. */\nexport async function filesOf(tx: EntityManager, domain: { id: string }, refType: string, refBy: string): Promise<Attachment[]> {\n return await tx.getRepository(Attachment).find({ where: { domain: { id: domain.id }, refType, refBy } as any, order: { createdAt: 'ASC' } as any })\n}\n\n/** Hangs `files` on one record; answers its files after. */\nexport async function attachFilesTo(refType: string, refBy: string, files: FileUpload[] | undefined, context: ResolverContext): Promise<Attachment[]> {\n for (const file of files ?? []) await createAttachment(null, { attachment: { file, refType, refBy } } as any, context)\n return await filesOf(context.state.tx, context.state.domain, refType, refBy)\n}\n\n/** A trimmed text, or null for nothing. */\nexport const text = (value: unknown) => (typeof value === 'string' && value.trim() ? value.trim() : null)\n\n/** The fields a patch carries, past its id and flag. */\nexport const fieldsOf = (patch: object) => Object.keys(patch).filter(field => !['id', 'cuFlag'].includes(field) && (patch as any)[field] !== undefined)\n\n/** The request's transaction, or the data source's manager for a query that runs outside one. */\nexport const managerOf = (context: ResolverContext): EntityManager => context.state.tx ?? getRepository(Attachment).manager\n"]}
@@ -0,0 +1,9 @@
1
+ import { EntitySubscriberInterface, InsertEvent, UpdateEvent } from 'typeorm';
2
+ import { Employee } from '@things-factory/organization';
3
+ export declare class ResearchCentreEmployeeSubscriber implements EntitySubscriberInterface<Employee> {
4
+ listenTo(): typeof Employee;
5
+ beforeUpdate(event: UpdateEvent<Employee>): Promise<void>;
6
+ afterUpdate(event: UpdateEvent<Employee>): Promise<void>;
7
+ afterInsert(event: InsertEvent<Employee>): Promise<void>;
8
+ private note;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResearchCentreEmployeeSubscriber = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const env_1 = require("@things-factory/env");
7
+ const organization_1 = require("@things-factory/organization");
8
+ const legal_registration_service_1 = require("./legal-registration-service");
9
+ /*
10
+ * organization emits nothing of its own when an employee joins, moves or leaves - it saves the `Employee` row. The
11
+ * research centre listens to that save (ADR-0187 decision 23): the row as it was is read before the update, the row
12
+ * as it is after, in the same transaction. A centre change that cannot be written is logged, never a reason to refuse
13
+ * the organization's save.
14
+ */
15
+ const BEFORE = new WeakMap();
16
+ let ResearchCentreEmployeeSubscriber = class ResearchCentreEmployeeSubscriber {
17
+ listenTo() {
18
+ return organization_1.Employee;
19
+ }
20
+ async beforeUpdate(event) {
21
+ const id = event.entity?.id;
22
+ if (!id)
23
+ return;
24
+ BEFORE.set(event.entity, (0, legal_registration_service_1.centreEmployeeStateOf)(await event.manager.getRepository(organization_1.Employee).findOne({ where: { id } })));
25
+ }
26
+ async afterUpdate(event) {
27
+ const id = event.entity?.id;
28
+ if (!id || !BEFORE.has(event.entity))
29
+ return;
30
+ await this.note(event.manager, id, BEFORE.get(event.entity) ?? null);
31
+ }
32
+ async afterInsert(event) {
33
+ const id = event.entity?.id;
34
+ if (id)
35
+ await this.note(event.manager, id, null);
36
+ }
37
+ async note(manager, id, before) {
38
+ try {
39
+ await (0, legal_registration_service_1.noteCentreEmployeeChange)(manager, id, before);
40
+ }
41
+ catch (error) {
42
+ env_1.logger.error(`[Compliance] the research centre change of employee ${id} was not written: ${error?.message ?? error}`);
43
+ }
44
+ }
45
+ };
46
+ exports.ResearchCentreEmployeeSubscriber = ResearchCentreEmployeeSubscriber;
47
+ exports.ResearchCentreEmployeeSubscriber = ResearchCentreEmployeeSubscriber = tslib_1.__decorate([
48
+ (0, typeorm_1.EventSubscriber)()
49
+ ], ResearchCentreEmployeeSubscriber);
50
+ //# sourceMappingURL=centre-change-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"centre-change-subscriber.js","sourceRoot":"","sources":["../../../server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AAY,EAAE,EAAU,EAAE,MAAkC;QAC7E,IAAI,CAAC;YACH,MAAM,IAAA,qDAAwB,EAAC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAM,CAAC,KAAK,CAAC,uDAAuD,EAAE,qBAAqB,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,CAAC,CAAA;QACvH,CAAC;IACH,CAAC;CACF,CAAA;AA7BY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,yBAAe,GAAE;GACL,gCAAgC,CA6B5C","sourcesContent":["import { EntitySubscriberInterface, EventSubscriber, InsertEvent, UpdateEvent } from 'typeorm'\n\nimport { logger } from '@things-factory/env'\nimport { Employee } from '@things-factory/organization'\n\nimport { centreEmployeeStateOf, noteCentreEmployeeChange } from './legal-registration-service'\nimport { CentreEmployeeState } from './legal-registration-rules'\n\n/*\n * organization emits nothing of its own when an employee joins, moves or leaves - it saves the `Employee` row. The\n * research centre listens to that save (ADR-0187 decision 23): the row as it was is read before the update, the row\n * as it is after, in the same transaction. A centre change that cannot be written is logged, never a reason to refuse\n * the organization's save.\n */\n\nconst BEFORE = new WeakMap<object, CentreEmployeeState | null>()\n\n@EventSubscriber()\nexport class ResearchCentreEmployeeSubscriber implements EntitySubscriberInterface<Employee> {\n listenTo() {\n return Employee\n }\n\n async beforeUpdate(event: UpdateEvent<Employee>): Promise<void> {\n const id = (event.entity as any)?.id\n if (!id) return\n BEFORE.set(event.entity as object, centreEmployeeStateOf(await event.manager.getRepository(Employee).findOne({ where: { id } as any })))\n }\n\n async afterUpdate(event: UpdateEvent<Employee>): Promise<void> {\n const id = (event.entity as any)?.id\n if (!id || !BEFORE.has(event.entity as object)) return\n await this.note(event.manager, id, BEFORE.get(event.entity as object) ?? null)\n }\n\n async afterInsert(event: InsertEvent<Employee>): Promise<void> {\n const id = (event.entity as any)?.id\n if (id) await this.note(event.manager, id, null)\n }\n\n private async note(manager: any, id: string, before: CentreEmployeeState | null) {\n try {\n await noteCentreEmployeeChange(manager, id, before)\n } catch (error) {\n logger.error(`[Compliance] the research centre change of employee ${id} was not written: ${error?.message ?? error}`)\n }\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { ResearchCentreEmployeeSubscriber } from './centre-change-subscriber';
2
+ import { LegalCentreChange, LegalRegistration, LegalResearcher } from './legal-registration';
3
+ import { LegalRegistrationMutation } from './legal-registration-mutation';
4
+ import { LegalCentreChangeQuery, LegalRegistrationQuery, LegalResearcherQuery } from './legal-registration-query';
5
+ export declare const entities: (typeof LegalRegistration | typeof LegalResearcher | typeof LegalCentreChange)[];
6
+ export declare const resolvers: (typeof LegalRegistrationMutation | typeof LegalRegistrationQuery | typeof LegalResearcherQuery | typeof LegalCentreChangeQuery)[];
7
+ export declare const subscribers: (typeof ResearchCentreEmployeeSubscriber)[];
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const centre_change_subscriber_1 = require("./centre-change-subscriber");
5
+ const legal_registration_1 = require("./legal-registration");
6
+ const legal_registration_mutation_1 = require("./legal-registration-mutation");
7
+ const legal_registration_query_1 = require("./legal-registration-query");
8
+ exports.entities = [legal_registration_1.LegalRegistration, legal_registration_1.LegalResearcher, legal_registration_1.LegalCentreChange];
9
+ exports.resolvers = [legal_registration_query_1.LegalRegistrationQuery, legal_registration_query_1.LegalResearcherQuery, legal_registration_query_1.LegalCentreChangeQuery, legal_registration_mutation_1.LegalRegistrationMutation];
10
+ exports.subscribers = [centre_change_subscriber_1.ResearchCentreEmployeeSubscriber];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/legal-registration/index.ts"],"names":[],"mappings":";;;AAAA,yEAA6E;AAC7E,6DAA4F;AAC5F,+EAAyE;AACzE,yEAAiH;AAEpG,QAAA,QAAQ,GAAG,CAAC,sCAAiB,EAAE,oCAAe,EAAE,sCAAiB,CAAC,CAAA;AAClE,QAAA,SAAS,GAAG,CAAC,iDAAsB,EAAE,+CAAoB,EAAE,iDAAsB,EAAE,uDAAyB,CAAC,CAAA;AAC7G,QAAA,WAAW,GAAG,CAAC,2DAAgC,CAAC,CAAA","sourcesContent":["import { ResearchCentreEmployeeSubscriber } from './centre-change-subscriber'\nimport { LegalCentreChange, LegalRegistration, LegalResearcher } from './legal-registration'\nimport { LegalRegistrationMutation } from './legal-registration-mutation'\nimport { LegalCentreChangeQuery, LegalRegistrationQuery, LegalResearcherQuery } from './legal-registration-query'\n\nexport const entities = [LegalRegistration, LegalResearcher, LegalCentreChange]\nexport const resolvers = [LegalRegistrationQuery, LegalResearcherQuery, LegalCentreChangeQuery, LegalRegistrationMutation]\nexport const subscribers = [ResearchCentreEmployeeSubscriber]\n"]}
@@ -0,0 +1,10 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { Attachment } from '@things-factory/attachment-base';
3
+ import { LegalCentreChange, LegalRegistration, LegalResearcher } from './legal-registration';
4
+ import { LegalCentreChangePatch, LegalRegistrationPatch, LegalResearcherPatch } from './legal-registration-type';
5
+ export declare class LegalRegistrationMutation {
6
+ updateMultipleLegalRegistration(patches: LegalRegistrationPatch[], context: ResolverContext): Promise<LegalRegistration[]>;
7
+ updateMultipleLegalResearcher(registrationId: string, patches: LegalResearcherPatch[], context: ResolverContext): Promise<LegalResearcher[]>;
8
+ fileLegalCentreChanges(patches: LegalCentreChangePatch[], context: ResolverContext): Promise<LegalCentreChange[]>;
9
+ attachLegalRegistrationFiles(id: string, files: FileUpload[], context: ResolverContext): Promise<Attachment[]>;
10
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegalRegistrationMutation = 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 attachment_base_1 = require("@things-factory/attachment-base");
8
+ const shell_1 = require("@things-factory/shell");
9
+ const legal_record_support_1 = require("../legal-record/legal-record-support");
10
+ const legal_registration_1 = require("./legal-registration");
11
+ const legal_registration_service_1 = require("./legal-registration-service");
12
+ const legal_registration_type_1 = require("./legal-registration-type");
13
+ let LegalRegistrationMutation = class LegalRegistrationMutation {
14
+ async updateMultipleLegalRegistration(patches, context) {
15
+ return await (0, legal_registration_service_1.saveLegalRegistrations)(patches, context);
16
+ }
17
+ async updateMultipleLegalResearcher(registrationId, patches, context) {
18
+ return await (0, legal_registration_service_1.saveLegalResearchers)(registrationId, patches, context);
19
+ }
20
+ async fileLegalCentreChanges(patches, context) {
21
+ return await (0, legal_registration_service_1.fileCentreChanges)(patches, context);
22
+ }
23
+ async attachLegalRegistrationFiles(id, files, context) {
24
+ const { domain, tx } = context.state;
25
+ if (!(await tx.getRepository(legal_registration_1.LegalRegistration).count({ where: { id, domain: { id: domain.id } } })))
26
+ throw new shell_1.Refusal('legal-registration-not-found', {}, 'the record was not found. reload and try again.');
27
+ return await (0, legal_record_support_1.attachFilesTo)(legal_registration_service_1.LEGAL_REGISTRATION_REF_TYPE, id, files, context);
28
+ }
29
+ };
30
+ exports.LegalRegistrationMutation = LegalRegistrationMutation;
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Directive)('@privilege(category: "legal-registration", privilege: "mutation", domainOwnerGranted: true)'),
33
+ (0, type_graphql_1.Directive)('@transaction'),
34
+ (0, type_graphql_1.Mutation)(returns => [legal_registration_1.LegalRegistration], { description: 'To write the new and changed rows of the ledger - a row is never deleted, it is ended' }),
35
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [legal_registration_type_1.LegalRegistrationPatch])),
36
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
37
+ tslib_1.__metadata("design:type", Function),
38
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
39
+ tslib_1.__metadata("design:returntype", Promise)
40
+ ], LegalRegistrationMutation.prototype, "updateMultipleLegalRegistration", null);
41
+ tslib_1.__decorate([
42
+ (0, type_graphql_1.Directive)('@privilege(category: "legal-registration", privilege: "mutation", domainOwnerGranted: true)'),
43
+ (0, type_graphql_1.Directive)('@transaction'),
44
+ (0, type_graphql_1.Mutation)(returns => [legal_registration_1.LegalResearcher], { description: 'To write the researchers of a research centre - listed from a day, ended on a day' }),
45
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('registrationId')),
46
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [legal_registration_type_1.LegalResearcherPatch])),
47
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
48
+ tslib_1.__metadata("design:type", Function),
49
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
50
+ tslib_1.__metadata("design:returntype", Promise)
51
+ ], LegalRegistrationMutation.prototype, "updateMultipleLegalResearcher", null);
52
+ tslib_1.__decorate([
53
+ (0, type_graphql_1.Directive)('@privilege(category: "legal-registration", privilege: "mutation", domainOwnerGranted: true)'),
54
+ (0, type_graphql_1.Directive)('@transaction'),
55
+ (0, type_graphql_1.Mutation)(returns => [legal_registration_1.LegalCentreChange], { description: "To write the day a research centre's change was filed - which closes its to-do" }),
56
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [legal_registration_type_1.LegalCentreChangePatch])),
57
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
58
+ tslib_1.__metadata("design:type", Function),
59
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
60
+ tslib_1.__metadata("design:returntype", Promise)
61
+ ], LegalRegistrationMutation.prototype, "fileLegalCentreChanges", null);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Directive)('@privilege(category: "legal-registration", privilege: "mutation", domainOwnerGranted: true)'),
64
+ (0, type_graphql_1.Directive)('@transaction'),
65
+ (0, type_graphql_1.Mutation)(returns => [attachment_base_1.Attachment], { description: 'To attach files to a registration - a file attached is kept' }),
66
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
67
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('files', type => [GraphQLUpload_js_1.default])),
68
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
69
+ tslib_1.__metadata("design:type", Function),
70
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
71
+ tslib_1.__metadata("design:returntype", Promise)
72
+ ], LegalRegistrationMutation.prototype, "attachLegalRegistrationFiles", null);
73
+ exports.LegalRegistrationMutation = LegalRegistrationMutation = tslib_1.__decorate([
74
+ (0, type_graphql_1.Resolver)(legal_registration_1.LegalRegistration),
75
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
76
+ ], LegalRegistrationMutation);
77
+ //# sourceMappingURL=legal-registration-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-registration-mutation.js","sourceRoot":"","sources":["../../../server/service/legal-registration/legal-registration-mutation.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAqF;AAErF,qEAA4D;AAC5D,iDAA8D;AAE9D,+EAAoE;AACpE,6DAA4F;AAC5F,6EAA2I;AAC3I,uEAAgH;AAIzG,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAI9B,AAAN,KAAK,CAAC,+BAA+B,CAAmD,OAAiC,EAAS,OAAwB;QACxJ,OAAO,MAAM,IAAA,mDAAsB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAKK,AAAN,KAAK,CAAC,6BAA6B,CACV,cAAsB,EACG,OAA+B,EACxE,OAAwB;QAE/B,OAAO,MAAM,IAAA,iDAAoB,EAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACrE,CAAC;IAKK,AAAN,KAAK,CAAC,sBAAsB,CAAmD,OAAiC,EAAS,OAAwB;QAC/I,OAAO,MAAM,IAAA,8CAAiB,EAAC,OAAO,EA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S,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,8CAAoB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8EAGP;AAKK;IAHL,IAAA,wBAAS,EAAC,6FAA6F,CAAC;IACxG,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,gFAAgF,EAAE,CAAC;IAC9G,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,gDAAsB,CAAC,CAAC,CAAA;IAAqC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAEvH;AAKK;IAHL,IAAA,wBAAS,EAAC,6FAA6F,CAAC;IACxG,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;IAC9E,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAa,CAAC,CAAC,CAAA;IAAuB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6EAI3H;oCAjCU,yBAAyB;IAFrC,IAAA,uBAAQ,EAAC,sCAAiB,CAAC;IAC3B,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,yBAAyB,CAkCrC","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 { Attachment } from '@things-factory/attachment-base'\nimport { Refusal, SpeakRefusals } from '@things-factory/shell'\n\nimport { attachFilesTo } from '../legal-record/legal-record-support'\nimport { LegalCentreChange, LegalRegistration, LegalResearcher } from './legal-registration'\nimport { fileCentreChanges, LEGAL_REGISTRATION_REF_TYPE, saveLegalRegistrations, saveLegalResearchers } from './legal-registration-service'\nimport { LegalCentreChangePatch, LegalRegistrationPatch, LegalResearcherPatch } from './legal-registration-type'\n\n@Resolver(LegalRegistration)\n@UseMiddleware(SpeakRefusals)\nexport class LegalRegistrationMutation {\n @Directive('@privilege(category: \"legal-registration\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [LegalRegistration], { description: 'To write the new and changed rows of the ledger - a row is never deleted, it is ended' })\n async updateMultipleLegalRegistration(@Arg('patches', type => [LegalRegistrationPatch]) patches: LegalRegistrationPatch[], @Ctx() context: ResolverContext): Promise<LegalRegistration[]> {\n return await saveLegalRegistrations(patches, context)\n }\n\n @Directive('@privilege(category: \"legal-registration\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [LegalResearcher], { description: 'To write the researchers of a research centre - listed from a day, ended on a day' })\n async updateMultipleLegalResearcher(\n @Arg('registrationId') registrationId: string,\n @Arg('patches', type => [LegalResearcherPatch]) patches: LegalResearcherPatch[],\n @Ctx() context: ResolverContext\n ): Promise<LegalResearcher[]> {\n return await saveLegalResearchers(registrationId, patches, context)\n }\n\n @Directive('@privilege(category: \"legal-registration\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [LegalCentreChange], { description: \"To write the day a research centre's change was filed - which closes its to-do\" })\n async fileLegalCentreChanges(@Arg('patches', type => [LegalCentreChangePatch]) patches: LegalCentreChangePatch[], @Ctx() context: ResolverContext): Promise<LegalCentreChange[]> {\n return await fileCentreChanges(patches, context)\n }\n\n @Directive('@privilege(category: \"legal-registration\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [Attachment], { description: 'To attach files to a registration - a file attached is kept' })\n async attachLegalRegistrationFiles(@Arg('id') id: string, @Arg('files', type => [GraphQLUpload]) files: FileUpload[], @Ctx() context: ResolverContext): Promise<Attachment[]> {\n const { domain, tx } = context.state\n if (!(await tx.getRepository(LegalRegistration).count({ where: { id, domain: { id: domain.id } } as any }))) throw new Refusal('legal-registration-not-found', {}, 'the record was not found. reload and try again.')\n return await attachFilesTo(LEGAL_REGISTRATION_REF_TYPE, id, files, context)\n }\n}\n"]}