@things-factory/kpi 9.0.38 → 9.0.40

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.
@@ -8,6 +8,7 @@ export declare class NewKpiValue {
8
8
  meta?: any;
9
9
  kpiOrgScopeId?: string;
10
10
  org?: string;
11
+ group?: string;
11
12
  inputType?: KpiValueInputType;
12
13
  source?: string;
13
14
  }
@@ -21,6 +22,7 @@ export declare class KpiValuePatch {
21
22
  meta?: any;
22
23
  kpiOrgScopeId?: string;
23
24
  org?: string;
25
+ group?: string;
24
26
  inputType?: KpiValueInputType;
25
27
  source?: string;
26
28
  cuFlag?: string;
@@ -46,6 +46,10 @@ tslib_1.__decorate([
46
46
  (0, type_graphql_1.Field)({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' }),
47
47
  tslib_1.__metadata("design:type", String)
48
48
  ], NewKpiValue.prototype, "org", void 0);
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Group key for this value (organization, line, user, project, etc.)' }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], NewKpiValue.prototype, "group", void 0);
49
53
  tslib_1.__decorate([
50
54
  (0, type_graphql_1.Field)(type => kpi_value_1.KpiValueInputType, {
51
55
  nullable: true,
@@ -111,6 +115,10 @@ tslib_1.__decorate([
111
115
  (0, type_graphql_1.Field)({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' }),
112
116
  tslib_1.__metadata("design:type", String)
113
117
  ], KpiValuePatch.prototype, "org", void 0);
118
+ tslib_1.__decorate([
119
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Group key for this value (organization, line, user, project, etc.)' }),
120
+ tslib_1.__metadata("design:type", String)
121
+ ], KpiValuePatch.prototype, "group", void 0);
114
122
  tslib_1.__decorate([
115
123
  (0, type_graphql_1.Field)(type => kpi_value_1.KpiValueInputType, {
116
124
  nullable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"kpi-value-type.js","s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C;;2CACQ;AAGV;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;oDACjF;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oEAAoE,EAAE,CAAC;;0CACjG;AAMZ;IAJC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,6BAAiB,EAAE;QAChC,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,+EAA+E;KAC7F,CAAC;;gDAC2B;AAG7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;;6CAC3F;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;;6CAC7E;wBAnDJ,aAAa;IAHzB,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,8FAA8F;KAC5G,CAAC;GACW,aAAa,CAoDzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { KpiValue, KpiValueInputType } from './kpi-value'\n\n@InputType({ description: 'Input type for creating a new KPI value. Used in mutations to provide KPI value details.' })\nexport class NewKpiValue {\n @Field(type => ID, { description: 'ID of the KPI to which this value belongs.' })\n kpiId: string\n\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value is calculated.' })\n version: number\n\n @Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })\n valueDate: string\n\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI organization scope for this value.' })\n kpiOrgScopeId?: string\n\n @Field({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' })\n org?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n}\n\n@InputType({\n description: 'Input type for updating an existing KPI value. Used in mutations to patch KPI value details.'\n})\nexport class KpiValuePatch {\n @Field(type => ID, { nullable: true, description: 'ID of the KPI value to update.' })\n id?: string\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI to which this value belongs.' })\n kpiId?: string\n\n @Field(type => Int, {\n nullable: true,\n description: 'Version of the KPI definition at the time this value is calculated.'\n })\n version?: number\n\n @Field({\n nullable: true,\n description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).'\n })\n valueDate?: string\n\n @Field(type => Float, { nullable: true, description: 'The calculated numeric value for this KPI and period.' })\n value?: number\n\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI organization scope for this value.' })\n kpiOrgScopeId?: string\n\n @Field({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' })\n org?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiValueList {\n @Field(type => [KpiValue])\n items: KpiValue[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"kpi-value-type.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value-type.ts"],"names":[],"mappings":";;;;AAEA,+CAA6F;AAE7F,iDAA+D;AAE/D,2CAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CA2CvB,CAAA;AA3CY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;0CACpE;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,qEAAqE,EAAE,CAAC;;4CAC5F;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,kFAAkF,EAAE,CAAC;;8CAC1F;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;;0CAClF;AAMb;IAJC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE;QACpB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,oGAAoG;KAClH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AAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;;6CAC7E;wBAtDJ,aAAa;IAHzB,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,8FAA8F;KAC5G,CAAC;GACW,aAAa,CAuDzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { KpiValue, KpiValueInputType } from './kpi-value'\n\n@InputType({ description: 'Input type for creating a new KPI value. Used in mutations to provide KPI value details.' })\nexport class NewKpiValue {\n @Field(type => ID, { description: 'ID of the KPI to which this value belongs.' })\n kpiId: string\n\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value is calculated.' })\n version: number\n\n @Field({ description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).' })\n valueDate: string\n\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI organization scope for this value.' })\n kpiOrgScopeId?: string\n\n @Field({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' })\n org?: string\n\n @Field({ nullable: true, description: 'Group key for this value (organization, line, user, project, etc.)' })\n group?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n}\n\n@InputType({\n description: 'Input type for updating an existing KPI value. Used in mutations to patch KPI value details.'\n})\nexport class KpiValuePatch {\n @Field(type => ID, { nullable: true, description: 'ID of the KPI value to update.' })\n id?: string\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI to which this value belongs.' })\n kpiId?: string\n\n @Field(type => Int, {\n nullable: true,\n description: 'Version of the KPI definition at the time this value is calculated.'\n })\n version?: number\n\n @Field({\n nullable: true,\n description: 'Date or period for which this KPI value is recorded (e.g., day, month, quarter).'\n })\n valueDate?: string\n\n @Field(type => Float, { nullable: true, description: 'The calculated numeric value for this KPI and period.' })\n value?: number\n\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Field(type => ID, { nullable: true, description: 'ID of the KPI organization scope for this value.' })\n kpiOrgScopeId?: string\n\n @Field({ nullable: true, description: 'Legacy organizational unit identifier (for backward compatibility)' })\n org?: string\n\n @Field({ nullable: true, description: 'Group key for this value (organization, line, user, project, etc.)' })\n group?: string\n\n @Field(type => KpiValueInputType, {\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Field({ nullable: true, description: 'Custom flag for update operations (internal use).' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class KpiValueList {\n @Field(type => [KpiValue])\n items: KpiValue[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -16,6 +16,7 @@ export declare class KpiValue {
16
16
  valueDate: string;
17
17
  value: number;
18
18
  score?: number;
19
+ group?: string;
19
20
  kpiOrgScope?: KpiOrgScope;
20
21
  kpiOrgScopeId?: string;
21
22
  inputType?: KpiValueInputType;
@@ -76,9 +76,20 @@ tslib_1.__decorate([
76
76
  }),
77
77
  tslib_1.__metadata("design:type", Number)
78
78
  ], KpiValue.prototype, "score", void 0);
79
+ tslib_1.__decorate([
80
+ (0, typeorm_1.Column)({ nullable: true }),
81
+ (0, type_graphql_1.Field)(type => String, {
82
+ nullable: true,
83
+ description: 'Group key for this value (organization, line, user, project, etc.)'
84
+ }),
85
+ tslib_1.__metadata("design:type", String)
86
+ ], KpiValue.prototype, "group", void 0);
79
87
  tslib_1.__decorate([
80
88
  (0, typeorm_1.ManyToOne)(() => kpi_org_scope_1.KpiOrgScope, { nullable: true }),
81
- (0, type_graphql_1.Field)(type => kpi_org_scope_1.KpiOrgScope, { nullable: true, description: 'Reference to the organization scope mapping for this KPI value.' }),
89
+ (0, type_graphql_1.Field)(type => kpi_org_scope_1.KpiOrgScope, {
90
+ nullable: true,
91
+ description: 'Reference to the organization scope mapping for this KPI value.'
92
+ }),
82
93
  tslib_1.__metadata("design:type", kpi_org_scope_1.KpiOrgScope)
83
94
  ], KpiValue.prototype, "kpiOrgScope", void 0);
84
95
  tslib_1.__decorate([
@@ -157,6 +168,8 @@ exports.KpiValue = KpiValue = tslib_1.__decorate([
157
168
  (0, typeorm_1.Entity)(),
158
169
  (0, typeorm_1.Index)('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'kpiOrgScope', 'version'], { unique: true }),
159
170
  (0, typeorm_1.Index)('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'kpiOrgScope'], { unique: false }),
171
+ (0, typeorm_1.Index)('ix_kpi_value_group_kpi', ['domain', 'group', 'kpi', 'valueDate'], { unique: false }),
172
+ (0, typeorm_1.Index)('ix_kpi_value_kpi_group', ['domain', 'kpi', 'group', 'valueDate'], { unique: false }),
160
173
  (0, type_graphql_1.ObjectType)({ description: 'Entity for KpiValue' })
161
174
  ], KpiValue);
162
175
  //# sourceMappingURL=kpi-value.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kpi-value.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAkF;AAElF,yDAAgD;AAChD,iDAA8E;AAC9E,6CAA4C;AAC5C,oCAA+C;AAC/C,kEAA4D;AAE5D,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oCAAoC;CAClD,CAAC,CAAA;AAMK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAgHpB,CAAA;AAhHY,4BAAQ;AAGV;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;;oCAChE;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;sCAClF,cAAM;wCAAA;AAIf;IAFC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,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AAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;;2CAC/E;mBA/GP,QAAQ;IAJpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxG,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACxG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAgHpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, ScalarObject, json5Transformer } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\nimport { Kpi, KpiPeriodType } from '../kpi/kpi'\nimport { KpiOrgScope } from '../kpi-org-scope/kpi-org-scope'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum KpiValueInputType {\n MANUAL = 'MANUAL',\n AUTO = 'AUTO'\n}\n\nregisterEnumType(KpiValueInputType, {\n name: 'KpiValueInputType',\n description: 'Type of the input (Manual or Auto)'\n})\n\n@Entity()\n@Index('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'kpiOrgScope', 'version'], { unique: true })\n@Index('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'kpiOrgScope'], { unique: false })\n@ObjectType({ description: 'Entity for KpiValue' })\nexport class KpiValue {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this KPI value record.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this KPI value belongs.' })\n domain?: Domain\n\n @RelationId((kpiValue: KpiValue) => kpiValue.domain)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI value.' })\n domainId?: string\n\n @ManyToOne(() => Kpi)\n @Field(type => Kpi, {\n nullable: true,\n description: 'Reference to the KPI definition for which this value is calculated.'\n })\n kpi: Kpi\n\n @RelationId((kpiValue: KpiValue) => kpiValue.kpi)\n @Field({ description: 'ID of the referenced KPI.' })\n kpiId: string\n\n @Column('int')\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value was calculated.' })\n version: number\n\n @Column()\n @Field({\n description:\n 'Date or period for which this KPI value is recorded (e.g., day: YYYY-MM-DD, month: YYYY-MM, quarter: YYYY-Qn, range: YYYY-MM-DD~YYYY-MM-DD).'\n })\n valueDate: string\n\n @Column('float')\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Column('float', { nullable: true })\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @ManyToOne(() => KpiOrgScope, { nullable: true })\n @Field(type => KpiOrgScope, { nullable: true, description: 'Reference to the organization scope mapping for this KPI value.' })\n kpiOrgScope?: KpiOrgScope\n\n @RelationId((kpiValue: KpiValue) => kpiValue.kpiOrgScope)\n @Field({ nullable: true, description: 'ID of the referenced KPI organization scope.' })\n kpiOrgScopeId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined,\n transformer: json5Transformer\n })\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Column({ default: 'DAY' })\n @Field(type => KpiPeriodType, { description: 'Aggregation period type for this KPI value.' })\n periodType: KpiPeriodType\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was last updated.' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created this KPI value record.' })\n creator?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.creator)\n @Field({ nullable: true, description: 'ID of the user who created this KPI value record.' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated this KPI value record.' })\n updater?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this KPI value record.' })\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"kpi-value.js","sourceRoot":"","sources":["../../../server/service/kpi-value/kpi-value.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAkF;AAElF,yDAAgD;AAChD,iDAA8E;AAC9E,6CAA4C;AAC5C,oCAA+C;AAC/C,kEAA4D;AAE5D,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,i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AAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3F,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CA0HpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType, Float } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, ScalarObject, json5Transformer } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\nimport { Kpi, KpiPeriodType } from '../kpi/kpi'\nimport { KpiOrgScope } from '../kpi-org-scope/kpi-org-scope'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum KpiValueInputType {\n MANUAL = 'MANUAL',\n AUTO = 'AUTO'\n}\n\nregisterEnumType(KpiValueInputType, {\n name: 'KpiValueInputType',\n description: 'Type of the input (Manual or Auto)'\n})\n\n@Entity()\n@Index('ix_kpi_value_latest', ['domain', 'kpi', 'valueDate', 'kpiOrgScope', 'version'], { unique: true })\n@Index('ix_kpi_value_latest_for_query', ['domain', 'kpi', 'valueDate', 'kpiOrgScope'], { unique: false })\n@Index('ix_kpi_value_group_kpi', ['domain', 'group', 'kpi', 'valueDate'], { unique: false })\n@Index('ix_kpi_value_kpi_group', ['domain', 'kpi', 'group', 'valueDate'], { unique: false })\n@ObjectType({ description: 'Entity for KpiValue' })\nexport class KpiValue {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this KPI value record.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this KPI value belongs.' })\n domain?: Domain\n\n @RelationId((kpiValue: KpiValue) => kpiValue.domain)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this KPI value.' })\n domainId?: string\n\n @ManyToOne(() => Kpi)\n @Field(type => Kpi, {\n nullable: true,\n description: 'Reference to the KPI definition for which this value is calculated.'\n })\n kpi: Kpi\n\n @RelationId((kpiValue: KpiValue) => kpiValue.kpi)\n @Field({ description: 'ID of the referenced KPI.' })\n kpiId: string\n\n @Column('int')\n @Field(type => Int, { description: 'Version of the KPI definition at the time this value was calculated.' })\n version: number\n\n @Column()\n @Field({\n description:\n 'Date or period for which this KPI value is recorded (e.g., day: YYYY-MM-DD, month: YYYY-MM, quarter: YYYY-Qn, range: YYYY-MM-DD~YYYY-MM-DD).'\n })\n valueDate: string\n\n @Column('float')\n @Field(type => Float, { description: 'The calculated numeric value for this KPI and period.' })\n value: number\n\n @Column('float', { nullable: true })\n @Field(type => Float, {\n nullable: true,\n description: 'Performance score calculated from KPI value using scoreFormula or grades lookup table. Range: 0-1.'\n })\n score?: number\n\n @Column({ nullable: true })\n @Field(type => String, {\n nullable: true,\n description: 'Group key for this value (organization, line, user, project, etc.)'\n })\n group?: string\n\n @ManyToOne(() => KpiOrgScope, { nullable: true })\n @Field(type => KpiOrgScope, {\n nullable: true,\n description: 'Reference to the organization scope mapping for this KPI value.'\n })\n kpiOrgScope?: KpiOrgScope\n\n @RelationId((kpiValue: KpiValue) => kpiValue.kpiOrgScope)\n @Field({ nullable: true, description: 'ID of the referenced KPI organization scope.' })\n kpiOrgScopeId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'Indicates whether this value was entered manually or generated automatically.'\n })\n inputType?: KpiValueInputType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Source of the value (e.g., system, user, external integration).' })\n source?: string\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined,\n transformer: json5Transformer\n })\n @Field(type => ScalarObject, {\n nullable: true,\n description:\n 'Extended or non-numeric information related to this KPI value, stored as JSON5. Can include grade, status, comments, or other metadata.'\n })\n meta?: any\n\n @Column({ default: 'DAY' })\n @Field(type => KpiPeriodType, { description: 'Aggregation period type for this KPI value.' })\n periodType: KpiPeriodType\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this KPI value record was last updated.' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created this KPI value record.' })\n creator?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.creator)\n @Field({ nullable: true, description: 'ID of the user who created this KPI value record.' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated this KPI value record.' })\n updater?: User\n\n @RelationId((kpiValue: KpiValue) => kpiValue.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this KPI value record.' })\n updaterId?: string\n}\n"]}