efiber-prisma-schema 1.12.6 → 1.12.8

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.12.6",
3
+ "version": "1.12.8",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,44 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "CentralOfficeTeamPosition" AS ENUM ('Supervisor', 'Designer', 'Technician');
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "CentralOfficeTeam" (
6
+ "id" TEXT NOT NULL,
7
+ "no" SERIAL NOT NULL,
8
+ "name" TEXT NOT NULL,
9
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
10
+ "updatedAt" TIMESTAMP(3) NOT NULL,
11
+ "deletedAt" TIMESTAMP(3),
12
+ "centralOfficeId" TEXT,
13
+
14
+ CONSTRAINT "CentralOfficeTeam_pkey" PRIMARY KEY ("id")
15
+ );
16
+
17
+ -- CreateTable
18
+ CREATE TABLE "CentralOfficeUser" (
19
+ "id" TEXT NOT NULL,
20
+ "no" SERIAL NOT NULL,
21
+ "role" "CentralOfficeTeamPosition" NOT NULL DEFAULT 'Technician',
22
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
23
+ "updatedAt" TIMESTAMP(3) NOT NULL,
24
+ "deletedAt" TIMESTAMP(3),
25
+ "centralOfficeTeamId" TEXT,
26
+ "userId" TEXT NOT NULL,
27
+
28
+ CONSTRAINT "CentralOfficeUser_pkey" PRIMARY KEY ("id")
29
+ );
30
+
31
+ -- CreateIndex
32
+ CREATE UNIQUE INDEX "CentralOfficeTeam_id_key" ON "CentralOfficeTeam"("id");
33
+
34
+ -- CreateIndex
35
+ CREATE UNIQUE INDEX "CentralOfficeUser_id_key" ON "CentralOfficeUser"("id");
36
+
37
+ -- AddForeignKey
38
+ ALTER TABLE "CentralOfficeTeam" ADD CONSTRAINT "CentralOfficeTeam_centralOfficeId_fkey" FOREIGN KEY ("centralOfficeId") REFERENCES "CentralOffice"("id") ON DELETE SET NULL ON UPDATE CASCADE;
39
+
40
+ -- AddForeignKey
41
+ ALTER TABLE "CentralOfficeUser" ADD CONSTRAINT "CentralOfficeUser_centralOfficeTeamId_fkey" FOREIGN KEY ("centralOfficeTeamId") REFERENCES "CentralOfficeTeam"("id") ON DELETE SET NULL ON UPDATE CASCADE;
42
+
43
+ -- AddForeignKey
44
+ ALTER TABLE "CentralOfficeUser" ADD CONSTRAINT "CentralOfficeUser_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,37 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Building" ADD COLUMN "installationDate" TIMESTAMP(3),
3
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
4
+
5
+ -- AlterTable
6
+ ALTER TABLE "Cable" ADD COLUMN "actualCableLength" DOUBLE PRECISION,
7
+ ADD COLUMN "asBuiltCoordinates" JSONB,
8
+ ADD COLUMN "installationDate" TIMESTAMP(3),
9
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
10
+
11
+ -- AlterTable
12
+ ALTER TABLE "FDTSRO" ADD COLUMN "installationDate" TIMESTAMP(3),
13
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
14
+
15
+ -- AlterTable
16
+ ALTER TABLE "Loop" ADD COLUMN "installationDate" TIMESTAMP(3),
17
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
18
+
19
+ -- AlterTable
20
+ ALTER TABLE "Manhole" ADD COLUMN "installationDate" TIMESTAMP(3),
21
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
22
+
23
+ -- AlterTable
24
+ ALTER TABLE "PboFat" ADD COLUMN "installationDate" TIMESTAMP(3),
25
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
26
+
27
+ -- AlterTable
28
+ ALTER TABLE "Pole" ADD COLUMN "installationDate" TIMESTAMP(3),
29
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
30
+
31
+ -- AlterTable
32
+ ALTER TABLE "SFU" ADD COLUMN "installationDate" TIMESTAMP(3),
33
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
34
+
35
+ -- AlterTable
36
+ ALTER TABLE "SpliceClosure" ADD COLUMN "installationDate" TIMESTAMP(3),
37
+ ADD COLUMN "isInstalled" BOOLEAN NOT NULL DEFAULT false;
@@ -84,6 +84,12 @@ enum MapElementType {
84
84
  Polygon
85
85
  }
86
86
 
87
+ enum CentralOfficeTeamPosition {
88
+ Supervisor
89
+ Designer
90
+ Technician
91
+ }
92
+
87
93
  model Country {
88
94
  id String @id @unique @default(uuid())
89
95
  no Int @default(autoincrement())
@@ -470,6 +476,7 @@ model User {
470
476
  IntegrationReportTemplate IntegrationReportTemplate[]
471
477
  MapElementTemplate MapElementTemplate[]
472
478
  MapElement MapElement[]
479
+ CentralOfficeUser CentralOfficeUser[]
473
480
  }
474
481
 
475
482
  model MainProject {
@@ -1342,8 +1349,13 @@ model Cable {
1342
1349
  namePrefix String?
1343
1350
  templateIndex Int?
1344
1351
 
1352
+ asBuiltCoordinates Json? //As built coordinates
1353
+ isInstalled Boolean @default(false)
1354
+ installationDate DateTime?
1355
+
1345
1356
  // Reporting mirrors
1346
1357
  cableLength Float? //Length of the cable in meters
1358
+ actualCableLength Float? //Actual length of the cable in meters
1347
1359
 
1348
1360
  createdAt DateTime @default(now())
1349
1361
  updatedAt DateTime @updatedAt
@@ -1499,6 +1511,8 @@ model PboFat {
1499
1511
  templateIndex Int?
1500
1512
 
1501
1513
  asBuiltCoordinates Json? //Coordinates when installed
1514
+ isInstalled Boolean @default(false)
1515
+ installationDate DateTime?
1502
1516
 
1503
1517
  // Reporting mirrors
1504
1518
  fatMaxCapacity Int? //Maximum capacity of the PBO FAT
@@ -1583,6 +1597,8 @@ model SpliceClosure {
1583
1597
  templateIndex Int?
1584
1598
 
1585
1599
  asBuiltCoordinates Json? //Coordinates when installed
1600
+ isInstalled Boolean @default(false)
1601
+ installationDate DateTime?
1586
1602
 
1587
1603
  // Reporting mirrors
1588
1604
  spliceClosureMaxCapacity Int? //Maximum capacity of the Splice Closure
@@ -1776,6 +1792,8 @@ model Pole {
1776
1792
  templateIndex Int?
1777
1793
 
1778
1794
  asBuiltCoordinates Json? //Coordinates when installed
1795
+ isInstalled Boolean @default(false)
1796
+ installationDate DateTime?
1779
1797
 
1780
1798
  createdAt DateTime @default(now())
1781
1799
  updatedAt DateTime @updatedAt
@@ -1855,6 +1873,8 @@ model Manhole {
1855
1873
  templateIndex Int?
1856
1874
 
1857
1875
  asBuiltCoordinates Json? //Coordinates when installed
1876
+ isInstalled Boolean @default(false)
1877
+ installationDate DateTime?
1858
1878
 
1859
1879
  createdAt DateTime @default(now())
1860
1880
  updatedAt DateTime @updatedAt
@@ -1934,6 +1954,8 @@ model Loop {
1934
1954
  templateIndex Int?
1935
1955
 
1936
1956
  asBuiltCoordinates Json? //Coordinates when installed
1957
+ isInstalled Boolean @default(false)
1958
+ installationDate DateTime?
1937
1959
 
1938
1960
  createdAt DateTime @default(now())
1939
1961
  updatedAt DateTime @updatedAt
@@ -2013,6 +2035,8 @@ model FDTSRO {
2013
2035
  templateIndex Int?
2014
2036
 
2015
2037
  asBuiltCoordinates Json? //Coordinates when installed
2038
+ isInstalled Boolean @default(false)
2039
+ installationDate DateTime?
2016
2040
 
2017
2041
  // Reporting mirrors
2018
2042
  fdtsroMaxCapacity Int? //Maximum capacity of the FDTSRO
@@ -2096,6 +2120,8 @@ model SFU {
2096
2120
  templateIndex Int?
2097
2121
 
2098
2122
  asBuiltCoordinates Json? //Coordinates when installed
2123
+ isInstalled Boolean @default(false)
2124
+ installationDate DateTime?
2099
2125
 
2100
2126
  createdAt DateTime @default(now())
2101
2127
  updatedAt DateTime @updatedAt
@@ -2176,6 +2202,8 @@ model Building {
2176
2202
  templateIndex Int?
2177
2203
 
2178
2204
  asBuiltCoordinates Json? //Coordinates when installed
2205
+ isInstalled Boolean @default(false)
2206
+ installationDate DateTime?
2179
2207
 
2180
2208
  // Reporting mirrors
2181
2209
  totalFlats Int? //Total number of flats in the building
@@ -2265,7 +2293,6 @@ model MapElementTemplate {
2265
2293
 
2266
2294
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2267
2295
  networkElementId String
2268
-
2269
2296
 
2270
2297
  projects Project[]
2271
2298
 
@@ -2353,8 +2380,9 @@ model CentralOffice {
2353
2380
  project Project? @relation(fields: [projectId], references: [id])
2354
2381
  projectId String?
2355
2382
 
2356
- users User[]
2357
- Cluster Cluster[]
2383
+ users User[]
2384
+ Cluster Cluster[]
2385
+ CentralOfficeTeam CentralOfficeTeam[]
2358
2386
  }
2359
2387
 
2360
2388
  model Cluster {
@@ -2402,6 +2430,36 @@ model Cluster {
2402
2430
  MapElement MapElement[]
2403
2431
  }
2404
2432
 
2433
+ model CentralOfficeTeam {
2434
+ id String @id @unique @default(uuid())
2435
+ no Int @default(autoincrement())
2436
+ name String
2437
+
2438
+ createdAt DateTime @default(now())
2439
+ updatedAt DateTime @updatedAt
2440
+ deletedAt DateTime?
2441
+
2442
+ centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
2443
+ centralOfficeId String?
2444
+ users CentralOfficeUser[]
2445
+ }
2446
+
2447
+ model CentralOfficeUser {
2448
+ id String @id @unique @default(uuid())
2449
+ no Int @default(autoincrement())
2450
+ role CentralOfficeTeamPosition @default(Technician)
2451
+
2452
+ createdAt DateTime @default(now())
2453
+ updatedAt DateTime @updatedAt
2454
+ deletedAt DateTime?
2455
+
2456
+ centralOfficeTeam CentralOfficeTeam? @relation(fields: [centralOfficeTeamId], references: [id])
2457
+ centralOfficeTeamId String?
2458
+
2459
+ user User @relation(fields: [userId], references: [id])
2460
+ userId String
2461
+ }
2462
+
2405
2463
  model qrCodeTemplate {
2406
2464
  id String @id @unique @default(uuid())
2407
2465
  no Int @default(autoincrement())