efiber-prisma-schema 1.1.0 → 1.2.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.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -407,9 +407,9 @@ model Project {
407
407
  ReportFormats ReportFormats[]
408
408
  platforms Platform[]
409
409
 
410
- PboFat PboFat[]
411
- cable Cable[]
412
- SpliceClosure SpliceClosure[]
410
+ pboFatAttributes PboFatAttributes[]
411
+ cableAttributes CableAtttributes[]
412
+ spliceClosureAttributes SpliceClosureAttributes[]
413
413
  }
414
414
 
415
415
  model Audit {
@@ -652,7 +652,7 @@ model WorkOrder {
652
652
  workOrderTasks WorkOrderTask[]
653
653
  workOrderActivityLogs WorkOrderActivityLog[]
654
654
  workOrderEditLogs WorkOrderEditLog[]
655
- PboFat PboFat[]
655
+ pboFatAttributes PboFatAttributes[]
656
656
  }
657
657
 
658
658
  model WorkOrderChannel {
@@ -788,9 +788,9 @@ model Material {
788
788
 
789
789
  billOfMaterial MaterialBillOfMaterial[]
790
790
 
791
- pboFat PboFat[]
792
- cable Cable[]
793
- SpliceClosure SpliceClosure[]
791
+ pboFatAttributes PboFatAttributes[]
792
+ cableAttributes CableAtttributes[]
793
+ spliceClosureAttributes SpliceClosureAttributes[]
794
794
  }
795
795
 
796
796
  model MaterialBillOfMaterial {
@@ -1092,7 +1092,7 @@ model ReportFormats {
1092
1092
  model NetworkElement {
1093
1093
  id String @id @unique @default(uuid())
1094
1094
  no Int @default(autoincrement())
1095
- type String
1095
+ type String @unique
1096
1096
  createdAt DateTime @default(now())
1097
1097
  updatedAt DateTime @updatedAt
1098
1098
  deletedAt DateTime?
@@ -1103,7 +1103,7 @@ model NetworkElement {
1103
1103
  }
1104
1104
 
1105
1105
  model Cable {
1106
- id String @id @unique @default(uuid())
1106
+ id String @id @unique @default(uuid())
1107
1107
  no Int @default(autoincrement())
1108
1108
  name String
1109
1109
  type String //aerial/underground
@@ -1125,26 +1125,32 @@ model Cable {
1125
1125
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1126
1126
  networkElementId String
1127
1127
 
1128
- material Material? @relation(fields: [materialId], references: [id])
1129
- materialId String?
1128
+ cableAttributes CableAtttributes[]
1130
1129
 
1131
- project Project @relation(fields: [projectId], references: [id])
1132
- projectId String
1130
+ pboFatAttributes PboFatAttributes[]
1131
+ spliceClosureAttributes SpliceClosureAttributes[]
1133
1132
 
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")
1133
+ }
1134
+
1135
+ model CableAtttributes {
1136
+ id String @id @unique @default(uuid())
1137
+ no Int @default(autoincrement())
1138
+ name String
1139
+ description String?
1140
+ value String?
1141
+
1142
+ createdAt DateTime @default(now())
1143
+ updatedAt DateTime @updatedAt
1144
+ deletedAt DateTime?
1145
+
1146
+ cable Cable @relation(fields: [cableId], references: [id])
1147
+ cableId String
1148
+
1149
+ project Project? @relation(fields: [projectId], references: [id])
1150
+ projectId String?
1151
+
1152
+ material Material? @relation(fields: [materialId], references: [id])
1153
+ materialId String?
1148
1154
  }
1149
1155
 
1150
1156
  model Splitter {
@@ -1156,23 +1162,14 @@ model Splitter {
1156
1162
  updatedAt DateTime @updatedAt
1157
1163
  deletedAt DateTime?
1158
1164
 
1159
- PboFat PboFat[]
1165
+ PboFatAttributes PboFatAttributes[]
1160
1166
  }
1161
1167
 
1162
1168
  model PboFat {
1163
1169
  id String @id @unique @default(uuid())
1164
1170
  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?
1171
+
1173
1172
  status String @default("active")
1174
- brand String?
1175
- description String?
1176
1173
 
1177
1174
  createdAt DateTime @default(now())
1178
1175
  updatedAt DateTime @updatedAt
@@ -1181,31 +1178,40 @@ model PboFat {
1181
1178
  updatedBy User? @relation(fields: [updatedById], references: [id])
1182
1179
  updatedById String?
1183
1180
 
1184
- inputCable Cable? @relation(name: "InputCable", fields: [inputCableId], references: [id])
1185
- inputCableId String?
1181
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1182
+ networkElementId String
1186
1183
 
1187
- outputCable1 Cable? @relation(name: "OutputCable1", fields: [outputCable1Id], references: [id])
1188
- outputCable1Id String?
1184
+ pboFatAttributes PboFatAttributes[]
1189
1185
 
1190
- outputCable2 Cable? @relation(name: "OutputCable2", fields: [outputCable2Id], references: [id])
1191
- outputCable2Id String?
1186
+ //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1187
+ }
1192
1188
 
1193
- outputCable3 Cable? @relation(name: "OutputCable3", fields: [outputCable3Id], references: [id])
1194
- outputCable3Id String?
1189
+ model PboFatAttributes {
1190
+ id String @id @unique @default(uuid())
1191
+ no Int @default(autoincrement())
1192
+ name String
1193
+ description String?
1194
+ value String?
1195
1195
 
1196
- networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1197
- networkElementId String
1196
+ createdAt DateTime @default(now())
1197
+ updatedAt DateTime @updatedAt
1198
+ deletedAt DateTime?
1198
1199
 
1199
- project Project @relation(fields: [projectId], references: [id])
1200
- projectId String
1200
+ cable Cable? @relation(fields: [cableId], references: [id])
1201
+ cableId String?
1202
+
1203
+ project Project? @relation(fields: [projectId], references: [id])
1204
+ projectId String?
1201
1205
 
1202
1206
  material Material? @relation(fields: [materialId], references: [id])
1203
1207
  materialId String?
1204
1208
 
1205
- Splitter Splitter[]
1206
- subscribers WorkOrder[]
1209
+ pboFat PboFat @relation(fields: [pboFatId], references: [id])
1210
+ pboFatId String
1211
+
1212
+ splitter Splitter[]
1213
+ workOrder WorkOrder[]
1207
1214
 
1208
- //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1209
1215
  }
1210
1216
 
1211
1217
  model SpliceClosure {
@@ -1230,36 +1236,29 @@ model SpliceClosure {
1230
1236
  networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1231
1237
  networkElementId String
1232
1238
 
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?
1239
+ spliceClosureAttributes SpliceClosureAttributes[]
1240
+ }
1247
1241
 
1248
- outputCable3 Cable? @relation(name: "SpliceClosureOutputCable3", fields: [outputCable3Id], references: [id])
1249
- outputCable3Id String?
1242
+ model SpliceClosureAttributes {
1243
+ id String @id @unique @default(uuid())
1244
+ no Int @default(autoincrement())
1245
+ name String
1246
+ description String?
1247
+ value String?
1250
1248
 
1251
- outputCable4 Cable? @relation(name: "SpliceClosureOutputCable4", fields: [outputCable4Id], references: [id])
1252
- outputCable4Id String?
1249
+ createdAt DateTime @default(now())
1250
+ updatedAt DateTime @updatedAt
1251
+ deletedAt DateTime?
1253
1252
 
1254
- outputCable5 Cable? @relation(name: "SpliceClosureOutputCable5", fields: [outputCable5Id], references: [id])
1255
- outputCable5Id String?
1253
+ cable Cable? @relation(fields: [cableId], references: [id])
1254
+ cableId String?
1256
1255
 
1257
- outputCable6 Cable? @relation(name: "SpliceClosureOutputCable6", fields: [outputCable6Id], references: [id])
1258
- outputCable6Id String?
1256
+ project Project? @relation(fields: [projectId], references: [id])
1257
+ projectId String?
1259
1258
 
1260
- outputCable7 Cable? @relation(name: "SpliceClosureOutputCable7", fields: [outputCable7Id], references: [id])
1261
- outputCable7Id String?
1259
+ material Material? @relation(fields: [materialId], references: [id])
1260
+ materialId String?
1262
1261
 
1263
- outputCable8 Cable? @relation(name: "SpliceClosureOutputCable8", fields: [outputCable8Id], references: [id])
1264
- outputCable8Id String?
1265
- }
1262
+ spliceClosure SpliceClosure @relation(fields: [spliceClosureId], references: [id])
1263
+ spliceClosureId String
1264
+ }