@things-factory/kpi 1.0.0-alpha.5 → 9.0.9
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 +74 -0
- package/client/pages/kpi/kpi-list-page.ts +97 -47
- package/client/pages/kpi/kpi-overview-sample.ts +260 -0
- package/client/pages/kpi/kpi-overview.ts +271 -0
- package/client/pages/kpi-category/kpi-category-list-page.ts +39 -50
- package/client/pages/kpi-dashboard/kpi-alert-panel.ts +114 -0
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +285 -0
- package/client/pages/kpi-dashboard/kpi-grade-visualization.ts +75 -0
- package/client/pages/kpi-dashboard/kpi-history-viewer.ts +58 -0
- package/client/pages/kpi-dashboard/kpi-list-summary.ts +100 -0
- package/client/pages/kpi-dashboard/kpi-performance-summary.ts +124 -0
- package/client/pages/kpi-dashboard/kpi-value-entry.ts +78 -0
- package/client/pages/kpi-grade/kpi-grade-list-page.ts +58 -68
- package/client/pages/kpi-history/kpi-history-list-page.ts +146 -0
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +67 -63
- package/client/pages/kpi-value/kpi-value-list-page.ts +73 -72
- package/client/pages/kpi-value/kpi-value-manual-entry-form.ts +168 -0
- package/client/pages/kpi-value/kpi-value-manual-entry-page.ts +173 -0
- package/client/route.ts +35 -0
- package/dist-client/pages/kpi/kpi-importer.js +16 -17
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -1
- package/dist-client/pages/kpi/kpi-list-page.js +128 -68
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
- package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
- package/dist-client/pages/kpi/kpi-overview.js +290 -0
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js +16 -17
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -1
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +70 -71
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +24 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +305 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +139 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js +16 -17
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -1
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +89 -89
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +16 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +155 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +16 -17
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +98 -84
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-importer.js +16 -17
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +104 -93
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.d.ts +14 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js +201 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.d.ts +41 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js +180 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +27 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -1
- package/dist-server/index.js +2 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1752188906708-SeedKpiCategory.d.ts +5 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js +56 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js.map +1 -0
- package/dist-server/migrations/1752190849681-SeedKpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js +107 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js.map +1 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.d.ts +5 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js +271 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +48 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/index.d.ts +3 -4
- package/dist-server/service/index.js +4 -6
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
- package/dist-server/service/kpi/aggregate-kpi.js +88 -0
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +2 -0
- package/dist-server/service/kpi/event-subscriber.js +10 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -1
- package/dist-server/service/kpi/index.d.ts +2 -1
- package/dist-server/service/kpi/kpi-formula.service.d.ts +24 -0
- package/dist-server/service/kpi/kpi-formula.service.js +64 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +6 -2
- package/dist-server/service/kpi/kpi-history.js +29 -11
- package/dist-server/service/kpi/kpi-history.js.map +1 -1
- package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
- package/dist-server/service/kpi/kpi-mutation.js +215 -10
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
- package/dist-server/service/kpi/kpi-query.d.ts +10 -0
- package/dist-server/service/kpi/kpi-query.js +87 -3
- package/dist-server/service/kpi/kpi-query.js.map +1 -1
- package/dist-server/service/kpi/kpi-type.d.ts +14 -3
- package/dist-server/service/kpi/kpi-type.js +81 -18
- package/dist-server/service/kpi/kpi-type.js.map +1 -1
- package/dist-server/service/kpi/kpi.d.ts +14 -3
- package/dist-server/service/kpi/kpi.js +96 -19
- package/dist-server/service/kpi/kpi.js.map +1 -1
- package/dist-server/service/kpi-alert/index.d.ts +2 -0
- package/dist-server/service/kpi-alert/index.js +6 -0
- package/dist-server/service/kpi-alert/index.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js +71 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +1 -1
- package/dist-server/service/kpi-category/kpi-category-mutation.js +36 -10
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +2 -0
- package/dist-server/service/kpi-category/kpi-category-query.js +18 -2
- package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -5
- package/dist-server/service/kpi-category/kpi-category-type.js +16 -20
- package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category.d.ts +7 -9
- package/dist-server/service/kpi-category/kpi-category.js +40 -38
- package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
- package/dist-server/service/kpi-grade/index.d.ts +1 -2
- package/dist-server/service/kpi-grade/index.js +2 -4
- package/dist-server/service/kpi-grade/index.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js +33 -10
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-query.js +2 -2
- package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +13 -4
- package/dist-server/service/kpi-grade/kpi-grade-type.js +54 -18
- package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade.d.ts +8 -8
- package/dist-server/service/kpi-grade/kpi-grade.js +48 -40
- package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -1
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +134 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +1 -2
- package/dist-server/service/kpi-metric/index.js +2 -4
- package/dist-server/service/kpi-metric/index.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +139 -13
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-query.js +3 -3
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +17 -4
- package/dist-server/service/kpi-metric/kpi-metric-type.js +69 -11
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +11 -8
- package/dist-server/service/kpi-metric/kpi-metric.js +62 -37
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-mutation.js +66 -11
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +15 -2
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +19 -10
- package/dist-server/service/kpi-value/kpi-value-type.js +87 -24
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value.d.ts +15 -9
- package/dist-server/service/kpi-value/kpi-value.js +86 -32
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/implement-plan/01-entity-type-resolver.md +57 -0
- package/implement-plan/02-dataset-integration.md +35 -0
- package/implement-plan/03-kpivalue-automation.md +34 -0
- package/implement-plan/04-version-history.md +33 -0
- package/implement-plan/05-grade-visualization.md +33 -0
- package/implement-plan/06-graphql-frontend.md +30 -0
- package/implement-plan/07-test-docs.md +35 -0
- package/implement-plan/TODO.md +41 -0
- package/package.json +18 -6
- package/server/index.ts +2 -1
- package/server/migrations/1752188906708-SeedKpiCategory.ts +61 -0
- package/server/migrations/1752190849681-SeedKpi.ts +112 -0
- package/server/migrations/1752191090459-SeedKpiGrade.ts +270 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +55 -0
- package/server/service/index.ts +4 -6
- package/server/service/kpi/aggregate-kpi.ts +82 -0
- package/server/service/kpi/event-subscriber.ts +12 -0
- package/server/service/kpi/kpi-formula.service.ts +63 -0
- package/server/service/kpi/kpi-history.ts +29 -21
- package/server/service/kpi/kpi-mutation.ts +194 -12
- package/server/service/kpi/kpi-query.ts +57 -2
- package/server/service/kpi/kpi-type.ts +72 -19
- package/server/service/kpi/kpi.ts +96 -20
- package/server/service/kpi-alert/index.ts +3 -0
- package/server/service/kpi-alert/kpi-alert-query.ts +59 -0
- package/server/service/kpi-alert/kpi-alert-type.ts +20 -0
- package/server/service/kpi-category/kpi-category-mutation.ts +17 -4
- package/server/service/kpi-category/kpi-category-query.ts +20 -3
- package/server/service/kpi-category/kpi-category-type.ts +17 -19
- package/server/service/kpi-category/kpi-category.ts +39 -37
- package/server/service/kpi-grade/index.ts +2 -4
- package/server/service/kpi-grade/kpi-grade-mutation.ts +13 -4
- package/server/service/kpi-grade/kpi-grade-query.ts +5 -2
- package/server/service/kpi-grade/kpi-grade-type.ts +46 -19
- package/server/service/kpi-grade/kpi-grade.ts +44 -38
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +128 -0
- package/server/service/kpi-metric/index.ts +2 -4
- package/server/service/kpi-metric/kpi-metric-mutation.ts +123 -7
- package/server/service/kpi-metric/kpi-metric-query.ts +9 -3
- package/server/service/kpi-metric/kpi-metric-type.ts +56 -13
- package/server/service/kpi-metric/kpi-metric.ts +55 -35
- package/server/service/kpi-value/kpi-value-mutation.ts +52 -14
- package/server/service/kpi-value/kpi-value-query.ts +12 -2
- package/server/service/kpi-value/kpi-value-type.ts +80 -25
- package/server/service/kpi-value/kpi-value.ts +81 -29
- package/things-factory.config.js +12 -4
- package/translations/en.json +12 -1
- package/translations/ja.json +12 -1
- package/translations/ko.json +12 -1
- package/translations/ms.json +12 -1
- package/translations/zh.json +12 -1
- package/client/pages/kpe-metric/kpe-metric-importer.ts +0 -90
- package/client/pages/kpe-metric/kpe-metric-list-page.ts +0 -398
- package/client/pages/kpi-formula/kpi-formula-importer.ts +0 -90
- package/client/pages/kpi-formula/kpi-formula-list-page.ts +0 -398
- package/client/pages/metric/metric-importer.ts +0 -90
- package/client/pages/metric/metric-list-page.ts +0 -398
- package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +0 -23
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js +0 -93
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +0 -1
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +0 -66
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +0 -370
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +0 -23
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js +0 -93
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +0 -66
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +0 -370
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +0 -1
- package/dist-client/pages/metric/metric-importer.d.ts +0 -23
- package/dist-client/pages/metric/metric-importer.js +0 -93
- package/dist-client/pages/metric/metric-importer.js.map +0 -1
- package/dist-client/pages/metric/metric-list-page.d.ts +0 -66
- package/dist-client/pages/metric/metric-list-page.js +0 -370
- package/dist-client/pages/metric/metric-list-page.js.map +0 -1
- package/dist-server/service/kpi-formula/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-formula/event-subscriber.js +0 -21
- package/dist-server/service/kpi-formula/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-formula/index.d.ts +0 -7
- package/dist-server/service/kpi-formula/index.js +0 -12
- package/dist-server/service/kpi-formula/index.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +0 -25
- package/dist-server/service/kpi-formula/kpi-formula-history.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-history.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +0 -10
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +0 -11
- package/dist-server/service/kpi-formula/kpi-formula-query.js +0 -79
- package/dist-server/service/kpi-formula/kpi-formula-query.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +0 -20
- package/dist-server/service/kpi-formula/kpi-formula-type.js +0 -77
- package/dist-server/service/kpi-formula/kpi-formula-type.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula.d.ts +0 -24
- package/dist-server/service/kpi-formula/kpi-formula.js +0 -109
- package/dist-server/service/kpi-formula/kpi-formula.js.map +0 -1
- package/dist-server/service/kpi-grade/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-grade/event-subscriber.js +0 -21
- package/dist-server/service/kpi-grade/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +0 -25
- package/dist-server/service/kpi-grade/kpi-grade-history.js +0 -128
- package/dist-server/service/kpi-grade/kpi-grade-history.js.map +0 -1
- package/dist-server/service/kpi-metric/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-metric/event-subscriber.js +0 -21
- package/dist-server/service/kpi-metric/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +0 -25
- package/dist-server/service/kpi-metric/kpi-metric-history.js +0 -128
- package/dist-server/service/kpi-metric/kpi-metric-history.js.map +0 -1
- package/server/service/kpi-formula/event-subscriber.ts +0 -17
- package/server/service/kpi-formula/index.ts +0 -9
- package/server/service/kpi-formula/kpi-formula-history.ts +0 -116
- package/server/service/kpi-formula/kpi-formula-mutation.ts +0 -137
- package/server/service/kpi-formula/kpi-formula-query.ts +0 -48
- package/server/service/kpi-formula/kpi-formula-type.ts +0 -55
- package/server/service/kpi-formula/kpi-formula.ts +0 -95
- package/server/service/kpi-grade/event-subscriber.ts +0 -17
- package/server/service/kpi-grade/kpi-grade-history.ts +0 -116
- package/server/service/kpi-metric/event-subscriber.ts +0 -17
- package/server/service/kpi-metric/kpi-metric-history.ts +0 -116
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-value-query.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,2CAAsC;AACtC,qDAA+C;
|
|
1
|
+
{"version":3,"file":"kpi-value-query.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,2CAAsC;AACtC,qDAA+C;AAC/C,oCAAgC;AAGzB,IAAM,aAAa,GAAnB,MAAM,aAAa;IAElB,AAAN,KAAK,CAAC,QAAQ,CACgE,EAAU,EAC/E,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IA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K;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,SAAG,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;wCAGnC;wBAhDU,aAAa;IADzB,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,aAAa,CAiDzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { KpiValue } from './kpi-value'\nimport { KpiValueList } from './kpi-value-type'\nimport { Kpi } from '../kpi/kpi'\n\n@Resolver(KpiValue)\nexport class KpiValueQuery {\n @Query(returns => KpiValue!, { nullable: true, description: 'Fetch a single KPI value by its unique identifier.' })\n async kpiValue(\n @Arg('id', { description: 'Unique identifier of the KPI value to fetch.' }) id: string,\n @Ctx() context: ResolverContext\n ): Promise<KpiValue> {\n const { domain } = context.state\n\n return await getRepository(KpiValue).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => KpiValueList, { description: 'To fetch multiple KpiValues' })\n async kpiValues(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<KpiValueList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(KpiValue),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() kpiValue: KpiValue): Promise<Domain> {\n return kpiValue.domainId && (await getRepository(Domain).findOneBy({ id: kpiValue.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() kpiValue: KpiValue): Promise<User> {\n return kpiValue.updaterId && (await getRepository(User).findOneBy({ id: kpiValue.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() kpiValue: KpiValue): Promise<User> {\n return kpiValue.creatorId && (await getRepository(User).findOneBy({ id: kpiValue.creatorId }))\n }\n\n @FieldResolver(type => Kpi)\n async kpi(@Root() kpiValue: KpiValue): Promise<Kpi | null> {\n if (!kpiValue.kpiId) return null\n return await getRepository(Kpi).findOneBy({ id: kpiValue.kpiId })\n }\n}\n"]}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import { KpiValue,
|
|
1
|
+
import { KpiValue, KpiValueInputType } from './kpi-value';
|
|
2
2
|
export declare class NewKpiValue {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
kpiId: string;
|
|
4
|
+
version: number;
|
|
5
|
+
valueDate: string;
|
|
6
|
+
value: number;
|
|
7
|
+
meta?: any;
|
|
8
|
+
groupId?: string;
|
|
9
|
+
groupType?: string;
|
|
10
|
+
inputType?: KpiValueInputType;
|
|
11
|
+
source?: string;
|
|
8
12
|
}
|
|
9
13
|
export declare class KpiValuePatch {
|
|
10
14
|
id?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
kpiId?: string;
|
|
16
|
+
version?: number;
|
|
17
|
+
valueDate?: string;
|
|
18
|
+
value?: number;
|
|
19
|
+
meta?: any;
|
|
20
|
+
groupId?: string;
|
|
21
|
+
groupType?: string;
|
|
22
|
+
inputType?: KpiValueInputType;
|
|
23
|
+
source?: string;
|
|
15
24
|
cuFlag?: string;
|
|
16
25
|
}
|
|
17
26
|
export declare class KpiValueList {
|
|
@@ -3,62 +3,125 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.KpiValueList = exports.KpiValuePatch = exports.NewKpiValue = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
7
|
const kpi_value_1 = require("./kpi-value");
|
|
7
8
|
let NewKpiValue = class NewKpiValue {
|
|
8
9
|
};
|
|
9
10
|
exports.NewKpiValue = NewKpiValue;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)(),
|
|
12
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'ID of the KPI to which this value belongs.' }),
|
|
12
13
|
tslib_1.__metadata("design:type", String)
|
|
13
|
-
], NewKpiValue.prototype, "
|
|
14
|
+
], NewKpiValue.prototype, "kpiId", void 0);
|
|
14
15
|
tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.Field)({
|
|
16
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Version of the KPI definition at the time this value is calculated.' }),
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
18
|
+
], NewKpiValue.prototype, "version", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, type_graphql_1.Field)({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' }),
|
|
16
21
|
tslib_1.__metadata("design:type", String)
|
|
17
|
-
], NewKpiValue.prototype, "
|
|
22
|
+
], NewKpiValue.prototype, "valueDate", void 0);
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'The calculated numeric value for this KPI and period.' }),
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
|
+
], NewKpiValue.prototype, "value", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
|
|
29
|
+
nullable: true,
|
|
30
|
+
description: 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
31
|
+
}),
|
|
32
|
+
tslib_1.__metadata("design:type", Object)
|
|
33
|
+
], NewKpiValue.prototype, "meta", void 0);
|
|
18
34
|
tslib_1.__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)(
|
|
35
|
+
(0, type_graphql_1.Field)({
|
|
36
|
+
nullable: true,
|
|
37
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
38
|
+
}),
|
|
20
39
|
tslib_1.__metadata("design:type", String)
|
|
21
|
-
], NewKpiValue.prototype, "
|
|
40
|
+
], NewKpiValue.prototype, "groupId", void 0);
|
|
22
41
|
tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
-
tslib_1.__metadata("design:type",
|
|
25
|
-
], NewKpiValue.prototype, "
|
|
42
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' }),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], NewKpiValue.prototype, "groupType", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, type_graphql_1.Field)(type => kpi_value_1.KpiValueInputType, {
|
|
47
|
+
nullable: true,
|
|
48
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
49
|
+
}),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], NewKpiValue.prototype, "inputType", void 0);
|
|
26
52
|
tslib_1.__decorate([
|
|
27
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' }),
|
|
28
54
|
tslib_1.__metadata("design:type", String)
|
|
29
|
-
], NewKpiValue.prototype, "
|
|
55
|
+
], NewKpiValue.prototype, "source", void 0);
|
|
30
56
|
exports.NewKpiValue = NewKpiValue = tslib_1.__decorate([
|
|
31
|
-
(0, type_graphql_1.InputType)()
|
|
57
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for creating a new KPI value. Used in mutations to provide KPI value details.' })
|
|
32
58
|
], NewKpiValue);
|
|
33
59
|
let KpiValuePatch = class KpiValuePatch {
|
|
34
60
|
};
|
|
35
61
|
exports.KpiValuePatch = KpiValuePatch;
|
|
36
62
|
tslib_1.__decorate([
|
|
37
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
63
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'ID of the KPI value to update.' }),
|
|
38
64
|
tslib_1.__metadata("design:type", String)
|
|
39
65
|
], KpiValuePatch.prototype, "id", void 0);
|
|
40
66
|
tslib_1.__decorate([
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'ID of the KPI to which this value belongs.' }),
|
|
68
|
+
tslib_1.__metadata("design:type", String)
|
|
69
|
+
], KpiValuePatch.prototype, "kpiId", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, {
|
|
72
|
+
nullable: true,
|
|
73
|
+
description: 'Version of the KPI definition at the time this value is calculated.'
|
|
74
|
+
}),
|
|
75
|
+
tslib_1.__metadata("design:type", Number)
|
|
76
|
+
], KpiValuePatch.prototype, "version", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, type_graphql_1.Field)({
|
|
79
|
+
nullable: true,
|
|
80
|
+
description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).'
|
|
81
|
+
}),
|
|
42
82
|
tslib_1.__metadata("design:type", String)
|
|
43
|
-
], KpiValuePatch.prototype, "
|
|
83
|
+
], KpiValuePatch.prototype, "valueDate", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'The calculated numeric value for this KPI and period.' }),
|
|
86
|
+
tslib_1.__metadata("design:type", Number)
|
|
87
|
+
], KpiValuePatch.prototype, "value", void 0);
|
|
44
88
|
tslib_1.__decorate([
|
|
45
|
-
(0, type_graphql_1.Field)(
|
|
89
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
|
|
90
|
+
nullable: true,
|
|
91
|
+
description: 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
92
|
+
}),
|
|
93
|
+
tslib_1.__metadata("design:type", Object)
|
|
94
|
+
], KpiValuePatch.prototype, "meta", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, type_graphql_1.Field)({
|
|
97
|
+
nullable: true,
|
|
98
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
99
|
+
}),
|
|
100
|
+
tslib_1.__metadata("design:type", String)
|
|
101
|
+
], KpiValuePatch.prototype, "groupId", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' }),
|
|
46
104
|
tslib_1.__metadata("design:type", String)
|
|
47
|
-
], KpiValuePatch.prototype, "
|
|
105
|
+
], KpiValuePatch.prototype, "groupType", void 0);
|
|
48
106
|
tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.Field)(type => kpi_value_1.
|
|
107
|
+
(0, type_graphql_1.Field)(type => kpi_value_1.KpiValueInputType, {
|
|
108
|
+
nullable: true,
|
|
109
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
110
|
+
}),
|
|
50
111
|
tslib_1.__metadata("design:type", String)
|
|
51
|
-
], KpiValuePatch.prototype, "
|
|
112
|
+
], KpiValuePatch.prototype, "inputType", void 0);
|
|
52
113
|
tslib_1.__decorate([
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
tslib_1.__metadata("design:type",
|
|
55
|
-
], KpiValuePatch.prototype, "
|
|
114
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' }),
|
|
115
|
+
tslib_1.__metadata("design:type", String)
|
|
116
|
+
], KpiValuePatch.prototype, "source", void 0);
|
|
56
117
|
tslib_1.__decorate([
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
118
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Custom flag for update operations (internal use).' }),
|
|
58
119
|
tslib_1.__metadata("design:type", String)
|
|
59
120
|
], KpiValuePatch.prototype, "cuFlag", void 0);
|
|
60
121
|
exports.KpiValuePatch = KpiValuePatch = tslib_1.__decorate([
|
|
61
|
-
(0, type_graphql_1.InputType)(
|
|
122
|
+
(0, type_graphql_1.InputType)({
|
|
123
|
+
description: 'Input type for updating an existing KPI value. Used in mutations to patch KPI value details.'
|
|
124
|
+
})
|
|
62
125
|
], KpiValuePatch);
|
|
63
126
|
let KpiValueList = class KpiValueList {
|
|
64
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-value-type.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value-type.ts"],"names":[],"mappings":";;;;AAEA,+
|
|
1
|
+
{"version":3,"file":"kpi-value-type.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value-type.ts"],"names":[],"mappings":";;;;AAEA,+CAA6F;AAE7F,iDAA+D;AAE/D,2CAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAqCvB,CAAA;AArCY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;0CACpE;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,qEAAqE,EAAE,CAAC;;4CAC5F;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,kFAAkF,EAAE,CAAC;;8CAC1F;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;;0CAClF;AAOb;IALC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE;QAC3B,QAAQ,EAAE,IAAI;QACd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graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { KpiValue, KpiValueInputType } from './kpi-value'\n\n@InputType({ description: 'Input type for creating a new KPI value. Used in mutations to provide KPI value details.' })\nexport class NewKpiValue {\n @Field(type => ID, { description: 'ID of the KPI to which this value belongs.' })\n kpiId: string\n\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value is calculated.' })\n version: number\n\n @Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })\n valueDate: string\n\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field({\n nullable: true,\n description: 'ID of the group (organization, department, project, etc.) this value is associated with.'\n })\n groupId?: string\n\n @Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })\n groupType?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n}\n\n@InputType({\n description: 'Input type for updating an existing KPI value. Used in mutations to patch KPI value details.'\n})\nexport class KpiValuePatch {\n @Field(type => ID, { nullable: true, description: 'ID of the KPI value to update.' })\n id?: string\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI to which this value belongs.' })\n kpiId?: string\n\n @Field(type => Int, {\n nullable: true,\n description: 'Version of the KPI definition at the time this value is calculated.'\n })\n version?: number\n\n @Field({\n nullable: true,\n description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).'\n })\n valueDate?: string\n\n @Field(type => Float, { nullable: true, description: 'The calculated numeric value for this KPI and period.' })\n value?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field({\n nullable: true,\n description: 'ID of the group (organization, department, project, etc.) this value is associated with.'\n })\n groupId?: string\n\n @Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })\n groupType?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiValueList {\n @Field(type => [KpiValue])\n items: KpiValue[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { Domain } from '@things-factory/shell';
|
|
2
1
|
import { User } from '@things-factory/auth-base';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { Kpi } from '../kpi/kpi';
|
|
4
|
+
export declare enum KpiValueInputType {
|
|
5
|
+
MANUAL = "MANUAL",
|
|
6
|
+
AUTO = "AUTO"
|
|
6
7
|
}
|
|
7
8
|
export declare class KpiValue {
|
|
8
9
|
readonly id: string;
|
|
9
10
|
domain?: Domain;
|
|
10
11
|
domainId?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
kpi: Kpi;
|
|
13
|
+
kpiId: string;
|
|
14
|
+
version: number;
|
|
15
|
+
valueDate: string;
|
|
16
|
+
value: number;
|
|
17
|
+
groupId?: string;
|
|
18
|
+
groupType?: string;
|
|
19
|
+
inputType?: KpiValueInputType;
|
|
20
|
+
source?: string;
|
|
21
|
+
meta?: any;
|
|
16
22
|
createdAt?: Date;
|
|
17
23
|
updatedAt?: Date;
|
|
18
24
|
creator?: User;
|
|
@@ -1,95 +1,149 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KpiValue = exports.
|
|
3
|
+
exports.KpiValue = exports.KpiValueInputType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const env_1 = require("@things-factory/env");
|
|
10
|
+
const kpi_1 = require("../kpi/kpi");
|
|
11
|
+
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
12
|
+
const DATABASE_TYPE = ORMCONFIG.type;
|
|
13
|
+
var KpiValueInputType;
|
|
14
|
+
(function (KpiValueInputType) {
|
|
15
|
+
KpiValueInputType["MANUAL"] = "MANUAL";
|
|
16
|
+
KpiValueInputType["AUTO"] = "AUTO";
|
|
17
|
+
})(KpiValueInputType || (exports.KpiValueInputType = KpiValueInputType = {}));
|
|
18
|
+
(0, type_graphql_1.registerEnumType)(KpiValueInputType, {
|
|
19
|
+
name: 'KpiValueInputType',
|
|
20
|
+
description: 'Type of the input (Manual or Auto)'
|
|
17
21
|
});
|
|
18
22
|
let KpiValue = class KpiValue {
|
|
19
23
|
};
|
|
20
24
|
exports.KpiValue = KpiValue;
|
|
21
25
|
tslib_1.__decorate([
|
|
22
26
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
27
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for this KPI value record.' }),
|
|
24
28
|
tslib_1.__metadata("design:type", String)
|
|
25
29
|
], KpiValue.prototype, "id", void 0);
|
|
26
30
|
tslib_1.__decorate([
|
|
27
31
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain (tenant) to which this KPI value belongs.' }),
|
|
29
33
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
30
34
|
], KpiValue.prototype, "domain", void 0);
|
|
31
35
|
tslib_1.__decorate([
|
|
32
36
|
(0, typeorm_1.RelationId)((kpiValue) => kpiValue.domain),
|
|
37
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the domain (tenant) for this KPI value.' }),
|
|
33
38
|
tslib_1.__metadata("design:type", String)
|
|
34
39
|
], KpiValue.prototype, "domainId", void 0);
|
|
35
40
|
tslib_1.__decorate([
|
|
36
|
-
(0, typeorm_1.
|
|
37
|
-
(0, type_graphql_1.Field)(
|
|
41
|
+
(0, typeorm_1.ManyToOne)(() => kpi_1.Kpi),
|
|
42
|
+
(0, type_graphql_1.Field)(type => kpi_1.Kpi, {
|
|
43
|
+
nullable: true,
|
|
44
|
+
description: 'Reference to the KPI definition for which this value is calculated.'
|
|
45
|
+
}),
|
|
46
|
+
tslib_1.__metadata("design:type", kpi_1.Kpi)
|
|
47
|
+
], KpiValue.prototype, "kpi", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.RelationId)((kpiValue) => kpiValue.kpi),
|
|
50
|
+
(0, type_graphql_1.Field)({ description: 'ID of the referenced KPI.' }),
|
|
38
51
|
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], KpiValue.prototype, "
|
|
52
|
+
], KpiValue.prototype, "kpiId", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)('int'),
|
|
55
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Version of the KPI definition at the time this value was calculated.' }),
|
|
56
|
+
tslib_1.__metadata("design:type", Number)
|
|
57
|
+
], KpiValue.prototype, "version", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'date' }),
|
|
60
|
+
(0, type_graphql_1.Field)({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], KpiValue.prototype, "valueDate", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)('float'),
|
|
65
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'The calculated numeric value for this KPI and period.' }),
|
|
66
|
+
tslib_1.__metadata("design:type", Number)
|
|
67
|
+
], KpiValue.prototype, "value", void 0);
|
|
40
68
|
tslib_1.__decorate([
|
|
41
69
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
42
|
-
(0, type_graphql_1.Field)({
|
|
70
|
+
(0, type_graphql_1.Field)({
|
|
71
|
+
nullable: true,
|
|
72
|
+
description: 'ID of the group (organization, department, project, etc.) this value is associated with.'
|
|
73
|
+
}),
|
|
43
74
|
tslib_1.__metadata("design:type", String)
|
|
44
|
-
], KpiValue.prototype, "
|
|
75
|
+
], KpiValue.prototype, "groupId", void 0);
|
|
45
76
|
tslib_1.__decorate([
|
|
46
|
-
(0, typeorm_1.Column)({ nullable:
|
|
47
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
48
|
-
tslib_1.__metadata("design:type",
|
|
49
|
-
], KpiValue.prototype, "
|
|
77
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' }),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], KpiValue.prototype, "groupType", void 0);
|
|
50
81
|
tslib_1.__decorate([
|
|
51
82
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
52
|
-
(0, type_graphql_1.Field)({
|
|
83
|
+
(0, type_graphql_1.Field)({
|
|
84
|
+
nullable: true,
|
|
85
|
+
description: 'Indicates whether this value was entered manually or generated automatically.'
|
|
86
|
+
}),
|
|
53
87
|
tslib_1.__metadata("design:type", String)
|
|
54
|
-
], KpiValue.prototype, "
|
|
88
|
+
], KpiValue.prototype, "inputType", void 0);
|
|
55
89
|
tslib_1.__decorate([
|
|
56
90
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
91
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' }),
|
|
58
92
|
tslib_1.__metadata("design:type", String)
|
|
59
|
-
], KpiValue.prototype, "
|
|
93
|
+
], KpiValue.prototype, "source", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({
|
|
96
|
+
nullable: true,
|
|
97
|
+
type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
98
|
+
? 'longtext'
|
|
99
|
+
: DATABASE_TYPE == 'oracle'
|
|
100
|
+
? 'clob'
|
|
101
|
+
: DATABASE_TYPE == 'mssql'
|
|
102
|
+
? 'nvarchar'
|
|
103
|
+
: 'varchar',
|
|
104
|
+
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined,
|
|
105
|
+
transformer: shell_1.json5Transformer
|
|
106
|
+
}),
|
|
107
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
|
|
108
|
+
nullable: true,
|
|
109
|
+
description: 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'
|
|
110
|
+
}),
|
|
111
|
+
tslib_1.__metadata("design:type", Object)
|
|
112
|
+
], KpiValue.prototype, "meta", void 0);
|
|
60
113
|
tslib_1.__decorate([
|
|
61
114
|
(0, typeorm_1.CreateDateColumn)(),
|
|
62
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
115
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI value record was created.' }),
|
|
63
116
|
tslib_1.__metadata("design:type", Date)
|
|
64
117
|
], KpiValue.prototype, "createdAt", void 0);
|
|
65
118
|
tslib_1.__decorate([
|
|
66
119
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
67
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
120
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this KPI value record was last updated.' }),
|
|
68
121
|
tslib_1.__metadata("design:type", Date)
|
|
69
122
|
], KpiValue.prototype, "updatedAt", void 0);
|
|
70
123
|
tslib_1.__decorate([
|
|
71
124
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
72
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
125
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created this KPI value record.' }),
|
|
73
126
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
74
127
|
], KpiValue.prototype, "creator", void 0);
|
|
75
128
|
tslib_1.__decorate([
|
|
76
129
|
(0, typeorm_1.RelationId)((kpiValue) => kpiValue.creator),
|
|
130
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who created this KPI value record.' }),
|
|
77
131
|
tslib_1.__metadata("design:type", String)
|
|
78
132
|
], KpiValue.prototype, "creatorId", void 0);
|
|
79
133
|
tslib_1.__decorate([
|
|
80
134
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
135
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated this KPI value record.' }),
|
|
82
136
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
83
137
|
], KpiValue.prototype, "updater", void 0);
|
|
84
138
|
tslib_1.__decorate([
|
|
85
139
|
(0, typeorm_1.RelationId)((kpiValue) => kpiValue.updater),
|
|
140
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who last updated this KPI value record.' }),
|
|
86
141
|
tslib_1.__metadata("design:type", String)
|
|
87
142
|
], KpiValue.prototype, "updaterId", void 0);
|
|
88
143
|
exports.KpiValue = KpiValue = tslib_1.__decorate([
|
|
89
144
|
(0, typeorm_1.Entity)(),
|
|
90
|
-
(0, typeorm_1.Index)('
|
|
91
|
-
|
|
92
|
-
}),
|
|
145
|
+
(0, typeorm_1.Index)('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType', 'version'], { unique: true }),
|
|
146
|
+
(0, typeorm_1.Index)('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType'], { unique: false }),
|
|
93
147
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for KpiValue' })
|
|
94
148
|
], KpiValue);
|
|
95
149
|
//# sourceMappingURL=kpi-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-value.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+
|
|
1
|
+
{"version":3,"file":"kpi-value.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAkF;AAElF,yDAAgD;AAChD,iDAA8E;AAC9E,6CAA4C;AAC5C,oCAAgC;AAEhC,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,IAAA,+BAAgB,EA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AA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;IACpD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;;2CAC/E;mBApGP,QAAQ;IAJpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACjH,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACjH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAqGpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, ScalarObject, json5Transformer } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\nimport { Kpi } from '../kpi/kpi'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum KpiValueInputType {\n MANUAL = 'MANUAL',\n AUTO = 'AUTO'\n}\n\nregisterEnumType(KpiValueInputType, {\n name: 'KpiValueInputType',\n description: 'Type of the input (Manual or Auto)'\n})\n\n@Entity()\n@Index('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType', 'version'], { unique: true })\n@Index('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'groupId', 'groupType'], { unique: false })\n@ObjectType({ description: 'Entity for KpiValue' })\nexport class KpiValue {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this KPI value record.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this KPI value belongs.' })\n domain?: Domain\n\n @RelationId((kpiValue: KpiValue) => kpiValue.domain)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI value.' })\n domainId?: string\n\n @ManyToOne(() => Kpi)\n @Field(type => Kpi, {\n nullable: true,\n description: 'Reference to the KPI definition for which this value is calculated.'\n })\n kpi: Kpi\n\n @RelationId((kpiValue: KpiValue) => kpiValue.kpi)\n @Field({ description: 'ID of the referenced KPI.' })\n kpiId: string\n\n @Column('int')\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value was calculated.' })\n version: number\n\n @Column({ type: 'date' })\n @Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })\n valueDate: string\n\n @Column('float')\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'ID of the group (organization, department, project, etc.) this value is associated with.'\n })\n groupId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Type of the group (e.g., USER, DEPT, PROJECT) for this value.' })\n groupType?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined,\n transformer: json5Transformer\n })\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was last updated.' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created this KPI value record.' })\n creator?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.creator)\n @Field({ nullable: true, description: 'ID of the user who created this KPI value record.' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated this KPI value record.' })\n updater?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this KPI value record.' })\n updaterId?: string\n}\n"]}
|