efiber-prisma-schema 1.10.13 → 1.11.0

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.10.13",
3
+ "version": "1.11.0",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,16 @@
1
+ -- CreateTable
2
+ CREATE TABLE "_CamusatClientToUser" (
3
+ "A" TEXT NOT NULL,
4
+ "B" TEXT NOT NULL,
5
+
6
+ CONSTRAINT "_CamusatClientToUser_AB_pkey" PRIMARY KEY ("A","B")
7
+ );
8
+
9
+ -- CreateIndex
10
+ CREATE INDEX "_CamusatClientToUser_B_index" ON "_CamusatClientToUser"("B");
11
+
12
+ -- AddForeignKey
13
+ ALTER TABLE "_CamusatClientToUser" ADD CONSTRAINT "_CamusatClientToUser_A_fkey" FOREIGN KEY ("A") REFERENCES "CamusatClient"("id") ON DELETE CASCADE ON UPDATE CASCADE;
14
+
15
+ -- AddForeignKey
16
+ ALTER TABLE "_CamusatClientToUser" ADD CONSTRAINT "_CamusatClientToUser_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,3 +1,3 @@
1
1
  # Please do not edit this file manually
2
2
  # It should be added in your version-control system (e.g., Git)
3
- provider = "postgresql"
3
+ provider = "postgresql"
@@ -7,6 +7,15 @@ datasource db {
7
7
  url = env("DATABASE_URL")
8
8
  }
9
9
 
10
+ enum ProjectLevel {
11
+ Subsidiary
12
+ Client
13
+ MainProject
14
+ Project
15
+ CentralOffice
16
+ Cluster
17
+ }
18
+
10
19
  enum NetworkElementChildType {
11
20
  PboFat
12
21
  Cable
@@ -26,6 +35,19 @@ enum EquipmentType {
26
35
  FDTSRO
27
36
  }
28
37
 
38
+ enum FormulaOperation {
39
+ LIST
40
+ SUM
41
+ COUNT
42
+ AVERAGE
43
+ }
44
+
45
+ enum ChartType {
46
+ BAR
47
+ LINE
48
+ PIE
49
+ }
50
+
29
51
  model Country {
30
52
  id String @id @unique @default(uuid())
31
53
  no Int @default(autoincrement())
@@ -85,6 +107,7 @@ model CamusatClient {
85
107
 
86
108
  mainProject MainProject[]
87
109
  clientMaterial clientMaterial[]
110
+ users User[]
88
111
  }
89
112
 
90
113
  model Platform {
@@ -407,6 +430,8 @@ model User {
407
430
  BuildingTemplate BuildingTemplate[]
408
431
  integrationProjectUserStatus integrationProjectUserStatus[]
409
432
  integrationUserLocation integrationUserLocation[]
433
+ CamusatClient CamusatClient[]
434
+ IntegrationReportTemplate IntegrationReportTemplate[]
410
435
  }
411
436
 
412
437
  model MainProject {
@@ -1272,6 +1297,9 @@ model Cable {
1272
1297
  namePrefix String?
1273
1298
  templateIndex Int?
1274
1299
 
1300
+ // Reporting mirrors
1301
+ cableLength Float? //Length of the cable in meters
1302
+
1275
1303
  createdAt DateTime @default(now())
1276
1304
  updatedAt DateTime @updatedAt
1277
1305
  deletedAt DateTime?
@@ -1419,6 +1447,11 @@ model PboFat {
1419
1447
  namePrefix String?
1420
1448
  templateIndex Int?
1421
1449
 
1450
+ // Reporting mirrors
1451
+ fatMaxCapacity Int? //Maximum capacity of the PBO FAT
1452
+ fatExistingSubscribers Int? //Existing subscribers in the PBO FAT
1453
+ fatAvailableCapacity Int? //Available capacity in the PBO FAT
1454
+
1422
1455
  createdAt DateTime @default(now())
1423
1456
  updatedAt DateTime @updatedAt
1424
1457
  deletedAt DateTime?
@@ -1494,6 +1527,9 @@ model SpliceClosure {
1494
1527
  namePrefix String?
1495
1528
  templateIndex Int?
1496
1529
 
1530
+ // Reporting mirrors
1531
+ spliceClosureMaxCapacity Int? //Maximum capacity of the Splice Closure
1532
+
1497
1533
  createdAt DateTime @default(now())
1498
1534
  updatedAt DateTime @updatedAt
1499
1535
  updatedBy User? @relation(fields: [updatedById], references: [id])
@@ -1597,6 +1633,9 @@ model ZoneNro {
1597
1633
  namePrefix String?
1598
1634
  templateIndex Int?
1599
1635
 
1636
+ // Reporting mirrors
1637
+ zoneHouseCount Int? //Number of houses in the zone
1638
+
1600
1639
  createdAt DateTime @default(now())
1601
1640
  updatedAt DateTime @updatedAt
1602
1641
  deletedAt DateTime?
@@ -1890,6 +1929,9 @@ model FDTSRO {
1890
1929
  namePrefix String?
1891
1930
  templateIndex Int?
1892
1931
 
1932
+ // Reporting mirrors
1933
+ fdtsroMaxCapacity Int? //Maximum capacity of the FDTSRO
1934
+
1893
1935
  createdAt DateTime @default(now())
1894
1936
  updatedAt DateTime @updatedAt
1895
1937
  deletedAt DateTime?
@@ -2038,6 +2080,11 @@ model Building {
2038
2080
  namePrefix String?
2039
2081
  templateIndex Int?
2040
2082
 
2083
+ // Reporting mirrors
2084
+ totalFlats Int? //Total number of flats in the building
2085
+ floorCount Int? //Number of floors in the building
2086
+ flatsPerFloor Int? //Number of flats per floor
2087
+
2041
2088
  createdAt DateTime @default(now())
2042
2089
  updatedAt DateTime @updatedAt
2043
2090
  deletedAt DateTime?
@@ -2344,3 +2391,49 @@ model integrationUserLocation {
2344
2391
  updatedAt DateTime @updatedAt
2345
2392
  deletedAt DateTime?
2346
2393
  }
2394
+
2395
+ model IntegrationReportTemplate {
2396
+ id String @id @unique @default(uuid())
2397
+ no Int @default(autoincrement())
2398
+ name String
2399
+
2400
+ createdAt DateTime @default(now())
2401
+ updatedAt DateTime @updatedAt
2402
+ deletedAt DateTime?
2403
+
2404
+ createdBy User? @relation(fields: [createdById], references: [id])
2405
+ createdById String?
2406
+
2407
+ metrics ReportMetric[]
2408
+ visualizations ReportVisualization[]
2409
+ }
2410
+
2411
+ model ReportMetric {
2412
+ id String @id @unique @default(uuid())
2413
+
2414
+ reportTemplate IntegrationReportTemplate @relation(fields: [reportTemplateId], references: [id])
2415
+ reportTemplateId String
2416
+
2417
+ elementType NetworkElementChildType
2418
+ attributeName String //Name of the attribute to be reported
2419
+ formula FormulaOperation
2420
+ groupByLevel ProjectLevel
2421
+ visualizations ReportVisualization[]
2422
+ }
2423
+
2424
+ model ReportVisualization {
2425
+ id String @id @unique @default(uuid())
2426
+
2427
+ template IntegrationReportTemplate @relation(fields: [templateId], references: [id])
2428
+ templateId String
2429
+
2430
+ metric ReportMetric @relation(fields: [metricId], references: [id])
2431
+ metricId String
2432
+
2433
+ chartType ChartType
2434
+ xAxisField String? //e.g "Client Name"
2435
+ yAxisField String? //e.g "Fat Available Capacity"
2436
+
2437
+ useCustomColors Boolean @default(false)
2438
+ customColors Json? //e.g {"red": "#FF0000", "blue": "#0000FF"}
2439
+ }