@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.
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +28 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/compliance-case-form.d.ts +42 -0
- package/dist-client/components/compliance-case-form.js +313 -0
- package/dist-client/components/compliance-case-form.js.map +1 -0
- package/dist-client/components/compliance-case-sheet.d.ts +35 -0
- package/dist-client/components/compliance-case-sheet.js +335 -0
- package/dist-client/components/compliance-case-sheet.js.map +1 -0
- package/dist-client/components/compliance-my-inventions.d.ts +17 -0
- package/dist-client/components/compliance-my-inventions.js +133 -0
- package/dist-client/components/compliance-my-inventions.js.map +1 -0
- package/dist-client/components/compliance-my-privacy-requests.d.ts +34 -0
- package/dist-client/components/compliance-my-privacy-requests.js +232 -0
- package/dist-client/components/compliance-my-privacy-requests.js.map +1 -0
- package/dist-client/components/compliance-my-reports.d.ts +19 -0
- package/dist-client/components/compliance-my-reports.js +137 -0
- package/dist-client/components/compliance-my-reports.js.map +1 -0
- package/dist-client/components/guide-link.d.ts +13 -0
- package/dist-client/components/guide-link.js +55 -0
- package/dist-client/components/guide-link.js.map +1 -0
- package/dist-client/components/invention-report-form.d.ts +30 -0
- package/dist-client/components/invention-report-form.js +188 -0
- package/dist-client/components/invention-report-form.js.map +1 -0
- package/dist-client/components/legal-todo.d.ts +10 -0
- package/dist-client/components/legal-todo.js +43 -0
- package/dist-client/components/legal-todo.js.map +1 -0
- package/dist-client/components/my-trainings.d.ts +18 -0
- package/dist-client/components/my-trainings.js +149 -0
- package/dist-client/components/my-trainings.js.map +1 -0
- package/dist-client/components/regulation-form.d.ts +26 -0
- package/dist-client/components/regulation-form.js +161 -0
- package/dist-client/components/regulation-form.js.map +1 -0
- package/dist-client/components/seal-use-form.d.ts +47 -0
- package/dist-client/components/seal-use-form.js +300 -0
- package/dist-client/components/seal-use-form.js.map +1 -0
- package/dist-client/components/training-attendance-form.d.ts +37 -0
- package/dist-client/components/training-attendance-form.js +186 -0
- package/dist-client/components/training-attendance-form.js.map +1 -0
- package/dist-client/components/training-certificate-form.d.ts +41 -0
- package/dist-client/components/training-certificate-form.js +198 -0
- package/dist-client/components/training-certificate-form.js.map +1 -0
- package/dist-client/components/training-session-form.d.ts +39 -0
- package/dist-client/components/training-session-form.js +270 -0
- package/dist-client/components/training-session-form.js.map +1 -0
- package/dist-client/components/training-setting-form.d.ts +45 -0
- package/dist-client/components/training-setting-form.js +175 -0
- package/dist-client/components/training-setting-form.js.map +1 -0
- package/dist-client/index.d.ts +4 -0
- package/dist-client/index.js +8 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/legal-record/dispute-calendar-source.d.ts +1 -0
- package/dist-client/legal-record/dispute-calendar-source.js +51 -0
- package/dist-client/legal-record/dispute-calendar-source.js.map +1 -0
- package/dist-client/legal-record/legal-child-grid.d.ts +31 -0
- package/dist-client/legal-record/legal-child-grid.js +76 -0
- package/dist-client/legal-record/legal-child-grid.js.map +1 -0
- package/dist-client/legal-record/legal-codes.d.ts +3 -0
- package/dist-client/legal-record/legal-codes.js +5 -0
- package/dist-client/legal-record/legal-codes.js.map +1 -0
- package/dist-client/legal-record/legal-grid.d.ts +59 -0
- package/dist-client/legal-record/legal-grid.js +68 -0
- package/dist-client/legal-record/legal-grid.js.map +1 -0
- package/dist-client/legal-record/legal-record-files.d.ts +26 -0
- package/dist-client/legal-record/legal-record-files.js +162 -0
- package/dist-client/legal-record/legal-record-files.js.map +1 -0
- package/dist-client/pages/compliance-case-list.d.ts +35 -0
- package/dist-client/pages/compliance-case-list.js +112 -0
- package/dist-client/pages/compliance-case-list.js.map +1 -0
- package/dist-client/pages/dispute-list.d.ts +57 -0
- package/dist-client/pages/dispute-list.js +156 -0
- package/dist-client/pages/dispute-list.js.map +1 -0
- package/dist-client/pages/invention-list.d.ts +57 -0
- package/dist-client/pages/invention-list.js +166 -0
- package/dist-client/pages/invention-list.js.map +1 -0
- package/dist-client/pages/legal-registration-list.d.ts +63 -0
- package/dist-client/pages/legal-registration-list.js +206 -0
- package/dist-client/pages/legal-registration-list.js.map +1 -0
- package/dist-client/pages/privacy-record-list.d.ts +52 -0
- package/dist-client/pages/privacy-record-list.js +225 -0
- package/dist-client/pages/privacy-record-list.js.map +1 -0
- package/dist-client/pages/regulation-detail.d.ts +43 -0
- package/dist-client/pages/regulation-detail.js +370 -0
- package/dist-client/pages/regulation-detail.js.map +1 -0
- package/dist-client/pages/regulation-list.d.ts +52 -0
- package/dist-client/pages/regulation-list.js +144 -0
- package/dist-client/pages/regulation-list.js.map +1 -0
- package/dist-client/pages/regulations.d.ts +49 -0
- package/dist-client/pages/regulations.js +412 -0
- package/dist-client/pages/regulations.js.map +1 -0
- package/dist-client/pages/seal-use-list.d.ts +57 -0
- package/dist-client/pages/seal-use-list.js +168 -0
- package/dist-client/pages/seal-use-list.js.map +1 -0
- package/dist-client/pages/training-list.d.ts +51 -0
- package/dist-client/pages/training-list.js +333 -0
- package/dist-client/pages/training-list.js.map +1 -0
- package/dist-client/regulation/regulation-fragments.d.ts +1 -0
- package/dist-client/regulation/regulation-fragments.js +37 -0
- package/dist-client/regulation/regulation-fragments.js.map +1 -0
- package/dist-client/regulation/regulation-guide.d.ts +19 -0
- package/dist-client/regulation/regulation-guide.js +48 -0
- package/dist-client/regulation/regulation-guide.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +36 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/training-words.d.ts +11 -0
- package/dist-client/training-words.js +11 -0
- package/dist-client/training-words.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/words.d.ts +15 -0
- package/dist-client/words.js +20 -0
- package/dist-client/words.js.map +1 -0
- package/dist-server/activities/index.d.ts +6 -0
- package/dist-server/activities/index.js +35 -0
- package/dist-server/activities/index.js.map +1 -0
- package/dist-server/activities/legal-todo-activity-names.d.ts +1 -0
- package/dist-server/activities/legal-todo-activity-names.js +5 -0
- package/dist-server/activities/legal-todo-activity-names.js.map +1 -0
- package/dist-server/activities/legal-todo-activity.d.ts +37 -0
- package/dist-server/activities/legal-todo-activity.js +41 -0
- package/dist-server/activities/legal-todo-activity.js.map +1 -0
- package/dist-server/activities/regulation-activity-names.d.ts +1 -0
- package/dist-server/activities/regulation-activity-names.js +5 -0
- package/dist-server/activities/regulation-activity-names.js.map +1 -0
- package/dist-server/activities/regulation-activity.d.ts +48 -0
- package/dist-server/activities/regulation-activity.js +47 -0
- package/dist-server/activities/regulation-activity.js.map +1 -0
- package/dist-server/activities/seal-use-activity-names.d.ts +2 -0
- package/dist-server/activities/seal-use-activity-names.js +6 -0
- package/dist-server/activities/seal-use-activity-names.js.map +1 -0
- package/dist-server/activities/seal-use-activity.d.ts +48 -0
- package/dist-server/activities/seal-use-activity.js +47 -0
- package/dist-server/activities/seal-use-activity.js.map +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +21 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/role-tasks.d.ts +2 -0
- package/dist-server/role-tasks.js +28 -0
- package/dist-server/role-tasks.js.map +1 -0
- package/dist-server/service/common/correction.d.ts +32 -0
- package/dist-server/service/common/correction.js +98 -0
- package/dist-server/service/common/correction.js.map +1 -0
- package/dist-server/service/common/employee-reader.d.ts +11 -0
- package/dist-server/service/common/employee-reader.js +46 -0
- package/dist-server/service/common/employee-reader.js.map +1 -0
- package/dist-server/service/common/legal-todo.d.ts +19 -0
- package/dist-server/service/common/legal-todo.js +37 -0
- package/dist-server/service/common/legal-todo.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case-mutation.d.ts +9 -0
- package/dist-server/service/compliance-case/compliance-case-mutation.js +73 -0
- package/dist-server/service/compliance-case/compliance-case-mutation.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case-query.d.ts +28 -0
- package/dist-server/service/compliance-case/compliance-case-query.js +212 -0
- package/dist-server/service/compliance-case/compliance-case-query.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case-rules.d.ts +71 -0
- package/dist-server/service/compliance-case/compliance-case-rules.js +111 -0
- package/dist-server/service/compliance-case/compliance-case-rules.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case-service.d.ts +76 -0
- package/dist-server/service/compliance-case/compliance-case-service.js +425 -0
- package/dist-server/service/compliance-case/compliance-case-service.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case-type.d.ts +56 -0
- package/dist-server/service/compliance-case/compliance-case-type.js +200 -0
- package/dist-server/service/compliance-case/compliance-case-type.js.map +1 -0
- package/dist-server/service/compliance-case/compliance-case.d.ts +76 -0
- package/dist-server/service/compliance-case/compliance-case.js +260 -0
- package/dist-server/service/compliance-case/compliance-case.js.map +1 -0
- package/dist-server/service/compliance-case/index.d.ts +7 -0
- package/dist-server/service/compliance-case/index.js +17 -0
- package/dist-server/service/compliance-case/index.js.map +1 -0
- package/dist-server/service/dispute/dispute-mutation.d.ts +9 -0
- package/dist-server/service/dispute/dispute-mutation.js +64 -0
- package/dist-server/service/dispute/dispute-mutation.js.map +1 -0
- package/dist-server/service/dispute/dispute-query.d.ts +16 -0
- package/dist-server/service/dispute/dispute-query.js +124 -0
- package/dist-server/service/dispute/dispute-query.js.map +1 -0
- package/dist-server/service/dispute/dispute-rules.d.ts +20 -0
- package/dist-server/service/dispute/dispute-rules.js +42 -0
- package/dist-server/service/dispute/dispute-rules.js.map +1 -0
- package/dist-server/service/dispute/dispute-service.d.ts +17 -0
- package/dist-server/service/dispute/dispute-service.js +96 -0
- package/dist-server/service/dispute/dispute-service.js.map +1 -0
- package/dist-server/service/dispute/dispute-type.d.ts +39 -0
- package/dist-server/service/dispute/dispute-type.js +149 -0
- package/dist-server/service/dispute/dispute-type.js.map +1 -0
- package/dist-server/service/dispute/dispute.d.ts +48 -0
- package/dist-server/service/dispute/dispute.js +198 -0
- package/dist-server/service/dispute/dispute.js.map +1 -0
- package/dist-server/service/dispute/index.d.ts +5 -0
- package/dist-server/service/dispute/index.js +9 -0
- package/dist-server/service/dispute/index.js.map +1 -0
- package/dist-server/service/index.d.ts +46 -0
- package/dist-server/service/index.js +112 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/invention/index.d.ts +5 -0
- package/dist-server/service/invention/index.js +9 -0
- package/dist-server/service/invention/index.js.map +1 -0
- package/dist-server/service/invention/invention-mutation.d.ts +10 -0
- package/dist-server/service/invention/invention-mutation.js +79 -0
- package/dist-server/service/invention/invention-mutation.js.map +1 -0
- package/dist-server/service/invention/invention-query.d.ts +18 -0
- package/dist-server/service/invention/invention-query.js +141 -0
- package/dist-server/service/invention/invention-query.js.map +1 -0
- package/dist-server/service/invention/invention-rules.d.ts +28 -0
- package/dist-server/service/invention/invention-rules.js +54 -0
- package/dist-server/service/invention/invention-rules.js.map +1 -0
- package/dist-server/service/invention/invention-service.d.ts +25 -0
- package/dist-server/service/invention/invention-service.js +176 -0
- package/dist-server/service/invention/invention-service.js.map +1 -0
- package/dist-server/service/invention/invention-type.d.ts +34 -0
- package/dist-server/service/invention/invention-type.js +129 -0
- package/dist-server/service/invention/invention-type.js.map +1 -0
- package/dist-server/service/invention/invention.d.ts +55 -0
- package/dist-server/service/invention/invention.js +214 -0
- package/dist-server/service/invention/invention.js.map +1 -0
- package/dist-server/service/legal-record/attachment-readers.d.ts +1 -0
- package/dist-server/service/legal-record/attachment-readers.js +27 -0
- package/dist-server/service/legal-record/attachment-readers.js.map +1 -0
- package/dist-server/service/legal-record/days.d.ts +7 -0
- package/dist-server/service/legal-record/days.js +26 -0
- package/dist-server/service/legal-record/days.js.map +1 -0
- package/dist-server/service/legal-record/legal-record-support.d.ts +24 -0
- package/dist-server/service/legal-record/legal-record-support.js +51 -0
- package/dist-server/service/legal-record/legal-record-support.js.map +1 -0
- package/dist-server/service/legal-registration/centre-change-subscriber.d.ts +9 -0
- package/dist-server/service/legal-registration/centre-change-subscriber.js +50 -0
- package/dist-server/service/legal-registration/centre-change-subscriber.js.map +1 -0
- package/dist-server/service/legal-registration/index.d.ts +7 -0
- package/dist-server/service/legal-registration/index.js +11 -0
- package/dist-server/service/legal-registration/index.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration-mutation.d.ts +10 -0
- package/dist-server/service/legal-registration/legal-registration-mutation.js +77 -0
- package/dist-server/service/legal-registration/legal-registration-mutation.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration-query.d.ts +26 -0
- package/dist-server/service/legal-registration/legal-registration-query.js +199 -0
- package/dist-server/service/legal-registration/legal-registration-query.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration-rules.d.ts +80 -0
- package/dist-server/service/legal-registration/legal-registration-rules.js +106 -0
- package/dist-server/service/legal-registration/legal-registration-rules.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration-service.d.ts +37 -0
- package/dist-server/service/legal-registration/legal-registration-service.js +248 -0
- package/dist-server/service/legal-registration/legal-registration-service.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration-type.d.ts +55 -0
- package/dist-server/service/legal-registration/legal-registration-type.js +207 -0
- package/dist-server/service/legal-registration/legal-registration-type.js.map +1 -0
- package/dist-server/service/legal-registration/legal-registration.d.ts +76 -0
- package/dist-server/service/legal-registration/legal-registration.js +311 -0
- package/dist-server/service/legal-registration/legal-registration.js.map +1 -0
- package/dist-server/service/privacy-record/index.d.ts +5 -0
- package/dist-server/service/privacy-record/index.js +9 -0
- package/dist-server/service/privacy-record/index.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record-mutation.d.ts +7 -0
- package/dist-server/service/privacy-record/privacy-record-mutation.js +56 -0
- package/dist-server/service/privacy-record/privacy-record-mutation.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record-query.d.ts +18 -0
- package/dist-server/service/privacy-record/privacy-record-query.js +131 -0
- package/dist-server/service/privacy-record/privacy-record-query.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record-rules.d.ts +52 -0
- package/dist-server/service/privacy-record/privacy-record-rules.js +91 -0
- package/dist-server/service/privacy-record/privacy-record-rules.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record-service.d.ts +33 -0
- package/dist-server/service/privacy-record/privacy-record-service.js +133 -0
- package/dist-server/service/privacy-record/privacy-record-service.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record-type.d.ts +40 -0
- package/dist-server/service/privacy-record/privacy-record-type.js +153 -0
- package/dist-server/service/privacy-record/privacy-record-type.js.map +1 -0
- package/dist-server/service/privacy-record/privacy-record.d.ts +69 -0
- package/dist-server/service/privacy-record/privacy-record.js +245 -0
- package/dist-server/service/privacy-record/privacy-record.js.map +1 -0
- package/dist-server/service/regulation/index.d.ts +5 -0
- package/dist-server/service/regulation/index.js +9 -0
- package/dist-server/service/regulation/index.js.map +1 -0
- package/dist-server/service/regulation/regulation-mutation.d.ts +15 -0
- package/dist-server/service/regulation/regulation-mutation.js +152 -0
- package/dist-server/service/regulation/regulation-mutation.js.map +1 -0
- package/dist-server/service/regulation/regulation-query.d.ts +10 -0
- package/dist-server/service/regulation/regulation-query.js +109 -0
- package/dist-server/service/regulation/regulation-query.js.map +1 -0
- package/dist-server/service/regulation/regulation-read.d.ts +21 -0
- package/dist-server/service/regulation/regulation-read.js +111 -0
- package/dist-server/service/regulation/regulation-read.js.map +1 -0
- package/dist-server/service/regulation/regulation-rules.d.ts +83 -0
- package/dist-server/service/regulation/regulation-rules.js +170 -0
- package/dist-server/service/regulation/regulation-rules.js.map +1 -0
- package/dist-server/service/regulation/regulation-service.d.ts +63 -0
- package/dist-server/service/regulation/regulation-service.js +365 -0
- package/dist-server/service/regulation/regulation-service.js.map +1 -0
- package/dist-server/service/regulation/regulation-type.d.ts +61 -0
- package/dist-server/service/regulation/regulation-type.js +226 -0
- package/dist-server/service/regulation/regulation-type.js.map +1 -0
- package/dist-server/service/regulation/regulation.d.ts +113 -0
- package/dist-server/service/regulation/regulation.js +382 -0
- package/dist-server/service/regulation/regulation.js.map +1 -0
- package/dist-server/service/seal-use/index.d.ts +5 -0
- package/dist-server/service/seal-use/index.js +9 -0
- package/dist-server/service/seal-use/index.js.map +1 -0
- package/dist-server/service/seal-use/seal-use-mutation.d.ts +8 -0
- package/dist-server/service/seal-use/seal-use-mutation.js +69 -0
- package/dist-server/service/seal-use/seal-use-mutation.js.map +1 -0
- package/dist-server/service/seal-use/seal-use-query.d.ts +14 -0
- package/dist-server/service/seal-use/seal-use-query.js +100 -0
- package/dist-server/service/seal-use/seal-use-query.js.map +1 -0
- package/dist-server/service/seal-use/seal-use-rules.d.ts +35 -0
- package/dist-server/service/seal-use/seal-use-rules.js +64 -0
- package/dist-server/service/seal-use/seal-use-rules.js.map +1 -0
- package/dist-server/service/seal-use/seal-use-service.d.ts +20 -0
- package/dist-server/service/seal-use/seal-use-service.js +168 -0
- package/dist-server/service/seal-use/seal-use-service.js.map +1 -0
- package/dist-server/service/seal-use/seal-use-type.d.ts +24 -0
- package/dist-server/service/seal-use/seal-use-type.js +93 -0
- package/dist-server/service/seal-use/seal-use-type.js.map +1 -0
- package/dist-server/service/seal-use/seal-use.d.ts +57 -0
- package/dist-server/service/seal-use/seal-use.js +181 -0
- package/dist-server/service/seal-use/seal-use.js.map +1 -0
- package/dist-server/service/training/index.d.ts +5 -0
- package/dist-server/service/training/index.js +9 -0
- package/dist-server/service/training/index.js.map +1 -0
- package/dist-server/service/training/training-checks.d.ts +20 -0
- package/dist-server/service/training/training-checks.js +56 -0
- package/dist-server/service/training/training-checks.js.map +1 -0
- package/dist-server/service/training/training-kinds.d.ts +24 -0
- package/dist-server/service/training/training-kinds.js +42 -0
- package/dist-server/service/training/training-kinds.js.map +1 -0
- package/dist-server/service/training/training-mutation.d.ts +14 -0
- package/dist-server/service/training/training-mutation.js +140 -0
- package/dist-server/service/training/training-mutation.js.map +1 -0
- package/dist-server/service/training/training-query.d.ts +21 -0
- package/dist-server/service/training/training-query.js +196 -0
- package/dist-server/service/training/training-query.js.map +1 -0
- package/dist-server/service/training/training-read.d.ts +5 -0
- package/dist-server/service/training/training-read.js +35 -0
- package/dist-server/service/training/training-read.js.map +1 -0
- package/dist-server/service/training/training-register.d.ts +1 -0
- package/dist-server/service/training/training-register.js +27 -0
- package/dist-server/service/training/training-register.js.map +1 -0
- package/dist-server/service/training/training-rules.d.ts +72 -0
- package/dist-server/service/training/training-rules.js +143 -0
- package/dist-server/service/training/training-rules.js.map +1 -0
- package/dist-server/service/training/training-service.d.ts +98 -0
- package/dist-server/service/training/training-service.js +455 -0
- package/dist-server/service/training/training-service.js.map +1 -0
- package/dist-server/service/training/training-type.d.ts +94 -0
- package/dist-server/service/training/training-type.js +352 -0
- package/dist-server/service/training/training-type.js.map +1 -0
- package/dist-server/service/training/training.d.ts +127 -0
- package/dist-server/service/training/training.js +448 -0
- package/dist-server/service/training/training.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +61 -4
- package/things-factory.config.js +19 -0
- package/translations/en.json +610 -0
- package/translations/es.json +610 -0
- package/translations/ja.json +610 -0
- package/translations/ko.json +610 -0
- package/translations/ms.json +610 -0
- package/translations/zh.json +610 -0
- package/README.md +0 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INVENTION_REF_TYPE = exports.INVENTION_CATEGORY = void 0;
|
|
4
|
+
exports.reportInvention = reportInvention;
|
|
5
|
+
exports.visibleInvention = visibleInvention;
|
|
6
|
+
exports.myInventions = myInventions;
|
|
7
|
+
exports.updateInventions = updateInventions;
|
|
8
|
+
exports.saveInventionRewards = saveInventionRewards;
|
|
9
|
+
exports.inventionInventorsOf = inventionInventorsOf;
|
|
10
|
+
exports.inventionColleagues = inventionColleagues;
|
|
11
|
+
exports.inventionRewardsOf = inventionRewardsOf;
|
|
12
|
+
exports.inventionDecisionsDue = inventionDecisionsDue;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const organization_1 = require("@things-factory/organization");
|
|
15
|
+
const employee_profile_rules_js_1 = require("@things-factory/organization/dist-server/service/employee-profile/employee-profile-rules.js");
|
|
16
|
+
const shell_1 = require("@things-factory/shell");
|
|
17
|
+
const correction_1 = require("../common/correction");
|
|
18
|
+
const employee_reader_1 = require("../common/employee-reader");
|
|
19
|
+
const legal_registration_1 = require("../legal-registration/legal-registration");
|
|
20
|
+
const days_1 = require("../legal-record/days");
|
|
21
|
+
const legal_record_support_1 = require("../legal-record/legal-record-support");
|
|
22
|
+
const invention_1 = require("./invention");
|
|
23
|
+
const invention_rules_1 = require("./invention-rules");
|
|
24
|
+
/*
|
|
25
|
+
* 직무발명 (ADR-0187 decision 24): an employee reports one, its inventors and the keepers of the records read it, the
|
|
26
|
+
* keepers write what the company decided, the patent filed and the rewards. Nothing is deleted.
|
|
27
|
+
*/
|
|
28
|
+
exports.INVENTION_CATEGORY = 'invention';
|
|
29
|
+
exports.INVENTION_REF_TYPE = 'compliance-invention';
|
|
30
|
+
const notFound = () => new shell_1.Refusal('invention-not-found', {}, 'the invention was not found. reload and try again.');
|
|
31
|
+
const notDeletable = () => new shell_1.Refusal('legal-record-not-deletable', {}, 'a legal record is never deleted - end it, or correct it');
|
|
32
|
+
/** Reports an invention - the reporter is one of its inventors; the decision is due four months on. */
|
|
33
|
+
async function reportInvention(input, context) {
|
|
34
|
+
const { domain, user, tx } = context.state;
|
|
35
|
+
const reporter = await (0, employee_reader_1.requireWorkingEmployee)(context);
|
|
36
|
+
const inventorIds = [...new Set([reporter.id, ...(input.coInventorIds ?? []).filter(Boolean)])];
|
|
37
|
+
const reportedOn = (0, legal_record_support_1.text)(input.reportedOn) ?? (0, employee_reader_1.todayIn)(domain);
|
|
38
|
+
const refusal = (0, invention_rules_1.inventionReportRefusal)({ ...input, reportedOn, inventorIds });
|
|
39
|
+
if (refusal)
|
|
40
|
+
throw refusal;
|
|
41
|
+
const inventors = await tx.getRepository(organization_1.Employee).find({ where: { id: (0, typeorm_1.In)(inventorIds), domain: { id: domain.id } } });
|
|
42
|
+
if (inventors.length !== inventorIds.length)
|
|
43
|
+
throw new shell_1.Refusal('invention-inventor-unknown', {}, 'every inventor must be an employee of this company');
|
|
44
|
+
const repository = tx.getRepository(invention_1.Invention);
|
|
45
|
+
const saved = await repository.save(repository.create({ domain, title: (0, legal_record_support_1.text)(input.title), content: input.content.trim(), reportedOn, decisionDueOn: (0, invention_rules_1.inventionDecisionDueOnOf)(reportedOn), reporter, creator: user, updater: user }));
|
|
46
|
+
for (const employee of inventors)
|
|
47
|
+
await tx.getRepository(invention_1.InventionInventor).save({ domain, invention: saved, employee });
|
|
48
|
+
return saved;
|
|
49
|
+
}
|
|
50
|
+
/** Whether the request is one of the invention's inventors. */
|
|
51
|
+
async function isInventor(context, inventionId) {
|
|
52
|
+
const employee = await (0, employee_reader_1.workingEmployeeOf)(context);
|
|
53
|
+
return !!employee && !!(await (0, legal_record_support_1.managerOf)(context).getRepository(invention_1.InventionInventor).count({ where: { invention: { id: inventionId }, employee: { id: employee.id } } }));
|
|
54
|
+
}
|
|
55
|
+
/** The invention when the request may read it - an inventor, or a holder of the records; refused otherwise. */
|
|
56
|
+
async function visibleInvention(id, context) {
|
|
57
|
+
const { domain } = context.state;
|
|
58
|
+
const tx = (0, legal_record_support_1.managerOf)(context);
|
|
59
|
+
const row = await tx.getRepository(invention_1.Invention).findOne({ where: { id, domain: { id: domain.id } } });
|
|
60
|
+
if (!row)
|
|
61
|
+
throw notFound();
|
|
62
|
+
if (await (0, employee_reader_1.holds)(context, exports.INVENTION_CATEGORY, 'query'))
|
|
63
|
+
return row;
|
|
64
|
+
if (await isInventor(context, id))
|
|
65
|
+
return row;
|
|
66
|
+
throw new shell_1.Refusal('invention-not-yours', {}, 'an invention is read by its inventors and those who keep the records');
|
|
67
|
+
}
|
|
68
|
+
/** The inventions the request is an inventor of, the latest first. */
|
|
69
|
+
async function myInventions(context) {
|
|
70
|
+
const { domain } = context.state;
|
|
71
|
+
const tx = (0, legal_record_support_1.managerOf)(context);
|
|
72
|
+
const employee = await (0, employee_reader_1.requireWorkingEmployee)(context);
|
|
73
|
+
const mine = await tx.getRepository(invention_1.InventionInventor).find({ where: { employee: { id: employee.id } } });
|
|
74
|
+
if (!mine.length)
|
|
75
|
+
return [];
|
|
76
|
+
return await tx.getRepository(invention_1.Invention).find({ where: { id: (0, typeorm_1.In)(mine.map(one => one.inventionId)), domain: { id: domain.id } }, order: { reportedOn: 'DESC' } });
|
|
77
|
+
}
|
|
78
|
+
/** What the keepers write on an invention - its text, the decision told, the patent filed, notes. */
|
|
79
|
+
async function updateInventions(patches, context) {
|
|
80
|
+
const { domain, user, tx } = context.state;
|
|
81
|
+
const repository = tx.getRepository(invention_1.Invention);
|
|
82
|
+
const saved = [];
|
|
83
|
+
for (const patch of patches) {
|
|
84
|
+
if (patch.cuFlag === '-')
|
|
85
|
+
throw notDeletable();
|
|
86
|
+
if (patch.cuFlag === '+')
|
|
87
|
+
throw new shell_1.Refusal('invention-reported-by-employee', {}, 'an invention is reported by its inventor');
|
|
88
|
+
const row = await repository.findOne({ where: { id: patch.id, domain: { id: domain.id } } });
|
|
89
|
+
if (!row)
|
|
90
|
+
throw notFound();
|
|
91
|
+
const before = { ...row };
|
|
92
|
+
const given = new Set((0, legal_record_support_1.fieldsOf)(patch));
|
|
93
|
+
for (const field of ['title', 'content', 'decision', 'decisionToldOn', 'notes'])
|
|
94
|
+
if (given.has(field))
|
|
95
|
+
row[field] = (0, legal_record_support_1.text)(patch[field]);
|
|
96
|
+
if (!row.title || !row.content)
|
|
97
|
+
throw new shell_1.Refusal(row.title ? 'invention-content-required' : 'invention-title-required', {}, row.title ? 'say what the invention is' : 'give the invention a title');
|
|
98
|
+
const refusal = (0, invention_rules_1.inventionDecisionRefusal)(row.decision, row.decisionToldOn, row.reportedOn);
|
|
99
|
+
if (refusal)
|
|
100
|
+
throw refusal;
|
|
101
|
+
if (given.has('filingId')) {
|
|
102
|
+
const id = (0, legal_record_support_1.text)(patch.filingId);
|
|
103
|
+
const filing = id ? await tx.getRepository(legal_registration_1.LegalRegistration).findOne({ where: { id, domain: { id: domain.id } } }) : null;
|
|
104
|
+
if (id && filing?.kind !== 'PATENT')
|
|
105
|
+
throw new shell_1.Refusal('invention-filing-not-a-patent', {}, 'the filing is a patent of the ledger');
|
|
106
|
+
row.filing = filing;
|
|
107
|
+
}
|
|
108
|
+
row.updater = user;
|
|
109
|
+
saved.push(await repository.save(row));
|
|
110
|
+
const after = { ...row, filingId: given.has('filingId') ? (row.filing?.id ?? null) : row.filingId };
|
|
111
|
+
await (0, correction_1.recordCorrections)(tx, domain, user, { kind: 'Invention', id: row.id }, before, after, ['title', 'content', 'decision', 'decisionToldOn', 'notes', 'filingId']);
|
|
112
|
+
}
|
|
113
|
+
return saved;
|
|
114
|
+
}
|
|
115
|
+
/** Writes the rewards of an invention - a reward is never deleted, a wrong one is corrected. */
|
|
116
|
+
async function saveInventionRewards(inventionId, patches, context) {
|
|
117
|
+
const { domain, user, tx } = context.state;
|
|
118
|
+
const invention = await tx.getRepository(invention_1.Invention).findOne({ where: { id: inventionId, domain: { id: domain.id } } });
|
|
119
|
+
if (!invention)
|
|
120
|
+
throw notFound();
|
|
121
|
+
const repository = tx.getRepository(invention_1.InventionReward);
|
|
122
|
+
const saved = [];
|
|
123
|
+
for (const patch of patches) {
|
|
124
|
+
if (patch.cuFlag === '-')
|
|
125
|
+
throw notDeletable();
|
|
126
|
+
const row = patch.id ? await repository.findOne({ where: { id: patch.id, invention: { id: invention.id } } }) : repository.create({ domain, invention, creator: user });
|
|
127
|
+
if (!row)
|
|
128
|
+
throw notFound();
|
|
129
|
+
const before = { ...row };
|
|
130
|
+
if (patch.name !== undefined)
|
|
131
|
+
row.name = (0, legal_record_support_1.text)(patch.name);
|
|
132
|
+
if (patch.amount !== undefined)
|
|
133
|
+
row.amount = patch.amount;
|
|
134
|
+
if (patch.paidOn !== undefined)
|
|
135
|
+
row.paidOn = (0, legal_record_support_1.text)(patch.paidOn);
|
|
136
|
+
if (patch.paymentLink !== undefined)
|
|
137
|
+
row.paymentLink = (0, legal_record_support_1.text)(patch.paymentLink);
|
|
138
|
+
const refusal = (0, invention_rules_1.inventionRewardRefusal)(row);
|
|
139
|
+
if (refusal)
|
|
140
|
+
throw refusal;
|
|
141
|
+
row.updater = user;
|
|
142
|
+
saved.push(await repository.save(row));
|
|
143
|
+
await (0, correction_1.recordCorrections)(tx, domain, user, { kind: 'InventionReward', id: row.id }, before, row, ['name', 'amount', 'paidOn', 'paymentLink']);
|
|
144
|
+
}
|
|
145
|
+
return saved;
|
|
146
|
+
}
|
|
147
|
+
const personOf = (one, departments) => ({ id: one.id, name: one.name, departmentName: departments.get(one.departmentId) ?? null });
|
|
148
|
+
async function peopleOf(tx, employees) {
|
|
149
|
+
const ids = [...new Set(employees.map(one => one.departmentId).filter(Boolean))];
|
|
150
|
+
const departments = new Map((ids.length ? await tx.getRepository(organization_1.Department).find({ where: { id: (0, typeorm_1.In)(ids) } }) : []).map(one => [one.id, one.name]));
|
|
151
|
+
return employees.map(one => personOf(one, departments));
|
|
152
|
+
}
|
|
153
|
+
/** An invention's inventors. */
|
|
154
|
+
async function inventionInventorsOf(tx, inventionId) {
|
|
155
|
+
const rows = await tx.getRepository(invention_1.InventionInventor).find({ where: { invention: { id: inventionId } }, relations: ['employee'] });
|
|
156
|
+
return await peopleOf(tx, rows.map(one => one.employee).filter(Boolean));
|
|
157
|
+
}
|
|
158
|
+
/** The employees still working here, to name as co-inventors - an employee's own door, so it says who and where only. */
|
|
159
|
+
async function inventionColleagues(context) {
|
|
160
|
+
const { domain } = context.state;
|
|
161
|
+
const tx = (0, legal_record_support_1.managerOf)(context);
|
|
162
|
+
await (0, employee_reader_1.requireWorkingEmployee)(context);
|
|
163
|
+
const today = (0, employee_reader_1.todayIn)(domain);
|
|
164
|
+
const employees = (await tx.getRepository(organization_1.Employee).find({ where: { domain: { id: domain.id } }, order: { name: 'ASC' } })).filter(one => (0, employee_profile_rules_js_1.isActiveEmployee)(one, today));
|
|
165
|
+
return await peopleOf(tx, employees);
|
|
166
|
+
}
|
|
167
|
+
/** The rewards of an invention, oldest first. */
|
|
168
|
+
async function inventionRewardsOf(tx, inventionId) {
|
|
169
|
+
return await tx.getRepository(invention_1.InventionReward).find({ where: { invention: { id: inventionId } }, order: { createdAt: 'ASC' } });
|
|
170
|
+
}
|
|
171
|
+
/** The management check (ADR-0146): inventions undecided with the decision due within 30 days or past. */
|
|
172
|
+
async function inventionDecisionsDue(tx, domain, today) {
|
|
173
|
+
const undecided = await tx.getRepository(invention_1.Invention).find({ where: { domain: { id: domain.id }, decision: (0, typeorm_1.IsNull)() }, order: { decisionDueOn: 'ASC' } });
|
|
174
|
+
return undecided.filter(one => (0, days_1.isDay)(one.decisionDueOn) && (0, invention_rules_1.inventionDecisionDueSoon)(one, today));
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=invention-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invention-service.js","sourceRoot":"","sources":["../../../server/service/invention/invention-service.ts"],"names":[],"mappings":";;;AA2BA,0CAgBC;AASD,4CAQC;AAGD,oCAOC;AAGD,4CA2BC;AAGD,oDAsBC;AAWD,oDAGC;AAGD,kDAOC;AAGD,gDAEC;AAGD,sDAGC;AAhKD,qCAAmD;AAEnD,+DAAmE;AACnE,2IAA8H;AAC9H,iDAA+C;AAE/C,qDAAwD;AACxD,+DAAqG;AACrG,iFAA4E;AAC5E,+CAA4C;AAC5C,+EAAgF;AAChF,2CAA2E;AAC3E,uDAAgK;AAGhK;;;GAGG;AAEU,QAAA,kBAAkB,GAAG,WAAW,CAAA;AAChC,QAAA,kBAAkB,GAAG,sBAAsB,CAAA;AAExD,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,eAAO,CAAC,qBAAqB,EAAE,EAAE,EAAE,oDAAoD,CAAC,CAAA;AACnH,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,IAAI,eAAO,C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AE,MAAsB,EAAE,KAAa;IAClG,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAA,gBAAM,GAAE,EAAS,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IACrK,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,YAAK,EAAC,GAAG,CAAC,aAAa,CAAC,IAAI,IAAA,0CAAwB,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["import { EntityManager, In, IsNull } from 'typeorm'\n\nimport { Department, Employee } from '@things-factory/organization'\nimport { isActiveEmployee } from '@things-factory/organization/dist-server/service/employee-profile/employee-profile-rules.js'\nimport { Refusal } from '@things-factory/shell'\n\nimport { recordCorrections } from '../common/correction'\nimport { holds, requireWorkingEmployee, todayIn, workingEmployeeOf } from '../common/employee-reader'\nimport { LegalRegistration } from '../legal-registration/legal-registration'\nimport { isDay } from '../legal-record/days'\nimport { fieldsOf, managerOf, text } from '../legal-record/legal-record-support'\nimport { Invention, InventionInventor, InventionReward } from './invention'\nimport { inventionDecisionDueOnOf, inventionDecisionDueSoon, inventionDecisionRefusal, inventionReportRefusal, inventionRewardRefusal } from './invention-rules'\nimport { InventionPatch, InventionPerson, InventionRewardPatch, NewInvention } from './invention-type'\n\n/*\n * 직무발명 (ADR-0187 decision 24): an employee reports one, its inventors and the keepers of the records read it, the\n * keepers write what the company decided, the patent filed and the rewards. Nothing is deleted.\n */\n\nexport const INVENTION_CATEGORY = 'invention'\nexport const INVENTION_REF_TYPE = 'compliance-invention'\n\nconst notFound = () => new Refusal('invention-not-found', {}, 'the invention was not found. reload and try again.')\nconst notDeletable = () => new Refusal('legal-record-not-deletable', {}, 'a legal record is never deleted - end it, or correct it')\n\n/** Reports an invention - the reporter is one of its inventors; the decision is due four months on. */\nexport async function reportInvention(input: NewInvention, context: ResolverContext): Promise<Invention> {\n const { domain, user, tx } = context.state\n const reporter = await requireWorkingEmployee(context)\n const inventorIds = [...new Set([reporter.id, ...(input.coInventorIds ?? []).filter(Boolean)])]\n const reportedOn = text(input.reportedOn) ?? todayIn(domain)\n const refusal = inventionReportRefusal({ ...input, reportedOn, inventorIds })\n if (refusal) throw refusal\n const inventors = await tx.getRepository(Employee).find({ where: { id: In(inventorIds), domain: { id: domain.id } } as any })\n if (inventors.length !== inventorIds.length) throw new Refusal('invention-inventor-unknown', {}, 'every inventor must be an employee of this company')\n\n const repository = tx.getRepository(Invention)\n const saved = await repository.save(\n repository.create({ domain, title: text(input.title), content: input.content.trim(), reportedOn, decisionDueOn: inventionDecisionDueOnOf(reportedOn), reporter, creator: user, updater: user } as any) as any\n )\n for (const employee of inventors) await tx.getRepository(InventionInventor).save({ domain, invention: saved, employee } as any)\n return saved\n}\n\n/** Whether the request is one of the invention's inventors. */\nasync function isInventor(context: ResolverContext, inventionId: string): Promise<boolean> {\n const employee = await workingEmployeeOf(context)\n return !!employee && !!(await managerOf(context).getRepository(InventionInventor).count({ where: { invention: { id: inventionId }, employee: { id: employee.id } } as any }))\n}\n\n/** The invention when the request may read it - an inventor, or a holder of the records; refused otherwise. */\nexport async function visibleInvention(id: string, context: ResolverContext): Promise<Invention> {\n const { domain } = context.state\n const tx = managerOf(context)\n const row = await tx.getRepository(Invention).findOne({ where: { id, domain: { id: domain.id } } as any })\n if (!row) throw notFound()\n if (await holds(context, INVENTION_CATEGORY, 'query')) return row\n if (await isInventor(context, id)) return row\n throw new Refusal('invention-not-yours', {}, 'an invention is read by its inventors and those who keep the records')\n}\n\n/** The inventions the request is an inventor of, the latest first. */\nexport async function myInventions(context: ResolverContext): Promise<Invention[]> {\n const { domain } = context.state\n const tx = managerOf(context)\n const employee = await requireWorkingEmployee(context)\n const mine = await tx.getRepository(InventionInventor).find({ where: { employee: { id: employee.id } } as any })\n if (!mine.length) return []\n return await tx.getRepository(Invention).find({ where: { id: In(mine.map(one => one.inventionId)), domain: { id: domain.id } } as any, order: { reportedOn: 'DESC' } as any })\n}\n\n/** What the keepers write on an invention - its text, the decision told, the patent filed, notes. */\nexport async function updateInventions(patches: InventionPatch[], context: ResolverContext): Promise<Invention[]> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(Invention)\n const saved: Invention[] = []\n for (const patch of patches) {\n if (patch.cuFlag === '-') throw notDeletable()\n if (patch.cuFlag === '+') throw new Refusal('invention-reported-by-employee', {}, 'an invention is reported by its inventor')\n const row = await repository.findOne({ where: { id: patch.id, domain: { id: domain.id } } as any })\n if (!row) throw notFound()\n const before = { ...row }\n const given = new Set(fieldsOf(patch))\n for (const field of ['title', 'content', 'decision', 'decisionToldOn', 'notes'] as const) if (given.has(field)) (row as any)[field] = text((patch as any)[field])\n if (!row.title || !row.content) throw new Refusal(row.title ? 'invention-content-required' : 'invention-title-required', {}, row.title ? 'say what the invention is' : 'give the invention a title')\n const refusal = inventionDecisionRefusal(row.decision, row.decisionToldOn, row.reportedOn)\n if (refusal) throw refusal\n if (given.has('filingId')) {\n const id = text(patch.filingId)\n const filing = id ? await tx.getRepository(LegalRegistration).findOne({ where: { id, domain: { id: domain.id } } as any }) : null\n if (id && filing?.kind !== 'PATENT') throw new Refusal('invention-filing-not-a-patent', {}, 'the filing is a patent of the ledger')\n row.filing = filing\n }\n row.updater = user\n saved.push(await repository.save(row))\n const after = { ...row, filingId: given.has('filingId') ? (row.filing?.id ?? null) : row.filingId }\n await recordCorrections(tx, domain, user, { kind: 'Invention', id: row.id }, before, after, ['title', 'content', 'decision', 'decisionToldOn', 'notes', 'filingId'])\n }\n return saved\n}\n\n/** Writes the rewards of an invention - a reward is never deleted, a wrong one is corrected. */\nexport async function saveInventionRewards(inventionId: string, patches: InventionRewardPatch[], context: ResolverContext): Promise<InventionReward[]> {\n const { domain, user, tx } = context.state\n const invention = await tx.getRepository(Invention).findOne({ where: { id: inventionId, domain: { id: domain.id } } as any })\n if (!invention) throw notFound()\n const repository = tx.getRepository(InventionReward)\n const saved: InventionReward[] = []\n for (const patch of patches) {\n if (patch.cuFlag === '-') throw notDeletable()\n const row: InventionReward = patch.id ? await repository.findOne({ where: { id: patch.id, invention: { id: invention.id } } as any }) : (repository.create({ domain, invention, creator: user } as any) as any)\n if (!row) throw notFound()\n const before = { ...row }\n if (patch.name !== undefined) row.name = text(patch.name)\n if (patch.amount !== undefined) row.amount = patch.amount\n if (patch.paidOn !== undefined) row.paidOn = text(patch.paidOn)\n if (patch.paymentLink !== undefined) row.paymentLink = text(patch.paymentLink)\n const refusal = inventionRewardRefusal(row)\n if (refusal) throw refusal\n row.updater = user\n saved.push(await repository.save(row))\n await recordCorrections(tx, domain, user, { kind: 'InventionReward', id: row.id }, before, row, ['name', 'amount', 'paidOn', 'paymentLink'])\n }\n return saved\n}\n\nconst personOf = (one: Employee, departments: Map<string, string>): InventionPerson => ({ id: one.id, name: one.name, departmentName: departments.get(one.departmentId) ?? null })\n\nasync function peopleOf(tx: EntityManager, employees: Employee[]): Promise<InventionPerson[]> {\n const ids = [...new Set(employees.map(one => one.departmentId).filter(Boolean))]\n const departments = new Map((ids.length ? await tx.getRepository(Department).find({ where: { id: In(ids) } as any }) : []).map(one => [one.id, one.name] as [string, string]))\n return employees.map(one => personOf(one, departments))\n}\n\n/** An invention's inventors. */\nexport async function inventionInventorsOf(tx: EntityManager, inventionId: string): Promise<InventionPerson[]> {\n const rows = await tx.getRepository(InventionInventor).find({ where: { invention: { id: inventionId } } as any, relations: ['employee'] })\n return await peopleOf(tx, rows.map(one => one.employee).filter(Boolean))\n}\n\n/** The employees still working here, to name as co-inventors - an employee's own door, so it says who and where only. */\nexport async function inventionColleagues(context: ResolverContext): Promise<InventionPerson[]> {\n const { domain } = context.state\n const tx = managerOf(context)\n await requireWorkingEmployee(context)\n const today = todayIn(domain)\n const employees = (await tx.getRepository(Employee).find({ where: { domain: { id: domain.id } } as any, order: { name: 'ASC' } as any })).filter(one => isActiveEmployee(one as any, today))\n return await peopleOf(tx, employees)\n}\n\n/** The rewards of an invention, oldest first. */\nexport async function inventionRewardsOf(tx: EntityManager, inventionId: string): Promise<InventionReward[]> {\n return await tx.getRepository(InventionReward).find({ where: { invention: { id: inventionId } } as any, order: { createdAt: 'ASC' } as any })\n}\n\n/** The management check (ADR-0146): inventions undecided with the decision due within 30 days or past. */\nexport async function inventionDecisionsDue(tx: EntityManager, domain: { id: string }, today: string): Promise<Invention[]> {\n const undecided = await tx.getRepository(Invention).find({ where: { domain: { id: domain.id }, decision: IsNull() } as any, order: { decisionDueOn: 'ASC' } as any })\n return undecided.filter(one => isDay(one.decisionDueOn) && inventionDecisionDueSoon(one, today))\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Invention } from './invention';
|
|
2
|
+
export declare class NewInvention {
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
reportedOn?: string;
|
|
6
|
+
coInventorIds?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class InventionPatch {
|
|
9
|
+
id: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
content?: string;
|
|
12
|
+
decision?: string;
|
|
13
|
+
decisionToldOn?: string;
|
|
14
|
+
filingId?: string;
|
|
15
|
+
notes?: string;
|
|
16
|
+
cuFlag?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class InventionRewardPatch {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
amount?: number;
|
|
22
|
+
paidOn?: string;
|
|
23
|
+
paymentLink?: string;
|
|
24
|
+
cuFlag?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class InventionPerson {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
departmentName?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class InventionList {
|
|
32
|
+
items: Invention[];
|
|
33
|
+
total: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InventionList = exports.InventionPerson = exports.InventionRewardPatch = exports.InventionPatch = exports.NewInvention = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const invention_1 = require("./invention");
|
|
7
|
+
let NewInvention = class NewInvention {
|
|
8
|
+
};
|
|
9
|
+
exports.NewInvention = NewInvention;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)({ description: 'Its title' }),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], NewInvention.prototype, "title", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)({ description: 'What the invention is' }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], NewInvention.prototype, "content", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD reported - today when empty' }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], NewInvention.prototype, "reportedOn", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true, description: 'The other inventors - employees of the domain' }),
|
|
24
|
+
tslib_1.__metadata("design:type", Array)
|
|
25
|
+
], NewInvention.prototype, "coInventorIds", void 0);
|
|
26
|
+
exports.NewInvention = NewInvention = tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.InputType)({ description: 'An invention as an employee reports it - the reporter is an inventor' })
|
|
28
|
+
], NewInvention);
|
|
29
|
+
let InventionPatch = class InventionPatch {
|
|
30
|
+
};
|
|
31
|
+
exports.InventionPatch = InventionPatch;
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The invention' }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], InventionPatch.prototype, "id", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Its title' }),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], InventionPatch.prototype, "title", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'What the invention is' }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], InventionPatch.prototype, "content", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'SUCCEED or WAIVE' }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], InventionPatch.prototype, "decision", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD the inventors were told' }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], InventionPatch.prototype, "decisionToldOn", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The patent filed for it, on the ledger' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], InventionPatch.prototype, "filingId", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
59
|
+
], InventionPatch.prototype, "notes", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'M changed - an invention is never deleted' }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], InventionPatch.prototype, "cuFlag", void 0);
|
|
64
|
+
exports.InventionPatch = InventionPatch = tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.InputType)({ description: 'What a keeper of the records writes on an invention' })
|
|
66
|
+
], InventionPatch);
|
|
67
|
+
let InventionRewardPatch = class InventionRewardPatch {
|
|
68
|
+
};
|
|
69
|
+
exports.InventionRewardPatch = InventionRewardPatch;
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'Its id - empty for a new row' }),
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
73
|
+
], InventionRewardPatch.prototype, "id", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'What it is for' }),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], InventionRewardPatch.prototype, "name", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'The amount' }),
|
|
80
|
+
tslib_1.__metadata("design:type", Number)
|
|
81
|
+
], InventionRewardPatch.prototype, "amount", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD paid' }),
|
|
84
|
+
tslib_1.__metadata("design:type", String)
|
|
85
|
+
], InventionRewardPatch.prototype, "paidOn", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Where it was paid, as text' }),
|
|
88
|
+
tslib_1.__metadata("design:type", String)
|
|
89
|
+
], InventionRewardPatch.prototype, "paymentLink", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '+ new, M changed - a reward is never deleted' }),
|
|
92
|
+
tslib_1.__metadata("design:type", String)
|
|
93
|
+
], InventionRewardPatch.prototype, "cuFlag", void 0);
|
|
94
|
+
exports.InventionRewardPatch = InventionRewardPatch = tslib_1.__decorate([
|
|
95
|
+
(0, type_graphql_1.InputType)({ description: 'A reward for an invention as the grid writes it' })
|
|
96
|
+
], InventionRewardPatch);
|
|
97
|
+
let InventionPerson = class InventionPerson {
|
|
98
|
+
};
|
|
99
|
+
exports.InventionPerson = InventionPerson;
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The employee' }),
|
|
102
|
+
tslib_1.__metadata("design:type", String)
|
|
103
|
+
], InventionPerson.prototype, "id", void 0);
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
(0, type_graphql_1.Field)({ description: 'Their name' }),
|
|
106
|
+
tslib_1.__metadata("design:type", String)
|
|
107
|
+
], InventionPerson.prototype, "name", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Their department' }),
|
|
110
|
+
tslib_1.__metadata("design:type", String)
|
|
111
|
+
], InventionPerson.prototype, "departmentName", void 0);
|
|
112
|
+
exports.InventionPerson = InventionPerson = tslib_1.__decorate([
|
|
113
|
+
(0, type_graphql_1.ObjectType)({ description: 'An employee as an invention names them - who, and their department' })
|
|
114
|
+
], InventionPerson);
|
|
115
|
+
let InventionList = class InventionList {
|
|
116
|
+
};
|
|
117
|
+
exports.InventionList = InventionList;
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
(0, type_graphql_1.Field)(type => [invention_1.Invention], { description: 'The rows' }),
|
|
120
|
+
tslib_1.__metadata("design:type", Array)
|
|
121
|
+
], InventionList.prototype, "items", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many there are' }),
|
|
124
|
+
tslib_1.__metadata("design:type", Number)
|
|
125
|
+
], InventionList.prototype, "total", void 0);
|
|
126
|
+
exports.InventionList = InventionList = tslib_1.__decorate([
|
|
127
|
+
(0, type_graphql_1.ObjectType)({ description: 'A page of inventions' })
|
|
128
|
+
], InventionList);
|
|
129
|
+
//# sourceMappingURL=invention-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invention-type.js","sourceRoot":"","sources":["../../../server/service/invention/invention-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,2CAAuC;AAGhC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAKxB,CAAA;AALY,oCAAY;AACc;IAApC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;;2CAAc;AACD;IAAhD,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;6CAAgB;AACkB;IAAjF,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;;gDAAoB;AACM;IAA1G,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;mDAAyB;uBAJxH,YAAY;IADxB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE,CAAC;GACtF,YAAY,CAKxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAS1B,CAAA;AATY,wCAAc;AAC4B;IAApD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;0CAAW;AACV;IAApD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;;6CAAe;AACF;IAAhE,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;+CAAiB;AACrB;IAA3D,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAA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ACF;IAAvF,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;;oDAAgB;+BAN5F,oBAAoB;IADhC,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;GACjE,oBAAoB,CAOhC;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAI3B,CAAA;AAJY,0CAAe;AAC0B;IAAnD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;2CAAW;AACxB;IAArC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;6CAAa;AACU;IAA3D,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;uDAAwB;0BAHxE,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oEAAoE,EAAE,CAAC;GACrF,eAAe,CAI3B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAGzB,CAAA;AAHY,sCAAa;AACiC;IAAxD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;4CAAmB;AAChB;IAA1D,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;;4CAAc;wBAF7D,aAAa;IADzB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,aAAa,CAGzB","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Invention } from './invention'\n\n@InputType({ description: 'An invention as an employee reports it - the reporter is an inventor' })\nexport class NewInvention {\n @Field({ description: 'Its title' }) title: string\n @Field({ description: 'What the invention is' }) content: string\n @Field({ nullable: true, description: 'YYYY-MM-DD reported - today when empty' }) reportedOn?: string\n @Field(type => [String], { nullable: true, description: 'The other inventors - employees of the domain' }) coInventorIds?: string[]\n}\n\n@InputType({ description: 'What a keeper of the records writes on an invention' })\nexport class InventionPatch {\n @Field(type => ID, { description: 'The invention' }) id: string\n @Field({ nullable: true, description: 'Its title' }) title?: string\n @Field({ nullable: true, description: 'What the invention is' }) content?: string\n @Field({ nullable: true, description: 'SUCCEED or WAIVE' }) decision?: string\n @Field({ nullable: true, description: 'YYYY-MM-DD the inventors were told' }) decisionToldOn?: string\n @Field({ nullable: true, description: 'The patent filed for it, on the ledger' }) filingId?: string\n @Field({ nullable: true, description: 'Notes' }) notes?: string\n @Field({ nullable: true, description: 'M changed - an invention is never deleted' }) cuFlag?: string\n}\n\n@InputType({ description: 'A reward for an invention as the grid writes it' })\nexport class InventionRewardPatch {\n @Field(type => ID, { nullable: true, description: 'Its id - empty for a new row' }) id?: string\n @Field({ nullable: true, description: 'What it is for' }) name?: string\n @Field(type => Float, { nullable: true, description: 'The amount' }) amount?: number\n @Field({ nullable: true, description: 'YYYY-MM-DD paid' }) paidOn?: string\n @Field({ nullable: true, description: 'Where it was paid, as text' }) paymentLink?: string\n @Field({ nullable: true, description: '+ new, M changed - a reward is never deleted' }) cuFlag?: string\n}\n\n@ObjectType({ description: 'An employee as an invention names them - who, and their department' })\nexport class InventionPerson {\n @Field(type => ID, { description: 'The employee' }) id: string\n @Field({ description: 'Their name' }) name: string\n @Field({ nullable: true, description: 'Their department' }) departmentName?: string\n}\n\n@ObjectType({ description: 'A page of inventions' })\nexport class InventionList {\n @Field(type => [Invention], { description: 'The rows' }) items: Invention[]\n @Field(type => Int, { description: 'How many there are' }) total: number\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Employee } from '@things-factory/organization';
|
|
3
|
+
import { Domain } from '@things-factory/shell';
|
|
4
|
+
import { LegalRegistration } from '../legal-registration/legal-registration';
|
|
5
|
+
/**
|
|
6
|
+
* 직무발명 (ADR-0187 decision 24) - an invention an employee reports: who invented it, what it is, the day the company
|
|
7
|
+
* is to tell whether it succeeds to the right (reported + 4 months), what it decided and told, the patent filed and
|
|
8
|
+
* the rewards paid. Read by its inventors and by those who keep the records. Never deleted.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Invention {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
domain?: Domain;
|
|
13
|
+
domainId?: string;
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
reportedOn: string;
|
|
17
|
+
decisionDueOn: string;
|
|
18
|
+
decision?: string;
|
|
19
|
+
decisionToldOn?: string;
|
|
20
|
+
filing?: LegalRegistration;
|
|
21
|
+
filingId?: string;
|
|
22
|
+
reporter?: Employee;
|
|
23
|
+
reporterId?: string;
|
|
24
|
+
notes?: string;
|
|
25
|
+
createdAt?: Date;
|
|
26
|
+
updatedAt?: Date;
|
|
27
|
+
creator?: User;
|
|
28
|
+
creatorId?: string;
|
|
29
|
+
updater?: User;
|
|
30
|
+
updaterId?: string;
|
|
31
|
+
}
|
|
32
|
+
/** 발명자 - one inventor of an invention. */
|
|
33
|
+
export declare class InventionInventor {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
domain?: Domain;
|
|
36
|
+
invention?: Invention;
|
|
37
|
+
inventionId?: string;
|
|
38
|
+
employee?: Employee;
|
|
39
|
+
employeeId?: string;
|
|
40
|
+
}
|
|
41
|
+
/** 보상 - a reward paid for an invention (발명진흥법 §15); the payment itself is the payroll's or an expenditure's. */
|
|
42
|
+
export declare class InventionReward {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
domain?: Domain;
|
|
45
|
+
invention?: Invention;
|
|
46
|
+
inventionId?: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
amount: number;
|
|
49
|
+
paidOn?: string;
|
|
50
|
+
paymentLink?: string;
|
|
51
|
+
createdAt?: Date;
|
|
52
|
+
updatedAt?: Date;
|
|
53
|
+
creator?: User;
|
|
54
|
+
updater?: User;
|
|
55
|
+
}
|