efiber-prisma-schema 1.1.1 → 1.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/prisma/schema.prisma +110 -81
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efiber-prisma-schema",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -357,6 +357,7 @@ model User {
357
357
  workOrderEditLogs WorkOrderEditLog[]
358
358
  Notifications Notifications[]
359
359
 
360
+ pboFatTemplates PboFatTemplate[]
360
361
  pboFat PboFat[]
361
362
  cable Cable[]
362
363
  SpliceClosure SpliceClosure[]
@@ -407,9 +408,9 @@ model Project {
407
408
  ReportFormats ReportFormats[]
408
409
  platforms Platform[]
409
410
 
410
- PboFat PboFat[]
411
- cable Cable[]
412
- SpliceClosure SpliceClosure[]
411
+ pboFatAttributes PboFatAttributes[]
412
+ cableAttributes CableAtttributes[]
413
+ spliceClosureAttributes SpliceClosureAttributes[]
413
414
  }
414
415
 
415
416
  model Audit {
@@ -652,7 +653,7 @@ model WorkOrder {
652
653
  workOrderTasks WorkOrderTask[]
653
654
  workOrderActivityLogs WorkOrderActivityLog[]
654
655
  workOrderEditLogs WorkOrderEditLog[]
655
- PboFat PboFat[]
656
+ pboFatAttributes PboFatAttributes[]
656
657
  }
657
658
 
658
659
  model WorkOrderChannel {
@@ -788,9 +789,9 @@ model Material {
788
789
 
789
790
  billOfMaterial MaterialBillOfMaterial[]
790
791
 
791
- pboFat PboFat[]
792
- cable Cable[]
793
- SpliceClosure SpliceClosure[]
792
+ pboFatAttributes PboFatAttributes[]
793
+ cableAttributes CableAtttributes[]
794
+ spliceClosureAttributes SpliceClosureAttributes[]
794
795
  }
795
796
 
796
797
  model MaterialBillOfMaterial {
@@ -1098,12 +1099,13 @@ model NetworkElement {
1098
1099
  deletedAt DateTime?
1099
1100
 
1100
1101
  PboFat PboFat[]
1102
+ pboFatTemplate PboFatTemplate[]
1101
1103
  Cable Cable[]
1102
1104
  SpliceClosure SpliceClosure[]
1103
1105
  }
1104
1106
 
1105
1107
  model Cable {
1106
- id String @id @unique @default(uuid())
1108
+ id String @id @unique @default(uuid())
1107
1109
  no Int @default(autoincrement())
1108
1110
  name String
1109
1111
  type String //aerial/underground
@@ -1112,7 +1114,7 @@ model Cable {
1112
1114
  fibersReserved Int
1113
1115
  fibersDark Int
1114
1116
  fibersDedicated Int
1115
- length Int
1117
+ length Int?
1116
1118
  brand String?
1117
1119
  description String?
1118
1120
 
@@ -1125,26 +1127,32 @@ model Cable {
1125
1127
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1126
1128
  networkElementId String
1127
1129
 
1128
- material Material? @relation(fields: [materialId], references: [id])
1129
- materialId String?
1130
+ cableAttributes CableAtttributes[]
1130
1131
 
1131
- project Project @relation(fields: [projectId], references: [id])
1132
- projectId String
1132
+ pboFatAttributes PboFatAttributes[]
1133
+ spliceClosureAttributes SpliceClosureAttributes[]
1133
1134
 
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")
1135
+ }
1136
+
1137
+ model CableAtttributes {
1138
+ id String @id @unique @default(uuid())
1139
+ no Int @default(autoincrement())
1140
+ name String
1141
+ description String?
1142
+ value String?
1143
+
1144
+ createdAt DateTime @default(now())
1145
+ updatedAt DateTime @updatedAt
1146
+ deletedAt DateTime?
1147
+
1148
+ cable Cable @relation(fields: [cableId], references: [id])
1149
+ cableId String
1150
+
1151
+ project Project? @relation(fields: [projectId], references: [id])
1152
+ projectId String?
1153
+
1154
+ material Material? @relation(fields: [materialId], references: [id])
1155
+ materialId String?
1148
1156
  }
1149
1157
 
1150
1158
  model Splitter {
@@ -1156,23 +1164,17 @@ model Splitter {
1156
1164
  updatedAt DateTime @updatedAt
1157
1165
  deletedAt DateTime?
1158
1166
 
1159
- PboFat PboFat[]
1167
+ PboFatAttributes PboFatAttributes[]
1160
1168
  }
1161
1169
 
1162
- model PboFat {
1170
+ model PboFatTemplate {
1163
1171
  id String @id @unique @default(uuid())
1164
1172
  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
+
1173
1174
  status String @default("active")
1174
- brand String?
1175
- description String?
1175
+ terminalAccess Boolean @default(false)
1176
+ photos Json? //Upload files for photos
1177
+ zone String? //Color code for zone
1176
1178
 
1177
1179
  createdAt DateTime @default(now())
1178
1180
  updatedAt DateTime @updatedAt
@@ -1181,31 +1183,65 @@ model PboFat {
1181
1183
  updatedBy User? @relation(fields: [updatedById], references: [id])
1182
1184
  updatedById String?
1183
1185
 
1184
- inputCable Cable? @relation(name: "InputCable", fields: [inputCableId], references: [id])
1185
- inputCableId String?
1186
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1187
+ networkElementId String
1186
1188
 
1187
- outputCable1 Cable? @relation(name: "OutputCable1", fields: [outputCable1Id], references: [id])
1188
- outputCable1Id String?
1189
+ pboFatAttributes PboFatAttributes[]
1189
1190
 
1190
- outputCable2 Cable? @relation(name: "OutputCable2", fields: [outputCable2Id], references: [id])
1191
- outputCable2Id String?
1191
+ //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1192
+ }
1192
1193
 
1193
- outputCable3 Cable? @relation(name: "OutputCable3", fields: [outputCable3Id], references: [id])
1194
- outputCable3Id String?
1194
+ model PboFat {
1195
+ id String @id @unique @default(uuid())
1196
+ no Int @default(autoincrement())
1195
1197
 
1196
- networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1197
- networkElementId String
1198
+ status String @default("active")
1199
+ terminalAccess Boolean @default(false)
1200
+ photos Json? //Upload files for photos
1201
+ zone String? //Color code for zone
1198
1202
 
1199
- project Project @relation(fields: [projectId], references: [id])
1200
- projectId String
1203
+ createdAt DateTime @default(now())
1204
+ updatedAt DateTime @updatedAt
1205
+ deletedAt DateTime?
1206
+
1207
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1208
+ updatedById String?
1209
+
1210
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1211
+ networkElementId String
1212
+
1213
+ pboFatAttributes PboFatAttributes[]
1214
+ }
1215
+
1216
+ model PboFatAttributes {
1217
+ id String @id @unique @default(uuid())
1218
+ no Int @default(autoincrement())
1219
+ name String
1220
+ description String?
1221
+ value String?
1222
+
1223
+ createdAt DateTime @default(now())
1224
+ updatedAt DateTime @updatedAt
1225
+ deletedAt DateTime?
1226
+
1227
+ cable Cable? @relation(fields: [cableId], references: [id])
1228
+ cableId String?
1229
+
1230
+ project Project? @relation(fields: [projectId], references: [id])
1231
+ projectId String?
1201
1232
 
1202
1233
  material Material? @relation(fields: [materialId], references: [id])
1203
1234
  materialId String?
1204
1235
 
1205
- Splitter Splitter[]
1206
- subscribers WorkOrder[]
1236
+ pboFatTemplate PboFatTemplate @relation(fields: [pboFatTemplateId], references: [id])
1237
+ pboFatTemplateId String
1238
+
1239
+ pboFat PboFat @relation(fields: [pboFatId], references: [id])
1240
+ pboFatId String
1241
+
1242
+ splitter Splitter[]
1243
+ workOrder WorkOrder[]
1207
1244
 
1208
- //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1209
1245
  }
1210
1246
 
1211
1247
  model SpliceClosure {
@@ -1230,36 +1266,29 @@ model SpliceClosure {
1230
1266
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1231
1267
  networkElementId String
1232
1268
 
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?
1269
+ spliceClosureAttributes SpliceClosureAttributes[]
1270
+ }
1247
1271
 
1248
- outputCable3 Cable? @relation(name: "SpliceClosureOutputCable3", fields: [outputCable3Id], references: [id])
1249
- outputCable3Id String?
1272
+ model SpliceClosureAttributes {
1273
+ id String @id @unique @default(uuid())
1274
+ no Int @default(autoincrement())
1275
+ name String
1276
+ description String?
1277
+ value String?
1250
1278
 
1251
- outputCable4 Cable? @relation(name: "SpliceClosureOutputCable4", fields: [outputCable4Id], references: [id])
1252
- outputCable4Id String?
1279
+ createdAt DateTime @default(now())
1280
+ updatedAt DateTime @updatedAt
1281
+ deletedAt DateTime?
1253
1282
 
1254
- outputCable5 Cable? @relation(name: "SpliceClosureOutputCable5", fields: [outputCable5Id], references: [id])
1255
- outputCable5Id String?
1283
+ cable Cable? @relation(fields: [cableId], references: [id])
1284
+ cableId String?
1256
1285
 
1257
- outputCable6 Cable? @relation(name: "SpliceClosureOutputCable6", fields: [outputCable6Id], references: [id])
1258
- outputCable6Id String?
1286
+ project Project? @relation(fields: [projectId], references: [id])
1287
+ projectId String?
1259
1288
 
1260
- outputCable7 Cable? @relation(name: "SpliceClosureOutputCable7", fields: [outputCable7Id], references: [id])
1261
- outputCable7Id String?
1289
+ material Material? @relation(fields: [materialId], references: [id])
1290
+ materialId String?
1262
1291
 
1263
- outputCable8 Cable? @relation(name: "SpliceClosureOutputCable8", fields: [outputCable8Id], references: [id])
1264
- outputCable8Id String?
1265
- }
1292
+ spliceClosure SpliceClosure @relation(fields: [spliceClosureId], references: [id])
1293
+ spliceClosureId String
1294
+ }