efiber-prisma-schema 1.0.0 → 1.1.1

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.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -356,6 +356,10 @@ model User {
356
356
  workOrderActivityLogs WorkOrderActivityLog[]
357
357
  workOrderEditLogs WorkOrderEditLog[]
358
358
  Notifications Notifications[]
359
+
360
+ pboFat PboFat[]
361
+ cable Cable[]
362
+ SpliceClosure SpliceClosure[]
359
363
  }
360
364
 
361
365
  model MainProject {
@@ -402,6 +406,10 @@ model Project {
402
406
  EmailTemplates EmailTemplates[]
403
407
  ReportFormats ReportFormats[]
404
408
  platforms Platform[]
409
+
410
+ PboFat PboFat[]
411
+ cable Cable[]
412
+ SpliceClosure SpliceClosure[]
405
413
  }
406
414
 
407
415
  model Audit {
@@ -644,6 +652,7 @@ model WorkOrder {
644
652
  workOrderTasks WorkOrderTask[]
645
653
  workOrderActivityLogs WorkOrderActivityLog[]
646
654
  workOrderEditLogs WorkOrderEditLog[]
655
+ PboFat PboFat[]
647
656
  }
648
657
 
649
658
  model WorkOrderChannel {
@@ -778,6 +787,10 @@ model Material {
778
787
  deletedAt DateTime?
779
788
 
780
789
  billOfMaterial MaterialBillOfMaterial[]
790
+
791
+ pboFat PboFat[]
792
+ cable Cable[]
793
+ SpliceClosure SpliceClosure[]
781
794
  }
782
795
 
783
796
  model MaterialBillOfMaterial {
@@ -1075,3 +1088,178 @@ model ReportFormats {
1075
1088
  project Project @relation(fields: [projectId], references: [id])
1076
1089
  projectId String
1077
1090
  }
1091
+
1092
+ model NetworkElement {
1093
+ id String @id @unique @default(uuid())
1094
+ no Int @default(autoincrement())
1095
+ type String @unique
1096
+ createdAt DateTime @default(now())
1097
+ updatedAt DateTime @updatedAt
1098
+ deletedAt DateTime?
1099
+
1100
+ PboFat PboFat[]
1101
+ Cable Cable[]
1102
+ SpliceClosure SpliceClosure[]
1103
+ }
1104
+
1105
+ model Cable {
1106
+ id String @id @unique @default(uuid())
1107
+ no Int @default(autoincrement())
1108
+ name String
1109
+ type String //aerial/underground
1110
+ capacity Int
1111
+ fibersActive Int
1112
+ fibersReserved Int
1113
+ fibersDark Int
1114
+ fibersDedicated Int
1115
+ length Int
1116
+ brand String?
1117
+ description String?
1118
+
1119
+ createdAt DateTime @default(now())
1120
+ updatedAt DateTime @updatedAt
1121
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1122
+ updatedById String?
1123
+ deletedAt DateTime?
1124
+
1125
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1126
+ networkElementId String
1127
+
1128
+ material Material? @relation(fields: [materialId], references: [id])
1129
+ materialId String?
1130
+
1131
+ project Project @relation(fields: [projectId], references: [id])
1132
+ projectId String
1133
+
1134
+ inputCablePboFat PboFat[] @relation(name: "InputCable")
1135
+ outputCable1PboFat PboFat[] @relation(name: "OutputCable1")
1136
+ outputCable2PboFat PboFat[] @relation(name: "OutputCable2")
1137
+ outputCable3PboFat PboFat[] @relation(name: "OutputCable3")
1138
+
1139
+ inputCableSpliceClosure SpliceClosure[] @relation(name: "SpliceClosureInputCable")
1140
+ outputCable1SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable1")
1141
+ outputCable2SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable2")
1142
+ outputCable3SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable3")
1143
+ outputCable4SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable4")
1144
+ outputCable5SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable5")
1145
+ outputCable6SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable6")
1146
+ outputCable7SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable7")
1147
+ outputCable8SpliceClosure SpliceClosure[] @relation(name: "SpliceClosureOutputCable8")
1148
+ }
1149
+
1150
+ model Splitter {
1151
+ id String @id @unique @default(uuid())
1152
+ no Int @default(autoincrement())
1153
+ noOfPorts Int
1154
+
1155
+ createdAt DateTime @default(now())
1156
+ updatedAt DateTime @updatedAt
1157
+ deletedAt DateTime?
1158
+
1159
+ PboFat PboFat[]
1160
+ }
1161
+
1162
+ model PboFat {
1163
+ id String @id @unique @default(uuid())
1164
+ no Int @default(autoincrement())
1165
+ name String
1166
+ maxCapacity Int
1167
+ currentCapacity Int
1168
+ availableCapacity Int //MaxCapacity - CurrentCapacity
1169
+ address String?
1170
+ coordinates String?
1171
+ qrCode String?
1172
+ photo String?
1173
+ status String @default("active")
1174
+ brand String?
1175
+ description String?
1176
+
1177
+ createdAt DateTime @default(now())
1178
+ updatedAt DateTime @updatedAt
1179
+ deletedAt DateTime?
1180
+
1181
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1182
+ updatedById String?
1183
+
1184
+ inputCable Cable? @relation(name: "InputCable", fields: [inputCableId], references: [id])
1185
+ inputCableId String?
1186
+
1187
+ outputCable1 Cable? @relation(name: "OutputCable1", fields: [outputCable1Id], references: [id])
1188
+ outputCable1Id String?
1189
+
1190
+ outputCable2 Cable? @relation(name: "OutputCable2", fields: [outputCable2Id], references: [id])
1191
+ outputCable2Id String?
1192
+
1193
+ outputCable3 Cable? @relation(name: "OutputCable3", fields: [outputCable3Id], references: [id])
1194
+ outputCable3Id String?
1195
+
1196
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1197
+ networkElementId String
1198
+
1199
+ project Project @relation(fields: [projectId], references: [id])
1200
+ projectId String
1201
+
1202
+ material Material? @relation(fields: [materialId], references: [id])
1203
+ materialId String?
1204
+
1205
+ Splitter Splitter[]
1206
+ subscribers WorkOrder[]
1207
+
1208
+ //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1209
+ }
1210
+
1211
+ model SpliceClosure {
1212
+ // TODO: Add the fields for previous/next equipment, CO and project phase
1213
+ id String @id @unique @default(uuid())
1214
+ no Int @default(autoincrement())
1215
+ name String
1216
+ maxCapacity Int
1217
+ coordinates String?
1218
+ qrCode String?
1219
+ photo String?
1220
+ status String @default("active")
1221
+ brand String?
1222
+ description String?
1223
+
1224
+ createdAt DateTime @default(now())
1225
+ updatedAt DateTime @updatedAt
1226
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1227
+ updatedById String?
1228
+ deletedAt DateTime?
1229
+
1230
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1231
+ networkElementId String
1232
+
1233
+ material Material? @relation(fields: [materialId], references: [id])
1234
+ materialId String?
1235
+
1236
+ project Project @relation(fields: [projectId], references: [id])
1237
+ projectId String
1238
+
1239
+ inputCable Cable? @relation(name: "SpliceClosureInputCable", fields: [inputCableId], references: [id])
1240
+ inputCableId String?
1241
+
1242
+ outputCable1 Cable? @relation(name: "SpliceClosureOutputCable1", fields: [outputCable1Id], references: [id])
1243
+ outputCable1Id String?
1244
+
1245
+ outputCable2 Cable? @relation(name: "SpliceClosureOutputCable2", fields: [outputCable2Id], references: [id])
1246
+ outputCable2Id String?
1247
+
1248
+ outputCable3 Cable? @relation(name: "SpliceClosureOutputCable3", fields: [outputCable3Id], references: [id])
1249
+ outputCable3Id String?
1250
+
1251
+ outputCable4 Cable? @relation(name: "SpliceClosureOutputCable4", fields: [outputCable4Id], references: [id])
1252
+ outputCable4Id String?
1253
+
1254
+ outputCable5 Cable? @relation(name: "SpliceClosureOutputCable5", fields: [outputCable5Id], references: [id])
1255
+ outputCable5Id String?
1256
+
1257
+ outputCable6 Cable? @relation(name: "SpliceClosureOutputCable6", fields: [outputCable6Id], references: [id])
1258
+ outputCable6Id String?
1259
+
1260
+ outputCable7 Cable? @relation(name: "SpliceClosureOutputCable7", fields: [outputCable7Id], references: [id])
1261
+ outputCable7Id String?
1262
+
1263
+ outputCable8 Cable? @relation(name: "SpliceClosureOutputCable8", fields: [outputCable8Id], references: [id])
1264
+ outputCable8Id String?
1265
+ }