@things-factory/kpi 9.0.22 → 9.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/client/pages/kpi/kpi-list-page.ts +180 -22
  2. package/client/pages/kpi/kpi-viz-editor.ts +1 -1
  3. package/client/pages/kpi-category/kpi-category-list-page.ts +76 -3
  4. package/client/pages/kpi-category/kpi-category-value-calculator.ts +233 -0
  5. package/client/pages/kpi-category-value/kpi-category-value-list-page.ts +404 -0
  6. package/client/pages/kpi-metric/kpi-metric-list-page.ts +13 -1
  7. package/client/pages/kpi-metric-value/kpi-metric-value-editor-page.ts +763 -0
  8. package/client/pages/kpi-metric-value/kpi-metric-value-list-page.ts +55 -1
  9. package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts +3 -13
  10. package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.ts +13 -1
  11. package/client/pages/kpi-value/kpi-value-editor-page.ts +774 -0
  12. package/client/pages/kpi-value/kpi-value-list-page.ts +58 -1
  13. package/client/route.ts +16 -0
  14. package/dist-client/pages/kpi/kpi-list-page.d.ts +2 -1
  15. package/dist-client/pages/kpi/kpi-list-page.js +180 -22
  16. package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
  17. package/dist-client/pages/kpi/kpi-viz-editor.d.ts +0 -1
  18. package/dist-client/pages/kpi/kpi-viz-editor.js +1 -1
  19. package/dist-client/pages/kpi/kpi-viz-editor.js.map +1 -1
  20. package/dist-client/pages/kpi-category/kpi-category-list-page.d.ts +3 -0
  21. package/dist-client/pages/kpi-category/kpi-category-list-page.js +71 -3
  22. package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
  23. package/dist-client/pages/kpi-category/kpi-category-value-calculator.d.ts +13 -0
  24. package/dist-client/pages/kpi-category/kpi-category-value-calculator.js +256 -0
  25. package/dist-client/pages/kpi-category/kpi-category-value-calculator.js.map +1 -0
  26. package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.d.ts +63 -0
  27. package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js +393 -0
  28. package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js.map +1 -0
  29. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +13 -1
  30. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
  31. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +58 -0
  32. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +736 -0
  33. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
  34. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +5 -1
  35. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +50 -2
  36. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
  37. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +3 -13
  38. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -1
  39. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +13 -1
  40. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -1
  41. package/dist-client/pages/kpi-value/kpi-value-editor-page.d.ts +55 -0
  42. package/dist-client/pages/kpi-value/kpi-value-editor-page.js +748 -0
  43. package/dist-client/pages/kpi-value/kpi-value-editor-page.js.map +1 -0
  44. package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +10 -2
  45. package/dist-client/pages/kpi-value/kpi-value-list-page.js +57 -1
  46. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
  47. package/dist-client/route.d.ts +1 -1
  48. package/dist-client/route.js +12 -0
  49. package/dist-client/route.js.map +1 -1
  50. package/dist-client/tsconfig.tsbuildinfo +1 -1
  51. package/dist-server/calculator/evaluator.d.ts +8 -0
  52. package/dist-server/calculator/evaluator.js +42 -0
  53. package/dist-server/calculator/evaluator.js.map +1 -0
  54. package/dist-server/calculator/functions.d.ts +3 -0
  55. package/dist-server/calculator/functions.js +62 -0
  56. package/dist-server/calculator/functions.js.map +1 -0
  57. package/dist-server/calculator/index.d.ts +4 -0
  58. package/dist-server/calculator/index.js +8 -0
  59. package/dist-server/calculator/index.js.map +1 -0
  60. package/dist-server/calculator/parser.d.ts +21 -0
  61. package/dist-server/calculator/parser.js +121 -0
  62. package/dist-server/calculator/parser.js.map +1 -0
  63. package/dist-server/calculator/provider.d.ts +8 -0
  64. package/dist-server/calculator/provider.js +13 -0
  65. package/dist-server/calculator/provider.js.map +1 -0
  66. package/dist-server/controllers/kpi-metric-value-provider.d.ts +11 -0
  67. package/dist-server/controllers/kpi-metric-value-provider.js +63 -0
  68. package/dist-server/controllers/kpi-metric-value-provider.js.map +1 -0
  69. package/dist-server/controllers/kpi-value-provider.d.ts +11 -0
  70. package/dist-server/controllers/kpi-value-provider.js +46 -0
  71. package/dist-server/controllers/kpi-value-provider.js.map +1 -0
  72. package/dist-server/service/index.d.ts +4 -2
  73. package/dist-server/service/index.js +5 -0
  74. package/dist-server/service/index.js.map +1 -1
  75. package/dist-server/service/kpi/aggregate-kpi.js +4 -4
  76. package/dist-server/service/kpi/aggregate-kpi.js.map +1 -1
  77. package/dist-server/service/kpi/kpi-grade.types.d.ts +11 -10
  78. package/dist-server/service/kpi/kpi-grade.types.js.map +1 -1
  79. package/dist-server/service/kpi/kpi-history.d.ts +2 -2
  80. package/dist-server/service/kpi/kpi-history.js.map +1 -1
  81. package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
  82. package/dist-server/service/kpi/kpi-mutation.js +126 -4
  83. package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
  84. package/dist-server/service/kpi/kpi-type.d.ts +8 -5
  85. package/dist-server/service/kpi/kpi-type.js +22 -8
  86. package/dist-server/service/kpi/kpi-type.js.map +1 -1
  87. package/dist-server/service/kpi/kpi.d.ts +6 -3
  88. package/dist-server/service/kpi/kpi.js +29 -9
  89. package/dist-server/service/kpi/kpi.js.map +1 -1
  90. package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +3 -4
  91. package/dist-server/service/kpi-category/kpi-category-mutation.js +151 -80
  92. package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
  93. package/dist-server/service/kpi-category/kpi-category-query.d.ts +5 -0
  94. package/dist-server/service/kpi-category/kpi-category-query.js +19 -1
  95. package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
  96. package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -0
  97. package/dist-server/service/kpi-category/kpi-category-type.js +16 -1
  98. package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
  99. package/dist-server/service/kpi-category/kpi-category.d.ts +2 -0
  100. package/dist-server/service/kpi-category/kpi-category.js +10 -1
  101. package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
  102. package/dist-server/service/kpi-category-value/index.d.ts +6 -0
  103. package/dist-server/service/kpi-category-value/index.js +10 -0
  104. package/dist-server/service/kpi-category-value/index.js.map +1 -0
  105. package/dist-server/service/kpi-category-value/kpi-category-value-mutation.d.ts +8 -0
  106. package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js +102 -0
  107. package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js.map +1 -0
  108. package/dist-server/service/kpi-category-value/kpi-category-value-query.d.ts +13 -0
  109. package/dist-server/service/kpi-category-value/kpi-category-value-query.js +91 -0
  110. package/dist-server/service/kpi-category-value/kpi-category-value-query.js.map +1 -0
  111. package/dist-server/service/kpi-category-value/kpi-category-value-type.d.ts +19 -0
  112. package/dist-server/service/kpi-category-value/kpi-category-value-type.js +73 -0
  113. package/dist-server/service/kpi-category-value/kpi-category-value-type.js.map +1 -0
  114. package/dist-server/service/kpi-category-value/kpi-category-value.d.ts +19 -0
  115. package/dist-server/service/kpi-category-value/kpi-category-value.js +91 -0
  116. package/dist-server/service/kpi-category-value/kpi-category-value.js.map +1 -0
  117. package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +5 -3
  118. package/dist-server/service/kpi-metric/kpi-metric-type.js +5 -3
  119. package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
  120. package/dist-server/service/kpi-metric/kpi-metric.d.ts +2 -8
  121. package/dist-server/service/kpi-metric/kpi-metric.js +3 -14
  122. package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
  123. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +87 -45
  124. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
  125. package/dist-server/service/kpi-metric-value/kpi-metric-value.js +3 -2
  126. package/dist-server/service/kpi-metric-value/kpi-metric-value.js.map +1 -1
  127. package/dist-server/service/kpi-value/kpi-value-mutation.d.ts +3 -1
  128. package/dist-server/service/kpi-value/kpi-value-mutation.js +174 -6
  129. package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
  130. package/dist-server/service/kpi-value/kpi-value-query.d.ts +0 -2
  131. package/dist-server/service/kpi-value/kpi-value-query.js +0 -12
  132. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
  133. package/dist-server/service/kpi-value/kpi-value-score.service.d.ts +26 -0
  134. package/dist-server/service/kpi-value/kpi-value-score.service.js +97 -0
  135. package/dist-server/service/kpi-value/kpi-value-score.service.js.map +1 -0
  136. package/dist-server/service/kpi-value/kpi-value-type.d.ts +2 -0
  137. package/dist-server/service/kpi-value/kpi-value-type.js +14 -0
  138. package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
  139. package/dist-server/service/kpi-value/kpi-value.d.ts +1 -0
  140. package/dist-server/service/kpi-value/kpi-value.js +9 -1
  141. package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
  142. package/dist-server/service/utils/value-date-util.d.ts +3 -0
  143. package/dist-server/service/utils/value-date-util.js +76 -0
  144. package/dist-server/service/utils/value-date-util.js.map +1 -0
  145. package/dist-server/tsconfig.tsbuildinfo +1 -1
  146. package/package.json +5 -5
  147. package/server/calculator/evaluator.ts +45 -0
  148. package/server/calculator/functions.ts +67 -0
  149. package/server/calculator/index.ts +4 -0
  150. package/server/calculator/parser.ts +128 -0
  151. package/server/calculator/provider.ts +10 -0
  152. package/server/controllers/kpi-metric-value-provider.ts +66 -0
  153. package/server/controllers/kpi-value-provider.ts +51 -0
  154. package/server/service/index.ts +5 -0
  155. package/server/service/kpi/aggregate-kpi.ts +4 -4
  156. package/server/service/kpi/kpi-grade.types.ts +11 -10
  157. package/server/service/kpi/kpi-history.ts +2 -2
  158. package/server/service/kpi/kpi-mutation.ts +128 -4
  159. package/server/service/kpi/kpi-type.ts +21 -9
  160. package/server/service/kpi/kpi.ts +32 -10
  161. package/server/service/kpi-category/kpi-category-mutation.ts +155 -82
  162. package/server/service/kpi-category/kpi-category-query.ts +21 -1
  163. package/server/service/kpi-category/kpi-category-type.ts +17 -6
  164. package/server/service/kpi-category/kpi-category.ts +10 -1
  165. package/server/service/kpi-category-value/index.ts +7 -0
  166. package/server/service/kpi-category-value/kpi-category-value-mutation.ts +88 -0
  167. package/server/service/kpi-category-value/kpi-category-value-query.ts +62 -0
  168. package/server/service/kpi-category-value/kpi-category-value-type.ts +48 -0
  169. package/server/service/kpi-category-value/kpi-category-value.ts +79 -0
  170. package/server/service/kpi-metric/kpi-metric-type.ts +7 -5
  171. package/server/service/kpi-metric/kpi-metric.ts +3 -15
  172. package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +95 -47
  173. package/server/service/kpi-metric-value/kpi-metric-value.ts +4 -2
  174. package/server/service/kpi-value/kpi-value-mutation.ts +176 -6
  175. package/server/service/kpi-value/kpi-value-query.ts +2 -8
  176. package/server/service/kpi-value/kpi-value-score.service.ts +112 -0
  177. package/server/service/kpi-value/kpi-value-type.ts +12 -0
  178. package/server/service/kpi-value/kpi-value.ts +8 -1
  179. package/server/service/utils/value-date-util.ts +72 -0
  180. package/things-factory.config.js +3 -0
  181. package/translations/en.json +3 -0
  182. package/translations/ja.json +3 -0
  183. package/translations/ko.json +3 -0
  184. package/translations/ms.json +3 -0
  185. package/translations/zh.json +3 -0
  186. package/dist-server/service/kpi-value/kpi-value-grade.service.d.ts +0 -34
  187. package/dist-server/service/kpi-value/kpi-value-grade.service.js +0 -117
  188. package/dist-server/service/kpi-value/kpi-value-grade.service.js.map +0 -1
  189. package/server/service/kpi-value/kpi-value-grade.service.ts +0 -127
@@ -1,10 +1,12 @@
1
1
  import { KpiCategory } from './kpi-category';
2
+ import { KpiPeriodType } from '../kpi/kpi';
2
3
  export declare class NewKpiCategory {
3
4
  name: string;
4
5
  description?: string;
5
6
  active?: boolean;
6
7
  formula?: string;
7
8
  weight?: number;
9
+ periodType?: KpiPeriodType;
8
10
  }
9
11
  export declare class KpiCategoryPatch {
10
12
  id?: string;
@@ -13,6 +15,7 @@ export declare class KpiCategoryPatch {
13
15
  active?: boolean;
14
16
  formula?: string;
15
17
  weight?: number;
18
+ periodType?: KpiPeriodType;
16
19
  cuFlag?: string;
17
20
  }
18
21
  export declare class KpiCategoryList {
@@ -4,6 +4,7 @@ exports.KpiCategoryList = exports.KpiCategoryPatch = exports.NewKpiCategory = vo
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const kpi_category_1 = require("./kpi-category");
7
+ const kpi_1 = require("../kpi/kpi");
7
8
  let NewKpiCategory = class NewKpiCategory {
8
9
  };
9
10
  exports.NewKpiCategory = NewKpiCategory;
@@ -27,6 +28,13 @@ tslib_1.__decorate([
27
28
  (0, type_graphql_1.Field)({ nullable: true, description: 'Weight for aggregation in higher-level summary.' }),
28
29
  tslib_1.__metadata("design:type", Number)
29
30
  ], NewKpiCategory.prototype, "weight", void 0);
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Field)(type => kpi_1.KpiPeriodType, {
33
+ nullable: true,
34
+ 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.'
35
+ }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], NewKpiCategory.prototype, "periodType", void 0);
30
38
  exports.NewKpiCategory = NewKpiCategory = tslib_1.__decorate([
31
39
  (0, type_graphql_1.InputType)({
32
40
  description: 'Input type for creating a new KPI category. Used in mutations to provide category details.'
@@ -52,13 +60,20 @@ tslib_1.__decorate([
52
60
  tslib_1.__metadata("design:type", Boolean)
53
61
  ], KpiCategoryPatch.prototype, "active", void 0);
54
62
  tslib_1.__decorate([
55
- (0, type_graphql_1.Field)({ nullable: true, description: 'Aggregation formula using child KPI codes.' }),
63
+ (0, type_graphql_1.Field)({
64
+ nullable: true,
65
+ 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.'
66
+ }),
56
67
  tslib_1.__metadata("design:type", String)
57
68
  ], KpiCategoryPatch.prototype, "formula", void 0);
58
69
  tslib_1.__decorate([
59
70
  (0, type_graphql_1.Field)({ nullable: true, description: 'Weight for aggregation in higher-level summary.' }),
60
71
  tslib_1.__metadata("design:type", Number)
61
72
  ], KpiCategoryPatch.prototype, "weight", void 0);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Field)(type => kpi_1.KpiPeriodType, { nullable: true, description: 'Aggregation period type for this category.' }),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], KpiCategoryPatch.prototype, "periodType", void 0);
62
77
  tslib_1.__decorate([
63
78
  (0, type_graphql_1.Field)({ nullable: true, description: 'Custom flag for update operations (internal use).' }),
64
79
  tslib_1.__metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"kpi-category-type.js","sourceRoot":"","sources":["../../../server/service/kpi-category/kpi-category-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,iDAA4C;AAKrC,IAAM,cAAc,GAApB,MAAM,cAAc;CAe1B,CAAA;AAfY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,E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AE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;gDAC3E;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;;gDAC7E;2BApBJ,gBAAgB;IAH5B,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,gGAAgG;KAC9G,CAAC;GACW,gBAAgB,CAqB5B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;;8CACT;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;8CACN;0BALF,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAM3B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { KpiCategory } from './kpi-category'\n\n@InputType({\n description: 'Input type for creating a new KPI category. Used in mutations to provide category details.'\n})\nexport class NewKpiCategory {\n @Field({ description: 'Name of the KPI category.' })\n name: string\n\n @Field({ nullable: true, description: 'Detailed description of this KPI category.' })\n description?: string\n\n @Field({ nullable: true, description: 'Whether this category is active (usable) or not.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Aggregation formula using child KPI codes.' })\n formula?: string\n\n @Field({ nullable: true, description: 'Weight for aggregation in higher-level summary.' })\n weight?: number\n}\n\n@InputType({\n description: 'Input type for updating an existing KPI category. Used in mutations to patch category details.'\n})\nexport class KpiCategoryPatch {\n @Field(type => ID, { nullable: true, description: 'ID of the KPI category to update.' })\n id?: string\n\n @Field({ nullable: true, description: 'Name of the KPI category.' })\n name?: string\n\n @Field({ nullable: true, description: 'Detailed description of this KPI category.' })\n description?: string\n\n @Field({ nullable: true, description: 'Whether this category is active (usable) or not.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Aggregation formula using child KPI codes.' })\n formula?: string\n\n @Field({ nullable: true, description: 'Weight for aggregation in higher-level summary.' })\n weight?: number\n\n @Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiCategoryList {\n @Field(type => [KpiCategory])\n items: KpiCategory[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"kpi-category-type.js","sourceRoot":"","sources":["../../../server/service/kpi-category/kpi-category-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAA4C;AAC5C,oCAA0C;AAKnC,IAAM,cAAc,GAApB,MAAM,cAAc;CAsB1B,CAAA;AAtBY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;4CACxC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;mDACjE;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;8CAC3E;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;+CACrE;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;8CAC3E;AAOf;IALC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAa,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,8NAA8N;KACjO,CAAC;;kDACwB;yBArBf,cAAc;IAH1B,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,4FAA4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,0BAAW,CAAC,CAAC;;8CACT;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;8CACN;0BALF,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAM3B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { KpiCategory } from './kpi-category'\nimport { KpiPeriodType } from '../kpi/kpi'\n\n@InputType({\n description: 'Input type for creating a new KPI category. Used in mutations to provide category details.'\n})\nexport class NewKpiCategory {\n @Field({ description: 'Name of the KPI category.' })\n name: string\n\n @Field({ nullable: true, description: 'Detailed description of this KPI category.' })\n description?: string\n\n @Field({ nullable: true, description: 'Whether this category is active (usable) or not.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Aggregation formula using child KPI codes.' })\n formula?: string\n\n @Field({ nullable: true, description: 'Weight for aggregation in higher-level summary.' })\n weight?: number\n\n @Field(type => KpiPeriodType, {\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 periodType?: KpiPeriodType\n}\n\n@InputType({\n description: 'Input type for updating an existing KPI category. Used in mutations to patch category details.'\n})\nexport class KpiCategoryPatch {\n @Field(type => ID, { nullable: true, description: 'ID of the KPI category to update.' })\n id?: string\n\n @Field({ nullable: true, description: 'Name of the KPI category.' })\n name?: string\n\n @Field({ nullable: true, description: 'Detailed description of this KPI category.' })\n description?: string\n\n @Field({ nullable: true, description: 'Whether this category is active (usable) or not.' })\n active?: boolean\n\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 @Field({ nullable: true, description: 'Weight for aggregation in higher-level summary.' })\n weight?: number\n\n @Field(type => KpiPeriodType, { nullable: true, description: 'Aggregation period type for this category.' })\n periodType?: KpiPeriodType\n\n @Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiCategoryList {\n @Field(type => [KpiCategory])\n items: KpiCategory[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
3
  import { Kpi } from '../kpi/kpi';
4
+ import { KpiPeriodType } from '../kpi/kpi';
4
5
  export declare class KpiCategory {
5
6
  readonly id: string;
6
7
  domain?: Domain;
@@ -10,6 +11,7 @@ export declare class KpiCategory {
10
11
  active?: boolean;
11
12
  formula?: string;
12
13
  weight?: number;
14
+ periodType: KpiPeriodType;
13
15
  creator?: User;
14
16
  creatorId?: string;
15
17
  updater?: User;
@@ -7,6 +7,7 @@ const type_graphql_1 = require("type-graphql");
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
9
  const kpi_1 = require("../kpi/kpi");
10
+ const kpi_2 = require("../kpi/kpi");
10
11
  let KpiCategory = class KpiCategory {
11
12
  };
12
13
  exports.KpiCategory = KpiCategory;
@@ -42,7 +43,10 @@ tslib_1.__decorate([
42
43
  ], KpiCategory.prototype, "active", void 0);
43
44
  tslib_1.__decorate([
44
45
  (0, typeorm_1.Column)({ nullable: true }),
45
- (0, type_graphql_1.Field)({ nullable: true, description: 'Aggregation formula using child KPI codes.' }),
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
+ }),
46
50
  tslib_1.__metadata("design:type", String)
47
51
  ], KpiCategory.prototype, "formula", void 0);
48
52
  tslib_1.__decorate([
@@ -50,6 +54,11 @@ tslib_1.__decorate([
50
54
  (0, type_graphql_1.Field)({ nullable: true, description: 'Weight for aggregation in higher-level summary.' }),
51
55
  tslib_1.__metadata("design:type", Number)
52
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);
53
62
  tslib_1.__decorate([
54
63
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
55
64
  (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created this KPI category.' }),
@@ -1 +1 @@
1
- {"version":3,"file":"kpi-category.js","sourceRoot":"","sources":["../../../server/service/kpi-category/kpi-category.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAyD;AAEzD,iDAA8C;AAC9C,yDAAgD;AAChD,oCAAgC;AAUzB,IAAM,WAAW,GAAjB,MAAM,WAAW;CA4DvB,CAAA;AA5DY,kCAAW;AAGb;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;uCAC5D;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qDAAqD,EAAE,CAAC;sCACrF,cAAM;2CAAA;AAIf;IAFC,IAAA,oBAAU,EAAC,CAAC,QAAqB,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;6CAC1E;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,E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;KAChH,CAAC;GACW,WAAW,CA4DvB","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'\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({ nullable: true, description: 'Aggregation formula using child KPI codes.' })\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 @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
+ {"version":3,"file":"kpi-category.js","sourceRoot":"","sources":["../../../server/service/kpi-category/kpi-category.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAyD;AAEzD,iDAA8C;AAC9C,yDAAgD;AAChD,oCAAgC;AAChC,oCAA0C;AAUnC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAoEvB,CAAA;AApEY,kCAAW;AAGb;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;uCAC5D;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qDAAqD,EAAE,CAAC;sCACrF,cAAM;2CAAA;AAIf;IAFC,IAAA,oBAAU,EAAC,CAAC,QAAqB,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;6CAC1E;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;yCACxC;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAA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I,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"]}
@@ -0,0 +1,6 @@
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[];
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,102 @@
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
@@ -0,0 +1 @@
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,MAAM,wBAAwB;IAI7B,AAAN,KAAK,CAAC,sBAAsB,CACD,gBAAqC,EACvD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,MAAM,mBAAmB,GAAG,IAAA,uBAAa,EAAC,qCAAgB,CAAC,CAAC,MAAM,CAAC;YACjE,GAAG,gBAAgB;YACnB,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,EAAE;YAClB,SAAS,EAAE,IAAI,CAAC,EAAE;SACnB,CAAC,CAAA;QAEF,OAAO,MAAM,IAAA,uBAAa,EAAC,qCAAgB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACxE,CAAC;IAKK,AAAN,KAAK,CAAC,sBAAsB,CACf,EAAU,EACP,KAA4B,EACnC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;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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"]}
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,91 @@
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
@@ -0,0 +1 @@
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,IAAA,qBAAa,EAAC,qCAAgB,CAAC;YACjD,WAAW,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC;SAChD,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,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;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"]}
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,73 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,19 @@
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
+ }