@things-factory/kpi 9.0.31 → 9.0.32
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/README.md +1 -2
- package/client/charts/kpi-boxplot-chart.ts +182 -42
- package/client/charts/kpi-radar-chart.ts +9 -9
- package/client/pages/kpi/kpi-list-page.ts +196 -32
- package/client/pages/kpi/kpi-overview.ts +9 -11
- package/client/pages/kpi/kpi-tree-page.ts +409 -0
- package/client/pages/kpi/kpi-view.ts +187 -0
- package/client/pages/kpi-dashboard/cards/kpi-level1-card.ts +1 -1
- package/client/pages/kpi-dashboard/cards/kpi-level2-comparison.ts +1 -1
- package/client/pages/kpi-dashboard/cards/kpi-level3-comparison.ts +1 -1
- package/client/pages/kpi-dashboard/components/kpi-left-panel.ts +198 -160
- package/client/pages/kpi-dashboard/components/kpi-map-panel.ts +133 -0
- package/client/pages/kpi-dashboard/components/kpi-region-popup.ts +3 -2
- package/client/pages/kpi-dashboard/kpi-dashboard-map.ts +4 -3
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +28 -30
- package/client/pages/kpi-history/kpi-history-list-page.ts +11 -11
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +10 -2
- package/client/pages/kpi-metric-value/kpi-metric-value-editor-page.ts +7 -7
- package/client/pages/kpi-metric-value/kpi-metric-value-importer.ts +2 -2
- package/client/pages/kpi-metric-value/kpi-metric-value-list-page.ts +16 -8
- package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts +5 -5
- package/client/pages/kpi-statistic/kpi-statistic-editor-page.ts +1 -2
- package/client/pages/kpi-statistic/kpi-statistic-list-page.ts +10 -2
- package/client/pages/kpi-value/kpi-value-editor-page.ts +11 -7
- package/client/pages/kpi-value/kpi-value-list-page.ts +31 -7
- package/client/route.ts +2 -9
- package/design-entities.md +8 -12
- package/dist-client/charts/kpi-boxplot-chart.d.ts +2 -0
- package/dist-client/charts/kpi-boxplot-chart.js +168 -42
- package/dist-client/charts/kpi-boxplot-chart.js.map +1 -1
- package/dist-client/charts/kpi-radar-chart.js +9 -9
- package/dist-client/charts/kpi-radar-chart.js.map +1 -1
- package/dist-client/pages/kpi/kpi-list-page.d.ts +19 -3
- package/dist-client/pages/kpi/kpi-list-page.js +188 -32
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-overview.js +9 -11
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -1
- package/dist-client/pages/kpi/kpi-tree-page.d.ts +59 -0
- package/dist-client/pages/kpi/kpi-tree-page.js +403 -0
- package/dist-client/pages/kpi/kpi-tree-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-view.d.ts +12 -0
- package/dist-client/pages/kpi/kpi-view.js +191 -0
- package/dist-client/pages/kpi/kpi-view.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +3 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +197 -161
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +5 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +146 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +3 -2
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +4 -3
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +28 -30
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +6 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +11 -11
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +10 -2
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +8 -8
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +2 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +16 -8
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +6 -6
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -1
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +1 -2
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +10 -2
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-editor-page.d.ts +2 -1
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js +16 -8
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +31 -7
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +2 -8
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/kpi-metric-value-provider.d.ts +1 -1
- package/dist-server/controllers/kpi-metric-value-provider.js +4 -4
- package/dist-server/controllers/kpi-metric-value-provider.js.map +1 -1
- package/dist-server/controllers/kpi-value-provider.d.ts +1 -1
- package/dist-server/controllers/kpi-value-provider.js +3 -3
- package/dist-server/controllers/kpi-value-provider.js.map +1 -1
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.d.ts +6 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js +101 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js.map +1 -0
- package/dist-server/migrations/1752190849681-seed-kpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js +315 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.d.ts +7 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js +51 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.d.ts +5 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js +710 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js.map +1 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.d.ts +6 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js +111 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js.map +1 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.d.ts +6 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js +187 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js.map +1 -0
- package/dist-server/migrations/grade-data/x11-performance-table.json +962 -0
- package/dist-server/migrations/grade-data/x12-performance-table.json +611 -0
- package/dist-server/migrations/grade-data/x14-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x21-performance-table.json +889 -0
- package/dist-server/migrations/grade-data/x22-performance-table.json +1064 -0
- package/dist-server/migrations/grade-data/x23-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x31-performance-table.json +644 -0
- package/dist-server/migrations/grade-data/x32-performance-table.json +993 -0
- package/dist-server/migrations/grade-data/x33-performance-table.json +195 -0
- package/dist-server/migrations/grade-data/x34-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x35-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x41-performance-table.json +825 -0
- package/dist-server/migrations/grade-data/x42-performance-table.json +786 -0
- package/dist-server/migrations/grade-data/x43-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x44-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x51-performance-table.json +924 -0
- package/dist-server/migrations/grade-data/x52-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x61-performance-table.json +261 -0
- package/dist-server/migrations/grade-data/x62-performance-table.json +42 -0
- package/dist-server/migrations/seed-data/kpi-metrics-seed.json +454 -0
- package/dist-server/migrations/seed-data/kpi-org-scope-seed.json +1676 -0
- package/dist-server/migrations/seed-data/kpi-values-seed.json +402 -0
- package/dist-server/migrations/seed-data/kpis-seed.json +488 -0
- package/dist-server/service/index.d.ts +3 -7
- package/dist-server/service/index.js +5 -12
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi/aggregate-kpi.js +30 -13
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -1
- package/dist-server/service/kpi/kpi-formula.service.d.ts +15 -0
- package/dist-server/service/kpi/kpi-formula.service.js +90 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -1
- package/dist-server/service/kpi/kpi-history.d.ts +0 -3
- package/dist-server/service/kpi/kpi-history.js +0 -10
- package/dist-server/service/kpi/kpi-history.js.map +1 -1
- package/dist-server/service/kpi/kpi-mutation.d.ts +1 -1
- package/dist-server/service/kpi/kpi-mutation.js +57 -20
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
- package/dist-server/service/kpi/kpi-query.d.ts +7 -3
- package/dist-server/service/kpi/kpi-query.js +126 -10
- package/dist-server/service/kpi/kpi-query.js.map +1 -1
- package/dist-server/service/kpi/kpi-type.d.ts +4 -2
- package/dist-server/service/kpi/kpi-type.js +12 -4
- package/dist-server/service/kpi/kpi-type.js.map +1 -1
- package/dist-server/service/kpi/kpi.d.ts +4 -3
- package/dist-server/service/kpi/kpi.js +20 -8
- package/dist-server/service/kpi/kpi.js.map +1 -1
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +46 -11
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +6 -6
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.d.ts +2 -2
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js +4 -4
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value.d.ts +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js +3 -3
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js.map +1 -1
- package/dist-server/service/kpi-org-scope/index.d.ts +9 -0
- package/dist-server/service/kpi-org-scope/index.js +14 -0
- package/dist-server/service/kpi-org-scope/index.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.d.ts +8 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js +170 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.d.ts +14 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js +152 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js +101 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js +135 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.d.ts +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js +11 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-mutation.js +71 -7
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +4 -2
- package/dist-server/service/kpi-value/kpi-value-type.js +12 -4
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value.d.ts +3 -1
- package/dist-server/service/kpi-value/kpi-value.js +11 -5
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
- package/dist-server/service/utils/value-date-util.d.ts +1 -0
- package/dist-server/service/utils/value-date-util.js +41 -0
- package/dist-server/service/utils/value-date-util.js.map +1 -1
- package/dist-server/tsconfig.json +10 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/server/@types/index.d.ts +11 -0
- package/server/controllers/kpi-metric-value-provider.ts +5 -5
- package/server/controllers/kpi-value-provider.ts +4 -4
- package/server/migrations/1752190849680-seed-kpi-metrics.ts +124 -0
- package/server/migrations/1752190849681-seed-kpi.ts +356 -0
- package/server/migrations/1752192090123-add-grades-to-kpi.ts +67 -0
- package/server/migrations/1752192090124-add-kpi-statistics.ts +719 -0
- package/server/migrations/1752192090128-seed-kpi-org-scope.ts +132 -0
- package/server/migrations/1752192090129-seed-kpi-values.ts +207 -0
- package/server/migrations/grade-data/x11-performance-table.json +962 -0
- package/server/migrations/grade-data/x12-performance-table.json +611 -0
- package/server/migrations/grade-data/x14-performance-table.json +42 -0
- package/server/migrations/grade-data/x21-performance-table.json +889 -0
- package/server/migrations/grade-data/x22-performance-table.json +1064 -0
- package/server/migrations/grade-data/x23-performance-table.json +42 -0
- package/server/migrations/grade-data/x31-performance-table.json +644 -0
- package/server/migrations/grade-data/x32-performance-table.json +993 -0
- package/server/migrations/grade-data/x33-performance-table.json +195 -0
- package/server/migrations/grade-data/x34-performance-table.json +12 -0
- package/server/migrations/grade-data/x35-performance-table.json +42 -0
- package/server/migrations/grade-data/x41-performance-table.json +825 -0
- package/server/migrations/grade-data/x42-performance-table.json +786 -0
- package/server/migrations/grade-data/x43-performance-table.json +12 -0
- package/server/migrations/grade-data/x44-performance-table.json +42 -0
- package/server/migrations/grade-data/x51-performance-table.json +924 -0
- package/server/migrations/grade-data/x52-performance-table.json +42 -0
- package/server/migrations/grade-data/x61-performance-table.json +261 -0
- package/server/migrations/grade-data/x62-performance-table.json +42 -0
- package/server/migrations/seed-data/kpi-metrics-seed.json +454 -0
- package/server/migrations/seed-data/kpi-org-scope-seed.json +1676 -0
- package/server/migrations/seed-data/kpi-values-seed.json +402 -0
- package/server/migrations/seed-data/kpis-seed.json +488 -0
- package/server/service/index.ts +5 -12
- package/server/service/kpi/aggregate-kpi.ts +31 -13
- package/server/service/kpi/kpi-formula.service.ts +101 -0
- package/server/service/kpi/kpi-history.ts +0 -8
- package/server/service/kpi/kpi-mutation.ts +59 -19
- package/server/service/kpi/kpi-query.ts +118 -8
- package/server/service/kpi/kpi-type.ts +10 -4
- package/server/service/kpi/kpi.ts +17 -7
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +55 -11
- package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +6 -6
- package/server/service/kpi-metric-value/kpi-metric-value-type.ts +4 -4
- package/server/service/kpi-metric-value/kpi-metric-value.ts +3 -3
- package/server/service/kpi-org-scope/index.ts +11 -0
- package/server/service/kpi-org-scope/kpi-org-scope-mutation.ts +173 -0
- package/server/service/kpi-org-scope/kpi-org-scope-query.ts +127 -0
- package/server/service/kpi-org-scope/kpi-org-scope-type.ts +68 -0
- package/server/service/kpi-org-scope/kpi-org-scope.ts +123 -0
- package/server/service/kpi-statistic/kpi-statistic.ts +10 -0
- package/server/service/kpi-value/kpi-value-mutation.ts +73 -7
- package/server/service/kpi-value/kpi-value-type.ts +10 -4
- package/server/service/kpi-value/kpi-value.ts +10 -5
- package/server/service/utils/value-date-util.ts +47 -0
- package/server/types/global.d.ts +8 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +15 -3
- package/translations/ja.json +13 -3
- package/translations/ko.json +15 -3
- package/translations/ms.json +13 -3
- package/translations/zh.json +13 -3
- package/client/pages/kpi-category/kpi-category-importer.ts +0 -90
- package/client/pages/kpi-category/kpi-category-list-page.ts +0 -537
- package/client/pages/kpi-category/kpi-category-value-calculator.ts +0 -233
- package/client/pages/kpi-category-value/kpi-category-value-list-page.ts +0 -404
- package/dist-client/pages/kpi-category/kpi-category-importer.d.ts +0 -23
- package/dist-client/pages/kpi-category/kpi-category-importer.js +0 -92
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +0 -1
- package/dist-client/pages/kpi-category/kpi-category-list-page.d.ts +0 -74
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +0 -517
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +0 -1
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.d.ts +0 -13
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.js +0 -256
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.js.map +0 -1
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.d.ts +0 -63
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js +0 -393
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js.map +0 -1
- package/dist-server/service/kpi-category/index.d.ts +0 -6
- package/dist-server/service/kpi-category/index.js +0 -10
- package/dist-server/service/kpi-category/index.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +0 -9
- package/dist-server/service/kpi-category/kpi-category-mutation.js +0 -221
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +0 -18
- package/dist-server/service/kpi-category/kpi-category-query.js +0 -115
- package/dist-server/service/kpi-category/kpi-category-query.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +0 -24
- package/dist-server/service/kpi-category/kpi-category-type.js +0 -100
- package/dist-server/service/kpi-category/kpi-category-type.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category.d.ts +0 -22
- package/dist-server/service/kpi-category/kpi-category.js +0 -106
- package/dist-server/service/kpi-category/kpi-category.js.map +0 -1
- package/dist-server/service/kpi-category-value/index.d.ts +0 -6
- package/dist-server/service/kpi-category-value/index.js +0 -10
- package/dist-server/service/kpi-category-value/index.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.d.ts +0 -8
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js +0 -102
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-query.d.ts +0 -13
- package/dist-server/service/kpi-category-value/kpi-category-value-query.js +0 -91
- package/dist-server/service/kpi-category-value/kpi-category-value-query.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-type.d.ts +0 -19
- package/dist-server/service/kpi-category-value/kpi-category-value-type.js +0 -73
- package/dist-server/service/kpi-category-value/kpi-category-value-type.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value.d.ts +0 -19
- package/dist-server/service/kpi-category-value/kpi-category-value.js +0 -91
- package/dist-server/service/kpi-category-value/kpi-category-value.js.map +0 -1
- package/helps/kpi/kpi-category.md +0 -160
- package/server/service/kpi-category/index.ts +0 -7
- package/server/service/kpi-category/kpi-category-mutation.ts +0 -217
- package/server/service/kpi-category/kpi-category-query.ts +0 -87
- package/server/service/kpi-category/kpi-category-type.ts +0 -73
- package/server/service/kpi-category/kpi-category.ts +0 -95
- package/server/service/kpi-category-value/index.ts +0 -7
- package/server/service/kpi-category-value/kpi-category-value-mutation.ts +0 -88
- package/server/service/kpi-category-value/kpi-category-value-query.ts +0 -62
- package/server/service/kpi-category-value/kpi-category-value-type.ts +0 -48
- package/server/service/kpi-category-value/kpi-category-value.ts +0 -79
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiCategory = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
const kpi_1 = require("../kpi/kpi");
|
|
10
|
-
const kpi_2 = require("../kpi/kpi");
|
|
11
|
-
let KpiCategory = class KpiCategory {
|
|
12
|
-
};
|
|
13
|
-
exports.KpiCategory = KpiCategory;
|
|
14
|
-
tslib_1.__decorate([
|
|
15
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
16
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for this KPI category.' }),
|
|
17
|
-
tslib_1.__metadata("design:type", String)
|
|
18
|
-
], KpiCategory.prototype, "id", void 0);
|
|
19
|
-
tslib_1.__decorate([
|
|
20
|
-
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
21
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain (tenant) to which this KPI category belongs.' }),
|
|
22
|
-
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
23
|
-
], KpiCategory.prototype, "domain", void 0);
|
|
24
|
-
tslib_1.__decorate([
|
|
25
|
-
(0, typeorm_1.RelationId)((category) => category.domain),
|
|
26
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the domain (tenant) for this KPI category.' }),
|
|
27
|
-
tslib_1.__metadata("design:type", String)
|
|
28
|
-
], KpiCategory.prototype, "domainId", void 0);
|
|
29
|
-
tslib_1.__decorate([
|
|
30
|
-
(0, typeorm_1.Column)(),
|
|
31
|
-
(0, type_graphql_1.Field)({ description: 'Name of the KPI category.' }),
|
|
32
|
-
tslib_1.__metadata("design:type", String)
|
|
33
|
-
], KpiCategory.prototype, "name", void 0);
|
|
34
|
-
tslib_1.__decorate([
|
|
35
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
36
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Detailed description of this KPI category.' }),
|
|
37
|
-
tslib_1.__metadata("design:type", String)
|
|
38
|
-
], KpiCategory.prototype, "description", void 0);
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, typeorm_1.Column)({ nullable: false, default: false }),
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Whether this category is active (usable) or not.' }),
|
|
42
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
43
|
-
], KpiCategory.prototype, "active", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
-
(0, type_graphql_1.Field)({
|
|
47
|
-
nullable: true,
|
|
48
|
-
description: 'Calculation formula for category score using KPI score variables. Example: "avg(sales_score, profit_score)" or "sales_score * 0.6 + profit_score * 0.4". If not provided, weighted average of child KPI scores will be used.'
|
|
49
|
-
}),
|
|
50
|
-
tslib_1.__metadata("design:type", String)
|
|
51
|
-
], KpiCategory.prototype, "formula", void 0);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
(0, typeorm_1.Column)({ type: 'float', nullable: true, default: 1 }),
|
|
54
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Weight for aggregation in higher-level summary.' }),
|
|
55
|
-
tslib_1.__metadata("design:type", Number)
|
|
56
|
-
], KpiCategory.prototype, "weight", void 0);
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
(0, typeorm_1.Column)({ default: 'DAY' }),
|
|
59
|
-
(0, type_graphql_1.Field)(type => kpi_2.KpiPeriodType, { description: 'Aggregation period type for this category.' }),
|
|
60
|
-
tslib_1.__metadata("design:type", String)
|
|
61
|
-
], KpiCategory.prototype, "periodType", void 0);
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
64
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created this KPI category.' }),
|
|
65
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
66
|
-
], KpiCategory.prototype, "creator", void 0);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
(0, typeorm_1.RelationId)((category) => category.creator),
|
|
69
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who created this KPI category.' }),
|
|
70
|
-
tslib_1.__metadata("design:type", String)
|
|
71
|
-
], KpiCategory.prototype, "creatorId", void 0);
|
|
72
|
-
tslib_1.__decorate([
|
|
73
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
74
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated this KPI category.' }),
|
|
75
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
76
|
-
], KpiCategory.prototype, "updater", void 0);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
(0, typeorm_1.RelationId)((category) => category.updater),
|
|
79
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who last updated this KPI category.' }),
|
|
80
|
-
tslib_1.__metadata("design:type", String)
|
|
81
|
-
], KpiCategory.prototype, "updaterId", void 0);
|
|
82
|
-
tslib_1.__decorate([
|
|
83
|
-
(0, typeorm_1.CreateDateColumn)(),
|
|
84
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI category was created.' }),
|
|
85
|
-
tslib_1.__metadata("design:type", Date)
|
|
86
|
-
], KpiCategory.prototype, "createdAt", void 0);
|
|
87
|
-
tslib_1.__decorate([
|
|
88
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
|
89
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI category was last updated.' }),
|
|
90
|
-
tslib_1.__metadata("design:type", Date)
|
|
91
|
-
], KpiCategory.prototype, "updatedAt", void 0);
|
|
92
|
-
tslib_1.__decorate([
|
|
93
|
-
(0, typeorm_1.OneToMany)(type => kpi_1.Kpi, kpi => kpi.category),
|
|
94
|
-
(0, type_graphql_1.Field)(type => [kpi_1.Kpi], { nullable: true, description: 'List of KPIs belonging to this category.' }),
|
|
95
|
-
tslib_1.__metadata("design:type", Array)
|
|
96
|
-
], KpiCategory.prototype, "kpis", void 0);
|
|
97
|
-
exports.KpiCategory = KpiCategory = tslib_1.__decorate([
|
|
98
|
-
(0, typeorm_1.Entity)(),
|
|
99
|
-
(0, typeorm_1.Index)('ix_kpi_category_0', (kpiCategory) => [kpiCategory.domain, kpiCategory.name], {
|
|
100
|
-
unique: true
|
|
101
|
-
}),
|
|
102
|
-
(0, type_graphql_1.ObjectType)({
|
|
103
|
-
description: 'KPI category entity. Represents a classification or group for KPIs. Supports hierarchical (tree) structure.'
|
|
104
|
-
})
|
|
105
|
-
], KpiCategory);
|
|
106
|
-
//# sourceMappingURL=kpi-category.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category.js","sour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AAA,oBAAU,EAAC,CAAC,QAAqB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;IACvD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;8CAC3E;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;sCAC5E,IAAI;8CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;sCACjF,IAAI;8CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,SAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;yCACtF;sBAnED,WAAW;IARvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE;QAChG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,6GAA6G;KAChH,CAAC;GACW,WAAW,CAoEvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Kpi } from '../kpi/kpi'\nimport { KpiPeriodType } from '../kpi/kpi'\n\n@Entity()\n@Index('ix_kpi_category_0', (kpiCategory: KpiCategory) => [kpiCategory.domain, kpiCategory.name], {\n unique: true\n})\n@ObjectType({\n description:\n 'KPI category entity. Represents a classification or group for KPIs. Supports hierarchical (tree) structure.'\n})\nexport class KpiCategory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this KPI category.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this KPI category belongs.' })\n domain?: Domain\n\n @RelationId((category: KpiCategory) => category.domain)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI category.' })\n domainId?: string\n\n @Column()\n @Field({ description: 'Name of the KPI category.' })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Detailed description of this KPI category.' })\n description?: string\n\n @Column({ nullable: false, default: false })\n @Field({ nullable: true, description: 'Whether this category is active (usable) or not.' })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n 'Calculation formula for category score using KPI score variables. Example: \"avg(sales_score, profit_score)\" or \"sales_score * 0.6 + profit_score * 0.4\". If not provided, weighted average of child KPI scores will be used.'\n })\n formula?: string\n\n @Column({ type: 'float', nullable: true, default: 1 })\n @Field({ nullable: true, description: 'Weight for aggregation in higher-level summary.' })\n weight?: number\n\n @Column({ default: 'DAY' })\n @Field(type => KpiPeriodType, { description: 'Aggregation period type for this category.' })\n periodType: KpiPeriodType\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created this KPI category.' })\n creator?: User\n\n @RelationId((category: KpiCategory) => category.creator)\n @Field({ nullable: true, description: 'ID of the user who created this KPI category.' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated this KPI category.' })\n updater?: User\n\n @RelationId((category: KpiCategory) => category.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this KPI category.' })\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI category was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI category was last updated.' })\n updatedAt?: Date\n\n @OneToMany(type => Kpi, kpi => kpi.category)\n @Field(type => [Kpi], { nullable: true, description: 'List of KPIs belonging to this category.' })\n kpis?: Kpi[]\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { KpiCategoryValue } from './kpi-category-value';
|
|
2
|
-
import { KpiCategoryValueQuery } from './kpi-category-value-query';
|
|
3
|
-
import { KpiCategoryValueMutation } from './kpi-category-value-mutation';
|
|
4
|
-
export declare const entities: (typeof KpiCategoryValue)[];
|
|
5
|
-
export declare const resolvers: (typeof KpiCategoryValueQuery | typeof KpiCategoryValueMutation)[];
|
|
6
|
-
export declare const subscribers: any[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const kpi_category_value_1 = require("./kpi-category-value");
|
|
5
|
-
const kpi_category_value_query_1 = require("./kpi-category-value-query");
|
|
6
|
-
const kpi_category_value_mutation_1 = require("./kpi-category-value-mutation");
|
|
7
|
-
exports.entities = [kpi_category_value_1.KpiCategoryValue];
|
|
8
|
-
exports.resolvers = [kpi_category_value_query_1.KpiCategoryValueQuery, kpi_category_value_mutation_1.KpiCategoryValueMutation];
|
|
9
|
-
exports.subscribers = [];
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/kpi-category-value/index.ts"],"names":[],"mappings":";;;AAAA,6DAAuD;AACvD,yEAAkE;AAClE,+EAAwE;AAE3D,QAAA,QAAQ,GAAG,CAAC,qCAAgB,CAAC,CAAA;AAC7B,QAAA,SAAS,GAAG,CAAC,gDAAqB,EAAE,sDAAwB,CAAC,CAAA;AAC7D,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { KpiCategoryValue } from './kpi-category-value'\nimport { KpiCategoryValueQuery } from './kpi-category-value-query'\nimport { KpiCategoryValueMutation } from './kpi-category-value-mutation'\n\nexport const entities = [KpiCategoryValue]\nexport const resolvers = [KpiCategoryValueQuery, KpiCategoryValueMutation]\nexport const subscribers = []\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { KpiCategoryValue } from './kpi-category-value';
|
|
2
|
-
import { NewKpiCategoryValue, KpiCategoryValuePatch } from './kpi-category-value-type';
|
|
3
|
-
export declare class KpiCategoryValueMutation {
|
|
4
|
-
createKpiCategoryValue(kpiCategoryValue: NewKpiCategoryValue, context: ResolverContext): Promise<KpiCategoryValue>;
|
|
5
|
-
updateKpiCategoryValue(id: string, patch: KpiCategoryValuePatch, context: ResolverContext): Promise<KpiCategoryValue>;
|
|
6
|
-
deleteKpiCategoryValue(id: string, context: ResolverContext): Promise<boolean>;
|
|
7
|
-
updateMultipleKpiCategoryValue(ids: string[], patch: KpiCategoryValuePatch, context: ResolverContext): Promise<KpiCategoryValue[]>;
|
|
8
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiCategoryValueMutation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const kpi_category_value_1 = require("./kpi-category-value");
|
|
8
|
-
const kpi_category_value_type_1 = require("./kpi-category-value-type");
|
|
9
|
-
let KpiCategoryValueMutation = class KpiCategoryValueMutation {
|
|
10
|
-
async createKpiCategoryValue(kpiCategoryValue, context) {
|
|
11
|
-
const { domain, user } = context.state;
|
|
12
|
-
const newKpiCategoryValue = (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).create({
|
|
13
|
-
...kpiCategoryValue,
|
|
14
|
-
domainId: domain.id,
|
|
15
|
-
creatorId: user.id,
|
|
16
|
-
updaterId: user.id
|
|
17
|
-
});
|
|
18
|
-
return await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).save(newKpiCategoryValue);
|
|
19
|
-
}
|
|
20
|
-
async updateKpiCategoryValue(id, patch, context) {
|
|
21
|
-
const { user } = context.state;
|
|
22
|
-
const kpiCategoryValue = await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).findOneBy({ id });
|
|
23
|
-
if (!kpiCategoryValue) {
|
|
24
|
-
throw new Error(`KPI category value with id ${id} not found`);
|
|
25
|
-
}
|
|
26
|
-
Object.assign(kpiCategoryValue, {
|
|
27
|
-
...patch,
|
|
28
|
-
updaterId: user.id
|
|
29
|
-
});
|
|
30
|
-
return await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).save(kpiCategoryValue);
|
|
31
|
-
}
|
|
32
|
-
async deleteKpiCategoryValue(id, context) {
|
|
33
|
-
const kpiCategoryValue = await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).findOneBy({ id });
|
|
34
|
-
if (!kpiCategoryValue) {
|
|
35
|
-
throw new Error(`KPI category value with id ${id} not found`);
|
|
36
|
-
}
|
|
37
|
-
await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).remove(kpiCategoryValue);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
async updateMultipleKpiCategoryValue(ids, patch, context) {
|
|
41
|
-
const { user } = context.state;
|
|
42
|
-
const kpiCategoryValues = await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).findByIds(ids);
|
|
43
|
-
if (kpiCategoryValues.length !== ids.length) {
|
|
44
|
-
throw new Error('Some KPI category values not found');
|
|
45
|
-
}
|
|
46
|
-
const updatedValues = kpiCategoryValues.map(value => {
|
|
47
|
-
Object.assign(value, {
|
|
48
|
-
...patch,
|
|
49
|
-
updaterId: user.id
|
|
50
|
-
});
|
|
51
|
-
return value;
|
|
52
|
-
});
|
|
53
|
-
return await (0, typeorm_1.getRepository)(kpi_category_value_1.KpiCategoryValue).save(updatedValues);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.KpiCategoryValueMutation = KpiCategoryValueMutation;
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
(0, type_graphql_1.Mutation)(type => kpi_category_value_1.KpiCategoryValue, {
|
|
59
|
-
description: 'Create a new KPI category value.'
|
|
60
|
-
}),
|
|
61
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiCategoryValue')),
|
|
62
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
|
-
tslib_1.__metadata("design:type", Function),
|
|
64
|
-
tslib_1.__metadata("design:paramtypes", [kpi_category_value_type_1.NewKpiCategoryValue, Object]),
|
|
65
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
66
|
-
], KpiCategoryValueMutation.prototype, "createKpiCategoryValue", null);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
(0, type_graphql_1.Mutation)(type => kpi_category_value_1.KpiCategoryValue, {
|
|
69
|
-
description: 'Update an existing KPI category value.'
|
|
70
|
-
}),
|
|
71
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
72
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
73
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
74
|
-
tslib_1.__metadata("design:type", Function),
|
|
75
|
-
tslib_1.__metadata("design:paramtypes", [String, kpi_category_value_type_1.KpiCategoryValuePatch, Object]),
|
|
76
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
-
], KpiCategoryValueMutation.prototype, "updateKpiCategoryValue", null);
|
|
78
|
-
tslib_1.__decorate([
|
|
79
|
-
(0, type_graphql_1.Mutation)(type => Boolean, {
|
|
80
|
-
description: 'Delete a KPI category value.'
|
|
81
|
-
}),
|
|
82
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
83
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
84
|
-
tslib_1.__metadata("design:type", Function),
|
|
85
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
86
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
87
|
-
], KpiCategoryValueMutation.prototype, "deleteKpiCategoryValue", null);
|
|
88
|
-
tslib_1.__decorate([
|
|
89
|
-
(0, type_graphql_1.Mutation)(type => [kpi_category_value_1.KpiCategoryValue], {
|
|
90
|
-
description: 'Update multiple KPI category values.'
|
|
91
|
-
}),
|
|
92
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
93
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
94
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
95
|
-
tslib_1.__metadata("design:type", Function),
|
|
96
|
-
tslib_1.__metadata("design:paramtypes", [Array, kpi_category_value_type_1.KpiCategoryValuePatch, Object]),
|
|
97
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
98
|
-
], KpiCategoryValueMutation.prototype, "updateMultipleKpiCategoryValue", null);
|
|
99
|
-
exports.KpiCategoryValueMutation = KpiCategoryValueMutation = tslib_1.__decorate([
|
|
100
|
-
(0, type_graphql_1.Resolver)()
|
|
101
|
-
], KpiCategoryValueMutation);
|
|
102
|
-
//# sourceMappingURL=kpi-category-value-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category-value-mutation.js","sourceRoot":"","sources":["../../../server/service/kpi-category-value/kpi-category-value-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D,qCAAuC;AACvC,6DAAuD;AACvD,uEAAsF;AAG/E,IAAM,wBAAwB,GAA9B,MAA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AC,qCAAgB,EAAE;QAClC,WAAW,EAAE,wCAAwC;KACtD,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,+CAAqB;;sEAgB3C;AAKK;IAHL,IAAA,uBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE;QACzB,WAAW,EAAE,8BAA8B;KAC5C,CAAC;IAC4B,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEAQzD;AAKK;IAHL,IAAA,uBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAgB,CAAC,EAAE;QACpC,WAAW,EAAE,sCAAsC;KACpD,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;oDADe,+CAAqB;;8EAmB3C;mCAhFU,wBAAwB;IADpC,IAAA,uBAAQ,GAAE;GACE,wBAAwB,CAiFpC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { KpiCategoryValue } from './kpi-category-value'\nimport { NewKpiCategoryValue, KpiCategoryValuePatch } from './kpi-category-value-type'\n\n@Resolver()\nexport class KpiCategoryValueMutation {\n @Mutation(type => KpiCategoryValue, {\n description: 'Create a new KPI category value.'\n })\n async createKpiCategoryValue(\n @Arg('kpiCategoryValue') kpiCategoryValue: NewKpiCategoryValue,\n @Ctx() context: ResolverContext\n ): Promise<KpiCategoryValue> {\n const { domain, user } = context.state\n\n const newKpiCategoryValue = getRepository(KpiCategoryValue).create({\n ...kpiCategoryValue,\n domainId: domain.id,\n creatorId: user.id,\n updaterId: user.id\n })\n\n return await getRepository(KpiCategoryValue).save(newKpiCategoryValue)\n }\n\n @Mutation(type => KpiCategoryValue, {\n description: 'Update an existing KPI category value.'\n })\n async updateKpiCategoryValue(\n @Arg('id') id: string,\n @Arg('patch') patch: KpiCategoryValuePatch,\n @Ctx() context: ResolverContext\n ): Promise<KpiCategoryValue> {\n const { user } = context.state\n\n const kpiCategoryValue = await getRepository(KpiCategoryValue).findOneBy({ id })\n if (!kpiCategoryValue) {\n throw new Error(`KPI category value with id ${id} not found`)\n }\n\n Object.assign(kpiCategoryValue, {\n ...patch,\n updaterId: user.id\n })\n\n return await getRepository(KpiCategoryValue).save(kpiCategoryValue)\n }\n\n @Mutation(type => Boolean, {\n description: 'Delete a KPI category value.'\n })\n async deleteKpiCategoryValue(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const kpiCategoryValue = await getRepository(KpiCategoryValue).findOneBy({ id })\n if (!kpiCategoryValue) {\n throw new Error(`KPI category value with id ${id} not found`)\n }\n\n await getRepository(KpiCategoryValue).remove(kpiCategoryValue)\n return true\n }\n\n @Mutation(type => [KpiCategoryValue], {\n description: 'Update multiple KPI category values.'\n })\n async updateMultipleKpiCategoryValue(\n @Arg('ids', type => [String]) ids: string[],\n @Arg('patch') patch: KpiCategoryValuePatch,\n @Ctx() context: ResolverContext\n ): Promise<KpiCategoryValue[]> {\n const { user } = context.state\n\n const kpiCategoryValues = await getRepository(KpiCategoryValue).findByIds(ids)\n if (kpiCategoryValues.length !== ids.length) {\n throw new Error('Some KPI category values not found')\n }\n\n const updatedValues = kpiCategoryValues.map(value => {\n Object.assign(value, {\n ...patch,\n updaterId: user.id\n })\n return value\n })\n\n return await getRepository(KpiCategoryValue).save(updatedValues)\n }\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { KpiCategoryValue } from './kpi-category-value';
|
|
2
|
-
import { Domain, ListParam } from '@things-factory/shell';
|
|
3
|
-
import { KpiCategory } from '../kpi-category/kpi-category';
|
|
4
|
-
import { User } from '@things-factory/auth-base';
|
|
5
|
-
import { KpiCategoryValueList } from './kpi-category-value-type';
|
|
6
|
-
export declare class KpiCategoryValueQuery {
|
|
7
|
-
kpiCategoryValue(id: string, context: ResolverContext): Promise<KpiCategoryValue>;
|
|
8
|
-
kpiCategoryValues(params: ListParam, context: ResolverContext): Promise<KpiCategoryValueList>;
|
|
9
|
-
domain(kpiCategoryValue: KpiCategoryValue): Promise<Domain>;
|
|
10
|
-
category(kpiCategoryValue: KpiCategoryValue): Promise<KpiCategory>;
|
|
11
|
-
creator(kpiCategoryValue: KpiCategoryValue): Promise<User>;
|
|
12
|
-
updater(kpiCategoryValue: KpiCategoryValue): Promise<User>;
|
|
13
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiCategoryValueQuery = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const kpi_category_value_1 = require("./kpi-category-value");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const kpi_category_1 = require("../kpi-category/kpi-category");
|
|
9
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
10
|
-
const kpi_category_value_type_1 = require("./kpi-category-value-type");
|
|
11
|
-
let KpiCategoryValueQuery = class KpiCategoryValueQuery {
|
|
12
|
-
async kpiCategoryValue(id, context) {
|
|
13
|
-
return await (0, shell_1.getRepository)(kpi_category_value_1.KpiCategoryValue).findOneBy({ id });
|
|
14
|
-
}
|
|
15
|
-
async kpiCategoryValues(params, context) {
|
|
16
|
-
const { domain } = context.state;
|
|
17
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
18
|
-
domain,
|
|
19
|
-
params,
|
|
20
|
-
repository: await (0, shell_1.getRepository)(kpi_category_value_1.KpiCategoryValue),
|
|
21
|
-
searchables: ['category', 'group', 'valueDate']
|
|
22
|
-
});
|
|
23
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
|
24
|
-
return { items, total };
|
|
25
|
-
}
|
|
26
|
-
async domain(kpiCategoryValue) {
|
|
27
|
-
return kpiCategoryValue.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: kpiCategoryValue.domainId }));
|
|
28
|
-
}
|
|
29
|
-
async category(kpiCategoryValue) {
|
|
30
|
-
return (kpiCategoryValue.categoryId && (await (0, shell_1.getRepository)(kpi_category_1.KpiCategory).findOneBy({ id: kpiCategoryValue.categoryId })));
|
|
31
|
-
}
|
|
32
|
-
async creator(kpiCategoryValue) {
|
|
33
|
-
return kpiCategoryValue.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiCategoryValue.creatorId }));
|
|
34
|
-
}
|
|
35
|
-
async updater(kpiCategoryValue) {
|
|
36
|
-
return kpiCategoryValue.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiCategoryValue.updaterId }));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.KpiCategoryValueQuery = KpiCategoryValueQuery;
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
(0, type_graphql_1.Query)(type => kpi_category_value_1.KpiCategoryValue, {
|
|
42
|
-
description: 'Get a specific KPI category value by ID.'
|
|
43
|
-
}),
|
|
44
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id', { description: 'Unique identifier of the KPI category value to fetch.' })),
|
|
45
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
46
|
-
tslib_1.__metadata("design:type", Function),
|
|
47
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
48
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
49
|
-
], KpiCategoryValueQuery.prototype, "kpiCategoryValue", null);
|
|
50
|
-
tslib_1.__decorate([
|
|
51
|
-
(0, type_graphql_1.Query)(type => kpi_category_value_type_1.KpiCategoryValueList, {
|
|
52
|
-
description: 'Get a list of KPI category values with optional filtering and pagination.'
|
|
53
|
-
}),
|
|
54
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
55
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
56
|
-
tslib_1.__metadata("design:type", Function),
|
|
57
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
58
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
59
|
-
], KpiCategoryValueQuery.prototype, "kpiCategoryValues", null);
|
|
60
|
-
tslib_1.__decorate([
|
|
61
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
62
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
63
|
-
tslib_1.__metadata("design:type", Function),
|
|
64
|
-
tslib_1.__metadata("design:paramtypes", [kpi_category_value_1.KpiCategoryValue]),
|
|
65
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
66
|
-
], KpiCategoryValueQuery.prototype, "domain", null);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
(0, type_graphql_1.FieldResolver)(type => kpi_category_1.KpiCategory),
|
|
69
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
70
|
-
tslib_1.__metadata("design:type", Function),
|
|
71
|
-
tslib_1.__metadata("design:paramtypes", [kpi_category_value_1.KpiCategoryValue]),
|
|
72
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
73
|
-
], KpiCategoryValueQuery.prototype, "category", null);
|
|
74
|
-
tslib_1.__decorate([
|
|
75
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
76
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
77
|
-
tslib_1.__metadata("design:type", Function),
|
|
78
|
-
tslib_1.__metadata("design:paramtypes", [kpi_category_value_1.KpiCategoryValue]),
|
|
79
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
80
|
-
], KpiCategoryValueQuery.prototype, "creator", null);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
83
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
84
|
-
tslib_1.__metadata("design:type", Function),
|
|
85
|
-
tslib_1.__metadata("design:paramtypes", [kpi_category_value_1.KpiCategoryValue]),
|
|
86
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
87
|
-
], KpiCategoryValueQuery.prototype, "updater", null);
|
|
88
|
-
exports.KpiCategoryValueQuery = KpiCategoryValueQuery = tslib_1.__decorate([
|
|
89
|
-
(0, type_graphql_1.Resolver)(kpi_category_value_1.KpiCategoryValue)
|
|
90
|
-
], KpiCategoryValueQuery);
|
|
91
|
-
//# sourceMappingURL=kpi-category-value-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category-value-query.js","sourceRoot":"","sources":["../../../server/service/kpi-category-value/kpi-category-value-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,6DAAuD;AACvD,iDAAuG;AACvG,+DAA0D;AAC1D,yDAAgD;AAChD,uEAAgE;AAGzD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAI1B,AAAN,KAAK,CAAC,gBAAgB,CACiE,EAAU,EACxF,OAAwB;QAE/B,OAAO,MAAM,IAAA,qBAAa,EAAC,qCAAgB,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAChE,CAAC;IAKK,AAAN,KAAK,CAAC,iBAAiB,CACI,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM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,qCAAgB,EAAE;QAC/B,WAAW,EAAE,0CAA0C;KACxD,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,IAAI,EAAE,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC,CAAA;IACnF,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAGP;AAKK;IAHL,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8CAAoB,EAAE;QACnC,WAAW,EAAE,2EAA2E;KACzF,CAAC;IAEC,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IACvB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD2B,iBAAS;;8DAe3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;mDAEtD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAW,CAAC;IACnB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;qDAIxD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;oDAEvD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;oDAEvD;gCApDU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,qCAAgB,CAAC;GACd,qBAAqB,CAqDjC","sourcesContent":["import { Resolver, Query, Arg, Ctx, FieldResolver, Root, Args } from 'type-graphql'\nimport { KpiCategoryValue } from './kpi-category-value'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { KpiCategory } from '../kpi-category/kpi-category'\nimport { User } from '@things-factory/auth-base'\nimport { KpiCategoryValueList } from './kpi-category-value-type'\n\n@Resolver(KpiCategoryValue)\nexport class KpiCategoryValueQuery {\n @Query(type => KpiCategoryValue, {\n description: 'Get a specific KPI category value by ID.'\n })\n async kpiCategoryValue(\n @Arg('id', { description: 'Unique identifier of the KPI category value to fetch.' }) id: string,\n @Ctx() context: ResolverContext\n ): Promise<KpiCategoryValue> {\n return await getRepository(KpiCategoryValue).findOneBy({ id })\n }\n\n @Query(type => KpiCategoryValueList, {\n description: 'Get a list of KPI category values with optional filtering and pagination.'\n })\n async kpiCategoryValues(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<KpiCategoryValueList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(KpiCategoryValue),\n searchables: ['category', 'group', 'valueDate']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() kpiCategoryValue: KpiCategoryValue): Promise<Domain> {\n return kpiCategoryValue.domainId && (await getRepository(Domain).findOneBy({ id: kpiCategoryValue.domainId }))\n }\n\n @FieldResolver(type => KpiCategory)\n async category(@Root() kpiCategoryValue: KpiCategoryValue): Promise<KpiCategory> {\n return (\n kpiCategoryValue.categoryId && (await getRepository(KpiCategory).findOneBy({ id: kpiCategoryValue.categoryId }))\n )\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() kpiCategoryValue: KpiCategoryValue): Promise<User> {\n return kpiCategoryValue.creatorId && (await getRepository(User).findOneBy({ id: kpiCategoryValue.creatorId }))\n }\n\n @FieldResolver(type => User, { nullable: true })\n async updater(@Root() kpiCategoryValue: KpiCategoryValue): Promise<User> {\n return kpiCategoryValue.updaterId && (await getRepository(User).findOneBy({ id: kpiCategoryValue.updaterId }))\n }\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { KpiCategoryValue } from './kpi-category-value';
|
|
2
|
-
export declare class NewKpiCategoryValue {
|
|
3
|
-
domainId: string;
|
|
4
|
-
categoryId: string;
|
|
5
|
-
group?: string;
|
|
6
|
-
score?: number;
|
|
7
|
-
valueDate: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class KpiCategoryValuePatch {
|
|
10
|
-
domainId?: string;
|
|
11
|
-
categoryId?: string;
|
|
12
|
-
group?: string;
|
|
13
|
-
score?: number;
|
|
14
|
-
valueDate?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class KpiCategoryValueList {
|
|
17
|
-
items: KpiCategoryValue[];
|
|
18
|
-
total: number;
|
|
19
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiCategoryValueList = exports.KpiCategoryValuePatch = exports.NewKpiCategoryValue = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const kpi_category_value_1 = require("./kpi-category-value");
|
|
7
|
-
let NewKpiCategoryValue = class NewKpiCategoryValue {
|
|
8
|
-
};
|
|
9
|
-
exports.NewKpiCategoryValue = NewKpiCategoryValue;
|
|
10
|
-
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)(),
|
|
12
|
-
tslib_1.__metadata("design:type", String)
|
|
13
|
-
], NewKpiCategoryValue.prototype, "domainId", void 0);
|
|
14
|
-
tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.Field)(),
|
|
16
|
-
tslib_1.__metadata("design:type", String)
|
|
17
|
-
], NewKpiCategoryValue.prototype, "categoryId", void 0);
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
-
tslib_1.__metadata("design:type", String)
|
|
21
|
-
], NewKpiCategoryValue.prototype, "group", void 0);
|
|
22
|
-
tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Performance score for this category (0-1 range)' }),
|
|
24
|
-
tslib_1.__metadata("design:type", Number)
|
|
25
|
-
], NewKpiCategoryValue.prototype, "score", void 0);
|
|
26
|
-
tslib_1.__decorate([
|
|
27
|
-
(0, type_graphql_1.Field)(),
|
|
28
|
-
tslib_1.__metadata("design:type", String)
|
|
29
|
-
], NewKpiCategoryValue.prototype, "valueDate", void 0);
|
|
30
|
-
exports.NewKpiCategoryValue = NewKpiCategoryValue = tslib_1.__decorate([
|
|
31
|
-
(0, type_graphql_1.InputType)()
|
|
32
|
-
], NewKpiCategoryValue);
|
|
33
|
-
let KpiCategoryValuePatch = class KpiCategoryValuePatch {
|
|
34
|
-
};
|
|
35
|
-
exports.KpiCategoryValuePatch = KpiCategoryValuePatch;
|
|
36
|
-
tslib_1.__decorate([
|
|
37
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
38
|
-
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], KpiCategoryValuePatch.prototype, "domainId", void 0);
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
-
tslib_1.__metadata("design:type", String)
|
|
43
|
-
], KpiCategoryValuePatch.prototype, "categoryId", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
-
tslib_1.__metadata("design:type", String)
|
|
47
|
-
], KpiCategoryValuePatch.prototype, "group", void 0);
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Performance score for this category (0-1 range)' }),
|
|
50
|
-
tslib_1.__metadata("design:type", Number)
|
|
51
|
-
], KpiCategoryValuePatch.prototype, "score", void 0);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], KpiCategoryValuePatch.prototype, "valueDate", void 0);
|
|
56
|
-
exports.KpiCategoryValuePatch = KpiCategoryValuePatch = tslib_1.__decorate([
|
|
57
|
-
(0, type_graphql_1.InputType)()
|
|
58
|
-
], KpiCategoryValuePatch);
|
|
59
|
-
let KpiCategoryValueList = class KpiCategoryValueList {
|
|
60
|
-
};
|
|
61
|
-
exports.KpiCategoryValueList = KpiCategoryValueList;
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
(0, type_graphql_1.Field)(type => [kpi_category_value_1.KpiCategoryValue]),
|
|
64
|
-
tslib_1.__metadata("design:type", Array)
|
|
65
|
-
], KpiCategoryValueList.prototype, "items", void 0);
|
|
66
|
-
tslib_1.__decorate([
|
|
67
|
-
(0, type_graphql_1.Field)(),
|
|
68
|
-
tslib_1.__metadata("design:type", Number)
|
|
69
|
-
], KpiCategoryValueList.prototype, "total", void 0);
|
|
70
|
-
exports.KpiCategoryValueList = KpiCategoryValueList = tslib_1.__decorate([
|
|
71
|
-
(0, type_graphql_1.ObjectType)()
|
|
72
|
-
], KpiCategoryValueList);
|
|
73
|
-
//# sourceMappingURL=kpi-category-value-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category-value-type.js","sourceRoot":"","sources":["../../../server/service/kpi-category-value/kpi-category-value-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkE;AAElE,6DAAuD;AAGhD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAe/B,CAAA;AAfY,kDAAmB;AAE9B;IADC,IAAA,oBAAK,GAAE;;qDACQ;AAGhB;IADC,IAAA,oBAAK,GAAE;;uDACU;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACZ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;kDAC3F;AAGd;IADC,IAAA,oBAAK,GAAE;;sDACS;8BAdN,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAe/B;AAGM,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAejC,CAAA;AAfY,sDAAqB;AAEhC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACZ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;oDAC3F;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACR;gCAdP,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAejC;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAMhC,CAAA;AANY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAgB,CAAC,CAAC;;mDACT;AAGzB;IADC,IAAA,oBAAK,GAAE;;mDACK;+BALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC","sourcesContent":["import { InputType, Field, Float, ObjectType } from 'type-graphql'\nimport { KpiPeriodType } from '../kpi/kpi'\nimport { KpiCategoryValue } from './kpi-category-value'\n\n@InputType()\nexport class NewKpiCategoryValue {\n @Field()\n domainId: string\n\n @Field()\n categoryId: string\n\n @Field({ nullable: true })\n group?: string\n\n @Field(type => Float, { nullable: true, description: 'Performance score for this category (0-1 range)' })\n score?: number\n\n @Field()\n valueDate: string\n}\n\n@InputType()\nexport class KpiCategoryValuePatch {\n @Field({ nullable: true })\n domainId?: string\n\n @Field({ nullable: true })\n categoryId?: string\n\n @Field({ nullable: true })\n group?: string\n\n @Field(type => Float, { nullable: true, description: 'Performance score for this category (0-1 range)' })\n score?: number\n\n @Field({ nullable: true })\n valueDate?: string\n}\n\n@ObjectType()\nexport class KpiCategoryValueList {\n @Field(type => [KpiCategoryValue])\n items: KpiCategoryValue[]\n\n @Field()\n total: number\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Domain } from '@things-factory/shell';
|
|
2
|
-
import { KpiCategory } from '../kpi-category/kpi-category';
|
|
3
|
-
import { User } from '@things-factory/auth-base';
|
|
4
|
-
export declare class KpiCategoryValue {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
domain: Domain;
|
|
7
|
-
domainId: string;
|
|
8
|
-
group?: string;
|
|
9
|
-
score?: number;
|
|
10
|
-
valueDate: string;
|
|
11
|
-
category: KpiCategory;
|
|
12
|
-
categoryId: string;
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
updatedAt: Date;
|
|
15
|
-
creator?: User;
|
|
16
|
-
creatorId?: string;
|
|
17
|
-
updater?: User;
|
|
18
|
-
updaterId?: string;
|
|
19
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiCategoryValue = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const kpi_category_1 = require("../kpi-category/kpi-category");
|
|
9
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
10
|
-
let KpiCategoryValue = class KpiCategoryValue {
|
|
11
|
-
};
|
|
12
|
-
exports.KpiCategoryValue = KpiCategoryValue;
|
|
13
|
-
tslib_1.__decorate([
|
|
14
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
15
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for this KPI category value record.' }),
|
|
16
|
-
tslib_1.__metadata("design:type", String)
|
|
17
|
-
], KpiCategoryValue.prototype, "id", void 0);
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, typeorm_1.ManyToOne)(() => shell_1.Domain, { onDelete: 'CASCADE' }),
|
|
20
|
-
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'Domain (tenant) to which this KPI category value belongs.' }),
|
|
21
|
-
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
22
|
-
], KpiCategoryValue.prototype, "domain", void 0);
|
|
23
|
-
tslib_1.__decorate([
|
|
24
|
-
(0, typeorm_1.RelationId)((kpiCategoryValue) => kpiCategoryValue.domain),
|
|
25
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain (tenant) to which this KPI category value belongs.' }),
|
|
26
|
-
tslib_1.__metadata("design:type", String)
|
|
27
|
-
], KpiCategoryValue.prototype, "domainId", void 0);
|
|
28
|
-
tslib_1.__decorate([
|
|
29
|
-
(0, typeorm_1.Column)({ default: '' }),
|
|
30
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Group key for this value (organization, line, user, etc.)' }),
|
|
31
|
-
tslib_1.__metadata("design:type", String)
|
|
32
|
-
], KpiCategoryValue.prototype, "group", void 0);
|
|
33
|
-
tslib_1.__decorate([
|
|
34
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Performance score for this category (0-1 range).' }),
|
|
35
|
-
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
36
|
-
tslib_1.__metadata("design:type", Number)
|
|
37
|
-
], KpiCategoryValue.prototype, "score", void 0);
|
|
38
|
-
tslib_1.__decorate([
|
|
39
|
-
(0, type_graphql_1.Field)({
|
|
40
|
-
nullable: true,
|
|
41
|
-
description: 'Date or period for which this KPI category value is recorded (e.g., day: YYYY-MM-DD, month: YYYY-MM, quarter: YYYY-Qn, range: YYYY-MM-DD~YYYY-MM-DD).'
|
|
42
|
-
}),
|
|
43
|
-
(0, typeorm_1.Column)(),
|
|
44
|
-
tslib_1.__metadata("design:type", String)
|
|
45
|
-
], KpiCategoryValue.prototype, "valueDate", void 0);
|
|
46
|
-
tslib_1.__decorate([
|
|
47
|
-
(0, typeorm_1.ManyToOne)(() => kpi_category_1.KpiCategory, { onDelete: 'CASCADE' }),
|
|
48
|
-
(0, type_graphql_1.Field)(type => kpi_category_1.KpiCategory, { nullable: true, description: 'KPI category to which this value belongs.' }),
|
|
49
|
-
tslib_1.__metadata("design:type", kpi_category_1.KpiCategory)
|
|
50
|
-
], KpiCategoryValue.prototype, "category", void 0);
|
|
51
|
-
tslib_1.__decorate([
|
|
52
|
-
(0, typeorm_1.RelationId)((kpiCategoryValue) => kpiCategoryValue.category),
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the domain (tenant) for this KPI category value.' }),
|
|
54
|
-
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], KpiCategoryValue.prototype, "categoryId", void 0);
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI category value record was created.' }),
|
|
58
|
-
(0, typeorm_1.CreateDateColumn)(),
|
|
59
|
-
tslib_1.__metadata("design:type", Date)
|
|
60
|
-
], KpiCategoryValue.prototype, "createdAt", void 0);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI category value record was last updated.' }),
|
|
63
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
|
64
|
-
tslib_1.__metadata("design:type", Date)
|
|
65
|
-
], KpiCategoryValue.prototype, "updatedAt", void 0);
|
|
66
|
-
tslib_1.__decorate([
|
|
67
|
-
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true, onDelete: 'SET NULL' }),
|
|
68
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created this KPI category value record.' }),
|
|
69
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
70
|
-
], KpiCategoryValue.prototype, "creator", void 0);
|
|
71
|
-
tslib_1.__decorate([
|
|
72
|
-
(0, typeorm_1.RelationId)((kpiCategoryValue) => kpiCategoryValue.creator),
|
|
73
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who created this KPI category value record.' }),
|
|
74
|
-
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], KpiCategoryValue.prototype, "creatorId", void 0);
|
|
76
|
-
tslib_1.__decorate([
|
|
77
|
-
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true, onDelete: 'SET NULL' }),
|
|
78
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated this KPI category value record.' }),
|
|
79
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
80
|
-
], KpiCategoryValue.prototype, "updater", void 0);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
(0, typeorm_1.RelationId)((kpiCategoryValue) => kpiCategoryValue.updater),
|
|
83
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who last updated this KPI category value record.' }),
|
|
84
|
-
tslib_1.__metadata("design:type", String)
|
|
85
|
-
], KpiCategoryValue.prototype, "updaterId", void 0);
|
|
86
|
-
exports.KpiCategoryValue = KpiCategoryValue = tslib_1.__decorate([
|
|
87
|
-
(0, typeorm_1.Entity)(),
|
|
88
|
-
(0, typeorm_1.Index)('ix_kpi_category_value_latest', ['domain', 'group', 'category', 'valueDate'], { unique: true }),
|
|
89
|
-
(0, type_graphql_1.ObjectType)({ description: 'Entity for KpiCategoryValue' })
|
|
90
|
-
], KpiCategoryValue);
|
|
91
|
-
//# sourceMappingURL=kpi-category-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category-value.js","sourceRoot":"","sources":["../../../server/service/kpi-category-value/kpi-category-value.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2D;AAC3D,iDAA8C;AAC9C,+DAA0D;AAC1D,yDAAgD;AAKzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CA4D5B,CAAA;AA5DY,4CAAgB;AAGlB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;;4CACzE;AAInB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAChD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2DAA2D,EAAE,CAAC;sCAC5G,cAAM;gDAAA;AAId;IAFC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAC3E,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2DAA2D,EAAE,CAAC;;kDACpF;AAIhB;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2DAA2D,EAAE,CAAC;;+CACtF;AAId;IAFC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;IACzG,IAAA,gBAAM,EAAC,OAAO,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E,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAC5E,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;;mDACnF;AAIlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/D,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;sCACpG,gBAAI;iDAAA;AAId;IAFC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAC5E,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;;mDACxF;2BA3DP,gBAAgB;IAH5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,8BAA8B,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CA4D5B","sourcesContent":["import {\n Entity,\n PrimaryGeneratedColumn,\n Column,\n Index,\n ManyToOne,\n CreateDateColumn,\n UpdateDateColumn,\n RelationId\n} from 'typeorm'\nimport { Field, ObjectType, ID, Float } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { KpiCategory } from '../kpi-category/kpi-category'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_kpi_category_value_latest', ['domain', 'group', 'category', 'valueDate'], { unique: true })\n@ObjectType({ description: 'Entity for KpiCategoryValue' })\nexport class KpiCategoryValue {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this KPI category value record.' })\n readonly id: string\n\n @ManyToOne(() => Domain, { onDelete: 'CASCADE' })\n @Field(type => Domain, { nullable: true, description: 'Domain (tenant) to which this KPI category value belongs.' })\n domain: Domain\n\n @RelationId((kpiCategoryValue: KpiCategoryValue) => kpiCategoryValue.domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this KPI category value belongs.' })\n domainId: string\n\n @Column({ default: '' })\n @Field({ nullable: true, description: 'Group key for this value (organization, line, user, etc.)' })\n group?: string\n\n @Field(type => Float, { nullable: true, description: 'Performance score for this category (0-1 range).' })\n @Column('float', { nullable: true })\n score?: number\n\n @Field({\n nullable: true,\n description:\n 'Date or period for which this KPI category value is recorded (e.g., day: YYYY-MM-DD, month: YYYY-MM, quarter: YYYY-Qn, range: YYYY-MM-DD~YYYY-MM-DD).'\n })\n @Column()\n valueDate: string\n\n @ManyToOne(() => KpiCategory, { onDelete: 'CASCADE' })\n @Field(type => KpiCategory, { nullable: true, description: 'KPI category to which this value belongs.' })\n category: KpiCategory\n\n @RelationId((kpiCategoryValue: KpiCategoryValue) => kpiCategoryValue.category)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI category value.' })\n categoryId: string\n\n @Field({ nullable: true, description: 'Timestamp when this KPI category value record was created.' })\n @CreateDateColumn()\n createdAt: Date\n\n @Field({ nullable: true, description: 'Timestamp when this KPI category value record was last updated.' })\n @UpdateDateColumn()\n updatedAt: Date\n\n @ManyToOne(() => User, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => User, { nullable: true, description: 'User who created this KPI category value record.' })\n creator?: User\n\n @RelationId((kpiCategoryValue: KpiCategoryValue) => kpiCategoryValue.creator)\n @Field({ nullable: true, description: 'ID of the user who created this KPI category value record.' })\n creatorId?: string\n\n @ManyToOne(() => User, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => User, { nullable: true, description: 'User who last updated this KPI category value record.' })\n updater?: User\n\n @RelationId((kpiCategoryValue: KpiCategoryValue) => kpiCategoryValue.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this KPI category value record.' })\n updaterId?: string\n}\n"]}
|