@things-factory/compliance 0.0.0-stage → 10.1.255

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 +37 -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 +612 -0
  351. package/translations/es.json +612 -0
  352. package/translations/ja.json +612 -0
  353. package/translations/ko.json +612 -0
  354. package/translations/ms.json +612 -0
  355. package/translations/zh.json +612 -0
  356. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8DAAmC;AACnC,oEAAyC;AACzC,mEAAwC;AACxC,sEAA2C;AAC3C,kEAAuC;AACvC,wEAA6C;AAC7C,uEAA4C;AAC5C,sEAA6J;AAApJ,gIAAA,0BAA0B,OAAA;AAAE,4HAAA,sBAAsB,OAAA;AAAE,mIAAA,6BAA6B,OAAA;AAAE,8HAAA,wBAAwB,OAAA;AACpH,8DAAmC;AACnC,oEAAyC;AACzC,oEAAyC;AACzC,mEAAwC;AACxC,sEAA2C;AAC3C,qEAA0C;AAC1C,0DAAyF;AAAhF,wHAAA,uBAAuB,OAAA;AAAE,sHAAA,qBAAqB,OAAA;AACvD,kEAAgE;AAAvD,sHAAA,iBAAiB,OAAA;AAC1B,8DAAmC;AACnC,4EAAiD;AACjD,kFAAuD;AACvD,iFAAsD;AACtD,oFAAyD;AACzD,qDAA+D;AAAtD,8HAAA,2BAA2B,OAAA;AACpC,0EAA+C;AAC/C,gFAAqD;AACrD,+EAAoD;AACpD,kFAAuD;AACvD,kFAAuD;AACvD,wFAA6D;AAC7D,uFAA4D;AAC5D,8FAA6S;AAApS,oIAAA,sBAAsB,OAAA;AAAE,kIAAA,oBAAoB,OAAA;AAAE,+HAAA,iBAAiB,OAAA;AAAE,sIAAA,wBAAwB,OAAA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AAiH;AACpG,QAAA,WAAW,GAAG,CAAC,GAAG,gCAA4B,CAAC,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './seal-use/seal-use'\nexport * from './seal-use/seal-use-rules'\nexport * from './seal-use/seal-use-type'\nexport * from './seal-use/seal-use-service'\nexport * from './regulation/regulation'\nexport * from './regulation/regulation-rules'\nexport * from './regulation/regulation-type'\nexport { REGULATION_ADOPTED_TRIGGER, REGULATION_HELP_SOURCE, REGULATION_PROCEDURE_REF_TYPE, regulationsWithoutFiling } from './regulation/regulation-service'\nexport * from './training/training'\nexport * from './training/training-kinds'\nexport * from './training/training-rules'\nexport * from './training/training-type'\nexport * from './training/training-service'\nexport * from './training/training-checks'\nexport { TRAINING_STANDINGS_READ, TRAINING_READ_TARGETS } from './training/training-read'\nexport { registerTrainings } from './training/training-register'\nexport * from './common/correction'\nexport * from './compliance-case/compliance-case'\nexport * from './compliance-case/compliance-case-rules'\nexport * from './compliance-case/compliance-case-type'\nexport * from './compliance-case/compliance-case-service'\nexport { registerComplianceCaseFiles } from './compliance-case'\nexport * from './privacy-record/privacy-record'\nexport * from './privacy-record/privacy-record-rules'\nexport * from './privacy-record/privacy-record-type'\nexport * from './privacy-record/privacy-record-service'\nexport * from './legal-registration/legal-registration'\nexport * from './legal-registration/legal-registration-rules'\nexport * from './legal-registration/legal-registration-type'\nexport { saveLegalRegistrations, saveLegalResearchers, fileCentreChanges, noteCentreEmployeeChange, legalRegistrationsExpiring, legalRegistrationsInRenewalWindow, legalRegistrationFeesDue, legalCentreChangesNotFiled, LEGAL_REGISTRATION_REF_TYPE } from './legal-registration/legal-registration-service'\nexport * from './invention/invention'\nexport * from './invention/invention-rules'\nexport * from './invention/invention-type'\nexport { reportInvention, visibleInvention, updateInventions, saveInventionRewards, inventionDecisionsDue, INVENTION_REF_TYPE } from './invention/invention-service'\nexport * from './dispute/dispute'\nexport * from './dispute/dispute-rules'\nexport * from './dispute/dispute-type'\nexport { saveDisputes, saveDisputeHearings, disputeHearingsSoon, DISPUTE_REF_TYPE } from './dispute/dispute-service'\nexport { registerLegalRecordFiles } from './legal-record/attachment-readers'\nexport * from './common/employee-reader'\nexport * from './common/legal-todo'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as SealUseEntities, resolvers as SealUseResolvers } from './seal-use'\nimport { entities as RegulationEntities, resolvers as RegulationResolvers } from './regulation'\nimport { entities as TrainingEntities, resolvers as TrainingResolvers } from './training'\nimport { entities as CorrectionEntities } from './common/correction'\nimport { entities as ComplianceCaseEntities, resolvers as ComplianceCaseResolvers } from './compliance-case'\nimport { entities as PrivacyRecordEntities, resolvers as PrivacyRecordResolvers } from './privacy-record'\nimport { entities as LegalRegistrationEntities, resolvers as LegalRegistrationResolvers, subscribers as LegalRegistrationSubscribers } from './legal-registration'\nimport { entities as InventionEntities, resolvers as InventionResolvers } from './invention'\nimport { entities as DisputeEntities, resolvers as DisputeResolvers } from './dispute'\n\nexport const entities = [\n /* ENTITIES */\n ...SealUseEntities,\n ...RegulationEntities,\n ...TrainingEntities,\n ...CorrectionEntities,\n ...ComplianceCaseEntities,\n ...PrivacyRecordEntities,\n ...LegalRegistrationEntities,\n ...InventionEntities,\n ...DisputeEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...SealUseResolvers,\n ...RegulationResolvers,\n ...TrainingResolvers,\n ...ComplianceCaseResolvers,\n ...PrivacyRecordResolvers,\n ...LegalRegistrationResolvers,\n ...InventionResolvers,\n ...DisputeResolvers\n ]\n}\n\n/* A research centre's change of staff is caught where organization saves the employee (ADR-0187 decision 23). */\nexport const subscribers = [...LegalRegistrationSubscribers]\n"]}
@@ -0,0 +1,5 @@
1
+ import { Invention, InventionInventor, InventionReward } from './invention';
2
+ import { InventionMutation } from './invention-mutation';
3
+ import { InventionQuery } from './invention-query';
4
+ export declare const entities: (typeof Invention | typeof InventionInventor | typeof InventionReward)[];
5
+ export declare const resolvers: (typeof InventionMutation | typeof InventionQuery)[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const invention_1 = require("./invention");
5
+ const invention_mutation_1 = require("./invention-mutation");
6
+ const invention_query_1 = require("./invention-query");
7
+ exports.entities = [invention_1.Invention, invention_1.InventionInventor, invention_1.InventionReward];
8
+ exports.resolvers = [invention_query_1.InventionQuery, invention_mutation_1.InventionMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/invention/index.ts"],"names":[],"mappings":";;;AAAA,2CAA2E;AAC3E,6DAAwD;AACxD,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,qBAAS,EAAE,6BAAiB,EAAE,2BAAe,CAAC,CAAA;AAC1D,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA","sourcesContent":["import { Invention, InventionInventor, InventionReward } from './invention'\nimport { InventionMutation } from './invention-mutation'\nimport { InventionQuery } from './invention-query'\n\nexport const entities = [Invention, InventionInventor, InventionReward]\nexport const resolvers = [InventionQuery, InventionMutation]\n"]}
@@ -0,0 +1,10 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { Attachment } from '@things-factory/attachment-base';
3
+ import { Invention, InventionReward } from './invention';
4
+ import { InventionPatch, InventionRewardPatch, NewInvention } from './invention-type';
5
+ export declare class InventionMutation {
6
+ reportInvention(invention: NewInvention, files: FileUpload[], context: ResolverContext): Promise<Invention>;
7
+ attachInventionFiles(id: string, files: FileUpload[], context: ResolverContext): Promise<Attachment[]>;
8
+ updateMultipleInvention(patches: InventionPatch[], context: ResolverContext): Promise<Invention[]>;
9
+ updateMultipleInventionReward(inventionId: string, patches: InventionRewardPatch[], context: ResolverContext): Promise<InventionReward[]>;
10
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InventionMutation = 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 invention_1 = require("./invention");
11
+ const invention_service_1 = require("./invention-service");
12
+ const invention_type_1 = require("./invention-type");
13
+ let InventionMutation = class InventionMutation {
14
+ /* An employee's door - the reporter is refused unless an employee still working here. */
15
+ async reportInvention(invention, files, context) {
16
+ const saved = await (0, invention_service_1.reportInvention)(invention, context);
17
+ if (files?.length)
18
+ await (0, legal_record_support_1.attachFilesTo)(invention_service_1.INVENTION_REF_TYPE, saved.id, files, context);
19
+ return saved;
20
+ }
21
+ /* Its inventors and the keepers of the records - `visibleInvention` refuses anyone else. */
22
+ async attachInventionFiles(id, files, context) {
23
+ await (0, invention_service_1.visibleInvention)(id, context);
24
+ return await (0, legal_record_support_1.attachFilesTo)(invention_service_1.INVENTION_REF_TYPE, id, files, context);
25
+ }
26
+ async updateMultipleInvention(patches, context) {
27
+ return await (0, invention_service_1.updateInventions)(patches, context);
28
+ }
29
+ async updateMultipleInventionReward(inventionId, patches, context) {
30
+ return await (0, invention_service_1.saveInventionRewards)(inventionId, patches, context);
31
+ }
32
+ };
33
+ exports.InventionMutation = InventionMutation;
34
+ tslib_1.__decorate([
35
+ (0, type_graphql_1.Directive)('@transaction'),
36
+ (0, type_graphql_1.Mutation)(returns => invention_1.Invention, { description: 'To report an invention to the company (발명진흥법 §12) - the reporter is one of its inventors' }),
37
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('invention', type => invention_type_1.NewInvention)),
38
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('files', type => [GraphQLUpload_js_1.default], { nullable: true })),
39
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
40
+ tslib_1.__metadata("design:type", Function),
41
+ tslib_1.__metadata("design:paramtypes", [invention_type_1.NewInvention, Array, Object]),
42
+ tslib_1.__metadata("design:returntype", Promise)
43
+ ], InventionMutation.prototype, "reportInvention", null);
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Directive)('@transaction'),
46
+ (0, type_graphql_1.Mutation)(returns => [attachment_base_1.Attachment], { description: 'To attach files to an invention - a file attached is kept' }),
47
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
48
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('files', type => [GraphQLUpload_js_1.default])),
49
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
50
+ tslib_1.__metadata("design:type", Function),
51
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
52
+ tslib_1.__metadata("design:returntype", Promise)
53
+ ], InventionMutation.prototype, "attachInventionFiles", null);
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.Directive)('@privilege(category: "invention", privilege: "mutation", domainOwnerGranted: true)'),
56
+ (0, type_graphql_1.Directive)('@transaction'),
57
+ (0, type_graphql_1.Mutation)(returns => [invention_1.Invention], { description: 'To write what the company decided and told, the patent filed and the notes - an invention is never deleted' }),
58
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [invention_type_1.InventionPatch])),
59
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
62
+ tslib_1.__metadata("design:returntype", Promise)
63
+ ], InventionMutation.prototype, "updateMultipleInvention", null);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Directive)('@privilege(category: "invention", privilege: "mutation", domainOwnerGranted: true)'),
66
+ (0, type_graphql_1.Directive)('@transaction'),
67
+ (0, type_graphql_1.Mutation)(returns => [invention_1.InventionReward], { description: 'To write the rewards paid for an invention (발명진흥법 §15)' }),
68
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('inventionId')),
69
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [invention_type_1.InventionRewardPatch])),
70
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
73
+ tslib_1.__metadata("design:returntype", Promise)
74
+ ], InventionMutation.prototype, "updateMultipleInventionReward", null);
75
+ exports.InventionMutation = InventionMutation = tslib_1.__decorate([
76
+ (0, type_graphql_1.Resolver)(invention_1.Invention),
77
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
78
+ ], InventionMutation);
79
+ //# sourceMappingURL=invention-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invention-mutation.js","sourceRoot":"","sources":["../../../server/service/invention/invention-mutation.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAqF;AAErF,qEAA4D;AAC5D,iDAAqD;AAErD,+EAAoE;AACpE,2CAAwD;AACxD,2DAAmI;AACnI,qDAAqF;AAI9E,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,yFAAyF;IAGnF,AAAN,KAAK,CAAC,eAAe,CACqB,SAAuB,EACJ,KAAmB,EACvE,OAAwB;QAE/B,MAAM,KAAK,GAAG,MAAM,IAAA,mCAAe,EAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QACvD,IAAI,KAAK,EAAE,MAAM;YAAE,MAAM,IAAA,oCAAa,EAAC,sCAAkB,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;QACpF,OAAO,KAAK,CAAA;IACd,CAAC;IAED,4FAA4F;IAGtF,AAAN,KAAK,CAAC,oBAAoB,CAAY,EAAU,EAAyC,KAAmB,EAAS,OAAwB;QAC3I,MAAM,IAAA,oCAAgB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,OAAO,MAAM,IAAA,oCAAa,EAAC,sCAAkB,EAAE,EAAE,EAAE,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AS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,EAAE,EAAE,WAAW,EAAE,4GAA4G,EAAE,CAAC;IACjI,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAc,CAAC,CAAC,CAAA;IAA6B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gEAExG;AAKK;IAHL,IAAA,wBAAS,EAAC,oFAAoF,CAAC;IAC/F,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,2BAAe,CAAC,EAAE,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;IAE/G,mBAAA,IAAA,kBAAG,EAAC,aAAa,CAAC,CAAA;IAClB,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAoB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEAGP;4BAtCU,iBAAiB;IAF7B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;IACnB,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,iBAAiB,CAuC7B","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 { SpeakRefusals } from '@things-factory/shell'\n\nimport { attachFilesTo } from '../legal-record/legal-record-support'\nimport { Invention, InventionReward } from './invention'\nimport { INVENTION_REF_TYPE, reportInvention, saveInventionRewards, updateInventions, visibleInvention } from './invention-service'\nimport { InventionPatch, InventionRewardPatch, NewInvention } from './invention-type'\n\n@Resolver(Invention)\n@UseMiddleware(SpeakRefusals)\nexport class InventionMutation {\n /* An employee's door - the reporter is refused unless an employee still working here. */\n @Directive('@transaction')\n @Mutation(returns => Invention, { description: 'To report an invention to the company (발명진흥법 §12) - the reporter is one of its inventors' })\n async reportInvention(\n @Arg('invention', type => NewInvention) invention: NewInvention,\n @Arg('files', type => [GraphQLUpload], { nullable: true }) files: FileUpload[],\n @Ctx() context: ResolverContext\n ): Promise<Invention> {\n const saved = await reportInvention(invention, context)\n if (files?.length) await attachFilesTo(INVENTION_REF_TYPE, saved.id, files, context)\n return saved\n }\n\n /* Its inventors and the keepers of the records - `visibleInvention` refuses anyone else. */\n @Directive('@transaction')\n @Mutation(returns => [Attachment], { description: 'To attach files to an invention - a file attached is kept' })\n async attachInventionFiles(@Arg('id') id: string, @Arg('files', type => [GraphQLUpload]) files: FileUpload[], @Ctx() context: ResolverContext): Promise<Attachment[]> {\n await visibleInvention(id, context)\n return await attachFilesTo(INVENTION_REF_TYPE, id, files, context)\n }\n\n @Directive('@privilege(category: \"invention\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [Invention], { description: 'To write what the company decided and told, the patent filed and the notes - an invention is never deleted' })\n async updateMultipleInvention(@Arg('patches', type => [InventionPatch]) patches: InventionPatch[], @Ctx() context: ResolverContext): Promise<Invention[]> {\n return await updateInventions(patches, context)\n }\n\n @Directive('@privilege(category: \"invention\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [InventionReward], { description: 'To write the rewards paid for an invention (발명진흥법 §15)' })\n async updateMultipleInventionReward(\n @Arg('inventionId') inventionId: string,\n @Arg('patches', type => [InventionRewardPatch]) patches: InventionRewardPatch[],\n @Ctx() context: ResolverContext\n ): Promise<InventionReward[]> {\n return await saveInventionRewards(inventionId, patches, context)\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Attachment } from '@things-factory/attachment-base';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { ListParam } from '@things-factory/shell';
4
+ import { LegalRegistration } from '../legal-registration/legal-registration';
5
+ import { Invention, InventionReward } from './invention';
6
+ import { InventionList, InventionPerson } from './invention-type';
7
+ export declare class InventionQuery {
8
+ inventions(params: ListParam, context: ResolverContext): Promise<InventionList>;
9
+ myInventions(context: ResolverContext): Promise<Invention[]>;
10
+ invention(id: string, context: ResolverContext): Promise<Invention>;
11
+ inventionColleagues(context: ResolverContext): Promise<InventionPerson[]>;
12
+ inventionFiles(id: string, context: ResolverContext): Promise<Attachment[]>;
13
+ inventors(row: Invention): Promise<InventionPerson[]>;
14
+ rewards(row: Invention): Promise<InventionReward[]>;
15
+ filing(row: Invention): Promise<LegalRegistration | null>;
16
+ creator(row: Invention): Promise<User | null>;
17
+ updater(row: Invention): Promise<User | null>;
18
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InventionQuery = 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 shell_1 = require("@things-factory/shell");
9
+ const legal_registration_1 = require("../legal-registration/legal-registration");
10
+ const legal_record_support_1 = require("../legal-record/legal-record-support");
11
+ const invention_1 = require("./invention");
12
+ const invention_service_1 = require("./invention-service");
13
+ const invention_type_1 = require("./invention-type");
14
+ /** The list's own narrowing - the undecided - asked by name, answered here. */
15
+ const OWN_FILTERS = ['undecided'];
16
+ let InventionQuery = class InventionQuery {
17
+ async inventions(params, context) {
18
+ const asked = (name) => params.filters?.some(one => one.name === name && one.value !== false);
19
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
+ domain: context.state.domain,
21
+ params: { ...params, filters: params.filters?.filter(one => !OWN_FILTERS.includes(one.name)) },
22
+ repository: (0, shell_1.getRepository)(invention_1.Invention),
23
+ searchables: ['title', 'content', 'notes'],
24
+ alias: 'invention',
25
+ defaultSortings: [{ name: 'reportedOn', desc: true }]
26
+ });
27
+ if (asked('undecided'))
28
+ queryBuilder.andWhere('invention.decision IS NULL');
29
+ const [items, total] = await queryBuilder.getManyAndCount();
30
+ return { items, total };
31
+ }
32
+ /* An employee's door - what one reports, one reads; the keepers read every one through `inventions`. */
33
+ async myInventions(context) {
34
+ return await (0, invention_service_1.myInventions)(context);
35
+ }
36
+ async invention(id, context) {
37
+ return await (0, invention_service_1.visibleInvention)(id, context);
38
+ }
39
+ async inventionColleagues(context) {
40
+ return await (0, invention_service_1.inventionColleagues)(context);
41
+ }
42
+ async inventionFiles(id, context) {
43
+ await (0, invention_service_1.visibleInvention)(id, context);
44
+ return await (0, legal_record_support_1.filesOf)((0, legal_record_support_1.managerOf)(context), context.state.domain, invention_service_1.INVENTION_REF_TYPE, id);
45
+ }
46
+ async inventors(row) {
47
+ return await (0, invention_service_1.inventionInventorsOf)((0, shell_1.getRepository)(invention_1.Invention).manager, row.id);
48
+ }
49
+ async rewards(row) {
50
+ return await (0, invention_service_1.inventionRewardsOf)((0, shell_1.getRepository)(invention_1.Invention).manager, row.id);
51
+ }
52
+ async filing(row) {
53
+ return row.filingId ? await (0, shell_1.getRepository)(legal_registration_1.LegalRegistration).findOne({ where: { id: row.filingId } }) : null;
54
+ }
55
+ async creator(row) {
56
+ return row.creatorId ? await (0, shell_1.getRepository)(auth_base_1.User).findOne({ where: { id: row.creatorId } }) : null;
57
+ }
58
+ async updater(row) {
59
+ return row.updaterId ? await (0, shell_1.getRepository)(auth_base_1.User).findOne({ where: { id: row.updaterId } }) : null;
60
+ }
61
+ };
62
+ exports.InventionQuery = InventionQuery;
63
+ tslib_1.__decorate([
64
+ (0, type_graphql_1.Directive)('@privilege(category: "invention", privilege: "query", domainOwnerGranted: true)'),
65
+ (0, type_graphql_1.Query)(returns => invention_type_1.InventionList, { description: '직무발명 - the inventions reported to the company (ADR-0187 decision 24)' }),
66
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
67
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
68
+ tslib_1.__metadata("design:type", Function),
69
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
70
+ tslib_1.__metadata("design:returntype", Promise)
71
+ ], InventionQuery.prototype, "inventions", null);
72
+ tslib_1.__decorate([
73
+ (0, type_graphql_1.Query)(returns => [invention_1.Invention], { description: 'The inventions the caller is an inventor of' }),
74
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
75
+ tslib_1.__metadata("design:type", Function),
76
+ tslib_1.__metadata("design:paramtypes", [Object]),
77
+ tslib_1.__metadata("design:returntype", Promise)
78
+ ], InventionQuery.prototype, "myInventions", null);
79
+ tslib_1.__decorate([
80
+ (0, type_graphql_1.Query)(returns => invention_1.Invention, { description: 'One invention - for its inventors and the keepers of the records' }),
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
82
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], InventionQuery.prototype, "invention", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.Query)(returns => [invention_type_1.InventionPerson], { description: 'The employees working here, to name as co-inventors - who and where only' }),
89
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
90
+ tslib_1.__metadata("design:type", Function),
91
+ tslib_1.__metadata("design:paramtypes", [Object]),
92
+ tslib_1.__metadata("design:returntype", Promise)
93
+ ], InventionQuery.prototype, "inventionColleagues", null);
94
+ tslib_1.__decorate([
95
+ (0, type_graphql_1.Query)(returns => [attachment_base_1.Attachment], { description: 'The files of an invention - for its inventors and the keepers of the records' }),
96
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
97
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
98
+ tslib_1.__metadata("design:type", Function),
99
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
100
+ tslib_1.__metadata("design:returntype", Promise)
101
+ ], InventionQuery.prototype, "inventionFiles", null);
102
+ tslib_1.__decorate([
103
+ (0, type_graphql_1.FieldResolver)(type => [invention_type_1.InventionPerson], { description: 'Its inventors' }),
104
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
105
+ tslib_1.__metadata("design:type", Function),
106
+ tslib_1.__metadata("design:paramtypes", [invention_1.Invention]),
107
+ tslib_1.__metadata("design:returntype", Promise)
108
+ ], InventionQuery.prototype, "inventors", null);
109
+ tslib_1.__decorate([
110
+ (0, type_graphql_1.FieldResolver)(type => [invention_1.InventionReward], { description: 'The rewards paid for it' }),
111
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
112
+ tslib_1.__metadata("design:type", Function),
113
+ tslib_1.__metadata("design:paramtypes", [invention_1.Invention]),
114
+ tslib_1.__metadata("design:returntype", Promise)
115
+ ], InventionQuery.prototype, "rewards", null);
116
+ tslib_1.__decorate([
117
+ (0, type_graphql_1.FieldResolver)(type => legal_registration_1.LegalRegistration, { nullable: true, description: 'The patent filed for it' }),
118
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
119
+ tslib_1.__metadata("design:type", Function),
120
+ tslib_1.__metadata("design:paramtypes", [invention_1.Invention]),
121
+ tslib_1.__metadata("design:returntype", Promise)
122
+ ], InventionQuery.prototype, "filing", null);
123
+ tslib_1.__decorate([
124
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
125
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
126
+ tslib_1.__metadata("design:type", Function),
127
+ tslib_1.__metadata("design:paramtypes", [invention_1.Invention]),
128
+ tslib_1.__metadata("design:returntype", Promise)
129
+ ], InventionQuery.prototype, "creator", null);
130
+ tslib_1.__decorate([
131
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
132
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
133
+ tslib_1.__metadata("design:type", Function),
134
+ tslib_1.__metadata("design:paramtypes", [invention_1.Invention]),
135
+ tslib_1.__metadata("design:returntype", Promise)
136
+ ], InventionQuery.prototype, "updater", null);
137
+ exports.InventionQuery = InventionQuery = tslib_1.__decorate([
138
+ (0, type_graphql_1.Resolver)(invention_1.Invention),
139
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
140
+ ], InventionQuery);
141
+ //# sourceMappingURL=invention-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invention-query.js","sourceRoot":"","sources":["../../../server/service/invention/invention-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA6G;AAE7G,qEAA4D;AAC5D,yDAAgD;AAChD,iDAA8G;AAE9G,iFAA4E;AAC5E,+EAAyE;AACzE,2CAAwD;AACxD,2DAAuJ;AACvJ,qDAAiE;AAEjE,+EAA+E;AAC/E,MAAM,WAAW,GAAG,CAAC,WAAW,CAAC,CAAA;AAI1B,IAAM,cAAc,GAApB,MAAM,cAAc;IAGnB,AAAN,KAAK,CAAC,UAAU,CAA0B,MAAiB,EAAS,OAAwB;QAC1F,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;QACrG,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;YAC5B,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE;YAC9F,UAAU,EAAE,IAAA,qBAAa,EAAC,qBAAS,CAAC;YACpC,WAAW,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAA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AW,EAAE,yBAAyB,EAAE,CAAC;IACvF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,qBAAS;;4CAElC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9D,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,qBAAS;;6CAEnC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrE,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,qBAAS;;6CAEnC;yBA/DU,cAAc;IAF1B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;IACnB,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,cAAc,CAgE1B","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root, UseMiddleware } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { getQueryBuilderFromListParams, getRepository, ListParam, SpeakRefusals } from '@things-factory/shell'\n\nimport { LegalRegistration } from '../legal-registration/legal-registration'\nimport { filesOf, managerOf } from '../legal-record/legal-record-support'\nimport { Invention, InventionReward } from './invention'\nimport { INVENTION_REF_TYPE, inventionColleagues, inventionInventorsOf, myInventions, inventionRewardsOf, visibleInvention } from './invention-service'\nimport { InventionList, InventionPerson } from './invention-type'\n\n/** The list's own narrowing - the undecided - asked by name, answered here. */\nconst OWN_FILTERS = ['undecided']\n\n@Resolver(Invention)\n@UseMiddleware(SpeakRefusals)\nexport class InventionQuery {\n @Directive('@privilege(category: \"invention\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => InventionList, { description: '직무발명 - the inventions reported to the company (ADR-0187 decision 24)' })\n async inventions(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<InventionList> {\n const asked = (name: string) => params.filters?.some(one => one.name === name && one.value !== false)\n const queryBuilder = getQueryBuilderFromListParams({\n domain: context.state.domain,\n params: { ...params, filters: params.filters?.filter(one => !OWN_FILTERS.includes(one.name)) },\n repository: getRepository(Invention),\n searchables: ['title', 'content', 'notes'],\n alias: 'invention',\n defaultSortings: [{ name: 'reportedOn', desc: true }]\n })\n if (asked('undecided')) queryBuilder.andWhere('invention.decision IS NULL')\n const [items, total] = await queryBuilder.getManyAndCount()\n return { items, total }\n }\n\n /* An employee's door - what one reports, one reads; the keepers read every one through `inventions`. */\n @Query(returns => [Invention], { description: 'The inventions the caller is an inventor of' })\n async myInventions(@Ctx() context: ResolverContext): Promise<Invention[]> {\n return await myInventions(context)\n }\n\n @Query(returns => Invention, { description: 'One invention - for its inventors and the keepers of the records' })\n async invention(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Invention> {\n return await visibleInvention(id, context)\n }\n\n @Query(returns => [InventionPerson], { description: 'The employees working here, to name as co-inventors - who and where only' })\n async inventionColleagues(@Ctx() context: ResolverContext): Promise<InventionPerson[]> {\n return await inventionColleagues(context)\n }\n\n @Query(returns => [Attachment], { description: 'The files of an invention - for its inventors and the keepers of the records' })\n async inventionFiles(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Attachment[]> {\n await visibleInvention(id, context)\n return await filesOf(managerOf(context), context.state.domain, INVENTION_REF_TYPE, id)\n }\n\n @FieldResolver(type => [InventionPerson], { description: 'Its inventors' })\n async inventors(@Root() row: Invention): Promise<InventionPerson[]> {\n return await inventionInventorsOf(getRepository(Invention).manager, row.id)\n }\n\n @FieldResolver(type => [InventionReward], { description: 'The rewards paid for it' })\n async rewards(@Root() row: Invention): Promise<InventionReward[]> {\n return await inventionRewardsOf(getRepository(Invention).manager, row.id)\n }\n\n @FieldResolver(type => LegalRegistration, { nullable: true, description: 'The patent filed for it' })\n async filing(@Root() row: Invention): Promise<LegalRegistration | null> {\n return row.filingId ? await getRepository(LegalRegistration).findOne({ where: { id: row.filingId } }) : null\n }\n\n @FieldResolver(type => User, { nullable: true, description: 'Who wrote it' })\n async creator(@Root() row: Invention): Promise<User | null> {\n return row.creatorId ? await getRepository(User).findOne({ where: { id: row.creatorId } }) : null\n }\n\n @FieldResolver(type => User, { nullable: true, description: 'Who last changed it' })\n async updater(@Root() row: Invention): Promise<User | null> {\n return row.updaterId ? await getRepository(User).findOne({ where: { id: row.updaterId } }) : null\n }\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import { Refusal } from '@things-factory/shell';
2
+ /** Months from the report the company tells the inventors whether it succeeds to the right ⚖. */
3
+ export declare const INVENTION_DECISION_MONTHS = 4;
4
+ /** How far ahead an undecided report is raised by the management check. */
5
+ export declare const INVENTION_DECISION_NOTICE_DAYS = 30;
6
+ export declare const INVENTION_DECISIONS: string[];
7
+ export interface InventionReportInput {
8
+ title?: string | null;
9
+ content?: string | null;
10
+ reportedOn?: string | null;
11
+ inventorIds?: string[] | null;
12
+ }
13
+ /** What a report asks for before it is written, or nothing. */
14
+ export declare function inventionReportRefusal(input: InventionReportInput): Refusal | null;
15
+ /** The day the company is to tell its decision by - four months from the report. */
16
+ export declare const inventionDecisionDueOnOf: (reportedOn: string) => string;
17
+ /** A decision as it is told, or a refusal: one of the two, told on a day on or after the report. */
18
+ export declare function inventionDecisionRefusal(decision: string | null | undefined, toldOn: string | null | undefined, reportedOn: string): Refusal | null;
19
+ /** Not decided, and its decision due within 30 days or past. */
20
+ export declare const inventionDecisionDueSoon: (row: {
21
+ decision?: string | null;
22
+ decisionDueOn: string;
23
+ }, today: string) => boolean;
24
+ /** A reward as it is written, or a refusal. */
25
+ export declare function inventionRewardRefusal(input: {
26
+ amount?: number | null;
27
+ paidOn?: string | null;
28
+ }): Refusal | null;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inventionDecisionDueSoon = exports.inventionDecisionDueOnOf = exports.INVENTION_DECISIONS = exports.INVENTION_DECISION_NOTICE_DAYS = exports.INVENTION_DECISION_MONTHS = void 0;
4
+ exports.inventionReportRefusal = inventionReportRefusal;
5
+ exports.inventionDecisionRefusal = inventionDecisionRefusal;
6
+ exports.inventionRewardRefusal = inventionRewardRefusal;
7
+ const shell_1 = require("@things-factory/shell");
8
+ const days_1 = require("../legal-record/days");
9
+ /*
10
+ * 직무발명 (ADR-0187 decision 24 · 발명진흥법 §12 신고, §13 승계 여부 통지, §15 보상). Pure - the service reads the rows
11
+ * and the people, these say yes or no and count the days. The four months are ⚖ until a 변리사 confirms them.
12
+ */
13
+ /** Months from the report the company tells the inventors whether it succeeds to the right ⚖. */
14
+ exports.INVENTION_DECISION_MONTHS = 4;
15
+ /** How far ahead an undecided report is raised by the management check. */
16
+ exports.INVENTION_DECISION_NOTICE_DAYS = 30;
17
+ exports.INVENTION_DECISIONS = ['SUCCEED', 'WAIVE'];
18
+ /** What a report asks for before it is written, or nothing. */
19
+ function inventionReportRefusal(input) {
20
+ if (!input.title?.trim())
21
+ return new shell_1.Refusal('invention-title-required', {}, 'give the invention a title');
22
+ if (!input.content?.trim())
23
+ return new shell_1.Refusal('invention-content-required', {}, 'say what the invention is');
24
+ if (!(0, days_1.isDay)(input.reportedOn))
25
+ return new shell_1.Refusal('invention-reported-on-required', {}, 'give the day it is reported, YYYY-MM-DD');
26
+ if (!input.inventorIds?.length)
27
+ return new shell_1.Refusal('invention-inventors-required', {}, 'name the inventors');
28
+ return null;
29
+ }
30
+ /** The day the company is to tell its decision by - four months from the report. */
31
+ const inventionDecisionDueOnOf = (reportedOn) => (0, days_1.addMonths)(reportedOn, exports.INVENTION_DECISION_MONTHS);
32
+ exports.inventionDecisionDueOnOf = inventionDecisionDueOnOf;
33
+ /** A decision as it is told, or a refusal: one of the two, told on a day on or after the report. */
34
+ function inventionDecisionRefusal(decision, toldOn, reportedOn) {
35
+ if (!decision)
36
+ return toldOn ? new shell_1.Refusal('invention-decision-required', {}, 'say what was decided - succeed or waive') : null;
37
+ if (!exports.INVENTION_DECISIONS.includes(decision))
38
+ return new shell_1.Refusal('invention-decision-invalid', { decisions: exports.INVENTION_DECISIONS.join(', ') }, 'the decision is succeed or waive');
39
+ if (!(0, days_1.isDay)(toldOn) || toldOn < reportedOn)
40
+ return new shell_1.Refusal('invention-decision-told-on-required', { reportedOn }, `give the day the inventors were told, on or after ${reportedOn}`);
41
+ return null;
42
+ }
43
+ /** Not decided, and its decision due within 30 days or past. */
44
+ const inventionDecisionDueSoon = (row, today) => !row.decision && row.decisionDueOn <= (0, days_1.addDays)(today, exports.INVENTION_DECISION_NOTICE_DAYS);
45
+ exports.inventionDecisionDueSoon = inventionDecisionDueSoon;
46
+ /** A reward as it is written, or a refusal. */
47
+ function inventionRewardRefusal(input) {
48
+ if (!(typeof input.amount === 'number' && input.amount > 0))
49
+ return new shell_1.Refusal('invention-reward-amount-required', {}, 'the reward amount is more than 0');
50
+ if (input.paidOn && !(0, days_1.isDay)(input.paidOn))
51
+ return new shell_1.Refusal('invention-reward-paid-on-invalid', {}, 'the day paid is YYYY-MM-DD');
52
+ return null;
53
+ }
54
+ //# sourceMappingURL=invention-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invention-rules.js","sourceRoot":"","sources":["../../../server/service/invention/invention-rules.ts"],"names":[],"mappings":";;;AAwBA,wDAMC;AAMD,4DAKC;AAMD,wDAIC;AAnDD,iDAA+C;AAE/C,+CAAgE;AAEhE;;;GAGG;AAEH,iGAAiG;AACpF,QAAA,yBAAyB,GAAG,CAAC,CAAA;AAC1C,2EAA2E;AAC9D,QAAA,8BAA8B,GAAG,EAAE,CAAA;AAEnC,QAAA,mBAAmB,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AASvD,+DAA+D;AAC/D,SAAgB,sBAAsB,CAAC,KAA2B;IAChE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;QAAE,OAAO,IAAI,eAAO,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;IACvL,OAAO,IAAI,CAAA;AACb,CAAC;AAED,gEAAgE;AACzD,MAAM,wBAAwB,GAAG,CAAC,GAAwD,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,aAAa,IAAI,IAAA,cAAO,EAAC,KAAK,EAAE,sCAA8B,CAAC,CAAA;AAA5L,QAAA,wBAAwB,4BAAoK;AAEzM,+CAA+C;AAC/C,SAAgB,sBAAsB,CAAC,KAAyD;IAC9F,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,eAAO,CAAC,kCAAkC,EAAE,EAAE,EAAE,kCAAkC,CAAC,CAAA;IAC3J,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,IAAA,YAAK,EAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,eAAO,CAAC,kCAAkC,EAAE,EAAE,EAAE,4BAA4B,CAAC,CAAA;IAClI,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { Refusal } from '@things-factory/shell'\n\nimport { addDays, addMonths, isDay } from '../legal-record/days'\n\n/*\n * 직무발명 (ADR-0187 decision 24 · 발명진흥법 §12 신고, §13 승계 여부 통지, §15 보상). Pure - the service reads the rows\n * and the people, these say yes or no and count the days. The four months are ⚖ until a 변리사 confirms them.\n */\n\n/** Months from the report the company tells the inventors whether it succeeds to the right ⚖. */\nexport const INVENTION_DECISION_MONTHS = 4\n/** How far ahead an undecided report is raised by the management check. */\nexport const INVENTION_DECISION_NOTICE_DAYS = 30\n\nexport const INVENTION_DECISIONS = ['SUCCEED', 'WAIVE']\n\nexport interface InventionReportInput {\n title?: string | null\n content?: string | null\n reportedOn?: string | null\n inventorIds?: string[] | null\n}\n\n/** What a report asks for before it is written, or nothing. */\nexport function inventionReportRefusal(input: InventionReportInput): Refusal | null {\n if (!input.title?.trim()) return new Refusal('invention-title-required', {}, 'give the invention a title')\n if (!input.content?.trim()) return new Refusal('invention-content-required', {}, 'say what the invention is')\n if (!isDay(input.reportedOn)) return new Refusal('invention-reported-on-required', {}, 'give the day it is reported, YYYY-MM-DD')\n if (!input.inventorIds?.length) return new Refusal('invention-inventors-required', {}, 'name the inventors')\n return null\n}\n\n/** The day the company is to tell its decision by - four months from the report. */\nexport const inventionDecisionDueOnOf = (reportedOn: string) => addMonths(reportedOn, INVENTION_DECISION_MONTHS)\n\n/** A decision as it is told, or a refusal: one of the two, told on a day on or after the report. */\nexport function inventionDecisionRefusal(decision: string | null | undefined, toldOn: string | null | undefined, reportedOn: string): Refusal | null {\n if (!decision) return toldOn ? new Refusal('invention-decision-required', {}, 'say what was decided - succeed or waive') : null\n if (!INVENTION_DECISIONS.includes(decision)) return new Refusal('invention-decision-invalid', { decisions: INVENTION_DECISIONS.join(', ') }, 'the decision is succeed or waive')\n if (!isDay(toldOn) || toldOn < reportedOn) return new Refusal('invention-decision-told-on-required', { reportedOn }, `give the day the inventors were told, on or after ${reportedOn}`)\n return null\n}\n\n/** Not decided, and its decision due within 30 days or past. */\nexport const inventionDecisionDueSoon = (row: { decision?: string | null; decisionDueOn: string }, today: string) => !row.decision && row.decisionDueOn <= addDays(today, INVENTION_DECISION_NOTICE_DAYS)\n\n/** A reward as it is written, or a refusal. */\nexport function inventionRewardRefusal(input: { amount?: number | null; paidOn?: string | null }): Refusal | null {\n if (!(typeof input.amount === 'number' && input.amount > 0)) return new Refusal('invention-reward-amount-required', {}, 'the reward amount is more than 0')\n if (input.paidOn && !isDay(input.paidOn)) return new Refusal('invention-reward-paid-on-invalid', {}, 'the day paid is YYYY-MM-DD')\n return null\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { EntityManager } from 'typeorm';
2
+ import { Invention, InventionReward } from './invention';
3
+ import { InventionPatch, InventionPerson, InventionRewardPatch, NewInvention } from './invention-type';
4
+ export declare const INVENTION_CATEGORY = "invention";
5
+ export declare const INVENTION_REF_TYPE = "compliance-invention";
6
+ /** Reports an invention - the reporter is one of its inventors; the decision is due four months on. */
7
+ export declare function reportInvention(input: NewInvention, context: ResolverContext): Promise<Invention>;
8
+ /** The invention when the request may read it - an inventor, or a holder of the records; refused otherwise. */
9
+ export declare function visibleInvention(id: string, context: ResolverContext): Promise<Invention>;
10
+ /** The inventions the request is an inventor of, the latest first. */
11
+ export declare function myInventions(context: ResolverContext): Promise<Invention[]>;
12
+ /** What the keepers write on an invention - its text, the decision told, the patent filed, notes. */
13
+ export declare function updateInventions(patches: InventionPatch[], context: ResolverContext): Promise<Invention[]>;
14
+ /** Writes the rewards of an invention - a reward is never deleted, a wrong one is corrected. */
15
+ export declare function saveInventionRewards(inventionId: string, patches: InventionRewardPatch[], context: ResolverContext): Promise<InventionReward[]>;
16
+ /** An invention's inventors. */
17
+ export declare function inventionInventorsOf(tx: EntityManager, inventionId: string): Promise<InventionPerson[]>;
18
+ /** The employees still working here, to name as co-inventors - an employee's own door, so it says who and where only. */
19
+ export declare function inventionColleagues(context: ResolverContext): Promise<InventionPerson[]>;
20
+ /** The rewards of an invention, oldest first. */
21
+ export declare function inventionRewardsOf(tx: EntityManager, inventionId: string): Promise<InventionReward[]>;
22
+ /** The management check (ADR-0146): inventions undecided with the decision due within 30 days or past. */
23
+ export declare function inventionDecisionsDue(tx: EntityManager, domain: {
24
+ id: string;
25
+ }, today: string): Promise<Invention[]>;