efiber-prisma-schema 1.12.5 → 1.12.7

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.5",
3
+ "version": "1.12.7",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,23 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Building" ADD COLUMN "asBuiltCoordinates" JSONB;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "FDTSRO" ADD COLUMN "asBuiltCoordinates" JSONB;
6
+
7
+ -- AlterTable
8
+ ALTER TABLE "Loop" ADD COLUMN "asBuiltCoordinates" JSONB;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "Manhole" ADD COLUMN "asBuiltCoordinates" JSONB;
12
+
13
+ -- AlterTable
14
+ ALTER TABLE "PboFat" ADD COLUMN "asBuiltCoordinates" JSONB;
15
+
16
+ -- AlterTable
17
+ ALTER TABLE "Pole" ADD COLUMN "asBuiltCoordinates" JSONB;
18
+
19
+ -- AlterTable
20
+ ALTER TABLE "SFU" ADD COLUMN "asBuiltCoordinates" JSONB;
21
+
22
+ -- AlterTable
23
+ ALTER TABLE "SpliceClosure" ADD COLUMN "asBuiltCoordinates" JSONB;
@@ -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;
@@ -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 {
@@ -1498,6 +1505,8 @@ model PboFat {
1498
1505
  namePrefix String?
1499
1506
  templateIndex Int?
1500
1507
 
1508
+ asBuiltCoordinates Json? //Coordinates when installed
1509
+
1501
1510
  // Reporting mirrors
1502
1511
  fatMaxCapacity Int? //Maximum capacity of the PBO FAT
1503
1512
  fatExistingSubscribers Int? //Existing subscribers in the PBO FAT
@@ -1580,6 +1589,8 @@ model SpliceClosure {
1580
1589
  namePrefix String?
1581
1590
  templateIndex Int?
1582
1591
 
1592
+ asBuiltCoordinates Json? //Coordinates when installed
1593
+
1583
1594
  // Reporting mirrors
1584
1595
  spliceClosureMaxCapacity Int? //Maximum capacity of the Splice Closure
1585
1596
 
@@ -1771,6 +1782,8 @@ model Pole {
1771
1782
  namePrefix String?
1772
1783
  templateIndex Int?
1773
1784
 
1785
+ asBuiltCoordinates Json? //Coordinates when installed
1786
+
1774
1787
  createdAt DateTime @default(now())
1775
1788
  updatedAt DateTime @updatedAt
1776
1789
  deletedAt DateTime?
@@ -1848,6 +1861,8 @@ model Manhole {
1848
1861
  namePrefix String?
1849
1862
  templateIndex Int?
1850
1863
 
1864
+ asBuiltCoordinates Json? //Coordinates when installed
1865
+
1851
1866
  createdAt DateTime @default(now())
1852
1867
  updatedAt DateTime @updatedAt
1853
1868
  deletedAt DateTime?
@@ -1925,6 +1940,8 @@ model Loop {
1925
1940
  namePrefix String?
1926
1941
  templateIndex Int?
1927
1942
 
1943
+ asBuiltCoordinates Json? //Coordinates when installed
1944
+
1928
1945
  createdAt DateTime @default(now())
1929
1946
  updatedAt DateTime @updatedAt
1930
1947
  deletedAt DateTime?
@@ -2002,6 +2019,8 @@ model FDTSRO {
2002
2019
  namePrefix String?
2003
2020
  templateIndex Int?
2004
2021
 
2022
+ asBuiltCoordinates Json? //Coordinates when installed
2023
+
2005
2024
  // Reporting mirrors
2006
2025
  fdtsroMaxCapacity Int? //Maximum capacity of the FDTSRO
2007
2026
 
@@ -2083,6 +2102,8 @@ model SFU {
2083
2102
  namePrefix String?
2084
2103
  templateIndex Int?
2085
2104
 
2105
+ asBuiltCoordinates Json? //Coordinates when installed
2106
+
2086
2107
  createdAt DateTime @default(now())
2087
2108
  updatedAt DateTime @updatedAt
2088
2109
  deletedAt DateTime?
@@ -2161,6 +2182,8 @@ model Building {
2161
2182
  namePrefix String?
2162
2183
  templateIndex Int?
2163
2184
 
2185
+ asBuiltCoordinates Json? //Coordinates when installed
2186
+
2164
2187
  // Reporting mirrors
2165
2188
  totalFlats Int? //Total number of flats in the building
2166
2189
  floorCount Int? //Number of floors in the building
@@ -2249,7 +2272,6 @@ model MapElementTemplate {
2249
2272
 
2250
2273
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2251
2274
  networkElementId String
2252
-
2253
2275
 
2254
2276
  projects Project[]
2255
2277
 
@@ -2337,8 +2359,9 @@ model CentralOffice {
2337
2359
  project Project? @relation(fields: [projectId], references: [id])
2338
2360
  projectId String?
2339
2361
 
2340
- users User[]
2341
- Cluster Cluster[]
2362
+ users User[]
2363
+ Cluster Cluster[]
2364
+ CentralOfficeTeam CentralOfficeTeam[]
2342
2365
  }
2343
2366
 
2344
2367
  model Cluster {
@@ -2386,6 +2409,36 @@ model Cluster {
2386
2409
  MapElement MapElement[]
2387
2410
  }
2388
2411
 
2412
+ model CentralOfficeTeam {
2413
+ id String @id @unique @default(uuid())
2414
+ no Int @default(autoincrement())
2415
+ name String
2416
+
2417
+ createdAt DateTime @default(now())
2418
+ updatedAt DateTime @updatedAt
2419
+ deletedAt DateTime?
2420
+
2421
+ centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
2422
+ centralOfficeId String?
2423
+ users CentralOfficeUser[]
2424
+ }
2425
+
2426
+ model CentralOfficeUser {
2427
+ id String @id @unique @default(uuid())
2428
+ no Int @default(autoincrement())
2429
+ role CentralOfficeTeamPosition @default(Technician)
2430
+
2431
+ createdAt DateTime @default(now())
2432
+ updatedAt DateTime @updatedAt
2433
+ deletedAt DateTime?
2434
+
2435
+ centralOfficeTeam CentralOfficeTeam? @relation(fields: [centralOfficeTeamId], references: [id])
2436
+ centralOfficeTeamId String?
2437
+
2438
+ user User @relation(fields: [userId], references: [id])
2439
+ userId String
2440
+ }
2441
+
2389
2442
  model qrCodeTemplate {
2390
2443
  id String @id @unique @default(uuid())
2391
2444
  no Int @default(autoincrement())