@things-factory/kpi 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/client/index.ts +0 -0
- package/client/pages/kpe-metric/kpe-metric-importer.ts +90 -0
- package/client/pages/kpe-metric/kpe-metric-list-page.ts +398 -0
- package/client/pages/kpi/kpi-importer.ts +90 -0
- package/client/pages/kpi/kpi-list-page.ts +398 -0
- package/client/pages/kpi-category/kpi-category-importer.ts +90 -0
- package/client/pages/kpi-category/kpi-category-list-page.ts +398 -0
- package/client/pages/kpi-formula/kpi-formula-importer.ts +90 -0
- package/client/pages/kpi-formula/kpi-formula-list-page.ts +398 -0
- package/client/pages/kpi-grade/kpi-grade-importer.ts +90 -0
- package/client/pages/kpi-grade/kpi-grade-list-page.ts +398 -0
- package/client/pages/kpi-metric/kpi-metric-importer.ts +90 -0
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +398 -0
- package/client/pages/kpi-value/kpi-value-importer.ts +90 -0
- package/client/pages/kpi-value/kpi-value-list-page.ts +398 -0
- package/client/pages/metric/metric-importer.ts +90 -0
- package/client/pages/metric/metric-list-page.ts +398 -0
- package/client/route.ts +4 -0
- package/client/tsconfig.json +11 -0
- package/design-entities.md +97 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +23 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js +93 -0
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +1 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +66 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +370 -0
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-importer.d.ts +23 -0
- package/dist-client/pages/kpi/kpi-importer.js +93 -0
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -0
- package/dist-client/pages/kpi/kpi-list-page.d.ts +66 -0
- package/dist-client/pages/kpi/kpi-list-page.js +370 -0
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.d.ts +23 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js +93 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +370 -0
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +23 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js +93 -0
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +1 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +370 -0
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.d.ts +23 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js +93 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +370 -0
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +93 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +370 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +66 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +370 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
- package/dist-client/pages/metric/metric-importer.d.ts +23 -0
- package/dist-client/pages/metric/metric-importer.js +93 -0
- package/dist-client/pages/metric/metric-importer.js.map +1 -0
- package/dist-client/pages/metric/metric-list-page.d.ts +66 -0
- package/dist-client/pages/metric/metric-list-page.js +370 -0
- package/dist-client/pages/metric/metric-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +5 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.d.ts +0 -0
- package/dist-server/routes.js +24 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.d.ts +16 -0
- package/dist-server/service/index.js +45 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi/event-subscriber.js +21 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi/index.d.ts +7 -0
- package/dist-server/service/kpi/index.js +12 -0
- package/dist-server/service/kpi/index.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +25 -0
- package/dist-server/service/kpi/kpi-history.js +128 -0
- package/dist-server/service/kpi/kpi-history.js.map +1 -0
- package/dist-server/service/kpi/kpi-mutation.d.ts +10 -0
- package/dist-server/service/kpi/kpi-mutation.js +169 -0
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -0
- package/dist-server/service/kpi/kpi-query.d.ts +12 -0
- package/dist-server/service/kpi/kpi-query.js +97 -0
- package/dist-server/service/kpi/kpi-query.js.map +1 -0
- package/dist-server/service/kpi/kpi-type.d.ts +23 -0
- package/dist-server/service/kpi/kpi-type.js +86 -0
- package/dist-server/service/kpi/kpi-type.js.map +1 -0
- package/dist-server/service/kpi/kpi.d.ts +25 -0
- package/dist-server/service/kpi/kpi.js +113 -0
- package/dist-server/service/kpi/kpi.js.map +1 -0
- package/dist-server/service/kpi-category/index.d.ts +6 -0
- package/dist-server/service/kpi-category/index.js +10 -0
- package/dist-server/service/kpi-category/index.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +10 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.js +128 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +11 -0
- package/dist-server/service/kpi-category/kpi-category-query.js +79 -0
- package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +20 -0
- package/dist-server/service/kpi-category/kpi-category-type.js +77 -0
- package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category.d.ts +22 -0
- package/dist-server/service/kpi-category/kpi-category.js +95 -0
- package/dist-server/service/kpi-category/kpi-category.js.map +1 -0
- package/dist-server/service/kpi-formula/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-formula/event-subscriber.js +21 -0
- package/dist-server/service/kpi-formula/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-formula/index.d.ts +7 -0
- package/dist-server/service/kpi-formula/index.js +12 -0
- package/dist-server/service/kpi-formula/index.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +25 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.js +128 -0
- package/dist-server/service/kpi-formula/kpi-formula-history.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +10 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js +128 -0
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +11 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.js +79 -0
- package/dist-server/service/kpi-formula/kpi-formula-query.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +20 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.js +77 -0
- package/dist-server/service/kpi-formula/kpi-formula-type.js.map +1 -0
- package/dist-server/service/kpi-formula/kpi-formula.d.ts +24 -0
- package/dist-server/service/kpi-formula/kpi-formula.js +109 -0
- package/dist-server/service/kpi-formula/kpi-formula.js.map +1 -0
- package/dist-server/service/kpi-grade/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-grade/event-subscriber.js +21 -0
- package/dist-server/service/kpi-grade/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-grade/index.d.ts +7 -0
- package/dist-server/service/kpi-grade/index.js +12 -0
- package/dist-server/service/kpi-grade/index.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +25 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.js +128 -0
- package/dist-server/service/kpi-grade/kpi-grade-history.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +10 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js +128 -0
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.d.ts +11 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.js +79 -0
- package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +20 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.js +77 -0
- package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -0
- package/dist-server/service/kpi-grade/kpi-grade.d.ts +24 -0
- package/dist-server/service/kpi-grade/kpi-grade.js +109 -0
- package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -0
- package/dist-server/service/kpi-metric/event-subscriber.d.ts +7 -0
- package/dist-server/service/kpi-metric/event-subscriber.js +21 -0
- package/dist-server/service/kpi-metric/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +7 -0
- package/dist-server/service/kpi-metric/index.js +12 -0
- package/dist-server/service/kpi-metric/index.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +25 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.js +128 -0
- package/dist-server/service/kpi-metric/kpi-metric-history.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +10 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +169 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.d.ts +12 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js +97 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +23 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js +86 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +25 -0
- package/dist-server/service/kpi-metric/kpi-metric.js +113 -0
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-value/index.d.ts +6 -0
- package/dist-server/service/kpi-value/index.js +10 -0
- package/dist-server/service/kpi-value/index.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.d.ts +10 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js +128 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +11 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +79 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +20 -0
- package/dist-server/service/kpi-value/kpi-value-type.js +77 -0
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value.d.ts +22 -0
- package/dist-server/service/kpi-value/kpi-value.js +95 -0
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/kpi/kpe-metric.md +160 -0
- package/helps/kpi/kpi-category.md +160 -0
- package/helps/kpi/kpi-formula.md +160 -0
- package/helps/kpi/kpi-grade.md +160 -0
- package/helps/kpi/kpi-metric.md +160 -0
- package/helps/kpi/kpi-value.md +160 -0
- package/helps/kpi/kpi.md +160 -0
- package/helps/kpi/metric.md +160 -0
- package/kpi-grade.csv +41 -0
- package/package.json +36 -0
- package/server/index.ts +3 -0
- package/server/routes.ts +26 -0
- package/server/service/index.ts +43 -0
- package/server/service/kpi/event-subscriber.ts +17 -0
- package/server/service/kpi/index.ts +9 -0
- package/server/service/kpi/kpi-history.ts +116 -0
- package/server/service/kpi/kpi-mutation.ts +198 -0
- package/server/service/kpi/kpi-query.ts +62 -0
- package/server/service/kpi/kpi-type.ts +61 -0
- package/server/service/kpi/kpi.ts +98 -0
- package/server/service/kpi-category/index.ts +7 -0
- package/server/service/kpi-category/kpi-category-mutation.ts +137 -0
- package/server/service/kpi-category/kpi-category-query.ts +48 -0
- package/server/service/kpi-category/kpi-category-type.ts +55 -0
- package/server/service/kpi-category/kpi-category.ts +84 -0
- package/server/service/kpi-formula/event-subscriber.ts +17 -0
- package/server/service/kpi-formula/index.ts +9 -0
- package/server/service/kpi-formula/kpi-formula-history.ts +116 -0
- package/server/service/kpi-formula/kpi-formula-mutation.ts +137 -0
- package/server/service/kpi-formula/kpi-formula-query.ts +48 -0
- package/server/service/kpi-formula/kpi-formula-type.ts +55 -0
- package/server/service/kpi-formula/kpi-formula.ts +95 -0
- package/server/service/kpi-grade/event-subscriber.ts +17 -0
- package/server/service/kpi-grade/index.ts +9 -0
- package/server/service/kpi-grade/kpi-grade-history.ts +116 -0
- package/server/service/kpi-grade/kpi-grade-mutation.ts +137 -0
- package/server/service/kpi-grade/kpi-grade-query.ts +48 -0
- package/server/service/kpi-grade/kpi-grade-type.ts +55 -0
- package/server/service/kpi-grade/kpi-grade.ts +95 -0
- package/server/service/kpi-metric/event-subscriber.ts +17 -0
- package/server/service/kpi-metric/index.ts +9 -0
- package/server/service/kpi-metric/kpi-metric-history.ts +116 -0
- package/server/service/kpi-metric/kpi-metric-mutation.ts +198 -0
- package/server/service/kpi-metric/kpi-metric-query.ts +62 -0
- package/server/service/kpi-metric/kpi-metric-type.ts +61 -0
- package/server/service/kpi-metric/kpi-metric.ts +98 -0
- package/server/service/kpi-value/index.ts +7 -0
- package/server/service/kpi-value/kpi-value-mutation.ts +137 -0
- package/server/service/kpi-value/kpi-value-query.ts +48 -0
- package/server/service/kpi-value/kpi-value-type.ts +55 -0
- package/server/service/kpi-value/kpi-value.ts +84 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +10 -0
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-category.js","sourceRoot":"","sources":["../../../server/service/kpi-category/kpi-category.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oCAAoC;CAClD,CAAC,CAAA;AAOK,IAAM,WAAW,GAAjB,MAAM,WAAW;CAqDvB,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K,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;8CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;sBApDP,WAAW;IALvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE;QAChG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,WAAW,CAqDvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum KpiCategoryStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(KpiCategoryStatus, {\n name: 'KpiCategoryStatus',\n description: 'state enumeration of a kpiCategory'\n})\n\n@Entity()\n@Index('ix_kpi_category_0', (kpiCategory: KpiCategory) => [kpiCategory.domain, kpiCategory.name], {\n unique: true\n})\n@ObjectType({ description: 'Entity for KpiCategory' })\nexport class KpiCategory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((kpiCategory: KpiCategory) => kpiCategory.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?: KpiCategoryStatus\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 @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((kpiCategory: KpiCategory) => kpiCategory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((kpiCategory: KpiCategory) => kpiCategory.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HistoryEntitySubscriber } from '@operato/typeorm-history';
|
|
2
|
+
import { KpiFormula } from './kpi-formula';
|
|
3
|
+
import { KpiFormulaHistory } from './kpi-formula-history';
|
|
4
|
+
export declare class KpiFormulaHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiFormula, KpiFormulaHistory> {
|
|
5
|
+
get entity(): typeof KpiFormula;
|
|
6
|
+
get historyEntity(): typeof KpiFormulaHistory;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiFormulaHistoryEntitySubscriber = 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_formula_1 = require("./kpi-formula");
|
|
8
|
+
const kpi_formula_history_1 = require("./kpi-formula-history");
|
|
9
|
+
let KpiFormulaHistoryEntitySubscriber = class KpiFormulaHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
10
|
+
get entity() {
|
|
11
|
+
return kpi_formula_1.KpiFormula;
|
|
12
|
+
}
|
|
13
|
+
get historyEntity() {
|
|
14
|
+
return kpi_formula_history_1.KpiFormulaHistory;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.KpiFormulaHistoryEntitySubscriber = KpiFormulaHistoryEntitySubscriber;
|
|
18
|
+
exports.KpiFormulaHistoryEntitySubscriber = KpiFormulaHistoryEntitySubscriber = tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.EventSubscriber)()
|
|
20
|
+
], KpiFormulaHistoryEntitySubscriber);
|
|
21
|
+
//# sourceMappingURL=event-subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,+CAA0C;AAC1C,+DAAyD;AAGlD,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,yCAAsD;IAC3G,IAAW,MAAM;QACf,OAAO,wBAAU,CAAA;IACnB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,uCAAiB,CAAA;IAC1B,CAAC;CACF,CAAA;AARY,8EAAiC;4CAAjC,iCAAiC;IAD7C,IAAA,yBAAe,GAAE;GACL,iCAAiC,CAQ7C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { KpiFormula } from './kpi-formula'\nimport { KpiFormulaHistory } from './kpi-formula-history'\n\n@EventSubscriber()\nexport class KpiFormulaHistoryEntitySubscriber extends HistoryEntitySubscriber<KpiFormula, KpiFormulaHistory> {\n public get entity() {\n return KpiFormula\n }\n\n public get historyEntity() {\n return KpiFormulaHistory\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KpiFormula } from './kpi-formula';
|
|
2
|
+
import { KpiFormulaHistoryEntitySubscriber } from './event-subscriber';
|
|
3
|
+
import { KpiFormulaQuery } from './kpi-formula-query';
|
|
4
|
+
import { KpiFormulaMutation } from './kpi-formula-mutation';
|
|
5
|
+
export declare const entities: (typeof KpiFormula)[];
|
|
6
|
+
export declare const resolvers: (typeof KpiFormulaQuery | typeof KpiFormulaMutation)[];
|
|
7
|
+
export declare const subscribers: (typeof KpiFormulaHistoryEntitySubscriber)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const kpi_formula_1 = require("./kpi-formula");
|
|
5
|
+
const kpi_formula_history_1 = require("./kpi-formula-history");
|
|
6
|
+
const event_subscriber_1 = require("./event-subscriber");
|
|
7
|
+
const kpi_formula_query_1 = require("./kpi-formula-query");
|
|
8
|
+
const kpi_formula_mutation_1 = require("./kpi-formula-mutation");
|
|
9
|
+
exports.entities = [kpi_formula_1.KpiFormula, kpi_formula_history_1.KpiFormulaHistory];
|
|
10
|
+
exports.resolvers = [kpi_formula_query_1.KpiFormulaQuery, kpi_formula_mutation_1.KpiFormulaMutation];
|
|
11
|
+
exports.subscribers = [event_subscriber_1.KpiFormulaHistoryEntitySubscriber];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+DAAyD;AACzD,yDAAsE;AACtE,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,EAAE,uCAAiB,CAAC,CAAA;AAC1C,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA;AACjD,QAAA,WAAW,GAAG,CAAC,oDAAiC,CAAC,CAAA","sourcesContent":["import { KpiFormula } from './kpi-formula'\nimport { KpiFormulaHistory } from './kpi-formula-history'\nimport { KpiFormulaHistoryEntitySubscriber } from './event-subscriber'\nimport { KpiFormulaQuery } from './kpi-formula-query'\nimport { KpiFormulaMutation } from './kpi-formula-mutation'\n\nexport const entities = [KpiFormula, KpiFormulaHistory]\nexport const resolvers = [KpiFormulaQuery, KpiFormulaMutation]\nexport const subscribers = [KpiFormulaHistoryEntitySubscriber]\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { KpiFormula, KpiFormulaStatus } from './kpi-formula';
|
|
5
|
+
export declare class KpiFormulaHistory implements HistoryEntityInterface<KpiFormula> {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
domain?: Domain;
|
|
9
|
+
domainId?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
state?: KpiFormulaStatus;
|
|
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
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiFormulaHistory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const env_1 = require("@things-factory/env");
|
|
10
|
+
const shell_1 = require("@things-factory/shell");
|
|
11
|
+
const kpi_formula_1 = require("./kpi-formula");
|
|
12
|
+
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
13
|
+
const DATABASE_TYPE = ORMCONFIG.type;
|
|
14
|
+
let KpiFormulaHistory = class KpiFormulaHistory {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.version = 1;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.KpiFormulaHistory = KpiFormulaHistory;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], KpiFormulaHistory.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", Number)
|
|
29
|
+
], KpiFormulaHistory.prototype, "version", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
34
|
+
], KpiFormulaHistory.prototype, "domain", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.domain),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], KpiFormulaHistory.prototype, "domainId", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)(),
|
|
41
|
+
(0, type_graphql_1.Field)(),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], KpiFormulaHistory.prototype, "name", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
48
|
+
], KpiFormulaHistory.prototype, "description", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
52
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
53
|
+
], KpiFormulaHistory.prototype, "active", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
58
|
+
], KpiFormulaHistory.prototype, "state", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], KpiFormulaHistory.prototype, "params", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], KpiFormulaHistory.prototype, "createdAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
72
|
+
tslib_1.__metadata("design:type", Date)
|
|
73
|
+
], KpiFormulaHistory.prototype, "updatedAt", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
+
tslib_1.__metadata("design:type", Date)
|
|
78
|
+
], KpiFormulaHistory.prototype, "deletedAt", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
82
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
83
|
+
], KpiFormulaHistory.prototype, "creator", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.creator),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], KpiFormulaHistory.prototype, "creatorId", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
90
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
91
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
92
|
+
], KpiFormulaHistory.prototype, "updater", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.RelationId)((kpiFormula) => kpiFormula.updater),
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
96
|
+
], KpiFormulaHistory.prototype, "updaterId", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], KpiFormulaHistory.prototype, "thumbnail", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_history_1.HistoryOriginalIdColumn)(),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], KpiFormulaHistory.prototype, "originalId", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_history_1.HistoryActionColumn)({
|
|
107
|
+
nullable: false,
|
|
108
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
109
|
+
? 'enum'
|
|
110
|
+
: DATABASE_TYPE == 'oracle'
|
|
111
|
+
? 'varchar2'
|
|
112
|
+
: DATABASE_TYPE == 'mssql'
|
|
113
|
+
? 'nvarchar'
|
|
114
|
+
: 'varchar',
|
|
115
|
+
enum: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
116
|
+
? typeorm_history_1.HistoryActionType
|
|
117
|
+
: undefined,
|
|
118
|
+
length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32
|
|
119
|
+
}),
|
|
120
|
+
tslib_1.__metadata("design:type", String)
|
|
121
|
+
], KpiFormulaHistory.prototype, "action", void 0);
|
|
122
|
+
exports.KpiFormulaHistory = KpiFormulaHistory = tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.Entity)(),
|
|
124
|
+
(0, typeorm_1.Index)('ix_kpi-formula_history_0', (kpiFormulaHistory) => [kpiFormulaHistory.originalId, kpiFormulaHistory.version], { unique: true }),
|
|
125
|
+
(0, typeorm_1.Index)('ix_kpi-formula_history_1', (kpiFormulaHistory) => [kpiFormulaHistory.domain, kpiFormulaHistory.originalId, kpiFormulaHistory.version], { unique: true }),
|
|
126
|
+
(0, type_graphql_1.ObjectType)({ description: 'History Entity of KpiFormula' })
|
|
127
|
+
], KpiFormulaHistory);
|
|
128
|
+
//# sourceMappingURL=kpi-formula-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-formula-history.js","sourceRoot":"","sources":["../../../server/service/kpi-formula/kpi-formula-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAA4D;AAE5D,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAc7B,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QAOL,YAAO,GAAY,CAAC,CAAA;IA8EtB,CAAC;CAAA,CAAA;AArFY,8CAAiB;AAGnB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;6CACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;iDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;;mDAC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EAAE;KAC9G,CAAC;;iDAC+B;4BApFtB,iBAAiB;IAZ7B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,iBAAoC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,EACnG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,iBAAoC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7H,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;GAC/C,iBAAiB,CAqF7B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { KpiFormula, KpiFormulaStatus } from './kpi-formula'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_kpi-formula_history_0',\n (kpiFormulaHistory: KpiFormulaHistory) => [kpiFormulaHistory.originalId, kpiFormulaHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_kpi-formula_history_1',\n (kpiFormulaHistory: KpiFormulaHistory) => [kpiFormulaHistory.domain, kpiFormulaHistory.originalId, kpiFormulaHistory.version],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of KpiFormula' })\nexport class KpiFormulaHistory implements HistoryEntityInterface<KpiFormula> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\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()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\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 @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\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 @Field(type => String, { nullable: true })\n thumbnail?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined: 32\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KpiFormula } from './kpi-formula';
|
|
2
|
+
import { NewKpiFormula, KpiFormulaPatch } from './kpi-formula-type';
|
|
3
|
+
export declare class KpiFormulaMutation {
|
|
4
|
+
createKpiFormula(kpiFormula: NewKpiFormula, context: ResolverContext): Promise<KpiFormula>;
|
|
5
|
+
updateKpiFormula(id: string, patch: KpiFormulaPatch, context: ResolverContext): Promise<KpiFormula>;
|
|
6
|
+
updateMultipleKpiFormula(patches: KpiFormulaPatch[], context: ResolverContext): Promise<KpiFormula[]>;
|
|
7
|
+
deleteKpiFormula(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteKpiFormulas(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importKpiFormulas(kpiFormulas: KpiFormulaPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,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BAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1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BAAA,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"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,E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'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"]}
|