efiber-prisma-schema 1.11.1 → 1.11.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efiber-prisma-schema",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,13 +35,30 @@ enum EquipmentType {
35
35
  FDTSRO
36
36
  }
37
37
 
38
- enum FormulaOperation {
38
+ enum AggregationOperation {
39
39
  LIST
40
40
  SUM
41
41
  COUNT
42
42
  AVERAGE
43
43
  }
44
44
 
45
+ enum ArithmeticOperation {
46
+ ADD
47
+ SUBTRACT
48
+ MULTIPLY
49
+ DIVIDE
50
+ }
51
+
52
+ enum ReportUsage {
53
+ TABLE
54
+ VISUALIZATION
55
+ }
56
+
57
+ enum ValueFormat {
58
+ PERCENTAGE
59
+ NUMBER
60
+ }
61
+
45
62
  enum ChartType {
46
63
  BAR
47
64
  LINE
@@ -2417,12 +2434,32 @@ model ReportMetric {
2417
2434
 
2418
2435
  elementType NetworkElementChildType
2419
2436
  attributeName String //Name of the attribute to be reported
2420
- formula FormulaOperation
2437
+
2438
+ // Aggregation across records
2439
+ formula AggregationOperation
2421
2440
  groupByLevel ProjectLevel
2441
+
2442
+ // Formula configuration
2443
+ formulaConfig ReportFormulaConfig?
2444
+
2445
+ // Usage Classification
2446
+ usage ReportUsage[] @default([TABLE])
2447
+
2422
2448
  visualizations ReportVisualization[]
2423
2449
  ReportTable ReportTable[]
2424
2450
  }
2425
2451
 
2452
+ model ReportFormulaConfig {
2453
+ metricId String @id
2454
+ metric ReportMetric @relation(fields: [metricId], references: [id])
2455
+
2456
+ resultName String //Name of the result to be reported
2457
+ numberOfVariables Int //Number of variables in the formula
2458
+ variableAttributes Json //e.g {"variable1": "Client Name", "variable2": "Fat Available Capacity"}
2459
+ operations ArithmeticOperation[] //e.g {"operation1": "sum", "operation2": "average"}
2460
+ resultFormat ValueFormat @default(NUMBER)
2461
+ }
2462
+
2426
2463
  model ReportVisualization {
2427
2464
  id String @id @unique @default(uuid())
2428
2465