efiber-prisma-schema 2.0.4 → 2.0.6

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.
@@ -0,0 +1,3345 @@
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ output = "./generated"
4
+ }
5
+
6
+ datasource db {
7
+ provider = "postgresql"
8
+ }
9
+
10
+ enum NetworkElementClassification {
11
+ NetworkElement
12
+ InfrastructureElement
13
+ MapElement
14
+ }
15
+
16
+ enum ProjectLevel {
17
+ Subsidiary
18
+ Client
19
+ MainProject
20
+ Project
21
+ CentralOffice
22
+ Cluster
23
+ }
24
+
25
+ enum NetworkElementChildType {
26
+ PboFat
27
+ Cable
28
+ SpliceClosure
29
+ Zone
30
+ SFU
31
+ Loop
32
+ FDTSRO
33
+ Manhole
34
+ Building
35
+ Pole
36
+ }
37
+
38
+ enum EquipmentType {
39
+ PboFat
40
+ SpliceClosure
41
+ FDTSRO
42
+ }
43
+
44
+ enum AggregationOperation {
45
+ LIST
46
+ SUM
47
+ COUNT
48
+ AVERAGE
49
+ }
50
+
51
+ enum ArithmeticOperation {
52
+ ADD
53
+ SUBTRACT
54
+ MULTIPLY
55
+ DIVIDE
56
+ }
57
+
58
+ enum ReportUsage {
59
+ TABLE
60
+ VISUALIZATION
61
+ }
62
+
63
+ enum ValueFormat {
64
+ PERCENTAGE
65
+ NUMBER
66
+ }
67
+
68
+ enum ChartType {
69
+ BAR
70
+ LINE
71
+ PIE
72
+ }
73
+
74
+ enum MetricType {
75
+ ProjectInfo
76
+ NetworkElement
77
+ NetworkElementAttributes
78
+ FormulaResult
79
+ }
80
+
81
+ enum MapElementType {
82
+ Marker
83
+ Polyline
84
+ Polygon
85
+ }
86
+
87
+ enum CentralOfficeTeamPosition {
88
+ Supervisor
89
+ Designer
90
+ Technician
91
+ }
92
+
93
+ enum NotificationPlatform {
94
+ Web
95
+ Mobile
96
+ }
97
+
98
+ enum ClusterProjectPhase {
99
+ Survey
100
+ Design
101
+ Construction
102
+ GIS
103
+ Dispatch
104
+ }
105
+
106
+ enum RevisionStatus {
107
+ IN_PROGRESS
108
+ SUBMITTED
109
+ APPROVED
110
+ REJECTED
111
+ }
112
+
113
+ enum RelationType {
114
+ INSTALLED_ON
115
+ CONNECTED_TO
116
+ ENCLOSURE_ORIGIN
117
+ ENCLOSURE_DESTINATION
118
+ }
119
+
120
+ enum AttributeType {
121
+ TEXT
122
+ NUMBER
123
+ BOOLEAN
124
+ DROPDOWN
125
+ OPTIONS
126
+ DATE
127
+ JSON
128
+ }
129
+
130
+ enum CableAttachmentRole {
131
+ DESTINATION
132
+ ORIGIN
133
+ }
134
+
135
+ model Country {
136
+ id String @id @unique @default(uuid())
137
+ no Int @default(autoincrement())
138
+ name String
139
+ official_name String
140
+ code String
141
+ capital String
142
+ region String
143
+ subregion String
144
+ population String
145
+ timezones String
146
+ flag String?
147
+
148
+ createdAt DateTime @default(now())
149
+ updatedAt DateTime @updatedAt
150
+ CamusatCountry CamusatCountry[]
151
+ User User[]
152
+ }
153
+
154
+ model CamusatCountry {
155
+ id String @id @unique @default(uuid())
156
+ no Int @default(autoincrement())
157
+ name String @unique
158
+ original String?
159
+ description String?
160
+ status String @default("active")
161
+ type String @default("subsidiary")
162
+
163
+ createdAt DateTime @default(now())
164
+ updatedAt DateTime @updatedAt
165
+ deletedAt DateTime?
166
+ CamusatClient CamusatClient[]
167
+ mainProjects MainProject[]
168
+
169
+ Country Country @relation(fields: [countryId], references: [id])
170
+ countryId String
171
+
172
+ user User[]
173
+
174
+ dispatchProject DispatchProject[]
175
+ SubsidiaryMaterial SubsidiaryMaterial[]
176
+ }
177
+
178
+ model CamusatClient {
179
+ id String @id @unique @default(uuid())
180
+ no Int @default(autoincrement())
181
+ name String
182
+ logo String? @db.Text //Upload file for logo
183
+ type String @default("client")
184
+
185
+ createdAt DateTime @default(now())
186
+ updatedAt DateTime @updatedAt
187
+ deletedAt DateTime?
188
+
189
+ Country CamusatCountry @relation(fields: [countryId], references: [id])
190
+ countryId String
191
+
192
+ mainProject MainProject[]
193
+ clientMaterial clientMaterial[]
194
+ users User[]
195
+ }
196
+
197
+ model Platform {
198
+ id String @id @unique @default(uuid())
199
+ no Int @default(autoincrement())
200
+ name String
201
+ url String?
202
+ directory String?
203
+ status String @default("active")
204
+ countries Json?
205
+ createdAt DateTime @default(now())
206
+ updatedAt DateTime @updatedAt
207
+ deletedAt DateTime?
208
+
209
+ User User[]
210
+ Project Project[]
211
+ }
212
+
213
+ model Position {
214
+ id String @id @unique @default(uuid())
215
+ no Int @default(autoincrement())
216
+ name String
217
+ description String?
218
+ status String @default("active")
219
+ countries Json?
220
+
221
+ createdAt DateTime @default(now())
222
+ updatedAt DateTime @updatedAt
223
+ deletedAt DateTime?
224
+ User User[]
225
+ }
226
+
227
+ model Role {
228
+ id String @id @unique @default(uuid())
229
+ no Int @default(autoincrement())
230
+ name String
231
+ description String?
232
+ status String @default("active")
233
+ countries Json?
234
+ platforms Json?
235
+ login Boolean @default(false)
236
+ access_web Boolean @default(false)
237
+ access_mobile Boolean @default(false)
238
+ add_users Boolean @default(false)
239
+ view_users Boolean @default(false)
240
+ delete_users Boolean @default(false)
241
+ view_requests Boolean @default(false)
242
+ manage_requests Boolean @default(false) //Either approve or rejects
243
+ add_main_projects Boolean @default(false)
244
+ view_main_projects Boolean @default(false)
245
+ edit_main_projects Boolean @default(false)
246
+ delete_main_projects Boolean @default(false)
247
+ view_settings Boolean @default(false)
248
+ view_audit Boolean @default(false)
249
+ full_projects Boolean @default(false)
250
+ add_projects Boolean @default(false)
251
+ edit_projects Boolean @default(false)
252
+ view_projects Boolean @default(false)
253
+ delete_projects Boolean @default(false)
254
+ add_sub_projects Boolean @default(false)
255
+ manage_work_orders Boolean @default(false)
256
+ full_teams Boolean @default(false)
257
+ add_team Boolean @default(false)
258
+ view_team Boolean @default(false)
259
+ quality Boolean @default(false)
260
+ dispatch_web_access Boolean @default(false)
261
+ dispatch_mobile Boolean @default(false)
262
+ dispatch_add_workorders Boolean @default(false)
263
+ dispatch_view_workorders Boolean @default(false)
264
+ dispatch_edit_workorders Boolean @default(false)
265
+ dispatch_view_schedule Boolean @default(false)
266
+ dispatch_add_teams Boolean @default(false)
267
+ dispatch_view_teams Boolean @default(false)
268
+ dispatch_edit_teams Boolean @default(false)
269
+ dispatch_delete_teams Boolean @default(false)
270
+ dispatch_view_projects Boolean @default(false)
271
+ dispatch_edit_projects Boolean @default(false)
272
+ dispatch_edit_materials Boolean @default(false)
273
+ dispatch_view_materials Boolean @default(false)
274
+ dispatch_add_materials Boolean @default(false)
275
+ dispatch_delete_materials Boolean @default(false)
276
+ dispatch_view_reports Boolean @default(false)
277
+ dispatch_view_kpi Boolean @default(false)
278
+ integration_web_access Boolean @default(false)
279
+ integration_mobile Boolean @default(false)
280
+
281
+ createdAt DateTime @default(now())
282
+ updatedAt DateTime @updatedAt
283
+ deletedAt DateTime?
284
+ User User[]
285
+ }
286
+
287
+ model Template {
288
+ id String @id @unique @default(uuid())
289
+ no Int @default(autoincrement())
290
+ name String @unique
291
+ statusColor String?
292
+ buttonName String
293
+ workflowType String @default("template")
294
+
295
+ createdAt DateTime @default(now())
296
+
297
+ features Feature[]
298
+ templateComponents TemplateComponent[]
299
+ projectWorkFlow ProjectWorkFlow[]
300
+ }
301
+
302
+ model Feature {
303
+ id String @id @unique @default(uuid())
304
+ no Int @default(autoincrement())
305
+ functionality String? // Describes the feature type
306
+ description String // Placeholder in the mobile app
307
+ classification String
308
+ KPI String
309
+ options Json?
310
+ linkToScheduler Boolean @default(false) // For Date and Time, will reschedule the work order
311
+ value String?
312
+
313
+ createdAt DateTime @default(now())
314
+ updatedAt DateTime @updatedAt
315
+ deletedAt DateTime?
316
+
317
+ featureType FeatureType @relation(fields: [featureTypeId], references: [id])
318
+ featureTypeId String
319
+
320
+ template Template @relation(fields: [templateId], references: [id])
321
+ templateId String
322
+ }
323
+
324
+ model FeatureType {
325
+ id String @id @unique @default(uuid())
326
+ no Int @default(autoincrement())
327
+ type String
328
+ functionality String
329
+
330
+ createdAt DateTime @default(now())
331
+ updatedAt DateTime @updatedAt
332
+ deletedAt DateTime?
333
+
334
+ Feature Feature[]
335
+ }
336
+
337
+ model TemplateComponent {
338
+ id String @id @unique @default(uuid())
339
+ no Int @default(autoincrement())
340
+
341
+ type String
342
+ createdAt DateTime @default(now())
343
+
344
+ template Template? @relation(fields: [templateId], references: [id])
345
+ templateId String?
346
+
347
+ bomComponent BillOfMaterial? @relation(fields: [bomComponentId], references: [id])
348
+ bomComponentId String?
349
+
350
+ dispatchProject DispatchProject? @relation(fields: [dispatchProjectId], references: [id])
351
+ dispatchProjectId String?
352
+
353
+ index Int? //order of the component
354
+
355
+ workOrderTasks WorkOrderTask[]
356
+
357
+ // TODO: Figure out how to tie this to a dispatch Project
358
+ }
359
+
360
+ model ProjectWorkFlow {
361
+ id String @id @unique @default(uuid())
362
+ no Int @default(autoincrement())
363
+ name String
364
+ project Project @relation(fields: [projectId], references: [id])
365
+ projectId String
366
+ index Int? //order of the workflow
367
+
368
+ createdAt DateTime @default(now())
369
+ updatedAt DateTime @updatedAt
370
+
371
+ template Template? @relation(fields: [templateId], references: [id])
372
+ templateId String?
373
+
374
+ billofMaterial BillOfMaterial? @relation(fields: [billofMaterialId], references: [id])
375
+ billofMaterialId String?
376
+ }
377
+
378
+ model TeamType {
379
+ id String @id @unique @default(uuid())
380
+ no Int @default(autoincrement())
381
+ name String
382
+ description String?
383
+ status String @default("active")
384
+ countries Json?
385
+ platforms Json?
386
+
387
+ createdAt DateTime @default(now())
388
+ updatedAt DateTime @updatedAt
389
+ deletedAt DateTime?
390
+
391
+ Team Team[]
392
+ User User[]
393
+ }
394
+
395
+ model Team {
396
+ id String @id @unique @default(uuid())
397
+ no Int @default(autoincrement())
398
+ name String
399
+ description String?
400
+ status String @default("active")
401
+ countries Json?
402
+ platforms Json?
403
+
404
+ createdAt DateTime @default(now())
405
+ updatedAt DateTime @updatedAt
406
+ deletedAt DateTime?
407
+
408
+ teamType TeamType @relation(fields: [teamTypeId], references: [id])
409
+ teamTypeId String
410
+ TeamPlatform TeamPlatform[]
411
+ User User[]
412
+ DispatchTeam DispatchTeam[]
413
+ }
414
+
415
+ model TeamPlatform {
416
+ id String @id @unique @default(uuid())
417
+ no Int @default(autoincrement())
418
+ name String
419
+ description String?
420
+ priority String?
421
+ status String @default("active")
422
+ countries Json?
423
+ platforms Json?
424
+ staffs Json?
425
+
426
+ createdAt DateTime @default(now())
427
+ updatedAt DateTime @updatedAt
428
+ deletedAt DateTime?
429
+
430
+ team Team @relation(fields: [teamId], references: [id])
431
+ teamId String
432
+ User User? @relation(fields: [userId], references: [id])
433
+ userId String?
434
+ }
435
+
436
+ model User {
437
+ id String @id @unique @default(uuid())
438
+ no Int @default(autoincrement())
439
+ name String
440
+ surname String
441
+ email String @unique
442
+ mobile String
443
+ password String
444
+ otp String?
445
+ passport String? //National Id/ Passport No.
446
+ passportFile String? @db.Text //Upload file for passport
447
+ status String @default("active")
448
+ countries Json? //Manage countrie
449
+ platforms Json? //Platform Access
450
+ staffId String? //Staff ID
451
+ deviceId1 String? //Build ID to limit number of devices
452
+ deviceId2 String? //Build ID to limit number of devices
453
+ notificationTokens String[] @default([])
454
+ webNotificationTokens String[] @default([])
455
+
456
+ platforms_list Platform[]
457
+ managing_countries CamusatCountry[]
458
+
459
+ refreshToken String? @unique
460
+
461
+ createdAt DateTime @default(now())
462
+ updatedAt DateTime @updatedAt
463
+ activatedAt DateTime?
464
+ deletedAt DateTime?
465
+
466
+ position Position? @relation(fields: [positionId], references: [id])
467
+ teamType TeamType? @relation(fields: [teamTypeId], references: [id])
468
+ team Team? @relation(fields: [teamId], references: [id])
469
+ country Country? @relation(fields: [countryId], references: [id])
470
+ role Role? @relation(fields: [roleId], references: [id])
471
+
472
+ positionId String?
473
+ teamTypeId String?
474
+ teamId String?
475
+ countryId String?
476
+ roleId String?
477
+
478
+ TeamPlatform TeamPlatform[]
479
+ project Project[]
480
+ audit Audit[]
481
+
482
+ leadTechnician DispatchTeam[] @relation("LeadTechnician")
483
+ firstTechnician DispatchTeam[] @relation("FirstTechnician")
484
+ secondTechnician DispatchTeam[] @relation("SecondTechnician")
485
+ otherTechnician DispatchTeam[] @relation("OtherTechnician")
486
+ DispatchProject DispatchProject[]
487
+ WorkOrder WorkOrder[]
488
+ WorkOrderTasks WorkOrderTask[]
489
+ workOrderActivityLogs WorkOrderActivityLog[]
490
+ workOrderEditLogs WorkOrderEditLog[]
491
+ Notifications Notifications[]
492
+
493
+ pboFatTemplates PboFatTemplate[]
494
+ pboFat PboFat[]
495
+ cable Cable[]
496
+ SpliceClosure SpliceClosure[]
497
+ CableTemplate CableTemplate[]
498
+ CentralOffices CentralOffice[]
499
+ Clusters Cluster[]
500
+ projectPhaseLog projectPhaseLog[]
501
+ ZoneNro ZoneNro[]
502
+ Pole Pole[]
503
+ Manhole Manhole[]
504
+ Loop Loop[]
505
+ FDTSRO FDTSRO[]
506
+ SFU SFU[]
507
+ Building Building[]
508
+ SpliceClosureTemplate SpliceClosureTemplate[]
509
+ ZoneNroTemplate ZoneNroTemplate[]
510
+ PoleTemplate PoleTemplate[]
511
+ ManholeTemplate ManholeTemplate[]
512
+ LoopTemplate LoopTemplate[]
513
+ FDTSROTemplate FDTSROTemplate[]
514
+ SFUTemplate SFUTemplate[]
515
+ BuildingTemplate BuildingTemplate[]
516
+ integrationProjectUserStatus integrationProjectUserStatus[]
517
+ integrationUserLocation integrationUserLocation[]
518
+ CamusatClient CamusatClient[]
519
+ IntegrationReportTemplate IntegrationReportTemplate[]
520
+ MapElementTemplate MapElementTemplate[]
521
+ MapElement MapElement[]
522
+ CentralOfficeUser CentralOfficeUser[]
523
+ ClusterComments ClusterComments[]
524
+ CreatedRevisions Revision[] @relation("revisionCreatedBy")
525
+ ResolvedRevisions Revision[] @relation("revisionResolvedBy")
526
+ ClusterNotes ClusterNotes[]
527
+ Conduit Conduit[]
528
+ ConduitTemplate ConduitTemplate[]
529
+ WorkOrderComments WorkOrderComments[]
530
+ }
531
+
532
+ model MainProject {
533
+ id String @id @unique @default(uuid())
534
+ no Int @default(autoincrement())
535
+ CamusatCountry CamusatCountry @relation(fields: [camusatCountryId], references: [id])
536
+ camusatCountryId String
537
+
538
+ CamusatClient CamusatClient? @relation(fields: [camusatClientId], references: [id])
539
+ camusatClientId String?
540
+ name String
541
+ projects Project[]
542
+ }
543
+
544
+ model Project {
545
+ id String @id @unique @default(uuid())
546
+ no Int @default(autoincrement())
547
+ name String
548
+ logo String? @db.Text //Upload file for logo
549
+ status String @default("Pending")
550
+ countries Json? //Manage countries
551
+ auditMatrices Json? //Audit Matrices
552
+ projectPhase String? @default("In-Progress")
553
+
554
+ createdAt DateTime @default(now())
555
+ updatedAt DateTime @updatedAt
556
+ activatedAt DateTime?
557
+ deletedAt DateTime?
558
+
559
+ types ProjectType[]
560
+
561
+ mainProject MainProject @relation(fields: [mainProjectId], references: [id])
562
+ mainProjectId String
563
+
564
+ User User? @relation(fields: [userId], references: [id])
565
+ userId String?
566
+
567
+ DispatchProject DispatchProject[]
568
+ projectWorkflow ProjectWorkFlow[]
569
+ BillOfMaterial BillOfMaterial[]
570
+ WorkOrder WorkOrder[]
571
+ EmailConfigurations EmailConfigurations[]
572
+ WorkOrderChannel WorkOrderChannel[]
573
+ problemCategorization problemCategorization[]
574
+ EmailTemplates EmailTemplates[]
575
+ ReportFormats ReportFormats[]
576
+ platforms Platform[]
577
+
578
+ pboFatTemplates PboFatTemplate[]
579
+ pboFat PboFat[]
580
+ cableAttributes CableAttributes[]
581
+ spliceClosureAttributes SpliceClosureAttributes[]
582
+ Cable Cable[]
583
+ CableTemplate CableTemplate[]
584
+ CentralOffice CentralOffice[]
585
+ qrCodeTemplate qrCodeTemplate[]
586
+ projectPhaseLog projectPhaseLog[]
587
+ ZoneNro ZoneNro[]
588
+ Pole Pole[]
589
+ Manhole Manhole[]
590
+ Loop Loop[]
591
+ FDTSRO FDTSRO[]
592
+ SFU SFU[]
593
+ Building Building[]
594
+ SpliceClosure SpliceClosure[]
595
+ SpliceClosureTemplate SpliceClosureTemplate[]
596
+ ZoneNroTemplate ZoneNroTemplate[]
597
+ PoleTemplate PoleTemplate[]
598
+ ManholeTemplate ManholeTemplate[]
599
+ LoopTemplate LoopTemplate[]
600
+ FDTSROTemplate FDTSROTemplate[]
601
+ SFUTemplate SFUTemplate[]
602
+ BuildingTemplate BuildingTemplate[]
603
+ usersOnline integrationProjectUserStatus[]
604
+ MapElementTemplate MapElementTemplate[]
605
+ MapElement MapElement[]
606
+ ConduitTemplate ConduitTemplate? @relation(fields: [conduitTemplateId], references: [id])
607
+ conduitTemplateId String?
608
+ }
609
+
610
+ model integrationProjectUserStatus {
611
+ id String @id @unique @default(uuid())
612
+ no Int @default(autoincrement())
613
+ isOnline Boolean @default(false)
614
+ connectedAt DateTime?
615
+
616
+ createdAt DateTime @default(now())
617
+ updatedAt DateTime @updatedAt
618
+ deletedAt DateTime?
619
+
620
+ User User? @relation(fields: [userId], references: [id])
621
+ userId String?
622
+
623
+ Project Project? @relation(fields: [projectId], references: [id])
624
+ projectId String?
625
+
626
+ Cluster Cluster? @relation(fields: [clusterId], references: [id])
627
+ clusterId String?
628
+ }
629
+
630
+ model projectPhaseLog {
631
+ id String @id @unique @default(uuid())
632
+ no Int @default(autoincrement())
633
+ project Project @relation(fields: [projectId], references: [id])
634
+ projectId String
635
+ phase String
636
+ action String
637
+ comment String?
638
+
639
+ createdAt DateTime @default(now())
640
+ updatedAt DateTime @updatedAt
641
+ deletedAt DateTime?
642
+ updatedBy User? @relation(fields: [updatedById], references: [id])
643
+ updatedById String?
644
+ }
645
+
646
+ model Audit {
647
+ id Int @id @default(autoincrement())
648
+ no Int @default(autoincrement())
649
+ module String
650
+ moduleId Int?
651
+ activity String
652
+ detail String? @db.Text
653
+ device String? @db.Text
654
+ deviceIp String?
655
+ platform String?
656
+ status String @default("active")
657
+
658
+ createdAt DateTime @default(now())
659
+ updatedAt DateTime @updatedAt
660
+ deletedAt DateTime?
661
+ User User? @relation(fields: [userId], references: [id])
662
+ userId String?
663
+ }
664
+
665
+ model DispatchTeam {
666
+ id String @id @unique @default(uuid())
667
+ name String? //Team name
668
+ status String @default("active")
669
+
670
+ createdAt DateTime @default(now())
671
+ updatedAt DateTime @updatedAt
672
+ deletedAt DateTime?
673
+ type String @default("team")
674
+
675
+ LeadTechnician User @relation("LeadTechnician", fields: [leadTechnicianId], references: [id])
676
+ FirstTechnician User? @relation("FirstTechnician", fields: [firstTechnicianId], references: [id])
677
+ SecondTechnician User? @relation("SecondTechnician", fields: [secondTechnicianId], references: [id])
678
+ OtherTechnician User? @relation("OtherTechnician", fields: [otherTechnicianId], references: [id])
679
+ leadTechnicianId String
680
+ firstTechnicianId String?
681
+ secondTechnicianId String?
682
+ otherTechnicianId String?
683
+
684
+ contractorTeam Team? @relation(fields: [contractorTeamId], references: [id])
685
+ contractorTeamId String?
686
+
687
+ TeamMaterial TeamMaterial[]
688
+ WorkOrders WorkOrder[]
689
+ dispatchProjects DispatchProject[]
690
+ workOrderActivityLogs WorkOrderActivityLog[]
691
+ }
692
+
693
+ model DispatchProject {
694
+ id String @id @unique @default(uuid())
695
+ no Int @default(autoincrement())
696
+ name String //sub project name
697
+ type String
698
+ teams DispatchTeam[] //Prject Teams
699
+ logo String? @db.Text //Upload file for logo
700
+ status String @default("active")
701
+ createdAt DateTime @default(now())
702
+ updatedAt DateTime @updatedAt
703
+ activatedAt DateTime?
704
+ deletedAt DateTime?
705
+ userId String?
706
+ projectId String?
707
+ Project Project? @relation(fields: [projectId], references: [id])
708
+ User User? @relation(fields: [userId], references: [id])
709
+ subsidiary CamusatCountry? @relation(fields: [subsidiaryId], references: [id])
710
+ subsidiaryId String?
711
+ DispatchMaterial DispatchMaterial[]
712
+ SubsidiaryMaterial SubsidiaryMaterial[]
713
+ clientMaterial clientMaterial[]
714
+ teamMaterial TeamMaterial[]
715
+ workOrderMaterial WorkOrderMaterial[]
716
+ templateComponent TemplateComponent[]
717
+ clientMaterialMovementLog clientMaterialMovementLog[]
718
+ teamMaterialMovementLog TeamMaterialMovementLog[]
719
+ subsidiaryMaterialMovementLog SubsidiaryMaterialMovementLog[]
720
+ }
721
+
722
+ model ProjectType {
723
+ id String @id @unique @default(uuid())
724
+ no Int @default(autoincrement())
725
+ name String
726
+ projects Project[]
727
+ }
728
+
729
+ model EmailConfigurations {
730
+ id String @id @unique @default(uuid())
731
+ no Int @default(autoincrement())
732
+ name String?
733
+ email String?
734
+ password String?
735
+ typeserver String? @default("IMAP")
736
+ server String?
737
+ serverportincoming String?
738
+ serverportoutgoing String?
739
+ authincoming String?
740
+ authoutgoing String?
741
+ sslincoming Boolean? @default(true)
742
+ ssloutgoing Boolean? @default(true)
743
+ infodelimiter String? @default(":")
744
+ otherdelimiter String?
745
+ subject String?
746
+ status String @default("active")
747
+ channel String @default("EMAIL")
748
+ mainId String?
749
+ column1title String?
750
+ column1key String?
751
+ column2title String?
752
+ column2key String?
753
+ typeKey String?
754
+ types Json?
755
+ data Json?
756
+ sampleData String? @db.Text
757
+ emailcount Int? @default(0)
758
+ emailsamplenumber Int?
759
+ emailuid String?
760
+ emailfirstpull Int?
761
+ emailfirstcount Int?
762
+ excelrownumber Int?
763
+ isCustomSla Boolean @default(false)
764
+ slaFieldKey String?
765
+
766
+ createdAt DateTime @default(now())
767
+ updatedAt DateTime @updatedAt
768
+ activatedAt DateTime?
769
+ deletedAt DateTime?
770
+ EmailsIncoming EmailsIncoming[]
771
+ EmailsOutGoing EmailsOutgoing[]
772
+ WorkOrder WorkOrder[]
773
+ Project Project? @relation(fields: [projectId], references: [id])
774
+ projectId String?
775
+ EmailsIncomingSample EmailsIncomingSample[]
776
+ }
777
+
778
+ model EmailsIncomingSample {
779
+ id String @id @unique @default(uuid())
780
+ messageId String?
781
+ subject String?
782
+ rawbody String?
783
+ attachment String?
784
+ headers Json?
785
+ body Json?
786
+ createdAt DateTime @default(now())
787
+ updatedAt DateTime @updatedAt
788
+
789
+ emailConfigurationsId String
790
+ EmailConfigurations EmailConfigurations @relation(fields: [emailConfigurationsId], references: [id])
791
+ }
792
+
793
+ model EmailsIncoming {
794
+ id String @id @unique @default(uuid())
795
+ no Int @default(autoincrement())
796
+ messageId String
797
+ sender String
798
+ receiver String
799
+ datereceived String
800
+ datesent String?
801
+ subject String?
802
+ body String?
803
+ attachment String?
804
+ seen Boolean @default(false)
805
+ status String @default("active")
806
+ createdAt DateTime @default(now())
807
+ updatedAt DateTime @updatedAt
808
+ activatedAt DateTime?
809
+ deletedAt DateTime?
810
+ emailConfigurationsId String?
811
+ EmailConfigurations EmailConfigurations? @relation(fields: [emailConfigurationsId], references: [id])
812
+
813
+ WorkOrder WorkOrder[]
814
+ }
815
+
816
+ model EmailsOutgoing {
817
+ id String @id @unique @default(uuid())
818
+ no Int @default(autoincrement())
819
+ receiver String
820
+ subject String?
821
+ body String?
822
+ attachment String?
823
+ status String @default("active")
824
+ createdAt DateTime @default(now())
825
+ updatedAt DateTime @updatedAt
826
+ activatedAt DateTime?
827
+ deletedAt DateTime?
828
+ emailConfigurationsId String?
829
+ EmailConfigurations EmailConfigurations? @relation(fields: [emailConfigurationsId], references: [id])
830
+ }
831
+
832
+ model EmailTemplates {
833
+ id String @id @unique @default(uuid())
834
+ no Int @default(autoincrement())
835
+ name String
836
+ subject String?
837
+ body String?
838
+ signature String? //Signature of the email
839
+ attachments Json?
840
+ workOrderInfo Json?
841
+ mailingList Json?
842
+ carbonCopyList Json?
843
+ templateInfo Json?
844
+ status String @default("active")
845
+ createdAt DateTime @default(now())
846
+ updatedAt DateTime @updatedAt
847
+ deletedAt DateTime?
848
+ project Project @relation(fields: [projectId], references: [id])
849
+ projectId String
850
+ }
851
+
852
+ model WorkOrder {
853
+ id String @id @unique @default(uuid())
854
+ no Int @default(autoincrement())
855
+ mainId String
856
+ column1 String?
857
+ column2 String?
858
+ type String?
859
+ channel String? @default("EMAIL")
860
+ data Json?
861
+ rawData Json?
862
+ status String @default("new")
863
+ statusColour String @default("#ffffff")
864
+ workOrderTeamStatus String?
865
+ scheduledStartAt DateTime?
866
+ scheduledEndAt DateTime?
867
+ actionDate DateTime? //Date the work order was completed
868
+ auditMatrices Json?
869
+ slaStartAt DateTime? //SLA Start Time
870
+ sla String?
871
+ isPaused Boolean @default(false)
872
+
873
+ createdAt DateTime @default(now())
874
+ updatedAt DateTime @updatedAt
875
+ deletedAt DateTime?
876
+
877
+ team DispatchTeam? @relation(fields: [teamId], references: [id])
878
+ teamId String?
879
+
880
+ projectId String
881
+ Project Project @relation(fields: [projectId], references: [id])
882
+
883
+ EmailConfigurations EmailConfigurations? @relation(fields: [emailConfigurationsId], references: [id])
884
+ emailConfigurationsId String?
885
+
886
+ EmailsIncoming EmailsIncoming? @relation(fields: [emailsIncomingId], references: [id])
887
+ emailsIncomingId String?
888
+
889
+ manager User? @relation(fields: [managerId], references: [id])
890
+ managerId String?
891
+
892
+ workOrderTasks WorkOrderTask[]
893
+ workOrderActivityLogs WorkOrderActivityLog[]
894
+ workOrderEditLogs WorkOrderEditLog[]
895
+ pboFatAttributes PboFatAttributes[]
896
+ PboFat PboFat? @relation(fields: [pboFatId], references: [id])
897
+ pboFatId String?
898
+ SFU SFU? @relation(fields: [sFUId], references: [id])
899
+ sFUId String?
900
+ Building Building? @relation(fields: [buildingId], references: [id])
901
+ buildingId String?
902
+ WorkOrderPauses WorkOrderPauses[]
903
+ WorkOrderComments WorkOrderComments[]
904
+ }
905
+
906
+ model WorkOrderChannel {
907
+ id String @id @unique @default(uuid())
908
+ no Int @default(autoincrement())
909
+ name String
910
+
911
+ Project Project @relation(fields: [projectId], references: [id])
912
+ projectId String
913
+
914
+ createdAt DateTime @default(now())
915
+ updatedAt DateTime @updatedAt
916
+ deletedAt DateTime?
917
+ }
918
+
919
+ model WorkOrderTask {
920
+ id String @id @unique @default(uuid())
921
+ no Int @default(autoincrement())
922
+ name String
923
+ buttonName String
924
+ isSpecialFeature Boolean @default(false)
925
+ statusColor String?
926
+ featureName String?
927
+ status String @default("pending")
928
+ features Json?
929
+ comments String?
930
+ scheduledStartAt DateTime?
931
+
932
+ createdAt DateTime @default(now())
933
+ updatedAt DateTime @updatedAt
934
+ deletedAt DateTime?
935
+
936
+ technician User? @relation(fields: [technicianId], references: [id])
937
+ technicianId String?
938
+
939
+ workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
940
+ workOrderId String
941
+
942
+ templateComponent TemplateComponent? @relation(fields: [templateComponentId], references: [id])
943
+ templateComponentId String
944
+
945
+ // workOrderTaskData WorkOrderTaskData[]
946
+ }
947
+
948
+ model WorkOrderActivityLog {
949
+ id String @id @unique @default(uuid())
950
+ no Int @default(autoincrement())
951
+ type String //Type of activity
952
+ activity String
953
+ detail Json?
954
+ reason String?
955
+ comment String?
956
+ statusUpdate String?
957
+
958
+ actionDate DateTime? //Date the work order was completed
959
+
960
+ createdAt DateTime @default(now())
961
+ updatedAt DateTime @updatedAt
962
+ deletedAt DateTime?
963
+
964
+ workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
965
+ workOrderId String
966
+
967
+ User User? @relation(fields: [userId], references: [id])
968
+ userId String?
969
+
970
+ team DispatchTeam? @relation(fields: [teamId], references: [id])
971
+ teamId String?
972
+ }
973
+
974
+ model WorkOrderEditLog {
975
+ id String @id @unique @default(uuid())
976
+ no Int @default(autoincrement())
977
+ action String @default("Edit")
978
+ description String @default("Edit Ticket")
979
+ newValues Json?
980
+ oldValues Json?
981
+
982
+ createdAt DateTime @default(now())
983
+ updatedAt DateTime @updatedAt
984
+ deletedAt DateTime?
985
+
986
+ workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
987
+ workOrderId String
988
+
989
+ User User? @relation(fields: [userId], references: [id])
990
+ userId String?
991
+ }
992
+
993
+ // Have data as JSON for now
994
+ model WorkOrderTaskData {
995
+ id String @id @unique @default(uuid())
996
+ no Int @default(autoincrement())
997
+ description String
998
+ value String
999
+
1000
+ createdAt DateTime @default(now())
1001
+ updatedAt DateTime @updatedAt
1002
+ deletedAt DateTime?
1003
+
1004
+ // workOrderTask WorkOrderTask @relation(fields: [workOrderTaskId], references: [id])
1005
+ // workOrderTaskId String
1006
+ }
1007
+
1008
+ model WorkOrderPauses {
1009
+ id String @id @unique @default(uuid())
1010
+ no Int @default(autoincrement())
1011
+
1012
+ pauseStartAt DateTime
1013
+ pauseEndAt DateTime?
1014
+
1015
+ createdAt DateTime @default(now())
1016
+ updatedAt DateTime @updatedAt
1017
+
1018
+ workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
1019
+ workOrderId String
1020
+ }
1021
+
1022
+ model WorkOrderComments {
1023
+ id String @id @unique @default(uuid())
1024
+ no Int @default(autoincrement())
1025
+ comment String
1026
+ hasAttachment Boolean @default(false)
1027
+ attachment String? @db.Text //Upload file for attachment
1028
+
1029
+ createdAt DateTime @default(now())
1030
+ updatedAt DateTime @updatedAt
1031
+
1032
+ workOrder WorkOrder @relation(fields: [workOrderId], references: [id])
1033
+ workOrderId String
1034
+
1035
+ createdBy User? @relation(fields: [createdById], references: [id])
1036
+ createdById String?
1037
+ }
1038
+
1039
+ // Houses the materials of a project
1040
+ model BillOfMaterial {
1041
+ id String @id @unique @default(uuid())
1042
+ no Int @default(autoincrement())
1043
+ name String
1044
+ project Project? @relation(fields: [projectId], references: [id])
1045
+ projectId String?
1046
+ workflowType String @default("bom")
1047
+
1048
+ materials MaterialBillOfMaterial[]
1049
+ projectWorkFlow ProjectWorkFlow[]
1050
+ templateComponent TemplateComponent[]
1051
+
1052
+ createdAt DateTime @default(now())
1053
+ updatedAt DateTime @updatedAt
1054
+ deletedAt DateTime?
1055
+ }
1056
+
1057
+ model Material {
1058
+ id String @id @unique @default(uuid())
1059
+ no Int @default(autoincrement())
1060
+ name String
1061
+ code String
1062
+ description String?
1063
+ unit String
1064
+ status String @default("active")
1065
+
1066
+ createdAt DateTime @default(now())
1067
+ updatedAt DateTime @updatedAt
1068
+ deletedAt DateTime?
1069
+
1070
+ billOfMaterial MaterialBillOfMaterial[]
1071
+
1072
+ pboFatAttributes PboFatAttributes[]
1073
+ cableAttributes CableAttributes[]
1074
+ spliceClosureAttributes SpliceClosureAttributes[]
1075
+ }
1076
+
1077
+ model MaterialBillOfMaterial {
1078
+ id String @id @unique @default(uuid())
1079
+ no Int @default(autoincrement())
1080
+
1081
+ createdAt DateTime @default(now())
1082
+ updatedAt DateTime @updatedAt
1083
+ deletedAt DateTime?
1084
+
1085
+ material Material @relation(fields: [materialId], references: [id])
1086
+ materialId String
1087
+ billOfMaterial BillOfMaterial @relation(fields: [billOfMaterialId], references: [id])
1088
+ billOfMaterialId String
1089
+
1090
+ dispatchMaterial DispatchMaterial[]
1091
+ }
1092
+
1093
+ model DispatchMaterial {
1094
+ id String @id @unique @default(uuid())
1095
+ no Int @default(autoincrement())
1096
+ materialBillOfMaterial MaterialBillOfMaterial? @relation(fields: [materialbomId], references: [id])
1097
+ materialbomId String?
1098
+
1099
+ dispatchProject DispatchProject? @relation(fields: [dispatchProjectId], references: [id])
1100
+ dispatchProjectId String?
1101
+
1102
+ materialCode String?
1103
+ materialName String?
1104
+ description String?
1105
+ unit String?
1106
+ status String @default("active")
1107
+
1108
+ quantityAdded String @default("0")
1109
+ quantityUsed String @default("0")
1110
+ quantityRemaining String @default("0")
1111
+
1112
+ createdAt DateTime @default(now())
1113
+ updatedAt DateTime @updatedAt
1114
+ deletedAt DateTime?
1115
+
1116
+ stockMovement StockMovement[]
1117
+ clientMaterial clientMaterial[]
1118
+ teamMaterial TeamMaterial[]
1119
+ workOrderMaterial WorkOrderMaterial[]
1120
+ subsidiaryMaterial SubsidiaryMaterial[]
1121
+ MaterialChangeLog MaterialChangeLog[]
1122
+ }
1123
+
1124
+ model StockMovement {
1125
+ id String @id @unique @default(uuid())
1126
+ no Int @default(autoincrement())
1127
+ material DispatchMaterial[]
1128
+ movementType String
1129
+ to String?
1130
+ toId String?
1131
+ from String?
1132
+ fromId String?
1133
+ quantity String
1134
+
1135
+ createdAt DateTime @default(now())
1136
+ updatedAt DateTime @updatedAt
1137
+ }
1138
+
1139
+ model clientMaterial {
1140
+ id String @id @unique @default(uuid())
1141
+ no Int @default(autoincrement())
1142
+ material DispatchMaterial @relation(fields: [materialId], references: [id])
1143
+ materialId String
1144
+ client CamusatClient @relation(fields: [clientId], references: [id])
1145
+ clientId String
1146
+
1147
+ quantityAdded String @default("0")
1148
+ quantityUsed String @default("0")
1149
+ quantityRemaining String @default("0")
1150
+ status String @default("active")
1151
+ type String @default("client")
1152
+
1153
+ createdAt DateTime @default(now())
1154
+ updatedAt DateTime @updatedAt
1155
+ deletedAt DateTime?
1156
+
1157
+ clientMaterialMovementLog clientMaterialMovementLog[]
1158
+ dispatchProject DispatchProject[]
1159
+ }
1160
+
1161
+ model clientMaterialMovementLog {
1162
+ id String @id @unique @default(uuid())
1163
+ no Int @default(autoincrement())
1164
+ material clientMaterial[]
1165
+ movementType String
1166
+ movementFrom String?
1167
+ movementFromName String?
1168
+ movementFromId String?
1169
+ movementTo String?
1170
+ movementToName String?
1171
+ movementToId String?
1172
+ quantity String
1173
+ materialMoved Json?
1174
+
1175
+ dispatchProject DispatchProject? @relation(fields: [dispatchProjectId], references: [id])
1176
+ dispatchProjectId String?
1177
+
1178
+ createdAt DateTime @default(now())
1179
+ updatedAt DateTime @updatedAt
1180
+ deletedAt DateTime?
1181
+ }
1182
+
1183
+ model SubsidiaryMaterial {
1184
+ id String @id @unique @default(uuid())
1185
+ no Int @default(autoincrement())
1186
+ material DispatchMaterial @relation(fields: [materialId], references: [id])
1187
+ materialId String
1188
+
1189
+ subsidiary CamusatCountry @relation(fields: [subsidiaryId], references: [id])
1190
+ subsidiaryId String
1191
+ dispatchProject DispatchProject[]
1192
+
1193
+ quantityAdded String @default("0")
1194
+ quantityUsed String @default("0")
1195
+ quantityRemaining String @default("0")
1196
+ status String @default("active")
1197
+ type String @default("subsidiary")
1198
+
1199
+ createdAt DateTime @default(now())
1200
+ updatedAt DateTime @updatedAt
1201
+ deletedAt DateTime?
1202
+
1203
+ subsidiaryMaterialMovementLog SubsidiaryMaterialMovementLog[]
1204
+ }
1205
+
1206
+ model SubsidiaryMaterialMovementLog {
1207
+ id String @id @unique @default(uuid())
1208
+ no Int @default(autoincrement())
1209
+ material SubsidiaryMaterial[]
1210
+ movementType String
1211
+ movementFrom String?
1212
+ movementFromName String?
1213
+ movementFromId String?
1214
+ movementTo String?
1215
+ movementToName String?
1216
+ movementToId String?
1217
+ quantity String
1218
+ materialMoved Json?
1219
+
1220
+ dispatchProject DispatchProject? @relation(fields: [dispatchProjectId], references: [id])
1221
+ dispatchProjectId String?
1222
+
1223
+ createdAt DateTime @default(now())
1224
+ updatedAt DateTime @updatedAt
1225
+ deletedAt DateTime?
1226
+ }
1227
+
1228
+ model TeamMaterial {
1229
+ id String @id @unique @default(uuid())
1230
+ no Int @default(autoincrement())
1231
+ material DispatchMaterial @relation(fields: [materialId], references: [id])
1232
+ materialId String
1233
+ team DispatchTeam @relation(fields: [teamId], references: [id])
1234
+ teamId String
1235
+
1236
+ quantityAdded String @default("0")
1237
+ quantityUsed String @default("0")
1238
+ quantityRemaining String @default("0")
1239
+ status String @default("active")
1240
+ type String @default("team")
1241
+
1242
+ createdAt DateTime @default(now())
1243
+ updatedAt DateTime @updatedAt
1244
+ deletedAt DateTime?
1245
+
1246
+ teamMaterialMovementLog TeamMaterialMovementLog[]
1247
+ dispatchProject DispatchProject[]
1248
+ }
1249
+
1250
+ model TeamMaterialMovementLog {
1251
+ id String @id @unique @default(uuid())
1252
+ no Int @default(autoincrement())
1253
+ material TeamMaterial[]
1254
+ movementType String
1255
+ movementFrom String?
1256
+ movementFromName String?
1257
+ movementFromId String?
1258
+ movementTo String?
1259
+ movementToName String?
1260
+ movementToId String?
1261
+ quantity String
1262
+ materialMoved Json?
1263
+
1264
+ dispatchProject DispatchProject? @relation(fields: [dispatchProjectId], references: [id])
1265
+ dispatchProjectId String?
1266
+
1267
+ createdAt DateTime @default(now())
1268
+ updatedAt DateTime @updatedAt
1269
+ deletedAt DateTime?
1270
+ }
1271
+
1272
+ model WorkOrderMaterial {
1273
+ id String @id @unique @default(uuid())
1274
+ no Int @default(autoincrement())
1275
+ material DispatchMaterial @relation(fields: [materialId], references: [id])
1276
+ materialId String
1277
+
1278
+ quantityAdded String? @default("0")
1279
+ quantityUsed String @default("0")
1280
+ quantityRemaining String @default("0")
1281
+ status String @default("active")
1282
+
1283
+ createdAt DateTime @default(now())
1284
+ updatedAt DateTime @updatedAt
1285
+ deletedAt DateTime?
1286
+
1287
+ ticketMaterialMovementLog ticketMaterialMovementLog[]
1288
+ dispatchProject DispatchProject[]
1289
+ }
1290
+
1291
+ model ticketMaterialMovementLog {
1292
+ id String @id @unique @default(uuid())
1293
+ no Int @default(autoincrement())
1294
+ material WorkOrderMaterial[]
1295
+ movementType String
1296
+ movementFrom String?
1297
+ movementFromId String?
1298
+ movementTo String?
1299
+ movementToId String?
1300
+ quantity String
1301
+ materialMoved Json?
1302
+
1303
+ createdAt DateTime @default(now())
1304
+ updatedAt DateTime @updatedAt
1305
+ deletedAt DateTime?
1306
+ }
1307
+
1308
+ model MaterialChangeLog {
1309
+ id String @id @unique @default(uuid())
1310
+ no Int @default(autoincrement())
1311
+
1312
+ material DispatchMaterial @relation(fields: [materialId], references: [id])
1313
+ materialId String
1314
+
1315
+ action String
1316
+ createdAt DateTime @default(now())
1317
+ updatedAt DateTime @updatedAt
1318
+ deletedAt DateTime?
1319
+ }
1320
+
1321
+ model problemCategorization {
1322
+ id String @id @unique @default(uuid())
1323
+ no Int @default(autoincrement())
1324
+ reason String
1325
+ problemType String
1326
+ platformName String
1327
+ project Project? @relation(fields: [projectId], references: [id])
1328
+ projectId String?
1329
+
1330
+ createdAt DateTime @default(now())
1331
+ updatedAt DateTime @updatedAt
1332
+ deletedAt DateTime?
1333
+ }
1334
+
1335
+ model Notifications {
1336
+ id String @id @unique @default(uuid())
1337
+ no Int @default(autoincrement())
1338
+ title String
1339
+ description String
1340
+ status String @default("unread")
1341
+ platform NotificationPlatform @default(Mobile)
1342
+ createdAt DateTime @default(now())
1343
+ updatedAt DateTime @updatedAt
1344
+ deletedAt DateTime?
1345
+
1346
+ user User @relation(fields: [userId], references: [id])
1347
+ userId String
1348
+ }
1349
+
1350
+ model ReportFormats {
1351
+ id String @id @unique @default(uuid())
1352
+ no Int @default(autoincrement())
1353
+ name String
1354
+ header1 String?
1355
+ header2 String?
1356
+ header3 String?
1357
+ mainInfo Json? //Ticket Main info
1358
+ ticketDetails Json? //More ticket details
1359
+ materialInfo Json? //Material Info
1360
+ teamInfo Json? //Team Info
1361
+ interventionResults Json? //Work Order Results
1362
+ attachments Json? //Attachments
1363
+
1364
+ status String @default("active")
1365
+
1366
+ createdAt DateTime @default(now())
1367
+ updatedAt DateTime @updatedAt
1368
+ deletedAt DateTime?
1369
+
1370
+ project Project @relation(fields: [projectId], references: [id])
1371
+ projectId String
1372
+ }
1373
+
1374
+ model NetworkElement {
1375
+ id String @id @unique @default(uuid())
1376
+ no Int @default(autoincrement())
1377
+ type String @unique
1378
+ createdAt DateTime @default(now())
1379
+ updatedAt DateTime @updatedAt
1380
+ deletedAt DateTime?
1381
+ classification NetworkElementClassification @default(NetworkElement)
1382
+
1383
+ PboFat PboFat[]
1384
+ pboFatTemplate PboFatTemplate[]
1385
+ Cable Cable[]
1386
+ SpliceClosure SpliceClosure[]
1387
+ CableTemplate CableTemplate[]
1388
+ qrCodeTemplate qrCodeTemplate[]
1389
+ ZoneNro ZoneNro[]
1390
+ Pole Pole[]
1391
+ Manhole Manhole[]
1392
+ Loop Loop[]
1393
+ FDTSRO FDTSRO[]
1394
+ SFU SFU[]
1395
+ Building Building[]
1396
+ SpliceClosureTemplate SpliceClosureTemplate[]
1397
+ ZoneNroTemplate ZoneNroTemplate[]
1398
+ PoleTemplate PoleTemplate[]
1399
+ ManholeTemplate ManholeTemplate[]
1400
+ LoopTemplate LoopTemplate[]
1401
+ FDTSROTemplate FDTSROTemplate[]
1402
+ SFUTemplate SFUTemplate[]
1403
+ BuildingTemplate BuildingTemplate[]
1404
+ MapElementTemplate MapElementTemplate[]
1405
+ MapElement MapElement[]
1406
+ ElementNode ElementNode[]
1407
+ Conduit Conduit[]
1408
+ ConduitTemplate ConduitTemplate[]
1409
+ }
1410
+
1411
+ model ElementNode {
1412
+ id String @id @unique @default(uuid())
1413
+ typeId String
1414
+ type NetworkElement @relation(fields: [typeId], references: [id])
1415
+ name String
1416
+ lat Float?
1417
+ lng Float?
1418
+ geometry Json?
1419
+
1420
+ isInstalled Boolean @default(false)
1421
+ installationDate DateTime?
1422
+
1423
+ relationsFrom ElementRelation[] @relation("relationsFrom")
1424
+ relationsTo ElementRelation[] @relation("relationsTo")
1425
+
1426
+ createdAt DateTime @default(now())
1427
+ updatedAt DateTime @updatedAt
1428
+ AttributeValues AttributeValue[]
1429
+ PboFat PboFat[]
1430
+ Cable Cable[]
1431
+ SpliceClosure SpliceClosure[]
1432
+ ZoneNro ZoneNro[]
1433
+ Pole Pole[]
1434
+ Manhole Manhole[]
1435
+ Loop Loop[]
1436
+ FDTSRO FDTSRO[]
1437
+ SFU SFU[]
1438
+ Building Building[]
1439
+ MapElement MapElement[]
1440
+ Conduit Conduit[]
1441
+ }
1442
+
1443
+ model ElementRelation {
1444
+ id String @id @unique @default(uuid())
1445
+ fromId String
1446
+ toId String
1447
+ relationType RelationType
1448
+ metadata Json?
1449
+ from ElementNode @relation("relationsFrom", fields: [fromId], references: [id])
1450
+ to ElementNode @relation("relationsTo", fields: [toId], references: [id])
1451
+
1452
+ clusterId String?
1453
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1454
+
1455
+ @@index([fromId])
1456
+ @@index([toId])
1457
+ @@index([relationType])
1458
+ }
1459
+
1460
+ model AttributeDefinition {
1461
+ id String @id @unique @default(uuid())
1462
+ no Int @default(autoincrement())
1463
+ key String @unique
1464
+ label String
1465
+ type AttributeType
1466
+
1467
+ required Boolean @default(false)
1468
+ visibleOnWeb Boolean @default(true)
1469
+ visibleOnMobile Boolean @default(true)
1470
+ visibleOnDispatchMobile Boolean @default(true)
1471
+ AttributeValue AttributeValue[]
1472
+ }
1473
+
1474
+ model OptionSource {
1475
+ id String @id @unique @default(uuid())
1476
+ sourceType String
1477
+ staticOptions Json?
1478
+ dynamicOptions Json?
1479
+ foreignTable String?
1480
+ }
1481
+
1482
+ model AttributeValue {
1483
+ id String @id @unique @default(uuid())
1484
+ attributeDefId String
1485
+ attributeDef AttributeDefinition @relation(fields: [attributeDefId], references: [id])
1486
+ value String //Always store as string, convert to other types in the application layer
1487
+
1488
+ node ElementNode @relation(fields: [nodeId], references: [id])
1489
+ nodeId String
1490
+
1491
+ @@index([nodeId])
1492
+ @@index([attributeDefId])
1493
+ }
1494
+
1495
+ model Cable {
1496
+ id String @id @unique @default(uuid())
1497
+ no Int @default(autoincrement())
1498
+
1499
+ status String @default("active")
1500
+ name String?
1501
+ terminalAccess Boolean @default(false)
1502
+ photos Json? //Upload files for photos
1503
+ texts Json? //Add text attributes to the cable
1504
+ files Json? //Upload files for the cable
1505
+ zone Json? //Color code for zone
1506
+ geometry Json? //Icon for the cable
1507
+ attributes Json? //Attributes for the cable
1508
+ coordinates Json?
1509
+ autoincrement Boolean @default(true)
1510
+ namePrefix String?
1511
+ templateIndex Int?
1512
+
1513
+ asBuiltCoordinates Json? //As built coordinates
1514
+ isInstalled Boolean @default(false)
1515
+ installationDate DateTime?
1516
+
1517
+ isInRevision Boolean @default(false)
1518
+ installationStatus String? @default("pending") //pending, approved, in-revision
1519
+
1520
+ comments String?
1521
+
1522
+ // Reporting mirrors
1523
+ enclosureOriginType String? //Type of the origin enclosure
1524
+ enclosureOriginId String? //ID of the origin enclosure
1525
+ enclosureDestinationType String? //Type of the destination enclosure
1526
+ enclosureDestinationId String? //ID of the destination enclosure
1527
+ cableLength Float? //Length of the cable in meters
1528
+ actualCableLength Float? //Actual length of the cable in meters
1529
+ type String? //Type of cable (e.g., aerial, underground)
1530
+ capacity String? //Capacity of cable(12FO, 24FO, 48FO)
1531
+ fibersActive Int? //Number of active fibers
1532
+ fibersReserved Int? //Number of reserved fibers
1533
+ fibersDark Int? //Number of dark fibers
1534
+ fibersDedicated Int? //Number of dedicated fibers
1535
+ brand String? //Brand of the cable
1536
+ brandDescription String? //Description of the brand
1537
+ centralOffice String? //Central office associated with the cable
1538
+ mainProject String? //Main project associated with the cable
1539
+ projectPhase String? //Project phase (e.g., planning, execution)
1540
+ client String? //Client associated with the cable
1541
+ subsidiary String? //Subsidiary or branch
1542
+
1543
+ // parent/subcable implementation
1544
+ isSubcable Boolean @default(false)
1545
+
1546
+ parentCable Cable? @relation("CableToSubcables", fields: [parentCableId], references: [id])
1547
+ parentCableId String?
1548
+ parentCableName String?
1549
+
1550
+ subcables Cable[] @relation("CableToSubcables")
1551
+
1552
+ createdAt DateTime @default(now())
1553
+ updatedAt DateTime @updatedAt
1554
+ deletedAt DateTime?
1555
+
1556
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1557
+ updatedById String?
1558
+
1559
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1560
+ networkElementId String
1561
+
1562
+ template CableTemplate? @relation(fields: [templateId], references: [id])
1563
+ templateId String?
1564
+
1565
+ project Project? @relation(fields: [projectId], references: [id])
1566
+ projectId String?
1567
+
1568
+ node ElementNode? @relation(fields: [nodeId], references: [id])
1569
+ nodeId String?
1570
+
1571
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
1572
+ installationId String?
1573
+
1574
+ cableAttachments CableAttachment[]
1575
+ cableAttributes CableAttributes[]
1576
+ PboFatAttributes PboFatAttributes[]
1577
+ spliceClosures SpliceClosure[]
1578
+ qrCodeTag qrCodeTag[]
1579
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1580
+ clusterId String?
1581
+ Revision Revision[]
1582
+ ducts Duct[]
1583
+ PboFat PboFat[]
1584
+ Loop Loop[]
1585
+ fdtsro FDTSRO[]
1586
+
1587
+ @@index([enclosureOriginType, enclosureOriginId])
1588
+ @@index([enclosureDestinationType, enclosureDestinationId])
1589
+ }
1590
+
1591
+ model CableAttachment {
1592
+ id String @id @unique @default(uuid())
1593
+ no Int @default(autoincrement())
1594
+
1595
+ cable Cable @relation(fields: [cableId], references: [id])
1596
+ cableId String
1597
+
1598
+ targetType String
1599
+ targetId String
1600
+
1601
+ role CableAttachmentRole
1602
+ metadata Json?
1603
+
1604
+ createdAt DateTime @default(now())
1605
+ updatedAt DateTime @updatedAt
1606
+
1607
+ @@unique([cableId, targetType, targetId, role])
1608
+ @@index([targetType, targetId])
1609
+ @@index([cableId, role])
1610
+ }
1611
+
1612
+ model CableTemplate {
1613
+ id String @id @unique @default(uuid())
1614
+ no Int @default(autoincrement())
1615
+
1616
+ status String @default("active")
1617
+ name String?
1618
+ terminalAccess Boolean @default(false)
1619
+ photos Json? //Upload files for photos
1620
+ files Json? //Upload files for the cable
1621
+ texts Json? //Add text attributes to the cable
1622
+ zone Json? //Color code for zone
1623
+ geometry Json? //Icon for the cable
1624
+ attributes Json? //Attributes for the cable
1625
+ coordinates Json?
1626
+ autoincrement Boolean @default(true)
1627
+ namePrefix String?
1628
+
1629
+ createdAt DateTime @default(now())
1630
+ updatedAt DateTime @updatedAt
1631
+ deletedAt DateTime?
1632
+
1633
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1634
+ updatedById String?
1635
+
1636
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1637
+ networkElementId String
1638
+
1639
+ projects Project[]
1640
+
1641
+ cableAttributes CableAttributes[]
1642
+ qrCodeTemplate qrCodeTemplate[]
1643
+ Cable Cable[]
1644
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1645
+ clusterId String?
1646
+ }
1647
+
1648
+ model Conduit {
1649
+ id String @id @unique @default(uuid())
1650
+ no Int @default(autoincrement())
1651
+
1652
+ status String @default("active")
1653
+ name String
1654
+ terminalAccess Boolean @default(false)
1655
+ photos Json? //Upload files for photos
1656
+ texts Json? //Add text attributes to the conduit
1657
+ files Json? //Upload files for the conduit
1658
+ zone Json? //Color code for zone
1659
+ geometry Json? //Icon for the conduit
1660
+ attributes Json? //Attributes for the conduit
1661
+ coordinates Json?
1662
+
1663
+ createdAt DateTime @default(now())
1664
+ updatedAt DateTime @updatedAt
1665
+ deletedAt DateTime?
1666
+
1667
+ namePrefix String?
1668
+
1669
+ asBuiltCoordinates Json? //As built coordinates
1670
+ isInstalled Boolean @default(false)
1671
+ installationDate DateTime?
1672
+
1673
+ isInRevision Boolean @default(false)
1674
+ installationStatus String? @default("pending") //pending, approved, in-revision
1675
+
1676
+ address String? //Address of the conduit
1677
+ deploymentPhase String? //Deployment phase of the conduit
1678
+ trenchConfiguration String? //Trench configuration for the conduit
1679
+ trenchDepth Float? //Trench depth for the conduit
1680
+ backfillMaterial String? //Backfill material for the conduit
1681
+ reinforcementMaterial String? //Reinforcement material for the conduit
1682
+ specialCharacteristics String? //Special characteristics of the conduit
1683
+ enclosureOriginType String? //Type of the origin enclosure
1684
+ enclosureOriginId String? //ID of the origin enclosure
1685
+ enclosureDestinationType String? //Type of the destination enclosure
1686
+ enclosureDestinationId String? //ID of the destination enclosure
1687
+ conduitLength Float? //Length of the conduit in meters
1688
+ brand String? //Brand of the conduit
1689
+ brandDescription String? //Description of the brand
1690
+ materialListReference String? //Reference to the material list
1691
+
1692
+ comments String?
1693
+
1694
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1695
+ updatedById String?
1696
+
1697
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1698
+ networkElementId String
1699
+
1700
+ node ElementNode? @relation(fields: [nodeId], references: [id])
1701
+ nodeId String?
1702
+
1703
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
1704
+ installationId String?
1705
+
1706
+ template ConduitTemplate? @relation(fields: [templateId], references: [id])
1707
+ templateId String?
1708
+
1709
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1710
+ clusterId String?
1711
+ qrCodeTag qrCodeTag[]
1712
+ ducts Duct[]
1713
+ }
1714
+
1715
+ model Duct {
1716
+ id String @id @unique @default(uuid())
1717
+ no Int @default(autoincrement())
1718
+
1719
+ type String
1720
+ material String
1721
+ dimension Float
1722
+ typeOptions String[]
1723
+ materialOptions String[]
1724
+
1725
+ createdAt DateTime @default(now())
1726
+ updatedAt DateTime @updatedAt
1727
+ deletedAt DateTime?
1728
+
1729
+ conduit Conduit @relation(fields: [conduitId], references: [id])
1730
+ conduitId String
1731
+
1732
+ cables Cable[]
1733
+ }
1734
+
1735
+ model ductTemplate {
1736
+ id String @id @unique @default(uuid())
1737
+ no Int @default(autoincrement())
1738
+
1739
+ type String
1740
+ material String
1741
+ dimension Float
1742
+
1743
+ typeOptions String[]
1744
+ materialOptions String[]
1745
+
1746
+ createdAt DateTime @default(now())
1747
+ updatedAt DateTime @updatedAt
1748
+ deletedAt DateTime?
1749
+
1750
+ conduit ConduitTemplate @relation(fields: [conduitTemplateId], references: [id])
1751
+ conduitTemplateId String
1752
+ }
1753
+
1754
+ model ConduitTemplate {
1755
+ id String @id @unique @default(uuid())
1756
+ no Int @default(autoincrement())
1757
+
1758
+ status String @default("active")
1759
+ name String
1760
+ terminalAccess Boolean @default(false)
1761
+ photos Json? //Upload files for photos
1762
+ texts Json? //Add text attributes to the conduit
1763
+ files Json? //Upload files for the conduit
1764
+ zone Json? //Color code for zone
1765
+ geometry Json? //Icon for the conduit
1766
+ attributes Json? //Attributes for the conduit
1767
+
1768
+ createdAt DateTime @default(now())
1769
+ updatedAt DateTime @updatedAt
1770
+ deletedAt DateTime?
1771
+
1772
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1773
+ updatedById String?
1774
+
1775
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1776
+ networkElementId String
1777
+
1778
+ projects Project[]
1779
+ Conduit Conduit[]
1780
+
1781
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1782
+ clusterId String?
1783
+ qrCodeTemplate qrCodeTemplate[]
1784
+ ductTemplates ductTemplate[]
1785
+ }
1786
+
1787
+ model CableAttributes {
1788
+ id String @id @unique @default(uuid())
1789
+ no Int @default(autoincrement())
1790
+ name String
1791
+ description String?
1792
+ value String?
1793
+ visibleOnMobile Boolean @default(false)
1794
+
1795
+ createdAt DateTime @default(now())
1796
+ updatedAt DateTime @updatedAt
1797
+ deletedAt DateTime?
1798
+
1799
+ cable Cable? @relation(fields: [cableId], references: [id])
1800
+ cableId String?
1801
+
1802
+ project Project? @relation(fields: [projectId], references: [id])
1803
+ projectId String?
1804
+
1805
+ material Material? @relation(fields: [materialId], references: [id])
1806
+ materialId String?
1807
+ CableTemplate CableTemplate? @relation(fields: [cableTemplateId], references: [id])
1808
+ cableTemplateId String?
1809
+ }
1810
+
1811
+ model Splitter {
1812
+ id String @id @unique @default(uuid())
1813
+ no Int @default(autoincrement())
1814
+ noOfPorts Int
1815
+
1816
+ createdAt DateTime @default(now())
1817
+ updatedAt DateTime @updatedAt
1818
+ deletedAt DateTime?
1819
+
1820
+ PboFatAttributes PboFatAttributes[]
1821
+ }
1822
+
1823
+ model PboFatTemplate {
1824
+ id String @id @unique @default(uuid())
1825
+ no Int @default(autoincrement())
1826
+
1827
+ status String @default("active")
1828
+ terminalAccess Boolean @default(false)
1829
+ name String?
1830
+ photos Json? //Upload files for photos
1831
+ texts Json? //Add text attributes to the PBO FAT
1832
+ files Json? //Upload files for the PBO FAT
1833
+ zone Json? //Color code for zone
1834
+ geometry Json? //Icon for the PBO FAT
1835
+ attributes Json? //Attributes for the PBO FAT
1836
+ autoincrement Boolean @default(true)
1837
+ namePrefix String?
1838
+
1839
+ createdAt DateTime @default(now())
1840
+ updatedAt DateTime @updatedAt
1841
+ deletedAt DateTime?
1842
+
1843
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1844
+ updatedById String?
1845
+
1846
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1847
+ networkElementId String
1848
+
1849
+ projects Project[]
1850
+
1851
+ pboFatAttributes PboFatAttributes[]
1852
+
1853
+ //TODO: Add the fields for input/output cable, previous/next equipment, CO and project phase
1854
+ qrCodeTemplate qrCodeTemplate[]
1855
+ PboFat PboFat[]
1856
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1857
+ clusterId String?
1858
+ }
1859
+
1860
+ model PboFat {
1861
+ id String @id @unique @default(uuid())
1862
+ no Int @default(autoincrement())
1863
+
1864
+ status String @default("active")
1865
+ terminalAccess Boolean @default(false)
1866
+ name String?
1867
+ photos Json? //Upload files for photos
1868
+ texts Json? //Add text attributes to the PBO FAT
1869
+ files Json? //Upload files for the PBO FAT
1870
+ zone Json? //Color code for zone
1871
+ geometry Json? //Icon for the PBO FAT
1872
+ attributes Json? //Attributes for the PBO FAT
1873
+ coordinates Json?
1874
+ autoincrement Boolean @default(true)
1875
+ namePrefix String?
1876
+ templateIndex Int?
1877
+
1878
+ asBuiltCoordinates Json? //Coordinates when installed
1879
+ isInstalled Boolean @default(false)
1880
+ installationDate DateTime?
1881
+
1882
+ comments String?
1883
+
1884
+ isInRevision Boolean @default(false)
1885
+ installationStatus String? @default("pending") //pending, approved, in-revision
1886
+
1887
+ // Reporting mirrors
1888
+ fatMaximumCapacity Int? //Maximum capacity of the PBO FAT
1889
+ fatExistingSubscribers Int? //Existing subscribers in the PBO FAT
1890
+ fatAvailableCapacity Int? //Available capacity in the PBO FAT
1891
+ placeOfInstallation String? //ID to an Infrastructure element
1892
+ address String? //Address of the PBO FAT
1893
+ splitter1 String? //1:2, 1:4, 1:8 etc
1894
+ splitter2 String?
1895
+ previousEquipmentType String? //Type of the previous equipment
1896
+ previousEquipmentId String? //ID of the previous equipment
1897
+ nextEquipmentType String? //Type of the next equipment
1898
+ nextEquipmentId String? //ID of the next equipment
1899
+ brand String?
1900
+ brandDescription String?
1901
+ materialListReference String? //Reference to the material list
1902
+
1903
+ createdAt DateTime @default(now())
1904
+ updatedAt DateTime @updatedAt
1905
+ deletedAt DateTime?
1906
+
1907
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1908
+ updatedById String?
1909
+
1910
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1911
+ networkElementId String
1912
+
1913
+ template PboFatTemplate? @relation(fields: [templateId], references: [id])
1914
+ templateId String?
1915
+
1916
+ project Project? @relation(fields: [projectId], references: [id])
1917
+ projectId String?
1918
+
1919
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
1920
+ installationId String?
1921
+
1922
+ workOrders WorkOrder[]
1923
+
1924
+ pboFatAttributes PboFatAttributes[]
1925
+ // qrCode qrCode[]
1926
+ qrCodeTag qrCodeTag[]
1927
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1928
+ clusterId String?
1929
+ // cluster relationship but static fields for centraloffice,project, main project etc
1930
+ centralOffice String?
1931
+ projectPhase String?
1932
+ mainProject String?
1933
+ client String?
1934
+ subsidiary String?
1935
+ cables Cable[]
1936
+
1937
+ node ElementNode? @relation(fields: [nodeId], references: [id])
1938
+ nodeId String?
1939
+
1940
+ dependencies PreviousEquipment[]
1941
+ Revision Revision[]
1942
+ SFU SFU[]
1943
+ Building Building[]
1944
+
1945
+ @@index([nodeId])
1946
+ @@index([clusterId])
1947
+ }
1948
+
1949
+ model PboFatAttributes {
1950
+ id String @id @unique @default(uuid())
1951
+ no Int @default(autoincrement())
1952
+ name String
1953
+ description String?
1954
+ value String?
1955
+ visibleOnMobile Boolean @default(false)
1956
+
1957
+ createdAt DateTime @default(now())
1958
+ updatedAt DateTime @updatedAt
1959
+ deletedAt DateTime?
1960
+
1961
+ cable Cable? @relation(fields: [cableId], references: [id])
1962
+ cableId String?
1963
+
1964
+ material Material? @relation(fields: [materialId], references: [id])
1965
+ materialId String?
1966
+
1967
+ pboFatTemplate PboFatTemplate? @relation(fields: [pboFatTemplateId], references: [id])
1968
+ pboFatTemplateId String?
1969
+
1970
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
1971
+ pboFatId String?
1972
+
1973
+ splitter Splitter[]
1974
+ workOrder WorkOrder[]
1975
+ }
1976
+
1977
+ model SpliceClosure {
1978
+ // TODO: Add the fields for previous/next equipment, CO and project phase
1979
+ id String @id @unique @default(uuid())
1980
+ no Int @default(autoincrement())
1981
+ name String?
1982
+ status String @default("active")
1983
+ terminalAccess Boolean @default(false)
1984
+ photos Json? //Upload files for photos
1985
+ texts Json? //Add text attributes to the PBO FAT
1986
+ files Json? //Upload files for the PBO FAT
1987
+ zone Json? //Color code for zone
1988
+ geometry Json? //Icon for the PBO FAT
1989
+ attributes Json? //Attributes for the PBO FAT
1990
+ coordinates Json?
1991
+ description String?
1992
+ autoincrement Boolean @default(true)
1993
+ namePrefix String?
1994
+ templateIndex Int?
1995
+
1996
+ asBuiltCoordinates Json? //Coordinates when installed
1997
+ isInstalled Boolean @default(false)
1998
+ installationDate DateTime?
1999
+
2000
+ isInRevision Boolean @default(false)
2001
+ installationStatus String? @default("pending") //pending, approved, in-revision
2002
+
2003
+ comments String?
2004
+
2005
+ // Reporting mirrors
2006
+ spliceClosureMaximumCapacity String? //Maximum capacity of the Splice Closure
2007
+ placeOfInstallation String? //ID to an Infrastructure element
2008
+ address String? //Address of the Splice Closure
2009
+ previousEquipmentType String? //Type of the previous equipment
2010
+ previousEquipmentId String? //ID of the previous equipment
2011
+ nextEquipmentType String? //Type of the next equipment
2012
+ nextEquipmentId String? //ID of the next equipment
2013
+ brand String?
2014
+ brandDescription String?
2015
+ materialListReference String? //Reference to the material list
2016
+
2017
+ createdAt DateTime @default(now())
2018
+ updatedAt DateTime @updatedAt
2019
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2020
+ updatedById String?
2021
+ deletedAt DateTime?
2022
+
2023
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2024
+ networkElementId String
2025
+
2026
+ project Project? @relation(fields: [projectId], references: [id])
2027
+ projectId String?
2028
+
2029
+ template SpliceClosureTemplate? @relation(fields: [templateId], references: [id])
2030
+ templateId String?
2031
+
2032
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2033
+ clusterId String?
2034
+
2035
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2036
+ nodeId String?
2037
+
2038
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2039
+ installationId String?
2040
+
2041
+ spliceClosureAttributes SpliceClosureAttributes[]
2042
+ qrCodeTag qrCodeTag[]
2043
+
2044
+ dependencies PreviousEquipment[]
2045
+ Revision Revision[]
2046
+ cables Cable[]
2047
+ }
2048
+
2049
+ model SpliceClosureTemplate {
2050
+ // TODO: Add the fields for previous/next equipment, CO and project phase
2051
+ id String @id @unique @default(uuid())
2052
+ no Int @default(autoincrement())
2053
+ name String?
2054
+ status String @default("active")
2055
+ terminalAccess Boolean @default(false)
2056
+ photos Json? //Upload files for photos
2057
+ texts Json? //Add text attributes to the PBO FAT
2058
+ files Json? //Upload files for the PBO FAT
2059
+ zone Json? //Color code for zone
2060
+ geometry Json? //Icon for the PBO FAT
2061
+ attributes Json? //Attributes for the PBO FAT
2062
+ description String?
2063
+ autoincrement Boolean @default(true)
2064
+ namePrefix String?
2065
+
2066
+ createdAt DateTime @default(now())
2067
+ updatedAt DateTime @updatedAt
2068
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2069
+ updatedById String?
2070
+ deletedAt DateTime?
2071
+
2072
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2073
+ networkElementId String
2074
+
2075
+ projects Project[]
2076
+
2077
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2078
+ clusterId String?
2079
+
2080
+ spliceClosureAttributes SpliceClosureAttributes[]
2081
+ qrCodeTemplate qrCodeTemplate[]
2082
+ SpliceClosure SpliceClosure[]
2083
+ }
2084
+
2085
+ model SpliceClosureAttributes {
2086
+ id String @id @unique @default(uuid())
2087
+ no Int @default(autoincrement())
2088
+ name String
2089
+ description String?
2090
+ value String?
2091
+
2092
+ createdAt DateTime @default(now())
2093
+ updatedAt DateTime @updatedAt
2094
+ deletedAt DateTime?
2095
+
2096
+ // cable Cable? @relation(fields: [cableId], references: [id])
2097
+ // cableId String?
2098
+
2099
+ project Project? @relation(fields: [projectId], references: [id])
2100
+ projectId String?
2101
+
2102
+ material Material? @relation(fields: [materialId], references: [id])
2103
+ materialId String?
2104
+
2105
+ spliceClosure SpliceClosure @relation(fields: [spliceClosureId], references: [id])
2106
+ spliceClosureId String
2107
+ SpliceClosureTemplate SpliceClosureTemplate? @relation(fields: [spliceClosureTemplateId], references: [id])
2108
+ spliceClosureTemplateId String?
2109
+ }
2110
+
2111
+ model ZoneNro {
2112
+ id String @id @unique @default(uuid())
2113
+ no Int @default(autoincrement())
2114
+
2115
+ status String @default("active")
2116
+ terminalAccess Boolean @default(false)
2117
+ name String?
2118
+ photos Json?
2119
+ texts Json? //Add text attributes to the zone
2120
+ files Json? //Upload files for the zone
2121
+ zone Json?
2122
+ geometry Json?
2123
+ attributes Json?
2124
+ coordinates Json?
2125
+ autoincrement Boolean @default(true)
2126
+ namePrefix String?
2127
+ templateIndex Int?
2128
+
2129
+ // Reporting mirrors
2130
+ zoneHouseCount Int? //Number of houses in the zone
2131
+
2132
+ createdAt DateTime @default(now())
2133
+ updatedAt DateTime @updatedAt
2134
+ deletedAt DateTime?
2135
+
2136
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2137
+ updatedById String?
2138
+
2139
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2140
+ networkElementId String
2141
+
2142
+ template ZoneNroTemplate? @relation(fields: [templateId], references: [id])
2143
+ templateId String?
2144
+
2145
+ project Project? @relation(fields: [projectId], references: [id])
2146
+ projectId String?
2147
+
2148
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2149
+ clusterId String?
2150
+
2151
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2152
+ nodeId String?
2153
+
2154
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2155
+ installationId String?
2156
+
2157
+ qrCodeTag qrCodeTag[]
2158
+ }
2159
+
2160
+ model ZoneNroTemplate {
2161
+ id String @id @unique @default(uuid())
2162
+ no Int @default(autoincrement())
2163
+
2164
+ status String @default("active")
2165
+ terminalAccess Boolean @default(false)
2166
+ name String?
2167
+ photos Json?
2168
+ texts Json? //Add text attributes to the zone
2169
+ files Json? //Upload files for the zone
2170
+ zone Json?
2171
+ geometry Json?
2172
+ attributes Json?
2173
+ coordinates Json?
2174
+ autoincrement Boolean @default(true)
2175
+ namePrefix String?
2176
+
2177
+ createdAt DateTime @default(now())
2178
+ updatedAt DateTime @updatedAt
2179
+ deletedAt DateTime?
2180
+
2181
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2182
+ updatedById String?
2183
+
2184
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2185
+ networkElementId String
2186
+
2187
+ projects Project[]
2188
+
2189
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2190
+ clusterId String?
2191
+ qrCodeTemplate qrCodeTemplate[]
2192
+ ZoneNro ZoneNro[]
2193
+ }
2194
+
2195
+ model Pole {
2196
+ id String @id @unique @default(uuid())
2197
+ no Int @default(autoincrement())
2198
+
2199
+ status String @default("active")
2200
+ terminalAccess Boolean @default(false)
2201
+ name String?
2202
+ photos Json?
2203
+ texts Json? //Add text attributes to the pole
2204
+ files Json? //Upload files for the pole
2205
+ zone Json?
2206
+ geometry Json?
2207
+ attributes Json?
2208
+ coordinates Json?
2209
+ autoincrement Boolean @default(true)
2210
+ namePrefix String?
2211
+ templateIndex Int?
2212
+
2213
+ asBuiltCoordinates Json? //Coordinates when installed
2214
+ isInstalled Boolean @default(false)
2215
+ installationDate DateTime?
2216
+
2217
+ address String? //Address of the pole
2218
+ material String? //Material of the pole
2219
+ height Float? //Height of the pole in meters
2220
+ topDiameter Float? //Top diameter of the pole in meters
2221
+ bottomDiameter Float? //Bottom diameter of the pole in meters
2222
+ downGuy Boolean @default(false) //Does the pole have a down guy?
2223
+ brand String? //Brand of the pole
2224
+ brandDescription String? //Description of the brand
2225
+ materialListReference String? //Reference to the material list
2226
+
2227
+ comments String?
2228
+
2229
+ isInRevision Boolean @default(false)
2230
+ installationStatus String? @default("pending") //pending, approved, in-revision
2231
+
2232
+ createdAt DateTime @default(now())
2233
+ updatedAt DateTime @updatedAt
2234
+ deletedAt DateTime?
2235
+
2236
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2237
+ updatedById String?
2238
+
2239
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2240
+ networkElementId String
2241
+
2242
+ template PoleTemplate? @relation(fields: [templateId], references: [id])
2243
+ templateId String?
2244
+
2245
+ project Project? @relation(fields: [projectId], references: [id])
2246
+ projectId String?
2247
+
2248
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2249
+ clusterId String?
2250
+
2251
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2252
+ nodeId String?
2253
+
2254
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2255
+ installationId String?
2256
+
2257
+ qrCodeTag qrCodeTag[]
2258
+ Revision Revision[]
2259
+ }
2260
+
2261
+ model PoleTemplate {
2262
+ id String @id @unique @default(uuid())
2263
+ no Int @default(autoincrement())
2264
+
2265
+ status String @default("active")
2266
+ terminalAccess Boolean @default(false)
2267
+ name String?
2268
+ photos Json?
2269
+ texts Json? //Add text attributes to the pole
2270
+ files Json? //Upload files for the pole
2271
+ zone Json?
2272
+ geometry Json?
2273
+ attributes Json?
2274
+ autoincrement Boolean @default(true)
2275
+ namePrefix String?
2276
+
2277
+ createdAt DateTime @default(now())
2278
+ updatedAt DateTime @updatedAt
2279
+ deletedAt DateTime?
2280
+
2281
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2282
+ updatedById String?
2283
+
2284
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2285
+ networkElementId String
2286
+
2287
+ projects Project[]
2288
+
2289
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2290
+ clusterId String?
2291
+ qrCodeTemplate qrCodeTemplate[]
2292
+ Pole Pole[]
2293
+ }
2294
+
2295
+ model Manhole {
2296
+ id String @id @unique @default(uuid())
2297
+ no Int @default(autoincrement())
2298
+
2299
+ status String @default("active")
2300
+ terminalAccess Boolean @default(false)
2301
+ name String?
2302
+ photos Json?
2303
+ texts Json? //Add text attributes to the manhole
2304
+ files Json? //Upload files for the manhole
2305
+ zone Json?
2306
+ geometry Json?
2307
+ attributes Json?
2308
+ coordinates Json?
2309
+ autoincrement Boolean @default(true)
2310
+ namePrefix String?
2311
+ templateIndex Int?
2312
+
2313
+ asBuiltCoordinates Json? //Coordinates when installed
2314
+ isInstalled Boolean @default(false)
2315
+ installationDate DateTime?
2316
+
2317
+ address String? //Address of the manhole
2318
+ material String? //Material of the manhole
2319
+ dimension String? //Dimension of the manhole
2320
+ coverType String? //Type of the cover
2321
+ brand String? //Brand of the manhole
2322
+ brandDescription String? //Description of the brand
2323
+ materialListReference String? //Reference to the material list
2324
+
2325
+ comments String?
2326
+
2327
+ isInRevision Boolean @default(false)
2328
+ installationStatus String? @default("pending") //pending, approved, in-revision
2329
+
2330
+ createdAt DateTime @default(now())
2331
+ updatedAt DateTime @updatedAt
2332
+ deletedAt DateTime?
2333
+
2334
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2335
+ updatedById String?
2336
+
2337
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2338
+ networkElementId String
2339
+
2340
+ template ManholeTemplate? @relation(fields: [templateId], references: [id])
2341
+ templateId String?
2342
+
2343
+ project Project? @relation(fields: [projectId], references: [id])
2344
+ projectId String?
2345
+
2346
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2347
+ clusterId String?
2348
+
2349
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2350
+ nodeId String?
2351
+
2352
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2353
+ installationId String?
2354
+
2355
+ qrCodeTag qrCodeTag[]
2356
+ Revision Revision[]
2357
+ }
2358
+
2359
+ model ManholeTemplate {
2360
+ id String @id @unique @default(uuid())
2361
+ no Int @default(autoincrement())
2362
+
2363
+ status String @default("active")
2364
+ terminalAccess Boolean @default(false)
2365
+ name String?
2366
+ photos Json?
2367
+ texts Json? //Add text attributes to the manhole
2368
+ files Json? //Upload files for the manhole
2369
+ zone Json?
2370
+ geometry Json?
2371
+ attributes Json?
2372
+ autoincrement Boolean @default(true)
2373
+ namePrefix String?
2374
+
2375
+ createdAt DateTime @default(now())
2376
+ updatedAt DateTime @updatedAt
2377
+ deletedAt DateTime?
2378
+
2379
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2380
+ updatedById String?
2381
+
2382
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2383
+ networkElementId String
2384
+
2385
+ projects Project[]
2386
+
2387
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2388
+ clusterId String?
2389
+ qrCodeTemplate qrCodeTemplate[]
2390
+ Manhole Manhole[]
2391
+ }
2392
+
2393
+ model Loop {
2394
+ id String @id @unique @default(uuid())
2395
+ no Int @default(autoincrement())
2396
+
2397
+ status String @default("active")
2398
+ terminalAccess Boolean @default(false)
2399
+ name String?
2400
+ photos Json?
2401
+ texts Json? //Add text attributes to the loop
2402
+ files Json? //Upload files for the loop
2403
+ zone Json?
2404
+ geometry Json?
2405
+ attributes Json?
2406
+ coordinates Json?
2407
+ autoincrement Boolean @default(true)
2408
+ namePrefix String?
2409
+ templateIndex Int?
2410
+
2411
+ asBuiltCoordinates Json? //Coordinates when installed
2412
+ isInstalled Boolean @default(false)
2413
+ installationDate DateTime?
2414
+
2415
+ length Float? //Length of the loop in meters
2416
+ brand String? //Brand of the loop
2417
+ brandDescription String? //Description of the brand
2418
+ materialListReference String? //Reference to the material list
2419
+
2420
+ comments String?
2421
+
2422
+ isInRevision Boolean @default(false)
2423
+ installationStatus String? @default("pending") //pending, approved, in-revision
2424
+
2425
+ createdAt DateTime @default(now())
2426
+ updatedAt DateTime @updatedAt
2427
+ deletedAt DateTime?
2428
+
2429
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2430
+ updatedById String?
2431
+
2432
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2433
+ networkElementId String
2434
+
2435
+ template LoopTemplate? @relation(fields: [templateId], references: [id])
2436
+ templateId String?
2437
+
2438
+ project Project? @relation(fields: [projectId], references: [id])
2439
+ projectId String?
2440
+
2441
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2442
+ clusterId String?
2443
+
2444
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2445
+ nodeId String?
2446
+
2447
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2448
+ installationId String?
2449
+
2450
+ cable Cable? @relation(fields: [cableId], references: [id])
2451
+ cableId String?
2452
+
2453
+ qrCodeTag qrCodeTag[]
2454
+ Revision Revision[]
2455
+ }
2456
+
2457
+ model LoopTemplate {
2458
+ id String @id @unique @default(uuid())
2459
+ no Int @default(autoincrement())
2460
+
2461
+ status String @default("active")
2462
+ terminalAccess Boolean @default(false)
2463
+ name String?
2464
+ photos Json?
2465
+ texts Json? //Add text attributes to the loop
2466
+ files Json? //Upload files for the loop
2467
+ zone Json?
2468
+ geometry Json?
2469
+ attributes Json?
2470
+ autoincrement Boolean @default(true)
2471
+ namePrefix String?
2472
+
2473
+ createdAt DateTime @default(now())
2474
+ updatedAt DateTime @updatedAt
2475
+ deletedAt DateTime?
2476
+
2477
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2478
+ updatedById String?
2479
+
2480
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2481
+ networkElementId String
2482
+
2483
+ projects Project[]
2484
+
2485
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2486
+ clusterId String?
2487
+ qrCodeTemplate qrCodeTemplate[]
2488
+ Loop Loop[]
2489
+ }
2490
+
2491
+ model FDTSRO {
2492
+ id String @id @unique @default(uuid())
2493
+ no Int @default(autoincrement())
2494
+
2495
+ status String @default("active")
2496
+ terminalAccess Boolean @default(false)
2497
+ name String?
2498
+ photos Json?
2499
+ texts Json? //Add text attributes to the FDTSRO
2500
+ files Json? //Upload files for the FDTSRO
2501
+ zone Json?
2502
+ geometry Json?
2503
+ attributes Json?
2504
+ coordinates Json?
2505
+ autoincrement Boolean @default(true)
2506
+ namePrefix String?
2507
+ templateIndex Int?
2508
+
2509
+ asBuiltCoordinates Json? //Coordinates when installed
2510
+ isInstalled Boolean @default(false)
2511
+ installationDate DateTime?
2512
+
2513
+ comments String?
2514
+
2515
+ isInRevision Boolean @default(false)
2516
+ installationStatus String? @default("pending") //pending, approved, in-revision
2517
+
2518
+ // Reporting mirrors
2519
+ maximumCapacity Int? //Maximum capacity of the FDTSRO
2520
+ typeOfEnclosure String? //Type of the enclosure
2521
+ placeOfInstallation String? //ID to an Infrastructure element
2522
+ address String? //Address of the FDTSRO
2523
+ previousEquipmentType String? //Type of the previous equipment
2524
+ previousEquipmentId String? //ID of the previous equipment
2525
+ nextEquipmentType String? //Type of the next equipment
2526
+ nextEquipmentId String? //ID of the next equipment
2527
+ splitter1 String? //1:2, 1:4, 1:8 etc
2528
+ brand String?
2529
+ brandDescription String? //Description of the brand
2530
+ materialListReference String? //Reference to the material list
2531
+
2532
+ createdAt DateTime @default(now())
2533
+ updatedAt DateTime @updatedAt
2534
+ deletedAt DateTime?
2535
+
2536
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2537
+ updatedById String?
2538
+
2539
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2540
+ networkElementId String
2541
+
2542
+ template FDTSROTemplate? @relation(fields: [templateId], references: [id])
2543
+ templateId String?
2544
+
2545
+ project Project? @relation(fields: [projectId], references: [id])
2546
+ projectId String?
2547
+
2548
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2549
+ clusterId String?
2550
+
2551
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2552
+ nodeId String?
2553
+
2554
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2555
+ installationId String?
2556
+
2557
+ qrCodeTag qrCodeTag[]
2558
+ PreviousEquipment PreviousEquipment[]
2559
+ Revision Revision[]
2560
+ cables Cable[]
2561
+ }
2562
+
2563
+ model FDTSROTemplate {
2564
+ id String @id @unique @default(uuid())
2565
+ no Int @default(autoincrement())
2566
+
2567
+ status String @default("active")
2568
+ terminalAccess Boolean @default(false)
2569
+ name String?
2570
+ photos Json?
2571
+ texts Json? //Add text attributes to the FDTSRO
2572
+ files Json? //Upload files for the FDTSRO
2573
+ zone Json?
2574
+ geometry Json?
2575
+ attributes Json?
2576
+ autoincrement Boolean @default(true)
2577
+ namePrefix String?
2578
+
2579
+ createdAt DateTime @default(now())
2580
+ updatedAt DateTime @updatedAt
2581
+ deletedAt DateTime?
2582
+
2583
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2584
+ updatedById String?
2585
+
2586
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2587
+ networkElementId String
2588
+
2589
+ projects Project[]
2590
+
2591
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2592
+ clusterId String?
2593
+ qrCodeTemplate qrCodeTemplate[]
2594
+ FDTSRO FDTSRO[]
2595
+ }
2596
+
2597
+ model SFU {
2598
+ id String @id @unique @default(uuid())
2599
+ no Int @default(autoincrement())
2600
+
2601
+ status String @default("active")
2602
+ terminalAccess Boolean @default(false)
2603
+ name String?
2604
+ photos Json?
2605
+ texts Json? //Add text attributes to the SFU
2606
+ files Json? //Upload files for the SFU
2607
+ zone Json?
2608
+ geometry Json?
2609
+ attributes Json?
2610
+ coordinates Json?
2611
+ autoincrement Boolean @default(true)
2612
+ namePrefix String?
2613
+ templateIndex Int?
2614
+
2615
+ asBuiltCoordinates Json? //Coordinates when installed
2616
+ isInstalled Boolean @default(false)
2617
+ installationDate DateTime?
2618
+
2619
+ address String? //Address of the SFU
2620
+ linkToDispatch String? //Link to the dispatch system
2621
+ macAddress String? //MAC address of the Router in the SFU
2622
+ gponAddress String? //GPON address of the SFU
2623
+
2624
+ isInRevision Boolean @default(false)
2625
+ installationStatus String? @default("pending") //pending, approved, in-revision
2626
+
2627
+ comments String?
2628
+
2629
+ createdAt DateTime @default(now())
2630
+ updatedAt DateTime @updatedAt
2631
+ deletedAt DateTime?
2632
+
2633
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2634
+ updatedById String?
2635
+
2636
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2637
+ networkElementId String
2638
+
2639
+ template SFUTemplate? @relation(fields: [templateId], references: [id])
2640
+ templateId String?
2641
+
2642
+ project Project? @relation(fields: [projectId], references: [id])
2643
+ projectId String?
2644
+
2645
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2646
+ clusterId String?
2647
+
2648
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2649
+ nodeId String?
2650
+
2651
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2652
+ installationId String?
2653
+
2654
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
2655
+ pboFatId String?
2656
+
2657
+ qrCodeTag qrCodeTag[]
2658
+ workOrders WorkOrder[]
2659
+ Revision Revision[]
2660
+ Building Building? @relation(fields: [buildingId], references: [id])
2661
+ buildingId String?
2662
+ }
2663
+
2664
+ model SFUTemplate {
2665
+ id String @id @unique @default(uuid())
2666
+ no Int @default(autoincrement())
2667
+
2668
+ status String @default("active")
2669
+ terminalAccess Boolean @default(false)
2670
+ name String?
2671
+ photos Json?
2672
+ texts Json? //Add text attributes to the SFU
2673
+ files Json? //Upload files for the SFU
2674
+ zone Json?
2675
+ geometry Json?
2676
+ attributes Json?
2677
+ autoincrement Boolean @default(true)
2678
+ namePrefix String?
2679
+
2680
+ createdAt DateTime @default(now())
2681
+ updatedAt DateTime @updatedAt
2682
+ deletedAt DateTime?
2683
+
2684
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2685
+ updatedById String?
2686
+
2687
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2688
+ networkElementId String
2689
+
2690
+ projects Project[]
2691
+
2692
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2693
+ clusterId String?
2694
+ qrCodeTemplate qrCodeTemplate[]
2695
+ SFU SFU[]
2696
+ }
2697
+
2698
+ model Building {
2699
+ id String @id @unique @default(uuid())
2700
+ no Int @default(autoincrement())
2701
+
2702
+ status String @default("active")
2703
+ terminalAccess Boolean @default(false)
2704
+ name String?
2705
+ photos Json?
2706
+ texts Json? //Add text attributes to the building
2707
+ files Json? //Upload files for the building
2708
+ zone Json?
2709
+ geometry Json?
2710
+ attributes Json?
2711
+ coordinates Json?
2712
+ autoincrement Boolean @default(true)
2713
+ namePrefix String?
2714
+ templateIndex Int?
2715
+
2716
+ asBuiltCoordinates Json? //Coordinates when installed
2717
+ isInstalled Boolean @default(false)
2718
+ installationDate DateTime?
2719
+
2720
+ comments String?
2721
+
2722
+ isInRevision Boolean @default(false)
2723
+ installationStatus String? @default("pending") //pending, approved, in-revision
2724
+
2725
+ // Reporting mirrors
2726
+ address String? //Address of the building
2727
+ buildingName String? //Name of the building
2728
+ totalFlats Int? //Total number of flats in the building
2729
+ floorCount Int? //Number of floors in the building
2730
+ flatsPerFloor Int? //Number of flats per floor
2731
+ managerName String? //Name of the building manager
2732
+ managerPhone String? //Phone number of the building manager
2733
+
2734
+ createdAt DateTime @default(now())
2735
+ updatedAt DateTime @updatedAt
2736
+ deletedAt DateTime?
2737
+
2738
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2739
+ updatedById String?
2740
+
2741
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2742
+ networkElementId String
2743
+
2744
+ template BuildingTemplate? @relation(fields: [templateId], references: [id])
2745
+ templateId String?
2746
+
2747
+ project Project? @relation(fields: [projectId], references: [id])
2748
+ projectId String?
2749
+
2750
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2751
+ clusterId String?
2752
+
2753
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2754
+ nodeId String?
2755
+
2756
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2757
+ installationId String?
2758
+
2759
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
2760
+ pboFatId String?
2761
+
2762
+ sfu SFU[]
2763
+ qrCodeTag qrCodeTag[]
2764
+ workOrders WorkOrder[]
2765
+ Revision Revision[]
2766
+ }
2767
+
2768
+ model BuildingTemplate {
2769
+ id String @id @unique @default(uuid())
2770
+ no Int @default(autoincrement())
2771
+
2772
+ status String @default("active")
2773
+ terminalAccess Boolean @default(false)
2774
+ name String?
2775
+ photos Json?
2776
+ texts Json? //Add text attributes to the building
2777
+ files Json? //Upload files for the building
2778
+ zone Json?
2779
+ geometry Json?
2780
+ attributes Json?
2781
+ autoincrement Boolean @default(true)
2782
+ namePrefix String?
2783
+
2784
+ createdAt DateTime @default(now())
2785
+ updatedAt DateTime @updatedAt
2786
+ deletedAt DateTime?
2787
+
2788
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2789
+ updatedById String?
2790
+
2791
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2792
+ networkElementId String
2793
+
2794
+ projects Project[]
2795
+
2796
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2797
+ clusterId String?
2798
+ qrCodeTemplate qrCodeTemplate[]
2799
+ Building Building[]
2800
+ }
2801
+
2802
+ model Revision {
2803
+ id String @id @unique @default(uuid())
2804
+
2805
+ pboFatId String?
2806
+ spliceClosureId String?
2807
+ manholeId String?
2808
+ loopId String?
2809
+ fdtsroId String?
2810
+ sfuId String?
2811
+ buildingId String?
2812
+ cableId String?
2813
+ poleId String?
2814
+
2815
+ title String
2816
+ comment String
2817
+ status RevisionStatus @default(IN_PROGRESS)
2818
+ priority Int @default(1)
2819
+
2820
+ createdById String?
2821
+ resolvedById String?
2822
+
2823
+ clusterId String?
2824
+
2825
+ createdAt DateTime @default(now())
2826
+ updatedAt DateTime @updatedAt
2827
+ resolvedAt DateTime?
2828
+
2829
+ clientRevisionId String? // ID of the revision from the client side
2830
+
2831
+ resolutionNotes String?
2832
+
2833
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
2834
+ spliceClosure SpliceClosure? @relation(fields: [spliceClosureId], references: [id])
2835
+ manhole Manhole? @relation(fields: [manholeId], references: [id])
2836
+ loop Loop? @relation(fields: [loopId], references: [id])
2837
+ fdtsro FDTSRO? @relation(fields: [fdtsroId], references: [id])
2838
+ sfu SFU? @relation(fields: [sfuId], references: [id])
2839
+ building Building? @relation(fields: [buildingId], references: [id])
2840
+ cable Cable? @relation(fields: [cableId], references: [id])
2841
+ pole Pole? @relation(fields: [poleId], references: [id])
2842
+
2843
+ createdBy User? @relation("revisionCreatedBy", fields: [createdById], references: [id])
2844
+ resolvedBy User? @relation("revisionResolvedBy", fields: [resolvedById], references: [id])
2845
+
2846
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2847
+ }
2848
+
2849
+ model MapElementTemplate {
2850
+ id String @id @unique @default(uuid())
2851
+ no Int @default(autoincrement())
2852
+
2853
+ status String @default("active")
2854
+ name String?
2855
+ photos Json? //Upload files for photos
2856
+ texts Json? //Add text attributes to the map element
2857
+ files Json? //Upload files for the map element
2858
+ zone Json? //Color code for zone
2859
+ geometry Json? //Icon for the map element
2860
+
2861
+ mapElementType MapElementType @default(Marker)
2862
+
2863
+ createdAt DateTime @default(now())
2864
+ updatedAt DateTime @updatedAt
2865
+ deletedAt DateTime?
2866
+
2867
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2868
+ updatedById String?
2869
+
2870
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2871
+ networkElementId String
2872
+
2873
+ projects Project[]
2874
+
2875
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2876
+ clusterId String?
2877
+ qrCodeTemplate qrCodeTemplate[]
2878
+ MapElement MapElement[]
2879
+ }
2880
+
2881
+ model MapElement {
2882
+ id String @id @unique @default(uuid())
2883
+ no Int @default(autoincrement())
2884
+
2885
+ status String @default("active")
2886
+ name String?
2887
+ photos Json? //Upload files for photos
2888
+ texts Json? //Add text attributes to the map element
2889
+ files Json? //Upload files for the map element
2890
+ zone Json? //Color code for zone
2891
+ geometry Json? //Icon for the map element
2892
+ coordinates Json?
2893
+ autoincrement Boolean @default(true)
2894
+ namePrefix String?
2895
+ templateIndex Int?
2896
+
2897
+ mapElementType MapElementType @default(Marker)
2898
+
2899
+ createdAt DateTime @default(now())
2900
+ updatedAt DateTime @updatedAt
2901
+ deletedAt DateTime?
2902
+
2903
+ updatedBy User? @relation(fields: [updatedById], references: [id])
2904
+ updatedById String?
2905
+
2906
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
2907
+ networkElementId String
2908
+
2909
+ template MapElementTemplate? @relation(fields: [templateId], references: [id])
2910
+ templateId String?
2911
+
2912
+ project Project? @relation(fields: [projectId], references: [id])
2913
+ projectId String?
2914
+
2915
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2916
+ clusterId String?
2917
+
2918
+ node ElementNode? @relation(fields: [nodeId], references: [id])
2919
+ nodeId String?
2920
+
2921
+ qrCodeTag qrCodeTag[]
2922
+ }
2923
+
2924
+ model NetworkElementInstallation {
2925
+ id String @id @unique @default(uuid())
2926
+ no Int @default(autoincrement())
2927
+
2928
+ createdAt DateTime @default(now())
2929
+ updatedAt DateTime @updatedAt
2930
+
2931
+ networkElementId String?
2932
+ previousType String?
2933
+ previousName String?
2934
+ previousId String?
2935
+ nextType String?
2936
+ nextName String?
2937
+ nextId String?
2938
+ Cable Cable[]
2939
+ PboFat PboFat[]
2940
+ SpliceClosure SpliceClosure[]
2941
+ ZoneNro ZoneNro[]
2942
+ Pole Pole[]
2943
+ Manhole Manhole[]
2944
+ Loop Loop[]
2945
+ FDTSRO FDTSRO[]
2946
+ SFU SFU[]
2947
+ Building Building[]
2948
+ Conduit Conduit[]
2949
+ }
2950
+
2951
+ model CentralOffice {
2952
+ id String @id @unique @default(uuid())
2953
+ no Int @default(autoincrement())
2954
+ name String
2955
+
2956
+ createdAt DateTime @default(now())
2957
+ updatedAt DateTime @updatedAt
2958
+ deletedAt DateTime?
2959
+
2960
+ project Project? @relation(fields: [projectId], references: [id])
2961
+ projectId String?
2962
+
2963
+ users User[]
2964
+ Cluster Cluster[]
2965
+ CentralOfficeTeam CentralOfficeTeam[]
2966
+ }
2967
+
2968
+ model Cluster {
2969
+ id String @id @unique @default(uuid())
2970
+ no Int @default(autoincrement())
2971
+ name String
2972
+ coordinates Json?
2973
+ color String?
2974
+
2975
+ createdAt DateTime @default(now())
2976
+ updatedAt DateTime @updatedAt
2977
+ deletedAt DateTime?
2978
+
2979
+ projectPhase ClusterProjectPhase @default(Survey)
2980
+ surveyProjectStatus String @default("Pending")
2981
+ designProjectStatus String @default("Pending")
2982
+ constructionProjectStatus String @default("Pending")
2983
+ gisProjectStatus String @default("Pending")
2984
+ dispatchProjectStatus String @default("Pending")
2985
+ namingConvention Json?
2986
+ installationStatus Int? @default(0) //percentage of installation completed
2987
+
2988
+ centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
2989
+ centralOfficeId String?
2990
+
2991
+ users User[]
2992
+ ZoneNro ZoneNro[]
2993
+ Pole Pole[]
2994
+ Manhole Manhole[]
2995
+ Loop Loop[]
2996
+ FDTSRO FDTSRO[]
2997
+ SFU SFU[]
2998
+ Building Building[]
2999
+ Cable Cable[]
3000
+ PboFat PboFat[]
3001
+ SpliceClosure SpliceClosure[]
3002
+ CableTemplate CableTemplate[]
3003
+ PboFatTemplate PboFatTemplate[]
3004
+ SpliceClosureTemplate SpliceClosureTemplate[]
3005
+ ZoneNroTemplate ZoneNroTemplate[]
3006
+ PoleTemplate PoleTemplate[]
3007
+ ManholeTemplate ManholeTemplate[]
3008
+ LoopTemplate LoopTemplate[]
3009
+ FDTSROTemplate FDTSROTemplate[]
3010
+ SFUTemplate SFUTemplate[]
3011
+ BuildingTemplate BuildingTemplate[]
3012
+ usersOnline integrationProjectUserStatus[]
3013
+ qrCodeTemplate qrCodeTemplate[]
3014
+ integrationUserLocation integrationUserLocation[]
3015
+ MapElementTemplate MapElementTemplate[]
3016
+ MapElement MapElement[]
3017
+ ClusterComments ClusterComments[]
3018
+ Revision Revision[]
3019
+ ElementRelation ElementRelation[]
3020
+ ClusterNotes ClusterNotes[]
3021
+ Conduit Conduit[]
3022
+ ConduitTemplate ConduitTemplate[]
3023
+ }
3024
+
3025
+ model ClusterComments {
3026
+ id String @id @unique @default(uuid())
3027
+ no Int @default(autoincrement())
3028
+
3029
+ comment String
3030
+ type String @default("General")
3031
+ createdAt DateTime @default(now())
3032
+ updatedAt DateTime @updatedAt
3033
+ deletedAt DateTime?
3034
+
3035
+ user User @relation(fields: [userId], references: [id])
3036
+ userId String
3037
+
3038
+ cluster Cluster @relation(fields: [clusterId], references: [id])
3039
+ clusterId String
3040
+ }
3041
+
3042
+ model ClusterNotes {
3043
+ id String @id @unique @default(uuid())
3044
+ no Int @default(autoincrement())
3045
+
3046
+ comment String
3047
+ hasPicture Boolean @default(false)
3048
+ coordinates Json?
3049
+ picture String?
3050
+
3051
+ createdAt DateTime @default(now())
3052
+ updatedAt DateTime @updatedAt
3053
+
3054
+ createdBy User @relation(fields: [createdById], references: [id])
3055
+ createdById String
3056
+
3057
+ cluster Cluster @relation(fields: [clusterId], references: [id])
3058
+ clusterId String
3059
+ }
3060
+
3061
+ model CentralOfficeTeam {
3062
+ id String @id @unique @default(uuid())
3063
+ no Int @default(autoincrement())
3064
+ name String
3065
+
3066
+ createdAt DateTime @default(now())
3067
+ updatedAt DateTime @updatedAt
3068
+ deletedAt DateTime?
3069
+
3070
+ centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
3071
+ centralOfficeId String?
3072
+ users CentralOfficeUser[]
3073
+ }
3074
+
3075
+ model CentralOfficeUser {
3076
+ id String @id @unique @default(uuid())
3077
+ no Int @default(autoincrement())
3078
+ role CentralOfficeTeamPosition @default(Technician)
3079
+
3080
+ createdAt DateTime @default(now())
3081
+ updatedAt DateTime @updatedAt
3082
+ deletedAt DateTime?
3083
+
3084
+ centralOfficeTeam CentralOfficeTeam? @relation(fields: [centralOfficeTeamId], references: [id])
3085
+ centralOfficeTeamId String?
3086
+
3087
+ user User @relation(fields: [userId], references: [id])
3088
+ userId String
3089
+ }
3090
+
3091
+ model qrCodeTemplate {
3092
+ id String @id @unique @default(uuid())
3093
+ no Int @default(autoincrement())
3094
+ name String
3095
+ prefix String
3096
+ index Int //number of qr code generated
3097
+ scanned Int @default(0)
3098
+ link String? @unique //where the qr code will redirect to
3099
+ tagDetails Json?
3100
+ status String @default("active")
3101
+
3102
+ createdAt DateTime @default(now())
3103
+ updatedAt DateTime @updatedAt
3104
+ deletedAt DateTime?
3105
+
3106
+ project Project? @relation(fields: [projectId], references: [id])
3107
+ projectId String?
3108
+
3109
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
3110
+ clusterId String?
3111
+
3112
+ // one to many relation with network element
3113
+ networkElement NetworkElement? @relation(fields: [networkElementTypeId], references: [id])
3114
+ networkElementTypeId String?
3115
+
3116
+ networkElementId String?
3117
+ templateId String?
3118
+
3119
+ pboFatTemplate PboFatTemplate? @relation(fields: [pboFatTemplateId], references: [id])
3120
+ pboFatTemplateId String?
3121
+
3122
+ cableTemplate CableTemplate? @relation(fields: [cableTemplateId], references: [id])
3123
+ cableTemplateId String?
3124
+
3125
+ spliceClosureTemplate SpliceClosureTemplate? @relation(fields: [spliceClosureTemplateId], references: [id])
3126
+ spliceClosureTemplateId String?
3127
+
3128
+ zoneNroTemplate ZoneNroTemplate? @relation(fields: [zoneNroTemplateId], references: [id])
3129
+ zoneNroTemplateId String?
3130
+
3131
+ poleTemplate PoleTemplate? @relation(fields: [poleTemplateId], references: [id])
3132
+ poleTemplateId String?
3133
+
3134
+ manholeTemplate ManholeTemplate? @relation(fields: [manholeTemplateId], references: [id])
3135
+ manholeTemplateId String?
3136
+
3137
+ loopTemplate LoopTemplate? @relation(fields: [loopTemplateId], references: [id])
3138
+ loopTemplateId String?
3139
+
3140
+ fdtsroTemplate FDTSROTemplate? @relation(fields: [fdtsroTemplateId], references: [id])
3141
+ fdtsroTemplateId String?
3142
+
3143
+ sfuTemplate SFUTemplate? @relation(fields: [sfuTemplateId], references: [id])
3144
+ sfuTemplateId String?
3145
+
3146
+ buildingTemplate BuildingTemplate? @relation(fields: [buildingTemplateId], references: [id])
3147
+ buildingTemplateId String?
3148
+
3149
+ // cable Cable? @relation(fields: [networkElementId], references: [id])
3150
+ // pboFat PboFat? @relation(fields: [networkElementId], references: [id])
3151
+ qrCodeTag qrCodeTag[]
3152
+ MapElementTemplate MapElementTemplate? @relation(fields: [mapElementTemplateId], references: [id])
3153
+ mapElementTemplateId String?
3154
+
3155
+ conduitTemplate ConduitTemplate? @relation(fields: [conduitTemplateId], references: [id])
3156
+ conduitTemplateId String?
3157
+ }
3158
+
3159
+ model qrCodeTag {
3160
+ id String @id @unique @default(uuid())
3161
+ no Int @default(autoincrement())
3162
+
3163
+ image String? @db.Text //Upload file for logo
3164
+ link String? @unique //where the qr code will redirect to
3165
+ scanned Boolean @default(false)
3166
+
3167
+ createdAt DateTime @default(now())
3168
+ updatedAt DateTime @updatedAt
3169
+ deletedAt DateTime?
3170
+
3171
+ templateId String?
3172
+ networkElementId String?
3173
+
3174
+ qrCode qrCodeTemplate @relation(fields: [qrCodeTemplateId], references: [id])
3175
+ qrCodeTemplateId String
3176
+
3177
+ cable Cable? @relation(fields: [cableId], references: [id])
3178
+ cableId String?
3179
+
3180
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
3181
+ pboFatId String?
3182
+
3183
+ spliceClosure SpliceClosure? @relation(fields: [spliceClosureId], references: [id])
3184
+ spliceClosureId String?
3185
+
3186
+ zoneNro ZoneNro? @relation(fields: [zoneNroId], references: [id])
3187
+ zoneNroId String?
3188
+
3189
+ pole Pole? @relation(fields: [poleId], references: [id])
3190
+ poleId String?
3191
+
3192
+ manhole Manhole? @relation(fields: [manholeId], references: [id])
3193
+ manholeId String?
3194
+
3195
+ loop Loop? @relation(fields: [loopId], references: [id])
3196
+ loopId String?
3197
+
3198
+ fdtsro FDTSRO? @relation(fields: [fdtsroId], references: [id])
3199
+ fdtsroId String?
3200
+
3201
+ sfu SFU? @relation(fields: [sfuId], references: [id])
3202
+ sfuId String?
3203
+
3204
+ building Building? @relation(fields: [buildingId], references: [id])
3205
+ buildingId String?
3206
+ MapElement MapElement? @relation(fields: [mapElementId], references: [id])
3207
+ mapElementId String?
3208
+
3209
+ conduit Conduit? @relation(fields: [conduitId], references: [id])
3210
+ conduitId String?
3211
+ }
3212
+
3213
+ model installationSequence {
3214
+ id String @id @unique @default(uuid())
3215
+ no Int @default(autoincrement())
3216
+ installationId String?
3217
+ sequenceOrder Int
3218
+ elementChildType NetworkElementChildType
3219
+ elementChildId String
3220
+ previousInstallationSeqId String?
3221
+
3222
+ createdAt DateTime @default(now())
3223
+ updatedAt DateTime @updatedAt
3224
+
3225
+ parent installationSequence? @relation("ChildToParent", fields: [previousInstallationSeqId], references: [id])
3226
+ children installationSequence[] @relation("ChildToParent")
3227
+ }
3228
+
3229
+ model PreviousEquipment {
3230
+ id String @id @unique @default(uuid())
3231
+ no Int @default(autoincrement())
3232
+ fromTable EquipmentType
3233
+ fromId String
3234
+ toTable EquipmentType
3235
+ toId String
3236
+ PboFat PboFat? @relation(fields: [pboFatId], references: [id])
3237
+ pboFatId String?
3238
+ SpliceClosure SpliceClosure? @relation(fields: [spliceClosureId], references: [id])
3239
+ spliceClosureId String?
3240
+ FDTSRO FDTSRO? @relation(fields: [fdtsroId], references: [id])
3241
+ fdtsroId String?
3242
+
3243
+ @@unique([fromTable, fromId, toTable, toId])
3244
+ }
3245
+
3246
+ model integrationUserLocation {
3247
+ id String @id @unique @default(uuid())
3248
+ no Int @default(autoincrement())
3249
+
3250
+ User User @relation(fields: [userId], references: [id])
3251
+ userId String
3252
+
3253
+ coordinates Json
3254
+
3255
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
3256
+ clusterId String?
3257
+
3258
+ isActive Boolean @default(true)
3259
+
3260
+ createdAt DateTime @default(now())
3261
+ updatedAt DateTime @updatedAt
3262
+ deletedAt DateTime?
3263
+ }
3264
+
3265
+ model IntegrationReportTemplate {
3266
+ id String @id @unique @default(uuid())
3267
+ no Int @default(autoincrement())
3268
+ name String
3269
+
3270
+ createdAt DateTime @default(now())
3271
+ updatedAt DateTime @updatedAt
3272
+ deletedAt DateTime?
3273
+
3274
+ createdBy User? @relation(fields: [createdById], references: [id])
3275
+ createdById String?
3276
+
3277
+ metrics ReportMetric[]
3278
+ visualizations ReportVisualization[]
3279
+ ReportTable ReportTable[]
3280
+ }
3281
+
3282
+ model ReportMetric {
3283
+ id String @id @unique @default(uuid())
3284
+
3285
+ reportTemplate IntegrationReportTemplate @relation(fields: [reportTemplateId], references: [id])
3286
+ reportTemplateId String
3287
+
3288
+ elementType NetworkElementChildType?
3289
+ attributeName String //Name of the attribute to be reported
3290
+
3291
+ metricType MetricType?
3292
+
3293
+ // Aggregation across records
3294
+ formula AggregationOperation?
3295
+ groupByLevel ProjectLevel?
3296
+
3297
+ // Formula configuration
3298
+ formulaConfig ReportFormulaConfig?
3299
+
3300
+ // Usage Classification
3301
+ usage ReportUsage[] @default([TABLE])
3302
+
3303
+ ReportTable ReportTable[]
3304
+ }
3305
+
3306
+ model ReportFormulaConfig {
3307
+ metricId String @id
3308
+ metric ReportMetric @relation(fields: [metricId], references: [id])
3309
+
3310
+ resultName String //Name of the result to be reported
3311
+ numberOfVariables Int //Number of variables in the formula
3312
+ variableAttributes Json //e.g {"variable1": "Client Name", "variable2": "Fat Available Capacity"}
3313
+ operations ArithmeticOperation[] //e.g {"operation1": "sum", "operation2": "average"}
3314
+ resultFormat ValueFormat @default(NUMBER)
3315
+ }
3316
+
3317
+ model ReportVisualization {
3318
+ id String @id @unique @default(uuid())
3319
+
3320
+ template IntegrationReportTemplate @relation(fields: [templateId], references: [id])
3321
+ templateId String
3322
+
3323
+ metricIds String[] //List of ReportMetric IDs to be visualized
3324
+
3325
+ chartType ChartType
3326
+ xAxisField String? //e.g "Client Name"
3327
+ yAxisField String? //e.g "Fat Available Capacity"
3328
+
3329
+ useCustomColors Boolean @default(false)
3330
+ customColors Json? //e.g {"red": "#FF0000", "blue": "#0000FF"}
3331
+ }
3332
+
3333
+ model ReportTable {
3334
+ id String @id @unique @default(uuid())
3335
+
3336
+ templateId String
3337
+ template IntegrationReportTemplate @relation(fields: [templateId], references: [id])
3338
+
3339
+ metricId String
3340
+ metric ReportMetric @relation(fields: [metricId], references: [id])
3341
+
3342
+ columns String[] //e.g ["Client Name", "Fat Available Capacity"]
3343
+ includeHeader Boolean @default(true)
3344
+ sortBy Json? //e.g {"column": "Client Name", "order": "asc"} for sorting the table by a specific column
3345
+ }