@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.
Files changed (309) hide show
  1. package/README.md +74 -0
  2. package/client/pages/kpi/kpi-list-page.ts +97 -47
  3. package/client/pages/kpi/kpi-overview-sample.ts +260 -0
  4. package/client/pages/kpi/kpi-overview.ts +271 -0
  5. package/client/pages/kpi-category/kpi-category-list-page.ts +39 -50
  6. package/client/pages/kpi-dashboard/kpi-alert-panel.ts +114 -0
  7. package/client/pages/kpi-dashboard/kpi-dashboard.ts +285 -0
  8. package/client/pages/kpi-dashboard/kpi-grade-visualization.ts +75 -0
  9. package/client/pages/kpi-dashboard/kpi-history-viewer.ts +58 -0
  10. package/client/pages/kpi-dashboard/kpi-list-summary.ts +100 -0
  11. package/client/pages/kpi-dashboard/kpi-performance-summary.ts +124 -0
  12. package/client/pages/kpi-dashboard/kpi-value-entry.ts +78 -0
  13. package/client/pages/kpi-grade/kpi-grade-list-page.ts +58 -68
  14. package/client/pages/kpi-history/kpi-history-list-page.ts +146 -0
  15. package/client/pages/kpi-metric/kpi-metric-list-page.ts +67 -63
  16. package/client/pages/kpi-value/kpi-value-list-page.ts +73 -72
  17. package/client/pages/kpi-value/kpi-value-manual-entry-form.ts +168 -0
  18. package/client/pages/kpi-value/kpi-value-manual-entry-page.ts +173 -0
  19. package/client/route.ts +35 -0
  20. package/dist-client/pages/kpi/kpi-importer.js +16 -17
  21. package/dist-client/pages/kpi/kpi-importer.js.map +1 -1
  22. package/dist-client/pages/kpi/kpi-list-page.js +128 -68
  23. package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
  24. package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
  25. package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
  26. package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
  27. package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
  28. package/dist-client/pages/kpi/kpi-overview.js +290 -0
  29. package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
  30. package/dist-client/pages/kpi-category/kpi-category-importer.js +16 -17
  31. package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -1
  32. package/dist-client/pages/kpi-category/kpi-category-list-page.js +70 -71
  33. package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
  34. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
  35. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
  36. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
  37. package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +24 -0
  38. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +305 -0
  39. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
  40. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
  41. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
  42. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
  43. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
  44. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
  45. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
  46. package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
  47. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
  48. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
  49. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
  50. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +139 -0
  51. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
  52. package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
  53. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
  54. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
  55. package/dist-client/pages/kpi-grade/kpi-grade-importer.js +16 -17
  56. package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -1
  57. package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +89 -89
  58. package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -1
  59. package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +16 -0
  60. package/dist-client/pages/kpi-history/kpi-history-list-page.js +155 -0
  61. package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
  62. package/dist-client/pages/kpi-metric/kpi-metric-importer.js +16 -17
  63. package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -1
  64. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +98 -84
  65. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
  66. package/dist-client/pages/kpi-value/kpi-value-importer.js +16 -17
  67. package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -1
  68. package/dist-client/pages/kpi-value/kpi-value-list-page.js +104 -93
  69. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
  70. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.d.ts +14 -0
  71. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js +201 -0
  72. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js.map +1 -0
  73. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.d.ts +41 -0
  74. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js +180 -0
  75. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js.map +1 -0
  76. package/dist-client/route.d.ts +1 -1
  77. package/dist-client/route.js +27 -0
  78. package/dist-client/route.js.map +1 -1
  79. package/dist-client/tsconfig.tsbuildinfo +1 -1
  80. package/dist-server/index.d.ts +2 -1
  81. package/dist-server/index.js +2 -1
  82. package/dist-server/index.js.map +1 -1
  83. package/dist-server/migrations/1752188906708-SeedKpiCategory.d.ts +5 -0
  84. package/dist-server/migrations/1752188906708-SeedKpiCategory.js +56 -0
  85. package/dist-server/migrations/1752188906708-SeedKpiCategory.js.map +1 -0
  86. package/dist-server/migrations/1752190849681-SeedKpi.d.ts +5 -0
  87. package/dist-server/migrations/1752190849681-SeedKpi.js +107 -0
  88. package/dist-server/migrations/1752190849681-SeedKpi.js.map +1 -0
  89. package/dist-server/migrations/1752191090459-SeedKpiGrade.d.ts +5 -0
  90. package/dist-server/migrations/1752191090459-SeedKpiGrade.js +271 -0
  91. package/dist-server/migrations/1752191090459-SeedKpiGrade.js.map +1 -0
  92. package/dist-server/migrations/index.d.ts +1 -0
  93. package/dist-server/migrations/index.js +12 -0
  94. package/dist-server/migrations/index.js.map +1 -0
  95. package/dist-server/routes.d.ts +1 -0
  96. package/dist-server/routes.js +48 -0
  97. package/dist-server/routes.js.map +1 -1
  98. package/dist-server/service/index.d.ts +3 -4
  99. package/dist-server/service/index.js +4 -6
  100. package/dist-server/service/index.js.map +1 -1
  101. package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
  102. package/dist-server/service/kpi/aggregate-kpi.js +88 -0
  103. package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
  104. package/dist-server/service/kpi/event-subscriber.d.ts +2 -0
  105. package/dist-server/service/kpi/event-subscriber.js +10 -0
  106. package/dist-server/service/kpi/event-subscriber.js.map +1 -1
  107. package/dist-server/service/kpi/index.d.ts +2 -1
  108. package/dist-server/service/kpi/kpi-formula.service.d.ts +24 -0
  109. package/dist-server/service/kpi/kpi-formula.service.js +64 -0
  110. package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
  111. package/dist-server/service/kpi/kpi-history.d.ts +6 -2
  112. package/dist-server/service/kpi/kpi-history.js +29 -11
  113. package/dist-server/service/kpi/kpi-history.js.map +1 -1
  114. package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
  115. package/dist-server/service/kpi/kpi-mutation.js +215 -10
  116. package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
  117. package/dist-server/service/kpi/kpi-query.d.ts +10 -0
  118. package/dist-server/service/kpi/kpi-query.js +87 -3
  119. package/dist-server/service/kpi/kpi-query.js.map +1 -1
  120. package/dist-server/service/kpi/kpi-type.d.ts +14 -3
  121. package/dist-server/service/kpi/kpi-type.js +81 -18
  122. package/dist-server/service/kpi/kpi-type.js.map +1 -1
  123. package/dist-server/service/kpi/kpi.d.ts +14 -3
  124. package/dist-server/service/kpi/kpi.js +96 -19
  125. package/dist-server/service/kpi/kpi.js.map +1 -1
  126. package/dist-server/service/kpi-alert/index.d.ts +2 -0
  127. package/dist-server/service/kpi-alert/index.js +6 -0
  128. package/dist-server/service/kpi-alert/index.js.map +1 -0
  129. package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
  130. package/dist-server/service/kpi-alert/kpi-alert-query.js +71 -0
  131. package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
  132. package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
  133. package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
  134. package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
  135. package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +1 -1
  136. package/dist-server/service/kpi-category/kpi-category-mutation.js +36 -10
  137. package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
  138. package/dist-server/service/kpi-category/kpi-category-query.d.ts +2 -0
  139. package/dist-server/service/kpi-category/kpi-category-query.js +18 -2
  140. package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
  141. package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -5
  142. package/dist-server/service/kpi-category/kpi-category-type.js +16 -20
  143. package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
  144. package/dist-server/service/kpi-category/kpi-category.d.ts +7 -9
  145. package/dist-server/service/kpi-category/kpi-category.js +40 -38
  146. package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
  147. package/dist-server/service/kpi-grade/index.d.ts +1 -2
  148. package/dist-server/service/kpi-grade/index.js +2 -4
  149. package/dist-server/service/kpi-grade/index.js.map +1 -1
  150. package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +1 -1
  151. package/dist-server/service/kpi-grade/kpi-grade-mutation.js +33 -10
  152. package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -1
  153. package/dist-server/service/kpi-grade/kpi-grade-query.js +2 -2
  154. package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -1
  155. package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +13 -4
  156. package/dist-server/service/kpi-grade/kpi-grade-type.js +54 -18
  157. package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -1
  158. package/dist-server/service/kpi-grade/kpi-grade.d.ts +8 -8
  159. package/dist-server/service/kpi-grade/kpi-grade.js +48 -40
  160. package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -1
  161. package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
  162. package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +134 -0
  163. package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
  164. package/dist-server/service/kpi-metric/index.d.ts +1 -2
  165. package/dist-server/service/kpi-metric/index.js +2 -4
  166. package/dist-server/service/kpi-metric/index.js.map +1 -1
  167. package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +1 -1
  168. package/dist-server/service/kpi-metric/kpi-metric-mutation.js +139 -13
  169. package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
  170. package/dist-server/service/kpi-metric/kpi-metric-query.js +3 -3
  171. package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
  172. package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +17 -4
  173. package/dist-server/service/kpi-metric/kpi-metric-type.js +69 -11
  174. package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
  175. package/dist-server/service/kpi-metric/kpi-metric.d.ts +11 -8
  176. package/dist-server/service/kpi-metric/kpi-metric.js +62 -37
  177. package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
  178. package/dist-server/service/kpi-value/kpi-value-mutation.js +66 -11
  179. package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
  180. package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -0
  181. package/dist-server/service/kpi-value/kpi-value-query.js +15 -2
  182. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
  183. package/dist-server/service/kpi-value/kpi-value-type.d.ts +19 -10
  184. package/dist-server/service/kpi-value/kpi-value-type.js +87 -24
  185. package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
  186. package/dist-server/service/kpi-value/kpi-value.d.ts +15 -9
  187. package/dist-server/service/kpi-value/kpi-value.js +86 -32
  188. package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
  189. package/dist-server/tsconfig.tsbuildinfo +1 -1
  190. package/implement-plan/01-entity-type-resolver.md +57 -0
  191. package/implement-plan/02-dataset-integration.md +35 -0
  192. package/implement-plan/03-kpivalue-automation.md +34 -0
  193. package/implement-plan/04-version-history.md +33 -0
  194. package/implement-plan/05-grade-visualization.md +33 -0
  195. package/implement-plan/06-graphql-frontend.md +30 -0
  196. package/implement-plan/07-test-docs.md +35 -0
  197. package/implement-plan/TODO.md +41 -0
  198. package/package.json +18 -6
  199. package/server/index.ts +2 -1
  200. package/server/migrations/1752188906708-SeedKpiCategory.ts +61 -0
  201. package/server/migrations/1752190849681-SeedKpi.ts +112 -0
  202. package/server/migrations/1752191090459-SeedKpiGrade.ts +270 -0
  203. package/server/migrations/index.ts +9 -0
  204. package/server/routes.ts +55 -0
  205. package/server/service/index.ts +4 -6
  206. package/server/service/kpi/aggregate-kpi.ts +82 -0
  207. package/server/service/kpi/event-subscriber.ts +12 -0
  208. package/server/service/kpi/kpi-formula.service.ts +63 -0
  209. package/server/service/kpi/kpi-history.ts +29 -21
  210. package/server/service/kpi/kpi-mutation.ts +194 -12
  211. package/server/service/kpi/kpi-query.ts +57 -2
  212. package/server/service/kpi/kpi-type.ts +72 -19
  213. package/server/service/kpi/kpi.ts +96 -20
  214. package/server/service/kpi-alert/index.ts +3 -0
  215. package/server/service/kpi-alert/kpi-alert-query.ts +59 -0
  216. package/server/service/kpi-alert/kpi-alert-type.ts +20 -0
  217. package/server/service/kpi-category/kpi-category-mutation.ts +17 -4
  218. package/server/service/kpi-category/kpi-category-query.ts +20 -3
  219. package/server/service/kpi-category/kpi-category-type.ts +17 -19
  220. package/server/service/kpi-category/kpi-category.ts +39 -37
  221. package/server/service/kpi-grade/index.ts +2 -4
  222. package/server/service/kpi-grade/kpi-grade-mutation.ts +13 -4
  223. package/server/service/kpi-grade/kpi-grade-query.ts +5 -2
  224. package/server/service/kpi-grade/kpi-grade-type.ts +46 -19
  225. package/server/service/kpi-grade/kpi-grade.ts +44 -38
  226. package/server/service/kpi-metric/aggregate-kpi-metric.ts +128 -0
  227. package/server/service/kpi-metric/index.ts +2 -4
  228. package/server/service/kpi-metric/kpi-metric-mutation.ts +123 -7
  229. package/server/service/kpi-metric/kpi-metric-query.ts +9 -3
  230. package/server/service/kpi-metric/kpi-metric-type.ts +56 -13
  231. package/server/service/kpi-metric/kpi-metric.ts +55 -35
  232. package/server/service/kpi-value/kpi-value-mutation.ts +52 -14
  233. package/server/service/kpi-value/kpi-value-query.ts +12 -2
  234. package/server/service/kpi-value/kpi-value-type.ts +80 -25
  235. package/server/service/kpi-value/kpi-value.ts +81 -29
  236. package/things-factory.config.js +12 -4
  237. package/translations/en.json +12 -1
  238. package/translations/ja.json +12 -1
  239. package/translations/ko.json +12 -1
  240. package/translations/ms.json +12 -1
  241. package/translations/zh.json +12 -1
  242. package/client/pages/kpe-metric/kpe-metric-importer.ts +0 -90
  243. package/client/pages/kpe-metric/kpe-metric-list-page.ts +0 -398
  244. package/client/pages/kpi-formula/kpi-formula-importer.ts +0 -90
  245. package/client/pages/kpi-formula/kpi-formula-list-page.ts +0 -398
  246. package/client/pages/metric/metric-importer.ts +0 -90
  247. package/client/pages/metric/metric-list-page.ts +0 -398
  248. package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +0 -23
  249. package/dist-client/pages/kpe-metric/kpe-metric-importer.js +0 -93
  250. package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +0 -1
  251. package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +0 -66
  252. package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +0 -370
  253. package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +0 -1
  254. package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +0 -23
  255. package/dist-client/pages/kpi-formula/kpi-formula-importer.js +0 -93
  256. package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +0 -1
  257. package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +0 -66
  258. package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +0 -370
  259. package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +0 -1
  260. package/dist-client/pages/metric/metric-importer.d.ts +0 -23
  261. package/dist-client/pages/metric/metric-importer.js +0 -93
  262. package/dist-client/pages/metric/metric-importer.js.map +0 -1
  263. package/dist-client/pages/metric/metric-list-page.d.ts +0 -66
  264. package/dist-client/pages/metric/metric-list-page.js +0 -370
  265. package/dist-client/pages/metric/metric-list-page.js.map +0 -1
  266. package/dist-server/service/kpi-formula/event-subscriber.d.ts +0 -7
  267. package/dist-server/service/kpi-formula/event-subscriber.js +0 -21
  268. package/dist-server/service/kpi-formula/event-subscriber.js.map +0 -1
  269. package/dist-server/service/kpi-formula/index.d.ts +0 -7
  270. package/dist-server/service/kpi-formula/index.js +0 -12
  271. package/dist-server/service/kpi-formula/index.js.map +0 -1
  272. package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +0 -25
  273. package/dist-server/service/kpi-formula/kpi-formula-history.js +0 -128
  274. package/dist-server/service/kpi-formula/kpi-formula-history.js.map +0 -1
  275. package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +0 -10
  276. package/dist-server/service/kpi-formula/kpi-formula-mutation.js +0 -128
  277. package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +0 -1
  278. package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +0 -11
  279. package/dist-server/service/kpi-formula/kpi-formula-query.js +0 -79
  280. package/dist-server/service/kpi-formula/kpi-formula-query.js.map +0 -1
  281. package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +0 -20
  282. package/dist-server/service/kpi-formula/kpi-formula-type.js +0 -77
  283. package/dist-server/service/kpi-formula/kpi-formula-type.js.map +0 -1
  284. package/dist-server/service/kpi-formula/kpi-formula.d.ts +0 -24
  285. package/dist-server/service/kpi-formula/kpi-formula.js +0 -109
  286. package/dist-server/service/kpi-formula/kpi-formula.js.map +0 -1
  287. package/dist-server/service/kpi-grade/event-subscriber.d.ts +0 -7
  288. package/dist-server/service/kpi-grade/event-subscriber.js +0 -21
  289. package/dist-server/service/kpi-grade/event-subscriber.js.map +0 -1
  290. package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +0 -25
  291. package/dist-server/service/kpi-grade/kpi-grade-history.js +0 -128
  292. package/dist-server/service/kpi-grade/kpi-grade-history.js.map +0 -1
  293. package/dist-server/service/kpi-metric/event-subscriber.d.ts +0 -7
  294. package/dist-server/service/kpi-metric/event-subscriber.js +0 -21
  295. package/dist-server/service/kpi-metric/event-subscriber.js.map +0 -1
  296. package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +0 -25
  297. package/dist-server/service/kpi-metric/kpi-metric-history.js +0 -128
  298. package/dist-server/service/kpi-metric/kpi-metric-history.js.map +0 -1
  299. package/server/service/kpi-formula/event-subscriber.ts +0 -17
  300. package/server/service/kpi-formula/index.ts +0 -9
  301. package/server/service/kpi-formula/kpi-formula-history.ts +0 -116
  302. package/server/service/kpi-formula/kpi-formula-mutation.ts +0 -137
  303. package/server/service/kpi-formula/kpi-formula-query.ts +0 -48
  304. package/server/service/kpi-formula/kpi-formula-type.ts +0 -55
  305. package/server/service/kpi-formula/kpi-formula.ts +0 -95
  306. package/server/service/kpi-grade/event-subscriber.ts +0 -17
  307. package/server/service/kpi-grade/kpi-grade-history.ts +0 -116
  308. package/server/service/kpi-metric/event-subscriber.ts +0 -17
  309. package/server/service/kpi-metric/kpi-metric-history.ts +0 -116
@@ -1,128 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KpiFormulaMutation = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const typeorm_1 = require("typeorm");
7
- const shell_1 = require("@things-factory/shell");
8
- const kpi_formula_1 = require("./kpi-formula");
9
- const kpi_formula_type_1 = require("./kpi-formula-type");
10
- let KpiFormulaMutation = class KpiFormulaMutation {
11
- async createKpiFormula(kpiFormula, context) {
12
- const { domain, user, tx } = context.state;
13
- const result = await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx).save(Object.assign(Object.assign({}, kpiFormula), { domain, creator: user, updater: user }));
14
- return result;
15
- }
16
- async updateKpiFormula(id, patch, context) {
17
- const { domain, user, tx } = context.state;
18
- const repository = (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx);
19
- const kpiFormula = await repository.findOne({
20
- where: { domain: { id: domain.id }, id }
21
- });
22
- const result = await repository.save(Object.assign(Object.assign(Object.assign({}, kpiFormula), patch), { updater: user }));
23
- return result;
24
- }
25
- async updateMultipleKpiFormula(patches, context) {
26
- const { domain, user, tx } = context.state;
27
- let results = [];
28
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
29
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
30
- const kpiFormulaRepo = (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx);
31
- if (_createRecords.length > 0) {
32
- for (let i = 0; i < _createRecords.length; i++) {
33
- const newRecord = _createRecords[i];
34
- const result = await kpiFormulaRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
35
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
36
- }
37
- }
38
- if (_updateRecords.length > 0) {
39
- for (let i = 0; i < _updateRecords.length; i++) {
40
- const updateRecord = _updateRecords[i];
41
- const kpiFormula = await kpiFormulaRepo.findOneBy({ id: updateRecord.id });
42
- const result = await kpiFormulaRepo.save(Object.assign(Object.assign(Object.assign({}, kpiFormula), updateRecord), { updater: user }));
43
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
44
- }
45
- }
46
- return results;
47
- }
48
- async deleteKpiFormula(id, context) {
49
- const { domain, tx } = context.state;
50
- await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx).delete({ domain: { id: domain.id }, id });
51
- return true;
52
- }
53
- async deleteKpiFormulas(ids, context) {
54
- const { domain, tx } = context.state;
55
- await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx).delete({
56
- domain: { id: domain.id },
57
- id: (0, typeorm_1.In)(ids)
58
- });
59
- return true;
60
- }
61
- async importKpiFormulas(kpiFormulas, context) {
62
- const { domain, tx } = context.state;
63
- await Promise.all(kpiFormulas.map(async (kpiFormula) => {
64
- const createdKpiFormula = await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula, tx).save(Object.assign({ domain }, kpiFormula));
65
- }));
66
- return true;
67
- }
68
- };
69
- exports.KpiFormulaMutation = KpiFormulaMutation;
70
- tslib_1.__decorate([
71
- (0, type_graphql_1.Directive)('@transaction'),
72
- (0, type_graphql_1.Mutation)(returns => kpi_formula_1.KpiFormula, { description: 'To create new KpiFormula' }),
73
- tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiFormula')),
74
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
75
- tslib_1.__metadata("design:type", Function),
76
- tslib_1.__metadata("design:paramtypes", [kpi_formula_type_1.NewKpiFormula, Object]),
77
- tslib_1.__metadata("design:returntype", Promise)
78
- ], KpiFormulaMutation.prototype, "createKpiFormula", null);
79
- tslib_1.__decorate([
80
- (0, type_graphql_1.Directive)('@transaction'),
81
- (0, type_graphql_1.Mutation)(returns => kpi_formula_1.KpiFormula, { description: 'To modify KpiFormula information' }),
82
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
83
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
84
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
85
- tslib_1.__metadata("design:type", Function),
86
- tslib_1.__metadata("design:paramtypes", [String, kpi_formula_type_1.KpiFormulaPatch, Object]),
87
- tslib_1.__metadata("design:returntype", Promise)
88
- ], KpiFormulaMutation.prototype, "updateKpiFormula", null);
89
- tslib_1.__decorate([
90
- (0, type_graphql_1.Directive)('@transaction'),
91
- (0, type_graphql_1.Mutation)(returns => [kpi_formula_1.KpiFormula], { description: "To modify multiple KpiFormulas' information" }),
92
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [kpi_formula_type_1.KpiFormulaPatch])),
93
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
94
- tslib_1.__metadata("design:type", Function),
95
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
96
- tslib_1.__metadata("design:returntype", Promise)
97
- ], KpiFormulaMutation.prototype, "updateMultipleKpiFormula", null);
98
- tslib_1.__decorate([
99
- (0, type_graphql_1.Directive)('@transaction'),
100
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete KpiFormula' }),
101
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
102
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
103
- tslib_1.__metadata("design:type", Function),
104
- tslib_1.__metadata("design:paramtypes", [String, Object]),
105
- tslib_1.__metadata("design:returntype", Promise)
106
- ], KpiFormulaMutation.prototype, "deleteKpiFormula", null);
107
- tslib_1.__decorate([
108
- (0, type_graphql_1.Directive)('@transaction'),
109
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple KpiFormulas' }),
110
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
112
- tslib_1.__metadata("design:type", Function),
113
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
114
- tslib_1.__metadata("design:returntype", Promise)
115
- ], KpiFormulaMutation.prototype, "deleteKpiFormulas", null);
116
- tslib_1.__decorate([
117
- (0, type_graphql_1.Directive)('@transaction'),
118
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple KpiFormulas' }),
119
- tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiFormulas', type => [kpi_formula_type_1.KpiFormulaPatch])),
120
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
121
- tslib_1.__metadata("design:type", Function),
122
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
123
- tslib_1.__metadata("design:returntype", Promise)
124
- ], KpiFormulaMutation.prototype, "importKpiFormulas", null);
125
- exports.KpiFormulaMutation = KpiFormulaMutation = tslib_1.__decorate([
126
- (0, type_graphql_1.Resolver)(kpi_formula_1.KpiFormula)
127
- ], KpiFormulaMutation);
128
- //# sourceMappingURL=kpi-formula-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kpi-formula-mutation.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/kpi-formula-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAErD,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAwB;QAClG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,wBAAU,EAAE,EAAE,CAAC,CAAC,IAAI,iCAClD,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QA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IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;6BA/HU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAgI9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\n\nimport { KpiFormula } from './kpi-formula'\nimport { NewKpiFormula, KpiFormulaPatch } from './kpi-formula-type'\n\n@Resolver(KpiFormula)\nexport class KpiFormulaMutation {\n @Directive('@transaction')\n @Mutation(returns => KpiFormula, { description: 'To create new KpiFormula' })\n async createKpiFormula(@Arg('kpiFormula') kpiFormula: NewKpiFormula, @Ctx() context: ResolverContext): Promise<KpiFormula> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(KpiFormula, tx).save({\n ...kpiFormula,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => KpiFormula, { description: 'To modify KpiFormula information' })\n async updateKpiFormula(\n @Arg('id') id: string,\n @Arg('patch') patch: KpiFormulaPatch,\n @Ctx() context: ResolverContext\n ): Promise<KpiFormula> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(KpiFormula, tx)\n const kpiFormula = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...kpiFormula,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [KpiFormula], { description: \"To modify multiple KpiFormulas' information\" })\n async updateMultipleKpiFormula(\n @Arg('patches', type => [KpiFormulaPatch]) patches: KpiFormulaPatch[],\n @Ctx() context: ResolverContext\n ): Promise<KpiFormula[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const kpiFormulaRepo = getRepository(KpiFormula, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await kpiFormulaRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const kpiFormula = await kpiFormulaRepo.findOneBy({ id: updateRecord.id })\n\n const result = await kpiFormulaRepo.save({\n ...kpiFormula,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete KpiFormula' })\n async deleteKpiFormula(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(KpiFormula, tx).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple KpiFormulas' })\n async deleteKpiFormulas(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(KpiFormula, tx).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple KpiFormulas' })\n async importKpiFormulas(\n @Arg('kpiFormulas', type => [KpiFormulaPatch]) kpiFormulas: KpiFormulaPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n kpiFormulas.map(async (kpiFormula: KpiFormulaPatch) => {\n const createdKpiFormula: KpiFormula = await getRepository(KpiFormula, tx).save({ domain, ...kpiFormula })\n })\n )\n\n return true\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- import { Domain, ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { KpiFormula } from './kpi-formula';
4
- import { KpiFormulaList } from './kpi-formula-type';
5
- export declare class KpiFormulaQuery {
6
- kpiFormula(id: string, context: ResolverContext): Promise<KpiFormula>;
7
- kpiFormulas(params: ListParam, context: ResolverContext): Promise<KpiFormulaList>;
8
- domain(kpiFormula: KpiFormula): Promise<Domain>;
9
- updater(kpiFormula: KpiFormula): Promise<User>;
10
- creator(kpiFormula: KpiFormula): Promise<User>;
11
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KpiFormulaQuery = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const auth_base_1 = require("@things-factory/auth-base");
8
- const kpi_formula_1 = require("./kpi-formula");
9
- const kpi_formula_type_1 = require("./kpi-formula-type");
10
- let KpiFormulaQuery = class KpiFormulaQuery {
11
- async kpiFormula(id, context) {
12
- const { domain } = context.state;
13
- return await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula).findOne({
14
- where: { domain: { id: domain.id }, id }
15
- });
16
- }
17
- async kpiFormulas(params, context) {
18
- const { domain } = context.state;
19
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
- domain,
21
- params,
22
- repository: await (0, shell_1.getRepository)(kpi_formula_1.KpiFormula),
23
- searchables: ['name', 'description']
24
- });
25
- const [items, total] = await queryBuilder.getManyAndCount();
26
- return { items, total };
27
- }
28
- async domain(kpiFormula) {
29
- return kpiFormula.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: kpiFormula.domainId }));
30
- }
31
- async updater(kpiFormula) {
32
- return kpiFormula.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiFormula.updaterId }));
33
- }
34
- async creator(kpiFormula) {
35
- return kpiFormula.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiFormula.creatorId }));
36
- }
37
- };
38
- exports.KpiFormulaQuery = KpiFormulaQuery;
39
- tslib_1.__decorate([
40
- (0, type_graphql_1.Query)(returns => kpi_formula_1.KpiFormula, { nullable: true, description: 'To fetch a KpiFormula' }),
41
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
42
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
43
- tslib_1.__metadata("design:type", Function),
44
- tslib_1.__metadata("design:paramtypes", [String, Object]),
45
- tslib_1.__metadata("design:returntype", Promise)
46
- ], KpiFormulaQuery.prototype, "kpiFormula", null);
47
- tslib_1.__decorate([
48
- (0, type_graphql_1.Query)(returns => kpi_formula_type_1.KpiFormulaList, { description: 'To fetch multiple KpiFormulas' }),
49
- tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
50
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
51
- tslib_1.__metadata("design:type", Function),
52
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
53
- tslib_1.__metadata("design:returntype", Promise)
54
- ], KpiFormulaQuery.prototype, "kpiFormulas", null);
55
- tslib_1.__decorate([
56
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
57
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
58
- tslib_1.__metadata("design:type", Function),
59
- tslib_1.__metadata("design:paramtypes", [kpi_formula_1.KpiFormula]),
60
- tslib_1.__metadata("design:returntype", Promise)
61
- ], KpiFormulaQuery.prototype, "domain", null);
62
- tslib_1.__decorate([
63
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
64
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
65
- tslib_1.__metadata("design:type", Function),
66
- tslib_1.__metadata("design:paramtypes", [kpi_formula_1.KpiFormula]),
67
- tslib_1.__metadata("design:returntype", Promise)
68
- ], KpiFormulaQuery.prototype, "updater", null);
69
- tslib_1.__decorate([
70
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
71
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
72
- tslib_1.__metadata("design:type", Function),
73
- tslib_1.__metadata("design:paramtypes", [kpi_formula_1.KpiFormula]),
74
- tslib_1.__metadata("design:returntype", Promise)
75
- ], KpiFormulaQuery.prototype, "creator", null);
76
- exports.KpiFormulaQuery = KpiFormulaQuery = tslib_1.__decorate([
77
- (0, type_graphql_1.Resolver)(kpi_formula_1.KpiFormula)
78
- ], KpiFormulaQuery);
79
- //# sourceMappingURL=kpi-formula-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kpi-formula-query.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/kpi-formula-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAA0B,MAAiB,EAAS,OAAwB;QAC3F,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,wBAAU,CAAC;YAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACz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,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BAvCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAwC3B","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 { KpiFormula } from './kpi-formula'\nimport { KpiFormulaList } from './kpi-formula-type'\n\n@Resolver(KpiFormula)\nexport class KpiFormulaQuery {\n @Query(returns => KpiFormula!, { nullable: true, description: 'To fetch a KpiFormula' })\n async kpiFormula(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<KpiFormula> {\n const { domain } = context.state\n\n return await getRepository(KpiFormula).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => KpiFormulaList, { description: 'To fetch multiple KpiFormulas' })\n async kpiFormulas(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<KpiFormulaList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(KpiFormula),\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() kpiFormula: KpiFormula): Promise<Domain> {\n return kpiFormula.domainId && (await getRepository(Domain).findOneBy({ id: kpiFormula.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() kpiFormula: KpiFormula): Promise<User> {\n return kpiFormula.updaterId && (await getRepository(User).findOneBy({ id: kpiFormula.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() kpiFormula: KpiFormula): Promise<User> {\n return kpiFormula.creatorId && (await getRepository(User).findOneBy({ id: kpiFormula.creatorId }))\n }\n}\n"]}
@@ -1,20 +0,0 @@
1
- import { KpiFormula, KpiFormulaStatus } from './kpi-formula';
2
- export declare class NewKpiFormula {
3
- name: string;
4
- description?: string;
5
- state?: KpiFormulaStatus;
6
- active?: boolean;
7
- params?: string;
8
- }
9
- export declare class KpiFormulaPatch {
10
- id?: string;
11
- name?: string;
12
- description?: string;
13
- state?: KpiFormulaStatus;
14
- active?: boolean;
15
- cuFlag?: string;
16
- }
17
- export declare class KpiFormulaList {
18
- items: KpiFormula[];
19
- total: number;
20
- }
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KpiFormulaList = exports.KpiFormulaPatch = exports.NewKpiFormula = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const kpi_formula_1 = require("./kpi-formula");
7
- let NewKpiFormula = class NewKpiFormula {
8
- };
9
- exports.NewKpiFormula = NewKpiFormula;
10
- tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
12
- tslib_1.__metadata("design:type", String)
13
- ], NewKpiFormula.prototype, "name", void 0);
14
- tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
16
- tslib_1.__metadata("design:type", String)
17
- ], NewKpiFormula.prototype, "description", void 0);
18
- tslib_1.__decorate([
19
- (0, type_graphql_1.Field)(type => kpi_formula_1.KpiFormulaStatus, { nullable: true }),
20
- tslib_1.__metadata("design:type", String)
21
- ], NewKpiFormula.prototype, "state", void 0);
22
- tslib_1.__decorate([
23
- (0, type_graphql_1.Field)({ nullable: true }),
24
- tslib_1.__metadata("design:type", Boolean)
25
- ], NewKpiFormula.prototype, "active", void 0);
26
- tslib_1.__decorate([
27
- (0, type_graphql_1.Field)({ nullable: true }),
28
- tslib_1.__metadata("design:type", String)
29
- ], NewKpiFormula.prototype, "params", void 0);
30
- exports.NewKpiFormula = NewKpiFormula = tslib_1.__decorate([
31
- (0, type_graphql_1.InputType)()
32
- ], NewKpiFormula);
33
- let KpiFormulaPatch = class KpiFormulaPatch {
34
- };
35
- exports.KpiFormulaPatch = KpiFormulaPatch;
36
- tslib_1.__decorate([
37
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
38
- tslib_1.__metadata("design:type", String)
39
- ], KpiFormulaPatch.prototype, "id", void 0);
40
- tslib_1.__decorate([
41
- (0, type_graphql_1.Field)({ nullable: true }),
42
- tslib_1.__metadata("design:type", String)
43
- ], KpiFormulaPatch.prototype, "name", void 0);
44
- tslib_1.__decorate([
45
- (0, type_graphql_1.Field)({ nullable: true }),
46
- tslib_1.__metadata("design:type", String)
47
- ], KpiFormulaPatch.prototype, "description", void 0);
48
- tslib_1.__decorate([
49
- (0, type_graphql_1.Field)(type => kpi_formula_1.KpiFormulaStatus, { nullable: true }),
50
- tslib_1.__metadata("design:type", String)
51
- ], KpiFormulaPatch.prototype, "state", void 0);
52
- tslib_1.__decorate([
53
- (0, type_graphql_1.Field)({ nullable: true }),
54
- tslib_1.__metadata("design:type", Boolean)
55
- ], KpiFormulaPatch.prototype, "active", void 0);
56
- tslib_1.__decorate([
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- tslib_1.__metadata("design:type", String)
59
- ], KpiFormulaPatch.prototype, "cuFlag", void 0);
60
- exports.KpiFormulaPatch = KpiFormulaPatch = tslib_1.__decorate([
61
- (0, type_graphql_1.InputType)()
62
- ], KpiFormulaPatch);
63
- let KpiFormulaList = class KpiFormulaList {
64
- };
65
- exports.KpiFormulaList = KpiFormulaList;
66
- tslib_1.__decorate([
67
- (0, type_graphql_1.Field)(type => [kpi_formula_1.KpiFormula]),
68
- tslib_1.__metadata("design:type", Array)
69
- ], KpiFormulaList.prototype, "items", void 0);
70
- tslib_1.__decorate([
71
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
72
- tslib_1.__metadata("design:type", Number)
73
- ], KpiFormulaList.prototype, "total", void 0);
74
- exports.KpiFormulaList = KpiFormulaList = tslib_1.__decorate([
75
- (0, type_graphql_1.ObjectType)()
76
- ], KpiFormulaList);
77
- //# sourceMappingURL=kpi-formula-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kpi-formula-type.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/kpi-formula-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,+CAA4D;AAGrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAkB3B,CAAA;AAlBY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BAjBJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAkB3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","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 { KpiFormula, KpiFormulaStatus } from './kpi-formula'\n\n@InputType()\nexport class NewKpiFormula {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => KpiFormulaStatus, { nullable: true })\n state?: KpiFormulaStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class KpiFormulaPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => KpiFormulaStatus, { nullable: true })\n state?: KpiFormulaStatus\n\n @Field({ nullable: true })\n active?: boolean\n \n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiFormulaList {\n @Field(type => [KpiFormula])\n items: KpiFormula[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,24 +0,0 @@
1
- import { Domain } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- export declare enum KpiFormulaStatus {
4
- STATUS_A = "STATUS_A",
5
- STATUS_B = "STATUS_B"
6
- }
7
- export declare class KpiFormula {
8
- readonly id: string;
9
- version?: number;
10
- domain?: Domain;
11
- domainId?: string;
12
- name?: string;
13
- description?: string;
14
- active?: boolean;
15
- state?: KpiFormulaStatus;
16
- params?: string;
17
- createdAt?: Date;
18
- updatedAt?: Date;
19
- deletedAt?: Date;
20
- creator?: User;
21
- creatorId?: string;
22
- updater?: User;
23
- updaterId?: string;
24
- }
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KpiFormula = exports.KpiFormulaStatus = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const type_graphql_1 = require("type-graphql");
7
- const shell_1 = require("@things-factory/shell");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- var KpiFormulaStatus;
10
- (function (KpiFormulaStatus) {
11
- KpiFormulaStatus["STATUS_A"] = "STATUS_A";
12
- KpiFormulaStatus["STATUS_B"] = "STATUS_B";
13
- })(KpiFormulaStatus || (exports.KpiFormulaStatus = KpiFormulaStatus = {}));
14
- (0, type_graphql_1.registerEnumType)(KpiFormulaStatus, {
15
- name: 'KpiFormulaStatus',
16
- description: 'state enumeration of a kpiFormula'
17
- });
18
- let KpiFormula = class KpiFormula {
19
- constructor() {
20
- this.version = 1;
21
- }
22
- };
23
- exports.KpiFormula = KpiFormula;
24
- tslib_1.__decorate([
25
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
26
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
27
- tslib_1.__metadata("design:type", String)
28
- ], KpiFormula.prototype, "id", void 0);
29
- tslib_1.__decorate([
30
- (0, typeorm_1.VersionColumn)(),
31
- (0, type_graphql_1.Field)({ nullable: true }),
32
- tslib_1.__metadata("design:type", Number)
33
- ], KpiFormula.prototype, "version", void 0);
34
- tslib_1.__decorate([
35
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
36
- (0, type_graphql_1.Field)({ nullable: true }),
37
- tslib_1.__metadata("design:type", shell_1.Domain)
38
- ], KpiFormula.prototype, "domain", void 0);
39
- tslib_1.__decorate([
40
- (0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.domain),
41
- tslib_1.__metadata("design:type", String)
42
- ], KpiFormula.prototype, "domainId", void 0);
43
- tslib_1.__decorate([
44
- (0, typeorm_1.Column)(),
45
- (0, type_graphql_1.Field)({ nullable: true }),
46
- tslib_1.__metadata("design:type", String)
47
- ], KpiFormula.prototype, "name", void 0);
48
- tslib_1.__decorate([
49
- (0, typeorm_1.Column)({ nullable: true }),
50
- (0, type_graphql_1.Field)({ nullable: true }),
51
- tslib_1.__metadata("design:type", String)
52
- ], KpiFormula.prototype, "description", void 0);
53
- tslib_1.__decorate([
54
- (0, typeorm_1.Column)({ nullable: false, default: false }),
55
- (0, type_graphql_1.Field)({ nullable: true }),
56
- tslib_1.__metadata("design:type", Boolean)
57
- ], KpiFormula.prototype, "active", void 0);
58
- tslib_1.__decorate([
59
- (0, typeorm_1.Column)({ nullable: true }),
60
- (0, type_graphql_1.Field)({ nullable: true }),
61
- tslib_1.__metadata("design:type", String)
62
- ], KpiFormula.prototype, "state", void 0);
63
- tslib_1.__decorate([
64
- (0, typeorm_1.Column)({ nullable: true }),
65
- (0, type_graphql_1.Field)({ nullable: true }),
66
- tslib_1.__metadata("design:type", String)
67
- ], KpiFormula.prototype, "params", void 0);
68
- tslib_1.__decorate([
69
- (0, typeorm_1.CreateDateColumn)(),
70
- (0, type_graphql_1.Field)({ nullable: true }),
71
- tslib_1.__metadata("design:type", Date)
72
- ], KpiFormula.prototype, "createdAt", void 0);
73
- tslib_1.__decorate([
74
- (0, typeorm_1.UpdateDateColumn)(),
75
- (0, type_graphql_1.Field)({ nullable: true }),
76
- tslib_1.__metadata("design:type", Date)
77
- ], KpiFormula.prototype, "updatedAt", void 0);
78
- tslib_1.__decorate([
79
- (0, typeorm_1.DeleteDateColumn)(),
80
- (0, type_graphql_1.Field)({ nullable: true }),
81
- tslib_1.__metadata("design:type", Date)
82
- ], KpiFormula.prototype, "deletedAt", void 0);
83
- tslib_1.__decorate([
84
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
85
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
86
- tslib_1.__metadata("design:type", auth_base_1.User)
87
- ], KpiFormula.prototype, "creator", void 0);
88
- tslib_1.__decorate([
89
- (0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.creator),
90
- tslib_1.__metadata("design:type", String)
91
- ], KpiFormula.prototype, "creatorId", void 0);
92
- tslib_1.__decorate([
93
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
94
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
95
- tslib_1.__metadata("design:type", auth_base_1.User)
96
- ], KpiFormula.prototype, "updater", void 0);
97
- tslib_1.__decorate([
98
- (0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.updater),
99
- tslib_1.__metadata("design:type", String)
100
- ], KpiFormula.prototype, "updaterId", void 0);
101
- exports.KpiFormula = KpiFormula = tslib_1.__decorate([
102
- (0, typeorm_1.Entity)(),
103
- (0, typeorm_1.Index)('ix_kpi_formula_0', (kpiFormula) => [kpiFormula.domain, kpiFormula.name], {
104
- where: '"deleted_at" IS NULL',
105
- unique: true
106
- }),
107
- (0, type_graphql_1.ObjectType)({ description: 'Entity for KpiFormula' })
108
- ], KpiFormula);
109
- //# sourceMappingURL=kpi-formula.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kpi-formula.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/kpi-formula.ts"],"names":[],"mappings":";;;;AAAA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;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;qBA5DP,UAAU;IANtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE;QAC3F,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CA6DtB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum KpiFormulaStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(KpiFormulaStatus, {\n name: 'KpiFormulaStatus',\n description: 'state enumeration of a kpiFormula'\n})\n\n@Entity()\n@Index('ix_kpi_formula_0', (kpiFormula: KpiFormula) => [kpiFormula.domain, kpiFormula.name], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@ObjectType({ description: 'Entity for KpiFormula' })\nexport class KpiFormula {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n \n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((kpiFormula: KpiFormula) => kpiFormula.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: false, default: false })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: KpiFormulaStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((kpiFormula: KpiFormula) => kpiFormula.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((kpiFormula: KpiFormula) => kpiFormula.updater)\n updaterId?: string\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
- import { KpiGrade } from './kpi-grade';
3
- import { KpiGradeHistory } from './kpi-grade-history';
4
- export declare class KpiGradeHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiGrade, KpiGradeHistory> {
5
- get entity(): typeof KpiGrade;
6
- get historyEntity(): typeof KpiGradeHistory;
7
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KpiGradeHistoryEntitySubscriber = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const typeorm_history_1 = require("@operato/typeorm-history");
7
- const kpi_grade_1 = require("./kpi-grade");
8
- const kpi_grade_history_1 = require("./kpi-grade-history");
9
- let KpiGradeHistoryEntitySubscriber = class KpiGradeHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
- get entity() {
11
- return kpi_grade_1.KpiGrade;
12
- }
13
- get historyEntity() {
14
- return kpi_grade_history_1.KpiGradeHistory;
15
- }
16
- };
17
- exports.KpiGradeHistoryEntitySubscriber = KpiGradeHistoryEntitySubscriber;
18
- exports.KpiGradeHistoryEntitySubscriber = KpiGradeHistoryEntitySubscriber = tslib_1.__decorate([
19
- (0, typeorm_1.EventSubscriber)()
20
- ], KpiGradeHistoryEntitySubscriber);
21
- //# sourceMappingURL=event-subscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/kpi-grade/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2CAAsC;AACtC,2DAAqD;AAG9C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,yCAAkD;IACrG,IAAW,MAAM;QACf,OAAO,oBAAQ,CAAA;IACjB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,mCAAe,CAAA;IACxB,CAAC;CACF,CAAA;AARY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,yBAAe,GAAE;GACL,+BAA+B,CAQ3C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { KpiGrade } from './kpi-grade'\nimport { KpiGradeHistory } from './kpi-grade-history'\n\n@EventSubscriber()\nexport class KpiGradeHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiGrade, KpiGradeHistory> {\n public get entity() {\n return KpiGrade\n }\n\n public get historyEntity() {\n return KpiGradeHistory\n }\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
2
- import { User } from '@things-factory/auth-base';
3
- import { Domain } from '@things-factory/shell';
4
- import { KpiGrade, KpiGradeStatus } from './kpi-grade';
5
- export declare class KpiGradeHistory implements HistoryEntityInterface<KpiGrade> {
6
- readonly id: string;
7
- version?: number;
8
- domain?: Domain;
9
- domainId?: string;
10
- name: string;
11
- description?: string;
12
- active?: boolean;
13
- state?: KpiGradeStatus;
14
- params?: string;
15
- createdAt?: Date;
16
- updatedAt?: Date;
17
- deletedAt?: Date;
18
- creator?: User;
19
- creatorId?: string;
20
- updater?: User;
21
- updaterId?: string;
22
- thumbnail?: string;
23
- originalId: string;
24
- action: HistoryActionType;
25
- }