@machynx/data-db 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1153 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+
8
+ const {
9
+ PrismaClientKnownRequestError,
10
+ PrismaClientUnknownRequestError,
11
+ PrismaClientRustPanicError,
12
+ PrismaClientInitializationError,
13
+ PrismaClientValidationError,
14
+ getPrismaClient,
15
+ sqltag,
16
+ empty,
17
+ join,
18
+ raw,
19
+ skip,
20
+ Decimal,
21
+ Debug,
22
+ DbNull,
23
+ JsonNull,
24
+ AnyNull,
25
+ NullTypes,
26
+ makeStrictEnum,
27
+ Extensions,
28
+ warnOnce,
29
+ defineDmmfProperty,
30
+ Public,
31
+ getRuntime,
32
+ createParam,
33
+ } = require('./runtime/client.js')
34
+
35
+
36
+ const Prisma = {}
37
+
38
+ exports.Prisma = Prisma
39
+ exports.$Enums = {}
40
+
41
+ /**
42
+ * Prisma Client JS version: 7.0.0
43
+ * Query Engine version: 0c19ccc313cf9911a90d99d2ac2eb0280c76c513
44
+ */
45
+ Prisma.prismaVersion = {
46
+ client: "7.0.0",
47
+ engine: "0c19ccc313cf9911a90d99d2ac2eb0280c76c513"
48
+ }
49
+
50
+ Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
51
+ Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
52
+ Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
53
+ Prisma.PrismaClientInitializationError = PrismaClientInitializationError
54
+ Prisma.PrismaClientValidationError = PrismaClientValidationError
55
+ Prisma.Decimal = Decimal
56
+
57
+ /**
58
+ * Re-export of sql-template-tag
59
+ */
60
+ Prisma.sql = sqltag
61
+ Prisma.empty = empty
62
+ Prisma.join = join
63
+ Prisma.raw = raw
64
+ Prisma.validator = Public.validator
65
+
66
+ /**
67
+ * Extensions
68
+ */
69
+ Prisma.getExtensionContext = Extensions.getExtensionContext
70
+ Prisma.defineExtension = Extensions.defineExtension
71
+
72
+ /**
73
+ * Shorthand utilities for JSON filtering
74
+ */
75
+ Prisma.DbNull = DbNull
76
+ Prisma.JsonNull = JsonNull
77
+ Prisma.AnyNull = AnyNull
78
+
79
+ Prisma.NullTypes = NullTypes
80
+
81
+
82
+
83
+
84
+ const path = require('path')
85
+
86
+ /**
87
+ * Enums
88
+ */
89
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
90
+ ReadUncommitted: 'ReadUncommitted',
91
+ ReadCommitted: 'ReadCommitted',
92
+ RepeatableRead: 'RepeatableRead',
93
+ Serializable: 'Serializable'
94
+ });
95
+
96
+ exports.Prisma.MachineHourlyAnalyticsScalarFieldEnum = {
97
+ id: 'id',
98
+ machineId: 'machineId',
99
+ organizationId: 'organizationId',
100
+ totalProductionCount: 'totalProductionCount',
101
+ efficiency: 'efficiency',
102
+ utilization: 'utilization',
103
+ totalPowerConsumed: 'totalPowerConsumed',
104
+ idleTime: 'idleTime',
105
+ nonWorkingTime: 'nonWorkingTime',
106
+ upTime: 'upTime',
107
+ productiveTime: 'productiveTime',
108
+ startDateTime: 'startDateTime',
109
+ endDateTime: 'endDateTime',
110
+ createdAt: 'createdAt',
111
+ updatedAt: 'updatedAt'
112
+ };
113
+
114
+ exports.Prisma.MachineDailyAnalyticsScalarFieldEnum = {
115
+ id: 'id',
116
+ machineId: 'machineId',
117
+ organizationId: 'organizationId',
118
+ totalProductionCount: 'totalProductionCount',
119
+ avgEfficiency: 'avgEfficiency',
120
+ avgUtilization: 'avgUtilization',
121
+ totalPowerConsumed: 'totalPowerConsumed',
122
+ totalUpTime: 'totalUpTime',
123
+ date: 'date',
124
+ createdAt: 'createdAt',
125
+ updatedAt: 'updatedAt'
126
+ };
127
+
128
+ exports.Prisma.MachineMonthlyAnalyticsScalarFieldEnum = {
129
+ id: 'id',
130
+ machineId: 'machineId',
131
+ organizationId: 'organizationId',
132
+ totalProductionCount: 'totalProductionCount',
133
+ avgEfficiency: 'avgEfficiency',
134
+ totalPowerConsumed: 'totalPowerConsumed',
135
+ month: 'month',
136
+ year: 'year',
137
+ createdAt: 'createdAt',
138
+ updatedAt: 'updatedAt'
139
+ };
140
+
141
+ exports.Prisma.LineHourlyAnalyticsScalarFieldEnum = {
142
+ id: 'id',
143
+ assemblyLineId: 'assemblyLineId',
144
+ organizationId: 'organizationId',
145
+ averageEfficiency: 'averageEfficiency',
146
+ averageUtilization: 'averageUtilization',
147
+ totalProductionCount: 'totalProductionCount',
148
+ startDateTime: 'startDateTime',
149
+ endDateTime: 'endDateTime',
150
+ createdAt: 'createdAt',
151
+ updatedAt: 'updatedAt'
152
+ };
153
+
154
+ exports.Prisma.FloorHourlyAnalyticsScalarFieldEnum = {
155
+ id: 'id',
156
+ floorId: 'floorId',
157
+ organizationId: 'organizationId',
158
+ averageEfficiency: 'averageEfficiency',
159
+ totalProductionCount: 'totalProductionCount',
160
+ startDateTime: 'startDateTime',
161
+ endDateTime: 'endDateTime',
162
+ createdAt: 'createdAt',
163
+ updatedAt: 'updatedAt'
164
+ };
165
+
166
+ exports.Prisma.FactoryHourlyAnalyticsScalarFieldEnum = {
167
+ id: 'id',
168
+ factoryId: 'factoryId',
169
+ organizationId: 'organizationId',
170
+ averageEfficiency: 'averageEfficiency',
171
+ totalProductionCount: 'totalProductionCount',
172
+ startDateTime: 'startDateTime',
173
+ endDateTime: 'endDateTime',
174
+ createdAt: 'createdAt',
175
+ updatedAt: 'updatedAt'
176
+ };
177
+
178
+ exports.Prisma.DeviceHourlyAnalyticsScalarFieldEnum = {
179
+ id: 'id',
180
+ deviceId: 'deviceId',
181
+ machineHourlyAnalyticsId: 'machineHourlyAnalyticsId',
182
+ organizationId: 'organizationId',
183
+ totalOnTime: 'totalOnTime',
184
+ totalActiveTime: 'totalActiveTime',
185
+ totalWorkingTime: 'totalWorkingTime',
186
+ startDateTime: 'startDateTime',
187
+ endDateTime: 'endDateTime',
188
+ createdAt: 'createdAt',
189
+ updatedAt: 'updatedAt'
190
+ };
191
+
192
+ exports.Prisma.SensorHourlyAnalyticsScalarFieldEnum = {
193
+ id: 'id',
194
+ sensorId: 'sensorId',
195
+ deviceHourlyAnalyticsId: 'deviceHourlyAnalyticsId',
196
+ initialSense: 'initialSense',
197
+ finalSense: 'finalSense',
198
+ startDateTime: 'startDateTime',
199
+ endDateTime: 'endDateTime',
200
+ createdAt: 'createdAt',
201
+ updatedAt: 'updatedAt'
202
+ };
203
+
204
+ exports.Prisma.ProximitySensorHourlyAnalyticsScalarFieldEnum = {
205
+ id: 'id',
206
+ sensorHourlyAnalyticsId: 'sensorHourlyAnalyticsId',
207
+ totalDetections: 'totalDetections',
208
+ productiveDetections: 'productiveDetections',
209
+ startDateTime: 'startDateTime',
210
+ endDateTime: 'endDateTime',
211
+ createdAt: 'createdAt',
212
+ updatedAt: 'updatedAt'
213
+ };
214
+
215
+ exports.Prisma.InfraredSensorHourlyAnalyticsScalarFieldEnum = {
216
+ id: 'id',
217
+ sensorHourlyAnalyticsId: 'sensorHourlyAnalyticsId',
218
+ totalDetections: 'totalDetections',
219
+ productiveDetections: 'productiveDetections',
220
+ startDateTime: 'startDateTime',
221
+ endDateTime: 'endDateTime',
222
+ createdAt: 'createdAt',
223
+ updatedAt: 'updatedAt'
224
+ };
225
+
226
+ exports.Prisma.DevicePowerSensorHourlyAnalyticsScalarFieldEnum = {
227
+ id: 'id',
228
+ deviceHourlyAnalyticsId: 'deviceHourlyAnalyticsId',
229
+ powerEvents: 'powerEvents',
230
+ totalOnTime: 'totalOnTime',
231
+ startDateTime: 'startDateTime',
232
+ endDateTime: 'endDateTime',
233
+ createdAt: 'createdAt',
234
+ updatedAt: 'updatedAt'
235
+ };
236
+
237
+ exports.Prisma.AuditLogScalarFieldEnum = {
238
+ id: 'id',
239
+ entityName: 'entityName',
240
+ entityId: 'entityId',
241
+ action: 'action',
242
+ userId: 'userId',
243
+ orgId: 'orgId',
244
+ timestamp: 'timestamp',
245
+ httpMethod: 'httpMethod',
246
+ route: 'route',
247
+ statusCode: 'statusCode',
248
+ ipAddress: 'ipAddress',
249
+ userAgent: 'userAgent',
250
+ oldValues: 'oldValues',
251
+ newValues: 'newValues'
252
+ };
253
+
254
+ exports.Prisma.ChatbotHistoryScalarFieldEnum = {
255
+ id: 'id',
256
+ title: 'title',
257
+ userId: 'userId',
258
+ organizationId: 'organizationId',
259
+ createdAt: 'createdAt',
260
+ updatedAt: 'updatedAt'
261
+ };
262
+
263
+ exports.Prisma.ChatbotMessageScalarFieldEnum = {
264
+ id: 'id',
265
+ chatHistoryId: 'chatHistoryId',
266
+ sender: 'sender',
267
+ message: 'message',
268
+ tokensUsed: 'tokensUsed',
269
+ jsonContent: 'jsonContent',
270
+ createdAt: 'createdAt',
271
+ updatedAt: 'updatedAt'
272
+ };
273
+
274
+ exports.Prisma.GatewayScalarFieldEnum = {
275
+ id: 'id',
276
+ gatewayUid: 'gatewayUid',
277
+ gatewayName: 'gatewayName',
278
+ isActive: 'isActive',
279
+ floorId: 'floorId',
280
+ secret: 'secret',
281
+ currentWifiSSID: 'currentWifiSSID',
282
+ currentWifiPassword: 'currentWifiPassword',
283
+ currentMQTTBrokerUrl: 'currentMQTTBrokerUrl',
284
+ fallBackWifiSSID: 'fallBackWifiSSID',
285
+ fallBackWifiPassword: 'fallBackWifiPassword',
286
+ createdAt: 'createdAt',
287
+ updatedAt: 'updatedAt'
288
+ };
289
+
290
+ exports.Prisma.GatewayApiTokenScalarFieldEnum = {
291
+ id: 'id',
292
+ gatewayId: 'gatewayId',
293
+ apiToken: 'apiToken',
294
+ expiresAt: 'expiresAt',
295
+ createdAt: 'createdAt',
296
+ updatedAt: 'updatedAt'
297
+ };
298
+
299
+ exports.Prisma.DeviceScalarFieldEnum = {
300
+ id: 'id',
301
+ globalDeviceUid: 'globalDeviceUid',
302
+ deviceUid: 'deviceUid',
303
+ deviceName: 'deviceName',
304
+ isActive: 'isActive',
305
+ orgId: 'orgId',
306
+ gatewayId: 'gatewayId',
307
+ machineId: 'machineId',
308
+ assemblyLineId: 'assemblyLineId',
309
+ floorId: 'floorId',
310
+ factoryId: 'factoryId',
311
+ createdAt: 'createdAt',
312
+ updatedAt: 'updatedAt'
313
+ };
314
+
315
+ exports.Prisma.SensorScalarFieldEnum = {
316
+ id: 'id',
317
+ sensorUid: 'sensorUid',
318
+ sensorName: 'sensorName',
319
+ sensorType: 'sensorType',
320
+ deviceId: 'deviceId',
321
+ isActive: 'isActive',
322
+ machineId: 'machineId',
323
+ assemblyLineId: 'assemblyLineId',
324
+ floorId: 'floorId',
325
+ factoryId: 'factoryId',
326
+ createdAt: 'createdAt',
327
+ updatedAt: 'updatedAt'
328
+ };
329
+
330
+ exports.Prisma.ProximitySensorConfigScalarFieldEnum = {
331
+ id: 'id',
332
+ sensorId: 'sensorId',
333
+ range: 'range',
334
+ sensitivity: 'sensitivity',
335
+ aggregationFactor: 'aggregationFactor',
336
+ createdAt: 'createdAt',
337
+ updatedAt: 'updatedAt'
338
+ };
339
+
340
+ exports.Prisma.CurrentSensorConfigScalarFieldEnum = {
341
+ id: 'id',
342
+ sensorId: 'sensorId',
343
+ currentThreshold: 'currentThreshold',
344
+ createdAt: 'createdAt',
345
+ updatedAt: 'updatedAt'
346
+ };
347
+
348
+ exports.Prisma.InfraredSensorConfigScalarFieldEnum = {
349
+ id: 'id',
350
+ sensorId: 'sensorId',
351
+ wavelength: 'wavelength',
352
+ resolution: 'resolution',
353
+ aggregationFactor: 'aggregationFactor',
354
+ createdAt: 'createdAt',
355
+ updatedAt: 'updatedAt'
356
+ };
357
+
358
+ exports.Prisma.MachineDeviceAssignmentScalarFieldEnum = {
359
+ id: 'id',
360
+ deviceId: 'deviceId',
361
+ machineId: 'machineId',
362
+ assignedAt: 'assignedAt',
363
+ unassignedAt: 'unassignedAt'
364
+ };
365
+
366
+ exports.Prisma.SensorLogScalarFieldEnum = {
367
+ id: 'id',
368
+ sensorId: 'sensorId',
369
+ senseTime: 'senseTime',
370
+ isProcessed: 'isProcessed',
371
+ createdAt: 'createdAt',
372
+ updatedAt: 'updatedAt'
373
+ };
374
+
375
+ exports.Prisma.RFIDSensorLogScalarFieldEnum = {
376
+ id: 'id',
377
+ sensorLogId: 'sensorLogId',
378
+ rfid: 'rfid',
379
+ tapType: 'tapType',
380
+ operatorId: 'operatorId',
381
+ createdAt: 'createdAt',
382
+ updatedAt: 'updatedAt'
383
+ };
384
+
385
+ exports.Prisma.ProximitySensorLogScalarFieldEnum = {
386
+ id: 'id',
387
+ sensorLogId: 'sensorLogId',
388
+ createdAt: 'createdAt',
389
+ updatedAt: 'updatedAt'
390
+ };
391
+
392
+ exports.Prisma.InfraredSensorLogScalarFieldEnum = {
393
+ id: 'id',
394
+ sensorLogId: 'sensorLogId',
395
+ createdAt: 'createdAt',
396
+ updatedAt: 'updatedAt'
397
+ };
398
+
399
+ exports.Prisma.CurrentSensorLogScalarFieldEnum = {
400
+ id: 'id',
401
+ sensorLogId: 'sensorLogId',
402
+ currentValue: 'currentValue',
403
+ createdAt: 'createdAt',
404
+ updatedAt: 'updatedAt'
405
+ };
406
+
407
+ exports.Prisma.DevicePowerSensorLogScalarFieldEnum = {
408
+ id: 'id',
409
+ sensorLogId: 'sensorLogId',
410
+ powerState: 'powerState',
411
+ createdAt: 'createdAt',
412
+ updatedAt: 'updatedAt'
413
+ };
414
+
415
+ exports.Prisma.FactoryScalarFieldEnum = {
416
+ id: 'id',
417
+ name: 'name',
418
+ description: 'description',
419
+ organizationId: 'organizationId',
420
+ timeZone: 'timeZone',
421
+ timeZoneString: 'timeZoneString',
422
+ createdAt: 'createdAt',
423
+ updatedAt: 'updatedAt'
424
+ };
425
+
426
+ exports.Prisma.FloorScalarFieldEnum = {
427
+ id: 'id',
428
+ code: 'code',
429
+ name: 'name',
430
+ description: 'description',
431
+ factoryId: 'factoryId',
432
+ isActive: 'isActive',
433
+ searchTags: 'searchTags',
434
+ accessLevel: 'accessLevel',
435
+ floorTypeId: 'floorTypeId',
436
+ createdAt: 'createdAt',
437
+ updatedAt: 'updatedAt'
438
+ };
439
+
440
+ exports.Prisma.FloorTypeScalarFieldEnum = {
441
+ id: 'id',
442
+ name: 'name',
443
+ organizationId: 'organizationId',
444
+ createdAt: 'createdAt',
445
+ updatedAt: 'updatedAt'
446
+ };
447
+
448
+ exports.Prisma.FloorSettingScalarFieldEnum = {
449
+ id: 'id',
450
+ floorId: 'floorId',
451
+ idleThresholdMinutes: 'idleThresholdMinutes',
452
+ oeeExcellentPct: 'oeeExcellentPct',
453
+ oeeAveragePct: 'oeeAveragePct',
454
+ oeePoorPct: 'oeePoorPct',
455
+ downtimeWarnMinutes: 'downtimeWarnMinutes',
456
+ downtimeAlertMinutes: 'downtimeAlertMinutes',
457
+ peakEnergykWh: 'peakEnergykWh',
458
+ offPeakEnergykWh: 'offPeakEnergykWh',
459
+ energyAlertPct: 'energyAlertPct',
460
+ createdAt: 'createdAt',
461
+ updatedAt: 'updatedAt'
462
+ };
463
+
464
+ exports.Prisma.AssemblyLineScalarFieldEnum = {
465
+ id: 'id',
466
+ code: 'code',
467
+ name: 'name',
468
+ description: 'description',
469
+ floorId: 'floorId',
470
+ machineOrder: 'machineOrder',
471
+ assemblyLineTypeId: 'assemblyLineTypeId',
472
+ createdAt: 'createdAt',
473
+ updatedAt: 'updatedAt'
474
+ };
475
+
476
+ exports.Prisma.FactoryShiftScalarFieldEnum = {
477
+ id: 'id',
478
+ factoryId: 'factoryId',
479
+ name: 'name',
480
+ startTime: 'startTime',
481
+ endTime: 'endTime',
482
+ createdAt: 'createdAt',
483
+ updatedAt: 'updatedAt'
484
+ };
485
+
486
+ exports.Prisma.FactoryShiftMachineScalarFieldEnum = {
487
+ id: 'id',
488
+ shiftId: 'shiftId',
489
+ machineId: 'machineId'
490
+ };
491
+
492
+ exports.Prisma.FactoryLotScalarFieldEnum = {
493
+ id: 'id',
494
+ lotNumber: 'lotNumber',
495
+ receivedAt: 'receivedAt',
496
+ expiryAt: 'expiryAt',
497
+ factoryId: 'factoryId',
498
+ createdAt: 'createdAt',
499
+ updatedAt: 'updatedAt'
500
+ };
501
+
502
+ exports.Prisma.FinalProductScalarFieldEnum = {
503
+ id: 'id',
504
+ externalId: 'externalId',
505
+ name: 'name',
506
+ code: 'code',
507
+ factoryId: 'factoryId',
508
+ description: 'description',
509
+ createdAt: 'createdAt',
510
+ updatedAt: 'updatedAt'
511
+ };
512
+
513
+ exports.Prisma.FinalProductRouteScalarFieldEnum = {
514
+ id: 'id',
515
+ finalProductId: 'finalProductId',
516
+ name: 'name',
517
+ sequence: 'sequence',
518
+ createdAt: 'createdAt',
519
+ updatedAt: 'updatedAt'
520
+ };
521
+
522
+ exports.Prisma.FinalProductMachineOperationRouteScalarFieldEnum = {
523
+ id: 'id',
524
+ routeId: 'routeId',
525
+ operationId: 'operationId',
526
+ productAggregationFactor: 'productAggregationFactor',
527
+ sequence: 'sequence',
528
+ expectedDuration: 'expectedDuration',
529
+ createdAt: 'createdAt',
530
+ updatedAt: 'updatedAt'
531
+ };
532
+
533
+ exports.Prisma.FinalProductRouteDependencyScalarFieldEnum = {
534
+ routeId: 'routeId',
535
+ dependsOnRouteId: 'dependsOnRouteId'
536
+ };
537
+
538
+ exports.Prisma.MachineScalarFieldEnum = {
539
+ id: 'id',
540
+ name: 'name',
541
+ details: 'details',
542
+ idealCycleTimeInSeconds: 'idealCycleTimeInSeconds',
543
+ assemblyLineId: 'assemblyLineId',
544
+ machineOperationId: 'machineOperationId',
545
+ trackingType: 'trackingType',
546
+ createdAt: 'createdAt',
547
+ updatedAt: 'updatedAt'
548
+ };
549
+
550
+ exports.Prisma.MachineOperationScalarFieldEnum = {
551
+ id: 'id',
552
+ operationName: 'operationName',
553
+ description: 'description',
554
+ organizationId: 'organizationId',
555
+ productionSIUnit: 'productionSIUnit',
556
+ createdAt: 'createdAt',
557
+ updatedAt: 'updatedAt'
558
+ };
559
+
560
+ exports.Prisma.MachineEventScalarFieldEnum = {
561
+ id: 'id',
562
+ machineId: 'machineId',
563
+ eventTime: 'eventTime',
564
+ category: 'category',
565
+ title: 'title',
566
+ subtitle: 'subtitle',
567
+ description: 'description',
568
+ createdAt: 'createdAt',
569
+ updatedAt: 'updatedAt'
570
+ };
571
+
572
+ exports.Prisma.MachineAlertScalarFieldEnum = {
573
+ id: 'id',
574
+ machineId: 'machineId',
575
+ title: 'title',
576
+ message: 'message',
577
+ severity: 'severity',
578
+ createdAt: 'createdAt',
579
+ resolvedAt: 'resolvedAt'
580
+ };
581
+
582
+ exports.Prisma.MachineAlertSubscriptionScalarFieldEnum = {
583
+ id: 'id',
584
+ userId: 'userId',
585
+ machineId: 'machineId',
586
+ createdAt: 'createdAt'
587
+ };
588
+
589
+ exports.Prisma.MaintenanceLogScalarFieldEnum = {
590
+ id: 'id',
591
+ machineId: 'machineId',
592
+ orgId: 'orgId',
593
+ reportedById: 'reportedById',
594
+ description: 'description',
595
+ status: 'status',
596
+ startTime: 'startTime',
597
+ endTime: 'endTime',
598
+ createdAt: 'createdAt',
599
+ updatedAt: 'updatedAt'
600
+ };
601
+
602
+ exports.Prisma.MaintenanceManagerConfigScalarFieldEnum = {
603
+ id: 'id',
604
+ managerId: 'managerId',
605
+ key: 'key',
606
+ value: 'value',
607
+ updatedAt: 'updatedAt'
608
+ };
609
+
610
+ exports.Prisma.MaintenanceRequestScalarFieldEnum = {
611
+ id: 'id',
612
+ machineId: 'machineId',
613
+ requestedById: 'requestedById',
614
+ title: 'title',
615
+ description: 'description',
616
+ status: 'status',
617
+ priority: 'priority',
618
+ categoryId: 'categoryId',
619
+ createdAt: 'createdAt',
620
+ updatedAt: 'updatedAt'
621
+ };
622
+
623
+ exports.Prisma.MaintenanceRequestCategoryScalarFieldEnum = {
624
+ id: 'id',
625
+ factoryId: 'factoryId',
626
+ name: 'name',
627
+ createdAt: 'createdAt',
628
+ updatedAt: 'updatedAt'
629
+ };
630
+
631
+ exports.Prisma.MaintenanceRequestAssignmentScalarFieldEnum = {
632
+ id: 'id',
633
+ requestId: 'requestId',
634
+ technicianId: 'technicianId',
635
+ assignedById: 'assignedById',
636
+ assignedAt: 'assignedAt'
637
+ };
638
+
639
+ exports.Prisma.MaintenanceRequestUpdateScalarFieldEnum = {
640
+ id: 'id',
641
+ requestId: 'requestId',
642
+ authorId: 'authorId',
643
+ message: 'message',
644
+ createdAt: 'createdAt'
645
+ };
646
+
647
+ exports.Prisma.MaintenanceRequestAttachmentScalarFieldEnum = {
648
+ id: 'id',
649
+ updateId: 'updateId',
650
+ fileUrl: 'fileUrl',
651
+ fileName: 'fileName',
652
+ uploadedAt: 'uploadedAt'
653
+ };
654
+
655
+ exports.Prisma.MaintenanceTechnicianScalarFieldEnum = {
656
+ id: 'id',
657
+ factoryId: 'factoryId',
658
+ name: 'name',
659
+ email: 'email',
660
+ phone: 'phone',
661
+ hiredAt: 'hiredAt',
662
+ createdAt: 'createdAt',
663
+ updatedAt: 'updatedAt'
664
+ };
665
+
666
+ exports.Prisma.TechnicianSpecializationScalarFieldEnum = {
667
+ id: 'id',
668
+ technicianId: 'technicianId',
669
+ specializationId: 'specializationId'
670
+ };
671
+
672
+ exports.Prisma.OperatorScalarFieldEnum = {
673
+ id: 'id',
674
+ rfid: 'rfid',
675
+ externalId: 'externalId',
676
+ name: 'name',
677
+ description: 'description',
678
+ organizationId: 'organizationId',
679
+ factoryId: 'factoryId',
680
+ createdAt: 'createdAt',
681
+ updatedAt: 'updatedAt'
682
+ };
683
+
684
+ exports.Prisma.OperatorTimeLogScalarFieldEnum = {
685
+ id: 'id',
686
+ operatorId: 'operatorId',
687
+ checkInAt: 'checkInAt',
688
+ checkOutAt: 'checkOutAt',
689
+ deviceId: 'deviceId',
690
+ machineId: 'machineId',
691
+ totalWorkingTime: 'totalWorkingTime',
692
+ totalIdleTime: 'totalIdleTime',
693
+ totalNonWorkingTime: 'totalNonWorkingTime',
694
+ efficiency: 'efficiency',
695
+ createdAt: 'createdAt',
696
+ updatedAt: 'updatedAt'
697
+ };
698
+
699
+ exports.Prisma.OrderScalarFieldEnum = {
700
+ id: 'id',
701
+ organizationId: 'organizationId',
702
+ externalId: 'externalId',
703
+ erpSource: 'erpSource',
704
+ customerId: 'customerId',
705
+ orderNumber: 'orderNumber',
706
+ title: 'title',
707
+ description: 'description',
708
+ factoryId: 'factoryId',
709
+ status: 'status',
710
+ progress: 'progress',
711
+ priority: 'priority',
712
+ deadline: 'deadline',
713
+ startDate: 'startDate',
714
+ createdById: 'createdById',
715
+ assignedToId: 'assignedToId',
716
+ assignedById: 'assignedById',
717
+ approvalAssignedToId: 'approvalAssignedToId',
718
+ approvedById: 'approvedById',
719
+ createdAt: 'createdAt',
720
+ updatedAt: 'updatedAt'
721
+ };
722
+
723
+ exports.Prisma.OrderProductScalarFieldEnum = {
724
+ id: 'id',
725
+ orderId: 'orderId',
726
+ productId: 'productId',
727
+ quantity: 'quantity',
728
+ title: 'title',
729
+ description: 'description',
730
+ status: 'status',
731
+ progress: 'progress',
732
+ createdAt: 'createdAt',
733
+ updatedAt: 'updatedAt'
734
+ };
735
+
736
+ exports.Prisma.OrderCommentScalarFieldEnum = {
737
+ id: 'id',
738
+ orderId: 'orderId',
739
+ organizationId: 'organizationId',
740
+ authorId: 'authorId',
741
+ text: 'text',
742
+ createdAt: 'createdAt',
743
+ updatedAt: 'updatedAt'
744
+ };
745
+
746
+ exports.Prisma.ProductionUnitScalarFieldEnum = {
747
+ id: 'id',
748
+ tagId: 'tagId',
749
+ serialNumber: 'serialNumber',
750
+ organizationId: 'organizationId',
751
+ orderProductId: 'orderProductId',
752
+ currentStepId: 'currentStepId',
753
+ status: 'status',
754
+ createdAt: 'createdAt',
755
+ updatedAt: 'updatedAt'
756
+ };
757
+
758
+ exports.Prisma.ProductionUnitLogScalarFieldEnum = {
759
+ id: 'id',
760
+ productionUnitId: 'productionUnitId',
761
+ eventId: 'eventId',
762
+ details: 'details',
763
+ stepId: 'stepId',
764
+ operatorId: 'operatorId',
765
+ createdAt: 'createdAt'
766
+ };
767
+
768
+ exports.Prisma.ProductionRouteStepScalarFieldEnum = {
769
+ id: 'id',
770
+ productionUnitId: 'productionUnitId',
771
+ stepId: 'stepId',
772
+ machineId: 'machineId',
773
+ isCompleted: 'isCompleted',
774
+ createdAt: 'createdAt',
775
+ updatedAt: 'updatedAt'
776
+ };
777
+
778
+ exports.Prisma.ProductionUnitQCScalarFieldEnum = {
779
+ id: 'id',
780
+ productionUnitId: 'productionUnitId',
781
+ status: 'status',
782
+ inspectorId: 'inspectorId',
783
+ notes: 'notes',
784
+ createdAt: 'createdAt',
785
+ updatedAt: 'updatedAt'
786
+ };
787
+
788
+ exports.Prisma.OrganizationUserFactoryEntityAccessScalarFieldEnum = {
789
+ id: 'id',
790
+ userId: 'userId',
791
+ createdAt: 'createdAt',
792
+ updatedAt: 'updatedAt'
793
+ };
794
+
795
+ exports.Prisma.OperatorOperationCategoryScalarFieldEnum = {
796
+ id: 'id',
797
+ factoryId: 'factoryId',
798
+ name: 'name',
799
+ description: 'description',
800
+ createdAt: 'createdAt',
801
+ updatedAt: 'updatedAt'
802
+ };
803
+
804
+ exports.Prisma.TaskScalarFieldEnum = {
805
+ id: 'id',
806
+ operatorId: 'operatorId',
807
+ assignedById: 'assignedById',
808
+ assignedToId: 'assignedToId',
809
+ deviceId: 'deviceId',
810
+ machineId: 'machineId',
811
+ taskGroupId: 'taskGroupId',
812
+ factoryId: 'factoryId',
813
+ organizationId: 'organizationId',
814
+ operatorOpCategoryId: 'operatorOpCategoryId',
815
+ shiftId: 'shiftId',
816
+ title: 'title',
817
+ description: 'description',
818
+ status: 'status',
819
+ startTime: 'startTime',
820
+ endTime: 'endTime',
821
+ targetCount: 'targetCount',
822
+ taskCount: 'taskCount',
823
+ sequence: 'sequence',
824
+ reworkOfTaskId: 'reworkOfTaskId',
825
+ reworkCount: 'reworkCount',
826
+ machineOperationId: 'machineOperationId',
827
+ startedAt: 'startedAt',
828
+ completedAt: 'completedAt',
829
+ createdAt: 'createdAt',
830
+ updatedAt: 'updatedAt'
831
+ };
832
+
833
+ exports.Prisma.TaskGroupScalarFieldEnum = {
834
+ id: 'id',
835
+ description: 'description',
836
+ status: 'status',
837
+ targetCount: 'targetCount',
838
+ factoryId: 'factoryId',
839
+ organizationId: 'organizationId',
840
+ productRouteId: 'productRouteId',
841
+ orderProductId: 'orderProductId',
842
+ deadline: 'deadline',
843
+ reworkOfTaskGroupId: 'reworkOfTaskGroupId',
844
+ reworkCount: 'reworkCount',
845
+ startedAt: 'startedAt',
846
+ completedAt: 'completedAt',
847
+ createdAt: 'createdAt',
848
+ updatedAt: 'updatedAt'
849
+ };
850
+
851
+ exports.Prisma.TaskLotScalarFieldEnum = {
852
+ id: 'id',
853
+ taskId: 'taskId',
854
+ lotId: 'lotId'
855
+ };
856
+
857
+ exports.Prisma.TaskGroupLotScalarFieldEnum = {
858
+ id: 'id',
859
+ taskGroupId: 'taskGroupId',
860
+ lotId: 'lotId'
861
+ };
862
+
863
+ exports.Prisma.TaskInspectionScalarFieldEnum = {
864
+ id: 'id',
865
+ taskId: 'taskId',
866
+ inspectorId: 'inspectorId',
867
+ passed: 'passed',
868
+ defectCount: 'defectCount',
869
+ wasteCount: 'wasteCount',
870
+ notes: 'notes',
871
+ createdAt: 'createdAt',
872
+ updatedAt: 'updatedAt'
873
+ };
874
+
875
+ exports.Prisma.TaskCommentScalarFieldEnum = {
876
+ id: 'id',
877
+ taskId: 'taskId',
878
+ organizationId: 'organizationId',
879
+ authorId: 'authorId',
880
+ text: 'text',
881
+ createdAt: 'createdAt',
882
+ updatedAt: 'updatedAt'
883
+ };
884
+
885
+ exports.Prisma.SortOrder = {
886
+ asc: 'asc',
887
+ desc: 'desc'
888
+ };
889
+
890
+ exports.Prisma.NullableJsonNullValueInput = {
891
+ DbNull: Prisma.DbNull,
892
+ JsonNull: Prisma.JsonNull
893
+ };
894
+
895
+ exports.Prisma.JsonNullValueInput = {
896
+ JsonNull: Prisma.JsonNull
897
+ };
898
+
899
+ exports.Prisma.NullsOrder = {
900
+ first: 'first',
901
+ last: 'last'
902
+ };
903
+
904
+ exports.Prisma.JsonNullValueFilter = {
905
+ DbNull: Prisma.DbNull,
906
+ JsonNull: Prisma.JsonNull,
907
+ AnyNull: Prisma.AnyNull
908
+ };
909
+
910
+ exports.Prisma.QueryMode = {
911
+ default: 'default',
912
+ insensitive: 'insensitive'
913
+ };
914
+ exports.ChatbotMessageSender = exports.$Enums.ChatbotMessageSender = {
915
+ USER: 'USER',
916
+ BOT: 'BOT'
917
+ };
918
+
919
+ exports.SensorType = exports.$Enums.SensorType = {
920
+ PROXIMITY: 'PROXIMITY',
921
+ INFRARED: 'INFRARED',
922
+ RFID: 'RFID',
923
+ CURRENT: 'CURRENT'
924
+ };
925
+
926
+ exports.RFIDTapType = exports.$Enums.RFIDTapType = {
927
+ CHECKIN: 'CHECKIN',
928
+ CHECKOUT: 'CHECKOUT'
929
+ };
930
+
931
+ exports.DevicePowerState = exports.$Enums.DevicePowerState = {
932
+ POWER_ON: 'POWER_ON',
933
+ POWER_OFF: 'POWER_OFF'
934
+ };
935
+
936
+ exports.WeekDay = exports.$Enums.WeekDay = {
937
+ SUNDAY: 'SUNDAY',
938
+ MONDAY: 'MONDAY',
939
+ TUESDAY: 'TUESDAY',
940
+ WEDNESDAY: 'WEDNESDAY',
941
+ THURSDAY: 'THURSDAY',
942
+ FRIDAY: 'FRIDAY',
943
+ SATURDAY: 'SATURDAY'
944
+ };
945
+
946
+ exports.AccessLevel = exports.$Enums.AccessLevel = {
947
+ PUBLIC: 'PUBLIC',
948
+ PRIVATE: 'PRIVATE'
949
+ };
950
+
951
+ exports.ProductionSIUnit = exports.$Enums.ProductionSIUnit = {
952
+ COUNT: 'COUNT',
953
+ WEIGHT: 'WEIGHT',
954
+ LITERS: 'LITERS'
955
+ };
956
+
957
+ exports.MachineAlertSeverity = exports.$Enums.MachineAlertSeverity = {
958
+ LOW: 'LOW',
959
+ MEDIUM: 'MEDIUM',
960
+ HIGH: 'HIGH',
961
+ CRITICAL: 'CRITICAL'
962
+ };
963
+
964
+ exports.EventCategory = exports.$Enums.EventCategory = {
965
+ GENERAL: 'GENERAL',
966
+ MEDIUM: 'MEDIUM',
967
+ OPERATION: 'OPERATION',
968
+ ALERT: 'ALERT'
969
+ };
970
+
971
+ exports.MachineTrackingType = exports.$Enums.MachineTrackingType = {
972
+ MANUAL: 'MANUAL',
973
+ AUTOMATED: 'AUTOMATED'
974
+ };
975
+
976
+ exports.MaintenanceLogStatus = exports.$Enums.MaintenanceLogStatus = {
977
+ OPEN: 'OPEN',
978
+ IN_PROGRESS: 'IN_PROGRESS',
979
+ COMPLETED: 'COMPLETED',
980
+ CANCELLED: 'CANCELLED'
981
+ };
982
+
983
+ exports.MaintenanceRequestStatus = exports.$Enums.MaintenanceRequestStatus = {
984
+ NEW: 'NEW',
985
+ APPROVED: 'APPROVED',
986
+ ASSIGNED: 'ASSIGNED',
987
+ IN_PROGRESS: 'IN_PROGRESS',
988
+ COMPLETED: 'COMPLETED',
989
+ CANCELLED: 'CANCELLED'
990
+ };
991
+
992
+ exports.MaintenanceRequestPriority = exports.$Enums.MaintenanceRequestPriority = {
993
+ LOW: 'LOW',
994
+ MEDIUM: 'MEDIUM',
995
+ HIGH: 'HIGH',
996
+ CRITICAL: 'CRITICAL'
997
+ };
998
+
999
+ exports.OrderStatus = exports.$Enums.OrderStatus = {
1000
+ NEW: 'NEW',
1001
+ CONFIRMED: 'CONFIRMED',
1002
+ IN_PROGRESS: 'IN_PROGRESS',
1003
+ ON_TRACK: 'ON_TRACK',
1004
+ DELAYED: 'DELAYED',
1005
+ AT_RISK: 'AT_RISK',
1006
+ COMPLETED: 'COMPLETED',
1007
+ CANCELED: 'CANCELED'
1008
+ };
1009
+
1010
+ exports.OrderPriority = exports.$Enums.OrderPriority = {
1011
+ LOW: 'LOW',
1012
+ MEDIUM: 'MEDIUM',
1013
+ HIGH: 'HIGH',
1014
+ CRITICAL: 'CRITICAL'
1015
+ };
1016
+
1017
+ exports.OrderProductStatus = exports.$Enums.OrderProductStatus = {
1018
+ NEW: 'NEW',
1019
+ IN_PROGRESS: 'IN_PROGRESS',
1020
+ ON_TRACK: 'ON_TRACK',
1021
+ DELAYED: 'DELAYED',
1022
+ AT_RISK: 'AT_RISK',
1023
+ COMPLETED: 'COMPLETED',
1024
+ CANCELED: 'CANCELED'
1025
+ };
1026
+
1027
+ exports.ProductionUnitStatus = exports.$Enums.ProductionUnitStatus = {
1028
+ IN_PRODUCTION: 'IN_PRODUCTION',
1029
+ IN_QA: 'IN_QA',
1030
+ REWORK: 'REWORK',
1031
+ COMPLETE: 'COMPLETE',
1032
+ REJECTED: 'REJECTED',
1033
+ SHIPPED: 'SHIPPED'
1034
+ };
1035
+
1036
+ exports.TaskStatus = exports.$Enums.TaskStatus = {
1037
+ NEW: 'NEW',
1038
+ IN_PROGRESS: 'IN_PROGRESS',
1039
+ COMPLETED: 'COMPLETED',
1040
+ CANCELED: 'CANCELED',
1041
+ OVERDUE: 'OVERDUE',
1042
+ INCOMPLETE: 'INCOMPLETE'
1043
+ };
1044
+
1045
+ exports.TaskGroupStatus = exports.$Enums.TaskGroupStatus = {
1046
+ NEW: 'NEW',
1047
+ IN_PROGRESS: 'IN_PROGRESS',
1048
+ COMPLETED: 'COMPLETED',
1049
+ CANCELED: 'CANCELED',
1050
+ OVERDUE: 'OVERDUE',
1051
+ INCOMPLETE: 'INCOMPLETE'
1052
+ };
1053
+
1054
+ exports.Prisma.ModelName = {
1055
+ MachineHourlyAnalytics: 'MachineHourlyAnalytics',
1056
+ MachineDailyAnalytics: 'MachineDailyAnalytics',
1057
+ MachineMonthlyAnalytics: 'MachineMonthlyAnalytics',
1058
+ LineHourlyAnalytics: 'LineHourlyAnalytics',
1059
+ FloorHourlyAnalytics: 'FloorHourlyAnalytics',
1060
+ FactoryHourlyAnalytics: 'FactoryHourlyAnalytics',
1061
+ DeviceHourlyAnalytics: 'DeviceHourlyAnalytics',
1062
+ SensorHourlyAnalytics: 'SensorHourlyAnalytics',
1063
+ ProximitySensorHourlyAnalytics: 'ProximitySensorHourlyAnalytics',
1064
+ InfraredSensorHourlyAnalytics: 'InfraredSensorHourlyAnalytics',
1065
+ DevicePowerSensorHourlyAnalytics: 'DevicePowerSensorHourlyAnalytics',
1066
+ AuditLog: 'AuditLog',
1067
+ ChatbotHistory: 'ChatbotHistory',
1068
+ ChatbotMessage: 'ChatbotMessage',
1069
+ Gateway: 'Gateway',
1070
+ GatewayApiToken: 'GatewayApiToken',
1071
+ Device: 'Device',
1072
+ Sensor: 'Sensor',
1073
+ ProximitySensorConfig: 'ProximitySensorConfig',
1074
+ CurrentSensorConfig: 'CurrentSensorConfig',
1075
+ InfraredSensorConfig: 'InfraredSensorConfig',
1076
+ MachineDeviceAssignment: 'MachineDeviceAssignment',
1077
+ SensorLog: 'SensorLog',
1078
+ RFIDSensorLog: 'RFIDSensorLog',
1079
+ ProximitySensorLog: 'ProximitySensorLog',
1080
+ InfraredSensorLog: 'InfraredSensorLog',
1081
+ CurrentSensorLog: 'CurrentSensorLog',
1082
+ DevicePowerSensorLog: 'DevicePowerSensorLog',
1083
+ Factory: 'Factory',
1084
+ Floor: 'Floor',
1085
+ FloorType: 'FloorType',
1086
+ FloorSetting: 'FloorSetting',
1087
+ AssemblyLine: 'AssemblyLine',
1088
+ FactoryShift: 'FactoryShift',
1089
+ FactoryShiftMachine: 'FactoryShiftMachine',
1090
+ FactoryLot: 'FactoryLot',
1091
+ FinalProduct: 'FinalProduct',
1092
+ FinalProductRoute: 'FinalProductRoute',
1093
+ FinalProductMachineOperationRoute: 'FinalProductMachineOperationRoute',
1094
+ FinalProductRouteDependency: 'FinalProductRouteDependency',
1095
+ Machine: 'Machine',
1096
+ MachineOperation: 'MachineOperation',
1097
+ MachineEvent: 'MachineEvent',
1098
+ MachineAlert: 'MachineAlert',
1099
+ MachineAlertSubscription: 'MachineAlertSubscription',
1100
+ MaintenanceLog: 'MaintenanceLog',
1101
+ MaintenanceManagerConfig: 'MaintenanceManagerConfig',
1102
+ MaintenanceRequest: 'MaintenanceRequest',
1103
+ MaintenanceRequestCategory: 'MaintenanceRequestCategory',
1104
+ MaintenanceRequestAssignment: 'MaintenanceRequestAssignment',
1105
+ MaintenanceRequestUpdate: 'MaintenanceRequestUpdate',
1106
+ MaintenanceRequestAttachment: 'MaintenanceRequestAttachment',
1107
+ MaintenanceTechnician: 'MaintenanceTechnician',
1108
+ TechnicianSpecialization: 'TechnicianSpecialization',
1109
+ Operator: 'Operator',
1110
+ OperatorTimeLog: 'OperatorTimeLog',
1111
+ Order: 'Order',
1112
+ OrderProduct: 'OrderProduct',
1113
+ OrderComment: 'OrderComment',
1114
+ ProductionUnit: 'ProductionUnit',
1115
+ ProductionUnitLog: 'ProductionUnitLog',
1116
+ ProductionRouteStep: 'ProductionRouteStep',
1117
+ ProductionUnitQC: 'ProductionUnitQC',
1118
+ OrganizationUserFactoryEntityAccess: 'OrganizationUserFactoryEntityAccess',
1119
+ OperatorOperationCategory: 'OperatorOperationCategory',
1120
+ Task: 'Task',
1121
+ TaskGroup: 'TaskGroup',
1122
+ TaskLot: 'TaskLot',
1123
+ TaskGroupLot: 'TaskGroupLot',
1124
+ TaskInspection: 'TaskInspection',
1125
+ TaskComment: 'TaskComment'
1126
+ };
1127
+ /**
1128
+ * Create the Client
1129
+ */
1130
+ const config = {
1131
+ "previewFeatures": [],
1132
+ "clientVersion": "7.0.0",
1133
+ "engineVersion": "0c19ccc313cf9911a90d99d2ac2eb0280c76c513",
1134
+ "activeProvider": "postgresql",
1135
+ "inlineSchema": "// ----------------------------------------------------------------------\n// HOURLY (HOT DATA)\n// ----------------------------------------------------------------------\nmodel MachineHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n machineId Int\n organizationId Int\n\n totalProductionCount Int?\n efficiency Float?\n utilization Float?\n totalPowerConsumed Float?\n idleTime Float?\n nonWorkingTime Float?\n upTime Float?\n productiveTime Float?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n machine Machine @relation(\"MachineToHourlyAnalytics\", fields: [machineId], references: [id])\n deviceHourlyAnalytics DeviceHourlyAnalytics[] @relation(\"MachineHourlyAnalytics_DeviceHourlyAnalytics\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, machineId, startDateTime], map: \"unique_machineHourlyCompound\")\n @@index([machineId, startDateTime])\n @@schema(\"analytics\")\n}\n\n// ----------------------------------------------------------------------\n// DAILY (WARM DATA - 2 to 5 Years)\n// ----------------------------------------------------------------------\nmodel MachineDailyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n machineId Int\n organizationId Int\n\n totalProductionCount Int?\n avgEfficiency Float?\n avgUtilization Float?\n totalPowerConsumed Float?\n totalUpTime Float?\n\n date DateTime @db.Date // YYYY-MM-DD\n\n machine Machine @relation(\"MachineToDailyAnalytics\", fields: [machineId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, machineId, date], map: \"unique_machineDailyCompound\")\n @@index([machineId, date])\n @@schema(\"analytics\")\n}\n\n// ----------------------------------------------------------------------\n// MONTHLY (COLD DATA - Forever)\n// ----------------------------------------------------------------------\nmodel MachineMonthlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n machineId Int\n organizationId Int\n\n totalProductionCount BigInt?\n avgEfficiency Float?\n totalPowerConsumed Float?\n\n month Int\n year Int\n\n machine Machine @relation(\"MachineToMonthlyAnalytics\", fields: [machineId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, machineId, month, year], map: \"unique_machineMonthlyCompound\")\n @@schema(\"analytics\")\n}\n\n// ----------------------------------------------------------------------\n// OTHER ENTITIES (Hourly is usually sufficient for these)\n// ----------------------------------------------------------------------\n\nmodel LineHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n assemblyLineId Int\n organizationId Int\n\n averageEfficiency Float?\n averageUtilization Float?\n totalProductionCount Int?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n assemblyLine AssemblyLine @relation(\"LineToHourlyAnalytics\", fields: [assemblyLineId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, assemblyLineId, startDateTime], map: \"unique_lineHourlyCompound\")\n @@schema(\"analytics\")\n}\n\nmodel FloorHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n floorId Int\n organizationId Int\n\n averageEfficiency Float?\n totalProductionCount Int?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n floor Floor @relation(\"FloorToHourlyAnalytics\", fields: [floorId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, floorId, startDateTime], map: \"unique_floorHourlyCompound\")\n @@schema(\"analytics\")\n}\n\nmodel FactoryHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n factoryId Int\n organizationId Int\n\n averageEfficiency Float?\n totalProductionCount Int?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n factory Factory @relation(\"FactoryToHourlyAnalytics\", fields: [factoryId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, factoryId, startDateTime], map: \"unique_factoryHourlyCompound\")\n @@schema(\"analytics\")\n}\n\nmodel DeviceHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n deviceId Int\n machineHourlyAnalyticsId BigInt? // Optional if device is not attached to machine\n organizationId Int\n\n totalOnTime Float?\n totalActiveTime Float?\n totalWorkingTime Float?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n device Device @relation(\"DeviceHourlyAnalytics_Device\", fields: [deviceId], references: [id])\n machineHourlyAnalytics MachineHourlyAnalytics? @relation(\"MachineHourlyAnalytics_DeviceHourlyAnalytics\", fields: [machineHourlyAnalyticsId], references: [id])\n sensorHourlyAnalytics SensorHourlyAnalytics[] @relation(\"DeviceHourlyAnalytics_SensorHourlyAnalytics\")\n devicePowerSensorHourlyAnalytics DevicePowerSensorHourlyAnalytics? @relation(\"DevicePowerRelation\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, deviceId, startDateTime], map: \"unique_deviceHourlyCompound\")\n @@schema(\"analytics\")\n}\n\nmodel SensorHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorId Int\n deviceHourlyAnalyticsId BigInt\n\n initialSense DateTime?\n finalSense DateTime?\n startDateTime DateTime?\n endDateTime DateTime?\n\n sensor Sensor @relation(\"SensorHourlyAnalytics_Sensor\", fields: [sensorId], references: [id])\n deviceHourlyAnalytics DeviceHourlyAnalytics @relation(\"DeviceHourlyAnalytics_SensorHourlyAnalytics\", fields: [deviceHourlyAnalyticsId], references: [id])\n\n proximitySensorHourlyAnalytics ProximitySensorHourlyAnalytics?\n infraredSensorHourlyAnalytics InfraredSensorHourlyAnalytics?\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([sensorId, startDateTime], map: \"unique_sensorHourlyCompound\")\n @@schema(\"analytics\")\n}\n\nmodel ProximitySensorHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorHourlyAnalyticsId BigInt @unique(map: \"unique_proximityCompound\")\n totalDetections Int\n productiveDetections Int?\n\n sensorHourlyAnalytics SensorHourlyAnalytics @relation(fields: [sensorHourlyAnalyticsId], references: [id])\n startDateTime DateTime?\n endDateTime DateTime?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"analytics\")\n}\n\nmodel InfraredSensorHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorHourlyAnalyticsId BigInt @unique(map: \"unique_infraredCompound\")\n totalDetections Int\n productiveDetections Int?\n\n sensorHourlyAnalytics SensorHourlyAnalytics @relation(fields: [sensorHourlyAnalyticsId], references: [id])\n startDateTime DateTime?\n endDateTime DateTime?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"analytics\")\n}\n\nmodel DevicePowerSensorHourlyAnalytics {\n id BigInt @id @default(autoincrement()) @db.BigInt\n deviceHourlyAnalyticsId BigInt @unique\n powerEvents Json?\n totalOnTime Float?\n\n startDateTime DateTime?\n endDateTime DateTime?\n\n deviceHourlyAnalytics DeviceHourlyAnalytics @relation(\"DevicePowerRelation\", fields: [deviceHourlyAnalyticsId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"analytics\")\n}\n\n// ----------------------------------------------------------------------\n// SCHEMA: audit\n// ----------------------------------------------------------------------\n\nmodel AuditLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n entityName String\n entityId Int?\n action String\n userId Int? // ID for CoreUser\n orgId Int? // ID for CoreOrganization\n timestamp DateTime @default(now())\n httpMethod String\n route String\n statusCode Int\n ipAddress String?\n userAgent String?\n oldValues Json?\n newValues Json?\n\n @@index([entityName, entityId])\n @@index([userId])\n @@index([orgId])\n @@schema(\"audit\")\n}\n\n// ----------------------------------------------------------------------\n// SCHEMA: chatbot\n// ----------------------------------------------------------------------\n\nenum ChatbotMessageSender {\n USER\n BOT\n\n @@schema(\"chatbot\")\n}\n\nmodel ChatbotHistory {\n id Int @id @default(autoincrement())\n title String\n userId Int // ID for CoreUser\n organizationId Int // ID for CoreOrganization\n messages ChatbotMessage[]\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([userId])\n @@index([organizationId])\n @@index([createdAt])\n @@index([title])\n @@schema(\"chatbot\")\n}\n\nmodel ChatbotMessage {\n id Int @id @default(autoincrement())\n chatHistoryId Int\n sender ChatbotMessageSender\n message String\n tokensUsed Int\n jsonContent Json?\n chatHistory ChatbotHistory @relation(fields: [chatHistoryId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([chatHistoryId])\n @@index([tokensUsed])\n @@schema(\"chatbot\")\n}\n\nenum SensorType {\n PROXIMITY\n INFRARED\n RFID\n CURRENT\n\n @@schema(\"device\")\n}\n\nenum RFIDTapType {\n CHECKIN\n CHECKOUT\n\n @@schema(\"device\")\n}\n\nenum DevicePowerState {\n POWER_ON\n POWER_OFF\n\n @@schema(\"device\")\n}\n\nmodel Gateway {\n id Int @id @default(autoincrement())\n gatewayUid String @unique @default(cuid()) // Matches Core DB\n gatewayName String?\n isActive Boolean @default(true)\n floorId Int\n secret String\n\n // Network Config\n currentWifiSSID String?\n currentWifiPassword String?\n currentMQTTBrokerUrl String?\n fallBackWifiSSID String?\n fallBackWifiPassword String?\n\n devices Device[] @relation(\"GatewayToDevices\")\n floor Floor @relation(\"FloorToGateways\", fields: [floorId], references: [id])\n apiToken GatewayApiToken?\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([floorId])\n @@schema(\"device\")\n}\n\nmodel GatewayApiToken {\n id Int @id @default(autoincrement())\n gatewayId Int @unique\n apiToken String\n expiresAt DateTime\n gateway Gateway @relation(fields: [gatewayId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel Device {\n id Int @id @default(autoincrement())\n\n // PRODUCTION CRITICAL: The Link to your Global Inventory\n globalDeviceUid String @unique // Immutable ID printed on the sticker (Core DB)\n\n deviceUid String @unique @default(cuid()) // Local Internal ID\n deviceName String?\n isActive Boolean @default(true)\n orgId Int\n gatewayId Int?\n\n // Hardware\n sensors Sensor[] @relation(\"DeviceSensors\")\n gateway Gateway? @relation(\"GatewayToDevices\", fields: [gatewayId], references: [id])\n\n // Usage\n tasks Task[] @relation(\"Device_UsedInTasks\")\n machineAssignments MachineDeviceAssignment[] @relation(\"DeviceToMachineAssignments\")\n operatorTimeLogs OperatorTimeLog[] @relation(\"Device_RFIDOperatorTimeLogs\")\n hourlyAnalytics DeviceHourlyAnalytics[] @relation(\"DeviceHourlyAnalytics_Device\")\n\n // Direct Assignments (Location)\n machineId Int?\n machine Machine? @relation(\"MachineToDevicesDirect\", fields: [machineId], references: [id])\n assemblyLineId Int?\n assemblyLine AssemblyLine? @relation(\"AssemblyLineToDevicesDirect\", fields: [assemblyLineId], references: [id])\n floorId Int?\n floor Floor? @relation(\"FloorToDevicesDirect\", fields: [floorId], references: [id])\n factoryId Int?\n factory Factory? @relation(\"FactoryToDevicesDirect\", fields: [factoryId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([orgId])\n @@index([globalDeviceUid])\n @@schema(\"device\")\n}\n\nmodel Sensor {\n id Int @id @default(autoincrement())\n sensorUid String @unique @default(cuid())\n sensorName String?\n sensorType SensorType @default(PROXIMITY)\n deviceId Int\n isActive Boolean @default(true)\n\n device Device @relation(\"DeviceSensors\", fields: [deviceId], references: [id])\n sensorLogs SensorLog[] @relation(\"Sensor_SensorLogs\")\n\n // Configs\n proximityConfig ProximitySensorConfig?\n infraredConfig InfraredSensorConfig?\n currentConfig CurrentSensorConfig?\n\n // Locations\n machineId Int?\n machine Machine? @relation(\"MachineToSensors\", fields: [machineId], references: [id])\n assemblyLineId Int?\n assemblyLine AssemblyLine? @relation(\"AssemblyLineToSensors\", fields: [assemblyLineId], references: [id])\n floorId Int?\n floor Floor? @relation(\"FloorToSensors\", fields: [floorId], references: [id])\n factoryId Int?\n factory Factory? @relation(\"FactoryToSensors\", fields: [factoryId], references: [id])\n\n hourlyAnalytics SensorHourlyAnalytics[] @relation(\"SensorHourlyAnalytics_Sensor\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([deviceId])\n @@schema(\"device\")\n}\n\nmodel ProximitySensorConfig {\n id Int @id @default(autoincrement())\n sensorId Int @unique\n range Float?\n sensitivity Float?\n aggregationFactor Int? @default(1)\n sensor Sensor @relation(fields: [sensorId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel CurrentSensorConfig {\n id Int @id @default(autoincrement())\n sensorId Int @unique\n currentThreshold Float?\n sensor Sensor @relation(fields: [sensorId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel InfraredSensorConfig {\n id Int @id @default(autoincrement())\n sensorId Int @unique\n wavelength Float?\n resolution Int?\n aggregationFactor Int? @default(1)\n sensor Sensor @relation(fields: [sensorId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel MachineDeviceAssignment {\n id Int @id @default(autoincrement())\n deviceId Int\n machineId Int\n assignedAt DateTime @default(now())\n unassignedAt DateTime?\n device Device @relation(\"DeviceToMachineAssignments\", fields: [deviceId], references: [id])\n machine Machine @relation(\"MachineToDeviceAssignments\", fields: [machineId], references: [id])\n\n @@index([deviceId])\n @@schema(\"device\")\n}\n\nmodel SensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorId Int\n senseTime DateTime\n isProcessed Boolean @default(false)\n sensor Sensor @relation(\"Sensor_SensorLogs\", fields: [sensorId], references: [id])\n\n proximityLog ProximitySensorLog? @relation(\"SensorLogProximityLog\")\n infraredLog InfraredSensorLog? @relation(\"SensorLogInfraredLog\")\n rfidLog RFIDSensorLog? @relation(\"SensorLogRFIDSensorLog\")\n devicePowerLog DevicePowerSensorLog? @relation(\"SensorLogDevicePowerSensorLog\")\n currentLog CurrentSensorLog? @relation(\"SensorLogCurrentLog\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n @@unique([sensorId, senseTime])\n @@schema(\"device\")\n}\n\nmodel RFIDSensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorLogId BigInt @unique\n rfid String?\n tapType RFIDTapType\n operatorId Int?\n\n sensorLog SensorLog @relation(\"SensorLogRFIDSensorLog\", fields: [sensorLogId], references: [id], onDelete: Cascade)\n operator Operator? @relation(\"OperatorToSensorLogs\", fields: [operatorId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel ProximitySensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorLogId BigInt @unique\n sensorLog SensorLog @relation(\"SensorLogProximityLog\", fields: [sensorLogId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel InfraredSensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorLogId BigInt @unique\n sensorLog SensorLog @relation(\"SensorLogInfraredLog\", fields: [sensorLogId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel CurrentSensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorLogId BigInt @unique\n currentValue Float?\n sensorLog SensorLog @relation(\"SensorLogCurrentLog\", fields: [sensorLogId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nmodel DevicePowerSensorLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n sensorLogId BigInt @unique\n powerState DevicePowerState\n sensorLog SensorLog @relation(\"SensorLogDevicePowerSensorLog\", fields: [sensorLogId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"device\")\n}\n\nenum WeekDay {\n SUNDAY\n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n\n @@schema(\"factory\")\n}\n\nenum AccessLevel {\n PUBLIC\n PRIVATE\n\n @@schema(\"factory\")\n}\n\nmodel Factory {\n id Int @id @default(autoincrement())\n name String\n description String?\n organizationId Int\n timeZone String @default(\"UTC+5:30\")\n timeZoneString String @default(\"Asia/Kolkata\")\n\n // Hierarchy\n floors Floor[] @relation(\"FactoryToFloors\")\n shifts FactoryShift[] @relation(\"FactoryToShifts\")\n\n // Assets & IoT\n sensors Sensor[] @relation(\"FactoryToSensors\")\n devicesDirect Device[] @relation(\"FactoryToDevicesDirect\")\n\n // People\n operators Operator[] @relation(\"FactoryToOperators\")\n technicians MaintenanceTechnician[] @relation(\"FactoryToTechnicians\")\n\n // Mini-ERP & Production\n finalProducts FinalProduct[] @relation(\"FactoryToFinalProducts\")\n orders Order[] @relation(\"FactoryToOrders\")\n lots FactoryLot[] @relation(\"Factory_Lots\")\n\n // Task Management\n tasksHistory Task[] @relation(\"Factory_Tasks\")\n taskGroups TaskGroup[] @relation(\"Factory_TaskGroups\")\n opCategories OperatorOperationCategory[] @relation(\"Factory_OperatorOperationCategories\")\n\n // Maintenance & Analytics\n requestCategories MaintenanceRequestCategory[] @relation(\"FactoryMaintenanceRequestCategories\")\n hourlyAnalytics FactoryHourlyAnalytics[] @relation(\"FactoryToHourlyAnalytics\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([organizationId])\n @@schema(\"factory\")\n}\n\nmodel Floor {\n id Int @id @default(autoincrement())\n code String?\n name String\n description String?\n factoryId Int\n isActive Boolean @default(true)\n searchTags String[] @default([])\n accessLevel AccessLevel @default(PUBLIC)\n\n // Relations\n lines AssemblyLine[] @relation(\"FloorToLines\")\n gateways Gateway[] @relation(\"FloorToGateways\")\n sensors Sensor[] @relation(\"FloorToSensors\")\n devicesDirect Device[] @relation(\"FloorToDevicesDirect\")\n hourlyAnalytics FloorHourlyAnalytics[] @relation(\"FloorToHourlyAnalytics\")\n\n // Access Control (FIXED: Added this relation)\n userAccess OrganizationUserFactoryEntityAccess[] @relation(\"UserToFloors\")\n\n floorTypeId Int?\n floorType FloorType? @relation(\"FloorToFloorType\", fields: [floorTypeId], references: [id])\n settings FloorSetting? @relation(\"FloorsToFloorSettings\")\n factory Factory @relation(\"FactoryToFloors\", fields: [factoryId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([factoryId])\n @@schema(\"factory\")\n}\n\nmodel FloorType {\n id Int @id @default(autoincrement())\n name String\n organizationId Int\n floors Floor[] @relation(\"FloorToFloorType\")\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, name])\n @@schema(\"factory\")\n}\n\nmodel FloorSetting {\n id Int @id @default(autoincrement())\n floorId Int @unique\n idleThresholdMinutes Int\n oeeExcellentPct Int\n oeeAveragePct Int\n oeePoorPct Int\n downtimeWarnMinutes Int\n downtimeAlertMinutes Int\n peakEnergykWh Int\n offPeakEnergykWh Int\n energyAlertPct Int\n floor Floor @relation(\"FloorsToFloorSettings\", fields: [floorId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"factory\")\n}\n\nmodel AssemblyLine {\n id Int @id @default(autoincrement())\n code String?\n name String\n description String?\n floorId Int\n\n machines Machine[] @relation(\"LineToMachines\")\n sensors Sensor[] @relation(\"AssemblyLineToSensors\")\n devicesDirect Device[] @relation(\"AssemblyLineToDevicesDirect\")\n hourlyAnalytics LineHourlyAnalytics[] @relation(\"LineToHourlyAnalytics\")\n\n // Access Control (FIXED: Added this relation)\n userAccess OrganizationUserFactoryEntityAccess[] @relation(\"UserToAssemblyLines\")\n\n floor Floor @relation(\"FloorToLines\", fields: [floorId], references: [id])\n machineOrder Int[] @default([])\n assemblyLineTypeId Int?\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([floorId])\n @@schema(\"factory\")\n}\n\nmodel FactoryShift {\n id Int @id @default(autoincrement())\n factoryId Int\n name String\n startTime DateTime @db.Time(0)\n endTime DateTime @db.Time(0)\n\n machines FactoryShiftMachine[] @relation(\"ShiftToMachineAssignments\")\n tasks Task[] @relation(\"Task_Shift\")\n factory Factory @relation(\"FactoryToShifts\", fields: [factoryId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([factoryId])\n @@schema(\"factory\")\n}\n\nmodel FactoryShiftMachine {\n id Int @id @default(autoincrement())\n shiftId Int\n machineId Int?\n shift FactoryShift @relation(\"ShiftToMachineAssignments\", fields: [shiftId], references: [id])\n machine Machine? @relation(\"MachineToShiftAssignments\", fields: [machineId], references: [id])\n\n @@schema(\"factory\")\n}\n\nmodel FactoryLot {\n id Int @id @default(autoincrement())\n lotNumber String\n receivedAt DateTime\n expiryAt DateTime?\n factoryId Int\n\n tasks TaskLot[] @relation(\"TaskToLots\")\n taskGroups TaskGroupLot[] @relation(\"TaskGroupToLots\")\n factory Factory @relation(\"Factory_Lots\", fields: [factoryId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([factoryId])\n @@schema(\"factory\")\n}\n\nmodel FinalProduct {\n id Int @id @default(autoincrement())\n\n // ERP OVERLAY FIELDS\n externalId String? // REMOVED @index here\n\n name String\n code String?\n factoryId Int\n description String?\n\n factory Factory @relation(\"FactoryToFinalProducts\", fields: [factoryId], references: [id], onDelete: Cascade)\n routes FinalProductRoute[] @relation(\"FinalProductToRoutes\")\n orderProducts OrderProduct[] @relation(\"OrderProductToProduct\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([externalId]) // ADDED here\n @@schema(\"inventory\")\n}\n\nmodel FinalProductRoute {\n id Int @id @default(autoincrement())\n finalProductId Int\n name String?\n sequence Int\n\n finalProduct FinalProduct @relation(\"FinalProductToRoutes\", fields: [finalProductId], references: [id], onDelete: Cascade)\n machineSteps FinalProductMachineOperationRoute[] @relation(\"FinalProductRouteToSteps\")\n\n dependencies FinalProductRouteDependency[] @relation(\"FinalProductRoute_Dependent\")\n dependents FinalProductRouteDependency[] @relation(\"FinalProductRoute_Prerequisite\")\n taskGroups TaskGroup[] @relation(\"FinalProductRouteToTaskGroups\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"inventory\")\n}\n\nmodel FinalProductMachineOperationRoute {\n id Int @id @default(autoincrement())\n routeId Int\n operationId Int\n productAggregationFactor Int? @default(1)\n sequence Int\n expectedDuration Int?\n\n route FinalProductRoute @relation(\"FinalProductRouteToSteps\", fields: [routeId], references: [id], onDelete: Cascade)\n operation MachineOperation @relation(\"RouteToOperations\", fields: [operationId], references: [id], onDelete: Cascade)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"inventory\")\n}\n\nmodel FinalProductRouteDependency {\n routeId Int\n dependsOnRouteId Int\n route FinalProductRoute @relation(\"FinalProductRoute_Dependent\", fields: [routeId], references: [id], onDelete: Cascade)\n dependsOnRoute FinalProductRoute @relation(\"FinalProductRoute_Prerequisite\", fields: [dependsOnRouteId], references: [id], onDelete: Cascade)\n\n @@id([routeId, dependsOnRouteId])\n @@schema(\"inventory\")\n}\n\nenum ProductionSIUnit {\n COUNT\n WEIGHT\n LITERS\n\n @@schema(\"machine\")\n}\n\nenum MachineAlertSeverity {\n LOW\n MEDIUM\n HIGH\n CRITICAL\n\n @@schema(\"machine\")\n}\n\nenum EventCategory {\n GENERAL\n MEDIUM\n OPERATION\n ALERT\n\n @@schema(\"machine\")\n}\n\nenum MachineTrackingType {\n MANUAL\n AUTOMATED\n\n @@schema(\"machine\")\n}\n\nmodel Machine {\n id Int @id @default(autoincrement())\n name String\n details String?\n idealCycleTimeInSeconds Int?\n assemblyLineId Int?\n machineOperationId Int?\n trackingType MachineTrackingType @default(MANUAL)\n\n // Production & Tasks\n tasks Task[] @relation(\"Machine_UsedInTasks\")\n\n // Hierarchy\n assemblyLine AssemblyLine? @relation(\"LineToMachines\", fields: [assemblyLineId], references: [id])\n operation MachineOperation? @relation(\"OperationToMachine\", fields: [machineOperationId], references: [id])\n shifts FactoryShiftMachine[] @relation(\"MachineToShiftAssignments\")\n\n // Hardware\n sensors Sensor[] @relation(\"MachineToSensors\")\n devicesDirect Device[] @relation(\"MachineToDevicesDirect\")\n deviceAssignments MachineDeviceAssignment[] @relation(\"MachineToDeviceAssignments\")\n\n // Maintenance\n maintenanceLogs MaintenanceLog[] @relation(\"MachineMaintenance\")\n maintenanceRequests MaintenanceRequest[] @relation(\"MaintenanceMachineToRequests\")\n\n // ANALYTICS - WATERFALL STRATEGY\n hourlyAnalytics MachineHourlyAnalytics[] @relation(\"MachineToHourlyAnalytics\")\n dailyAnalytics MachineDailyAnalytics[] @relation(\"MachineToDailyAnalytics\")\n monthlyAnalytics MachineMonthlyAnalytics[] @relation(\"MachineToMonthlyAnalytics\")\n\n operatorTimeLogs OperatorTimeLog[] @relation(\"Machine_RFIDOperatorTimeLogs\")\n events MachineEvent[] @relation(\"MachineEvents\")\n alerts MachineAlert[] @relation(\"MachineToAlerts\")\n alertSubscriptions MachineAlertSubscription[]\n\n // Access Control\n userAccess OrganizationUserFactoryEntityAccess[] @relation(\"UserToMachines\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n @@index([assemblyLineId])\n @@schema(\"machine\")\n}\n\nmodel MachineOperation {\n id Int @id @default(autoincrement())\n operationName String\n description String?\n organizationId Int\n productionSIUnit ProductionSIUnit @default(COUNT)\n\n machines Machine[] @relation(\"OperationToMachine\")\n routeOperations FinalProductMachineOperationRoute[] @relation(\"RouteToOperations\")\n tasks Task[] @relation(\"MachineOperationTasks\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, operationName])\n @@schema(\"machine\")\n}\n\nmodel MachineEvent {\n id Int @id @default(autoincrement())\n machineId Int\n eventTime DateTime\n category EventCategory\n title String\n subtitle String?\n description String?\n machine Machine @relation(\"MachineEvents\", fields: [machineId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([machineId])\n @@schema(\"machine\")\n}\n\nmodel MachineAlert {\n id Int @id @default(autoincrement())\n machineId Int\n title String\n message String\n severity MachineAlertSeverity @default(LOW)\n createdAt DateTime @default(now())\n resolvedAt DateTime?\n machine Machine @relation(\"MachineToAlerts\", fields: [machineId], references: [id])\n // Note: Subscriptions are not linked here. They are settings, not history.\n\n @@schema(\"machine\")\n}\n\nmodel MachineAlertSubscription {\n id Int @id @default(autoincrement())\n userId Int\n machineId Int\n machine Machine @relation(fields: [machineId], references: [id])\n createdAt DateTime @default(now())\n\n @@unique([userId, machineId])\n @@schema(\"machine\")\n}\n\nenum MaintenanceLogStatus {\n OPEN\n IN_PROGRESS\n COMPLETED\n CANCELLED\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceLog {\n id Int @id @default(autoincrement())\n machineId Int\n orgId Int\n reportedById Int?\n description String?\n status MaintenanceLogStatus @default(OPEN)\n startTime DateTime?\n endTime DateTime?\n\n machine Machine @relation(\"MachineMaintenance\", fields: [machineId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceManagerConfig {\n id Int @id @default(autoincrement())\n managerId Int\n key String\n value Json\n updatedAt DateTime @updatedAt\n\n @@unique([managerId, key])\n @@schema(\"maintenance\")\n}\n\nenum MaintenanceRequestStatus {\n NEW\n APPROVED\n ASSIGNED\n IN_PROGRESS\n COMPLETED\n CANCELLED\n\n @@schema(\"maintenance\")\n}\n\nenum MaintenanceRequestPriority {\n LOW\n MEDIUM\n HIGH\n CRITICAL\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceRequest {\n id Int @id @default(autoincrement())\n machineId Int\n requestedById Int\n title String\n description String\n status MaintenanceRequestStatus @default(NEW)\n priority MaintenanceRequestPriority @default(MEDIUM)\n categoryId Int\n\n machine Machine @relation(\"MaintenanceMachineToRequests\", fields: [machineId], references: [id])\n category MaintenanceRequestCategory @relation(\"MaintenanceRequestCategory\", fields: [categoryId], references: [id])\n assignments MaintenanceRequestAssignment[]\n updates MaintenanceRequestUpdate[] @relation(\"MaintenanceReqUpdates\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceRequestCategory {\n id Int @id @default(autoincrement())\n factoryId Int\n name String\n factory Factory @relation(\"FactoryMaintenanceRequestCategories\", fields: [factoryId], references: [id])\n requests MaintenanceRequest[] @relation(\"MaintenanceRequestCategory\")\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([factoryId, name])\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceRequestAssignment {\n id Int @id @default(autoincrement())\n requestId Int\n technicianId Int\n assignedById Int\n assignedAt DateTime @default(now())\n\n request MaintenanceRequest @relation(fields: [requestId], references: [id])\n technician MaintenanceTechnician @relation(fields: [technicianId], references: [id])\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceRequestUpdate {\n id Int @id @default(autoincrement())\n requestId Int\n authorId Int\n message String\n createdAt DateTime @default(now())\n request MaintenanceRequest @relation(\"MaintenanceReqUpdates\", fields: [requestId], references: [id])\n attachments MaintenanceRequestAttachment[]\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceRequestAttachment {\n id Int @id @default(autoincrement())\n updateId Int\n fileUrl String\n fileName String\n uploadedAt DateTime @default(now())\n update MaintenanceRequestUpdate @relation(fields: [updateId], references: [id])\n\n @@schema(\"maintenance\")\n}\n\nmodel MaintenanceTechnician {\n id Int @id @default(autoincrement())\n factoryId Int\n name String\n email String @unique\n phone String?\n hiredAt DateTime @default(now())\n\n factory Factory @relation(\"FactoryToTechnicians\", fields: [factoryId], references: [id])\n specializations TechnicianSpecialization[]\n assignments MaintenanceRequestAssignment[]\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"maintenance\")\n}\n\nmodel TechnicianSpecialization {\n id Int @id @default(autoincrement())\n technicianId Int\n specializationId Int // Links to Core DB Specialization\n technician MaintenanceTechnician @relation(fields: [technicianId], references: [id])\n\n @@unique([technicianId, specializationId])\n @@schema(\"maintenance\")\n}\n\nmodel Operator {\n id Int @id @default(autoincrement())\n rfid String?\n\n // ERP/HR Link\n externalId String? // REMOVED @index here\n\n name String?\n description String?\n organizationId Int?\n factoryId Int?\n\n tasks Task[] @relation(\"Task_Operator\")\n timeLogs OperatorTimeLog[]\n factory Factory? @relation(\"FactoryToOperators\", fields: [factoryId], references: [id])\n sensorLogs RFIDSensorLog[] @relation(\"OperatorToSensorLogs\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([organizationId, rfid])\n @@index([externalId]) // This creates the index\n @@schema(\"operator\")\n}\n\nmodel OperatorTimeLog {\n id BigInt @id @default(autoincrement()) @db.BigInt\n operatorId Int\n checkInAt DateTime\n checkOutAt DateTime?\n deviceId Int?\n machineId Int?\n\n // Efficiency metrics\n totalWorkingTime Int?\n totalIdleTime Int?\n totalNonWorkingTime Int?\n efficiency Float?\n\n operator Operator @relation(fields: [operatorId], references: [id])\n device Device? @relation(\"Device_RFIDOperatorTimeLogs\", fields: [deviceId], references: [id])\n machine Machine? @relation(\"Machine_RFIDOperatorTimeLogs\", fields: [machineId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"operator\")\n}\n\nenum OrderStatus {\n NEW\n CONFIRMED\n IN_PROGRESS\n ON_TRACK\n DELAYED\n AT_RISK\n COMPLETED\n CANCELED\n\n @@schema(\"order\")\n}\n\nenum OrderPriority {\n LOW\n MEDIUM\n HIGH\n CRITICAL\n\n @@schema(\"order\")\n}\n\nenum OrderProductStatus {\n NEW\n IN_PROGRESS\n ON_TRACK\n DELAYED\n AT_RISK\n COMPLETED\n CANCELED\n\n @@schema(\"order\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n organizationId Int\n\n // ERP OVERLAY FIELDS\n externalId String? @unique // e.g., \"SAP-ORDER-1002\"\n erpSource String? // e.g., \"SAP_S4HANA\", \"MS_DYNAMICS\"\n\n customerId Int?\n orderNumber String?\n title String?\n description String?\n factoryId Int\n status OrderStatus @default(NEW)\n progress Float @default(0)\n priority OrderPriority? @default(LOW)\n deadline DateTime?\n startDate DateTime?\n\n createdById Int?\n assignedToId Int?\n assignedById Int?\n approvalAssignedToId Int?\n approvedById Int?\n\n orderProducts OrderProduct[] @relation(\"OrderToOrderProducts\")\n factory Factory @relation(\"FactoryToOrders\", fields: [factoryId], references: [id])\n orderComments OrderComment[] @relation(\"OrderToOrderComments\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([organizationId])\n @@index([customerId])\n @@index([factoryId])\n @@schema(\"order\")\n}\n\nmodel OrderProduct {\n id Int @id @default(autoincrement())\n orderId Int\n productId Int\n quantity Int @default(0)\n title String?\n description String?\n status OrderProductStatus @default(NEW)\n progress Float @default(0)\n\n order Order @relation(\"OrderToOrderProducts\", fields: [orderId], references: [id])\n product FinalProduct @relation(\"OrderProductToProduct\", fields: [productId], references: [id])\n taskGroups TaskGroup[] @relation(\"OrderProductToTaskGroups\")\n productionUnits ProductionUnit[] @relation(\"OrderProductToProductionUnits\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([orderId])\n @@index([productId])\n @@schema(\"order\")\n}\n\nmodel OrderComment {\n id Int @id @default(autoincrement())\n orderId Int\n order Order @relation(\"OrderToOrderComments\", fields: [orderId], references: [id])\n organizationId Int\n authorId Int?\n text String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([orderId])\n @@index([organizationId])\n @@index([authorId])\n @@schema(\"order\")\n}\n\nenum ProductionUnitStatus {\n IN_PRODUCTION\n IN_QA\n REWORK\n COMPLETE\n REJECTED\n SHIPPED\n\n @@schema(\"production_tracking\")\n}\n\nmodel ProductionUnit {\n id String @id @default(cuid())\n tagId String @unique\n serialNumber String? @unique\n organizationId Int\n orderProductId Int\n currentStepId Int?\n status ProductionUnitStatus @default(IN_PRODUCTION)\n\n logs ProductionUnitLog[] @relation(\"UnitLogs\")\n qcRecords ProductionUnitQC[] @relation(\"UnitQCRecords\")\n currentStep ProductionRouteStep? @relation(\"UnitToRouteStep\")\n orderProduct OrderProduct @relation(\"OrderProductToProductionUnits\", fields: [orderProductId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([orderProductId])\n @@schema(\"production_tracking\")\n}\n\nmodel ProductionUnitLog {\n id String @id @default(cuid())\n productionUnitId String\n eventId String\n details String?\n stepId Int?\n operatorId Int?\n\n productionUnit ProductionUnit @relation(\"UnitLogs\", fields: [productionUnitId], references: [id])\n step ProductionRouteStep? @relation(\"StepToLogs\", fields: [stepId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([productionUnitId])\n @@schema(\"production_tracking\")\n}\n\nmodel ProductionRouteStep {\n id Int @id @default(autoincrement())\n productionUnitId String @unique\n stepId Int?\n machineId Int?\n isCompleted Boolean @default(false)\n\n unit ProductionUnit @relation(\"UnitToRouteStep\", fields: [productionUnitId], references: [id])\n logs ProductionUnitLog[] @relation(\"StepToLogs\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"production_tracking\")\n}\n\n// Add ProductionUnitQC as needed, linking to ProductionUnit\nmodel ProductionUnitQC {\n id String @id @default(cuid())\n productionUnitId String\n status String\n inspectorId Int?\n notes String?\n productionUnit ProductionUnit @relation(\"UnitQCRecords\", fields: [productionUnitId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"production_tracking\")\n}\n\nmodel OrganizationUserFactoryEntityAccess {\n id Int @id @default(autoincrement())\n userId Int @unique // Links to CoreUser in Core DB\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n // Local Access Grants\n floors Floor[] @relation(\"UserToFloors\")\n assemblyLines AssemblyLine[] @relation(\"UserToAssemblyLines\")\n machines Machine[] @relation(\"UserToMachines\")\n\n @@index([userId])\n @@schema(\"organization\")\n}\n\n// ----------------------------------------------------------------------\n// FILE: prisma/data/schema.prisma\n// ----------------------------------------------------------------------\n// This is the \"DATA DB\" (Data Plane) template.\n// One instance of this schema will be deployed for EACH tenant.\n// It contains ALL tenant-specific data.\n// ----------------------------------------------------------------------\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../client\"\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\", \"rhel-openssl-3.0.x\", \"darwin-arm64\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n schemas = [\"factory\", \"machine\", \"device\", \"tasks\", \"maintenance\", \"analytics\", \"audit\", \"operator\", \"chatbot\", \"inventory\", \"order\", \"production_tracking\", \"organization\"]\n}\n\nenum TaskStatus {\n NEW\n IN_PROGRESS\n COMPLETED\n CANCELED\n OVERDUE\n INCOMPLETE\n\n @@schema(\"tasks\")\n}\n\nenum TaskGroupStatus {\n NEW\n IN_PROGRESS\n COMPLETED\n CANCELED\n OVERDUE\n INCOMPLETE\n\n @@schema(\"tasks\")\n}\n\nmodel OperatorOperationCategory {\n id Int @id @default(autoincrement())\n factoryId Int\n name String\n description String?\n tasks Task[] @relation(\"OperatorOperationCategory_Tasks\")\n factory Factory @relation(\"Factory_OperatorOperationCategories\", fields: [factoryId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([factoryId])\n @@schema(\"tasks\")\n}\n\nmodel Task {\n id Int @id @default(autoincrement())\n operatorId Int?\n assignedById Int\n assignedToId Int?\n deviceId Int?\n machineId Int?\n taskGroupId Int?\n factoryId Int?\n organizationId Int\n operatorOpCategoryId Int?\n shiftId Int?\n\n title String?\n description String?\n status TaskStatus @default(NEW)\n\n startTime DateTime\n endTime DateTime\n targetCount Int?\n taskCount Int? @default(0)\n sequence Int @default(0)\n reworkOfTaskId Int?\n reworkCount Int @default(0)\n machineOperationId Int?\n startedAt DateTime?\n completedAt DateTime?\n\n // Relations\n operator Operator? @relation(\"Task_Operator\", fields: [operatorId], references: [id])\n device Device? @relation(\"Device_UsedInTasks\", fields: [deviceId], references: [id])\n machine Machine? @relation(\"Machine_UsedInTasks\", fields: [machineId], references: [id])\n taskGroup TaskGroup? @relation(\"TaskGroupTasks\", fields: [taskGroupId], references: [id])\n shift FactoryShift? @relation(\"Task_Shift\", fields: [shiftId], references: [id])\n factory Factory? @relation(\"Factory_Tasks\", fields: [factoryId], references: [id])\n operatorOpCategory OperatorOperationCategory? @relation(\"OperatorOperationCategory_Tasks\", fields: [operatorOpCategoryId], references: [id])\n\n reworkOf Task? @relation(\"Task_Rework\", fields: [reworkOfTaskId], references: [id])\n reworks Task[] @relation(\"Task_Rework\")\n\n lots TaskLot[] @relation(\"TaskToLots\")\n inspections TaskInspection[]\n taskComments TaskComment[] @relation(\"OrderToTaskComments\")\n machineOperation MachineOperation? @relation(\"MachineOperationTasks\", fields: [machineOperationId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([shiftId])\n @@index([taskGroupId])\n @@schema(\"tasks\")\n}\n\nmodel TaskGroup {\n id Int @id @default(autoincrement())\n description String?\n status TaskGroupStatus @default(NEW)\n targetCount Int\n factoryId Int?\n organizationId Int?\n productRouteId Int?\n orderProductId Int?\n deadline DateTime\n reworkOfTaskGroupId Int?\n reworkCount Int @default(0)\n startedAt DateTime?\n completedAt DateTime?\n\n reworkOf TaskGroup? @relation(\"TaskGroupRework\", fields: [reworkOfTaskGroupId], references: [id])\n reworks TaskGroup[] @relation(\"TaskGroupRework\")\n productMachineRoute FinalProductRoute? @relation(\"FinalProductRouteToTaskGroups\", fields: [productRouteId], references: [id])\n orderProduct OrderProduct? @relation(\"OrderProductToTaskGroups\", fields: [orderProductId], references: [id])\n tasks Task[] @relation(\"TaskGroupTasks\")\n lots TaskGroupLot[] @relation(\"TaskGroupToLots\")\n factory Factory? @relation(\"Factory_TaskGroups\", fields: [factoryId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"tasks\")\n}\n\nmodel TaskLot {\n id Int @id @default(autoincrement())\n taskId Int\n lotId Int\n task Task @relation(\"TaskToLots\", fields: [taskId], references: [id])\n lot FactoryLot @relation(\"TaskToLots\", fields: [lotId], references: [id])\n\n @@unique([taskId, lotId])\n @@schema(\"tasks\")\n}\n\nmodel TaskGroupLot {\n id Int @id @default(autoincrement())\n taskGroupId Int\n lotId Int\n taskGroup TaskGroup @relation(\"TaskGroupToLots\", fields: [taskGroupId], references: [id])\n lot FactoryLot @relation(\"TaskGroupToLots\", fields: [lotId], references: [id])\n\n @@unique([taskGroupId, lotId])\n @@schema(\"tasks\")\n}\n\nmodel TaskInspection {\n id Int @id @default(autoincrement())\n taskId Int\n inspectorId Int\n passed Boolean @default(false)\n defectCount Int @default(0)\n wasteCount Int @default(0)\n notes String?\n task Task @relation(fields: [taskId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"tasks\")\n}\n\nmodel TaskComment {\n id Int @id @default(autoincrement())\n taskId Int\n task Task @relation(\"OrderToTaskComments\", fields: [taskId], references: [id])\n organizationId Int\n authorId Int?\n text String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@schema(\"tasks\")\n}\n"
1136
+ }
1137
+
1138
+ config.runtimeDataModel = JSON.parse("{\"models\":{\"MachineHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"efficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"utilization\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalPowerConsumed\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"idleTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"nonWorkingTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"upTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"productiveTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToHourlyAnalytics\"},{\"name\":\"deviceHourlyAnalytics\",\"kind\":\"object\",\"type\":\"DeviceHourlyAnalytics\",\"relationName\":\"MachineHourlyAnalytics_DeviceHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineDailyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avgEfficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"avgUtilization\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalPowerConsumed\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalUpTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToDailyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineMonthlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"avgEfficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalPowerConsumed\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"month\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"year\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToMonthlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"LineHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"assemblyLineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"averageEfficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"averageUtilization\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"assemblyLine\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"LineToHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FloorHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"averageEfficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FactoryHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"averageEfficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalProductionCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"DeviceHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineHourlyAnalyticsId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalOnTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalActiveTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"totalWorkingTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceHourlyAnalytics_Device\"},{\"name\":\"machineHourlyAnalytics\",\"kind\":\"object\",\"type\":\"MachineHourlyAnalytics\",\"relationName\":\"MachineHourlyAnalytics_DeviceHourlyAnalytics\"},{\"name\":\"sensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"SensorHourlyAnalytics\",\"relationName\":\"DeviceHourlyAnalytics_SensorHourlyAnalytics\"},{\"name\":\"devicePowerSensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"DevicePowerSensorHourlyAnalytics\",\"relationName\":\"DevicePowerRelation\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"SensorHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"deviceHourlyAnalyticsId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"initialSense\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"finalSense\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sensor\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"SensorHourlyAnalytics_Sensor\"},{\"name\":\"deviceHourlyAnalytics\",\"kind\":\"object\",\"type\":\"DeviceHourlyAnalytics\",\"relationName\":\"DeviceHourlyAnalytics_SensorHourlyAnalytics\"},{\"name\":\"proximitySensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"ProximitySensorHourlyAnalytics\",\"relationName\":\"ProximitySensorHourlyAnalyticsToSensorHourlyAnalytics\"},{\"name\":\"infraredSensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"InfraredSensorHourlyAnalytics\",\"relationName\":\"InfraredSensorHourlyAnalyticsToSensorHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProximitySensorHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorHourlyAnalyticsId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"totalDetections\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productiveDetections\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"SensorHourlyAnalytics\",\"relationName\":\"ProximitySensorHourlyAnalyticsToSensorHourlyAnalytics\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"InfraredSensorHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorHourlyAnalyticsId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"totalDetections\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productiveDetections\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorHourlyAnalytics\",\"kind\":\"object\",\"type\":\"SensorHourlyAnalytics\",\"relationName\":\"InfraredSensorHourlyAnalyticsToSensorHourlyAnalytics\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"DevicePowerSensorHourlyAnalytics\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"deviceHourlyAnalyticsId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"powerEvents\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"totalOnTime\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"startDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endDateTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deviceHourlyAnalytics\",\"kind\":\"object\",\"type\":\"DeviceHourlyAnalytics\",\"relationName\":\"DevicePowerRelation\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"AuditLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"entityName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"entityId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"action\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orgId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"httpMethod\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"route\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"statusCode\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"oldValues\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"newValues\",\"kind\":\"scalar\",\"type\":\"Json\"}],\"dbName\":null},\"ChatbotHistory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"messages\",\"kind\":\"object\",\"type\":\"ChatbotMessage\",\"relationName\":\"ChatbotHistoryToChatbotMessage\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ChatbotMessage\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"chatHistoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sender\",\"kind\":\"enum\",\"type\":\"ChatbotMessageSender\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tokensUsed\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"jsonContent\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"chatHistory\",\"kind\":\"object\",\"type\":\"ChatbotHistory\",\"relationName\":\"ChatbotHistoryToChatbotMessage\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Gateway\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"gatewayUid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"gatewayName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"secret\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"currentWifiSSID\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"currentWifiPassword\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"currentMQTTBrokerUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fallBackWifiSSID\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fallBackWifiPassword\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"devices\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"GatewayToDevices\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToGateways\"},{\"name\":\"apiToken\",\"kind\":\"object\",\"type\":\"GatewayApiToken\",\"relationName\":\"GatewayToGatewayApiToken\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"GatewayApiToken\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"gatewayId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"apiToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"gateway\",\"kind\":\"object\",\"type\":\"Gateway\",\"relationName\":\"GatewayToGatewayApiToken\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Device\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"globalDeviceUid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"deviceUid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"deviceName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"orgId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"gatewayId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensors\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"DeviceSensors\"},{\"name\":\"gateway\",\"kind\":\"object\",\"type\":\"Gateway\",\"relationName\":\"GatewayToDevices\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Device_UsedInTasks\"},{\"name\":\"machineAssignments\",\"kind\":\"object\",\"type\":\"MachineDeviceAssignment\",\"relationName\":\"DeviceToMachineAssignments\"},{\"name\":\"operatorTimeLogs\",\"kind\":\"object\",\"type\":\"OperatorTimeLog\",\"relationName\":\"Device_RFIDOperatorTimeLogs\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"DeviceHourlyAnalytics\",\"relationName\":\"DeviceHourlyAnalytics_Device\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToDevicesDirect\"},{\"name\":\"assemblyLineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assemblyLine\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"AssemblyLineToDevicesDirect\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToDevicesDirect\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToDevicesDirect\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Sensor\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorUid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sensorName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sensorType\",\"kind\":\"enum\",\"type\":\"SensorType\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceSensors\"},{\"name\":\"sensorLogs\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"Sensor_SensorLogs\"},{\"name\":\"proximityConfig\",\"kind\":\"object\",\"type\":\"ProximitySensorConfig\",\"relationName\":\"ProximitySensorConfigToSensor\"},{\"name\":\"infraredConfig\",\"kind\":\"object\",\"type\":\"InfraredSensorConfig\",\"relationName\":\"InfraredSensorConfigToSensor\"},{\"name\":\"currentConfig\",\"kind\":\"object\",\"type\":\"CurrentSensorConfig\",\"relationName\":\"CurrentSensorConfigToSensor\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToSensors\"},{\"name\":\"assemblyLineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assemblyLine\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"AssemblyLineToSensors\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToSensors\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToSensors\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"SensorHourlyAnalytics\",\"relationName\":\"SensorHourlyAnalytics_Sensor\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProximitySensorConfig\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"range\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"sensitivity\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"aggregationFactor\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensor\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"ProximitySensorConfigToSensor\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"CurrentSensorConfig\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"currentThreshold\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"sensor\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"CurrentSensorConfigToSensor\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"InfraredSensorConfig\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"wavelength\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"resolution\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"aggregationFactor\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensor\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"InfraredSensorConfigToSensor\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineDeviceAssignment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"unassignedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToMachineAssignments\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToDeviceAssignments\"}],\"dbName\":null},\"SensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"senseTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"isProcessed\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sensor\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"Sensor_SensorLogs\"},{\"name\":\"proximityLog\",\"kind\":\"object\",\"type\":\"ProximitySensorLog\",\"relationName\":\"SensorLogProximityLog\"},{\"name\":\"infraredLog\",\"kind\":\"object\",\"type\":\"InfraredSensorLog\",\"relationName\":\"SensorLogInfraredLog\"},{\"name\":\"rfidLog\",\"kind\":\"object\",\"type\":\"RFIDSensorLog\",\"relationName\":\"SensorLogRFIDSensorLog\"},{\"name\":\"devicePowerLog\",\"kind\":\"object\",\"type\":\"DevicePowerSensorLog\",\"relationName\":\"SensorLogDevicePowerSensorLog\"},{\"name\":\"currentLog\",\"kind\":\"object\",\"type\":\"CurrentSensorLog\",\"relationName\":\"SensorLogCurrentLog\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"RFIDSensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLogId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"rfid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tapType\",\"kind\":\"enum\",\"type\":\"RFIDTapType\"},{\"name\":\"operatorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sensorLog\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"SensorLogRFIDSensorLog\"},{\"name\":\"operator\",\"kind\":\"object\",\"type\":\"Operator\",\"relationName\":\"OperatorToSensorLogs\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProximitySensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLogId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLog\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"SensorLogProximityLog\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"InfraredSensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLogId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLog\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"SensorLogInfraredLog\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"CurrentSensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLogId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"currentValue\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"sensorLog\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"SensorLogCurrentLog\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"DevicePowerSensorLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"sensorLogId\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"powerState\",\"kind\":\"enum\",\"type\":\"DevicePowerState\"},{\"name\":\"sensorLog\",\"kind\":\"object\",\"type\":\"SensorLog\",\"relationName\":\"SensorLogDevicePowerSensorLog\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Factory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timeZone\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"timeZoneString\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"floors\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FactoryToFloors\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"FactoryShift\",\"relationName\":\"FactoryToShifts\"},{\"name\":\"sensors\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"FactoryToSensors\"},{\"name\":\"devicesDirect\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"FactoryToDevicesDirect\"},{\"name\":\"operators\",\"kind\":\"object\",\"type\":\"Operator\",\"relationName\":\"FactoryToOperators\"},{\"name\":\"technicians\",\"kind\":\"object\",\"type\":\"MaintenanceTechnician\",\"relationName\":\"FactoryToTechnicians\"},{\"name\":\"finalProducts\",\"kind\":\"object\",\"type\":\"FinalProduct\",\"relationName\":\"FactoryToFinalProducts\"},{\"name\":\"orders\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"FactoryToOrders\"},{\"name\":\"lots\",\"kind\":\"object\",\"type\":\"FactoryLot\",\"relationName\":\"Factory_Lots\"},{\"name\":\"tasksHistory\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Factory_Tasks\"},{\"name\":\"taskGroups\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"Factory_TaskGroups\"},{\"name\":\"opCategories\",\"kind\":\"object\",\"type\":\"OperatorOperationCategory\",\"relationName\":\"Factory_OperatorOperationCategories\"},{\"name\":\"requestCategories\",\"kind\":\"object\",\"type\":\"MaintenanceRequestCategory\",\"relationName\":\"FactoryMaintenanceRequestCategories\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"FactoryHourlyAnalytics\",\"relationName\":\"FactoryToHourlyAnalytics\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Floor\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"searchTags\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessLevel\",\"kind\":\"enum\",\"type\":\"AccessLevel\"},{\"name\":\"lines\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"FloorToLines\"},{\"name\":\"gateways\",\"kind\":\"object\",\"type\":\"Gateway\",\"relationName\":\"FloorToGateways\"},{\"name\":\"sensors\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"FloorToSensors\"},{\"name\":\"devicesDirect\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"FloorToDevicesDirect\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"FloorHourlyAnalytics\",\"relationName\":\"FloorToHourlyAnalytics\"},{\"name\":\"userAccess\",\"kind\":\"object\",\"type\":\"OrganizationUserFactoryEntityAccess\",\"relationName\":\"UserToFloors\"},{\"name\":\"floorTypeId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floorType\",\"kind\":\"object\",\"type\":\"FloorType\",\"relationName\":\"FloorToFloorType\"},{\"name\":\"settings\",\"kind\":\"object\",\"type\":\"FloorSetting\",\"relationName\":\"FloorsToFloorSettings\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToFloors\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FloorType\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floors\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToFloorType\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FloorSetting\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"idleThresholdMinutes\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"oeeExcellentPct\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"oeeAveragePct\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"oeePoorPct\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"downtimeWarnMinutes\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"downtimeAlertMinutes\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"peakEnergykWh\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"offPeakEnergykWh\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"energyAlertPct\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorsToFloorSettings\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"AssemblyLine\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"floorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machines\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"LineToMachines\"},{\"name\":\"sensors\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"AssemblyLineToSensors\"},{\"name\":\"devicesDirect\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"AssemblyLineToDevicesDirect\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"LineHourlyAnalytics\",\"relationName\":\"LineToHourlyAnalytics\"},{\"name\":\"userAccess\",\"kind\":\"object\",\"type\":\"OrganizationUserFactoryEntityAccess\",\"relationName\":\"UserToAssemblyLines\"},{\"name\":\"floor\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"FloorToLines\"},{\"name\":\"machineOrder\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assemblyLineTypeId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FactoryShift\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"machines\",\"kind\":\"object\",\"type\":\"FactoryShiftMachine\",\"relationName\":\"ShiftToMachineAssignments\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Task_Shift\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToShifts\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FactoryShiftMachine\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"shiftId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"FactoryShift\",\"relationName\":\"ShiftToMachineAssignments\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToShiftAssignments\"}],\"dbName\":null},\"FactoryLot\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"lotNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expiryAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"TaskLot\",\"relationName\":\"TaskToLots\"},{\"name\":\"taskGroups\",\"kind\":\"object\",\"type\":\"TaskGroupLot\",\"relationName\":\"TaskGroupToLots\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"Factory_Lots\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FinalProduct\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"externalId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToFinalProducts\"},{\"name\":\"routes\",\"kind\":\"object\",\"type\":\"FinalProductRoute\",\"relationName\":\"FinalProductToRoutes\"},{\"name\":\"orderProducts\",\"kind\":\"object\",\"type\":\"OrderProduct\",\"relationName\":\"OrderProductToProduct\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FinalProductRoute\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"finalProductId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sequence\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"finalProduct\",\"kind\":\"object\",\"type\":\"FinalProduct\",\"relationName\":\"FinalProductToRoutes\"},{\"name\":\"machineSteps\",\"kind\":\"object\",\"type\":\"FinalProductMachineOperationRoute\",\"relationName\":\"FinalProductRouteToSteps\"},{\"name\":\"dependencies\",\"kind\":\"object\",\"type\":\"FinalProductRouteDependency\",\"relationName\":\"FinalProductRoute_Dependent\"},{\"name\":\"dependents\",\"kind\":\"object\",\"type\":\"FinalProductRouteDependency\",\"relationName\":\"FinalProductRoute_Prerequisite\"},{\"name\":\"taskGroups\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"FinalProductRouteToTaskGroups\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FinalProductMachineOperationRoute\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"routeId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"operationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productAggregationFactor\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sequence\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"expectedDuration\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"route\",\"kind\":\"object\",\"type\":\"FinalProductRoute\",\"relationName\":\"FinalProductRouteToSteps\"},{\"name\":\"operation\",\"kind\":\"object\",\"type\":\"MachineOperation\",\"relationName\":\"RouteToOperations\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"FinalProductRouteDependency\":{\"fields\":[{\"name\":\"routeId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"dependsOnRouteId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"route\",\"kind\":\"object\",\"type\":\"FinalProductRoute\",\"relationName\":\"FinalProductRoute_Dependent\"},{\"name\":\"dependsOnRoute\",\"kind\":\"object\",\"type\":\"FinalProductRoute\",\"relationName\":\"FinalProductRoute_Prerequisite\"}],\"dbName\":null},\"Machine\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"details\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"idealCycleTimeInSeconds\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assemblyLineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineOperationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"trackingType\",\"kind\":\"enum\",\"type\":\"MachineTrackingType\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Machine_UsedInTasks\"},{\"name\":\"assemblyLine\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"LineToMachines\"},{\"name\":\"operation\",\"kind\":\"object\",\"type\":\"MachineOperation\",\"relationName\":\"OperationToMachine\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"FactoryShiftMachine\",\"relationName\":\"MachineToShiftAssignments\"},{\"name\":\"sensors\",\"kind\":\"object\",\"type\":\"Sensor\",\"relationName\":\"MachineToSensors\"},{\"name\":\"devicesDirect\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"MachineToDevicesDirect\"},{\"name\":\"deviceAssignments\",\"kind\":\"object\",\"type\":\"MachineDeviceAssignment\",\"relationName\":\"MachineToDeviceAssignments\"},{\"name\":\"maintenanceLogs\",\"kind\":\"object\",\"type\":\"MaintenanceLog\",\"relationName\":\"MachineMaintenance\"},{\"name\":\"maintenanceRequests\",\"kind\":\"object\",\"type\":\"MaintenanceRequest\",\"relationName\":\"MaintenanceMachineToRequests\"},{\"name\":\"hourlyAnalytics\",\"kind\":\"object\",\"type\":\"MachineHourlyAnalytics\",\"relationName\":\"MachineToHourlyAnalytics\"},{\"name\":\"dailyAnalytics\",\"kind\":\"object\",\"type\":\"MachineDailyAnalytics\",\"relationName\":\"MachineToDailyAnalytics\"},{\"name\":\"monthlyAnalytics\",\"kind\":\"object\",\"type\":\"MachineMonthlyAnalytics\",\"relationName\":\"MachineToMonthlyAnalytics\"},{\"name\":\"operatorTimeLogs\",\"kind\":\"object\",\"type\":\"OperatorTimeLog\",\"relationName\":\"Machine_RFIDOperatorTimeLogs\"},{\"name\":\"events\",\"kind\":\"object\",\"type\":\"MachineEvent\",\"relationName\":\"MachineEvents\"},{\"name\":\"alerts\",\"kind\":\"object\",\"type\":\"MachineAlert\",\"relationName\":\"MachineToAlerts\"},{\"name\":\"alertSubscriptions\",\"kind\":\"object\",\"type\":\"MachineAlertSubscription\",\"relationName\":\"MachineToMachineAlertSubscription\"},{\"name\":\"userAccess\",\"kind\":\"object\",\"type\":\"OrganizationUserFactoryEntityAccess\",\"relationName\":\"UserToMachines\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineOperation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"operationName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productionSIUnit\",\"kind\":\"enum\",\"type\":\"ProductionSIUnit\"},{\"name\":\"machines\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"OperationToMachine\"},{\"name\":\"routeOperations\",\"kind\":\"object\",\"type\":\"FinalProductMachineOperationRoute\",\"relationName\":\"RouteToOperations\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"MachineOperationTasks\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineEvent\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"eventTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category\",\"kind\":\"enum\",\"type\":\"EventCategory\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"subtitle\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineEvents\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MachineAlert\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"severity\",\"kind\":\"enum\",\"type\":\"MachineAlertSeverity\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"resolvedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToAlerts\"}],\"dbName\":null},\"MachineAlertSubscription\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineToMachineAlertSubscription\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MaintenanceLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orgId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"reportedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"MaintenanceLogStatus\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MachineMaintenance\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MaintenanceManagerConfig\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"managerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MaintenanceRequest\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"requestedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"MaintenanceRequestStatus\"},{\"name\":\"priority\",\"kind\":\"enum\",\"type\":\"MaintenanceRequestPriority\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"MaintenanceMachineToRequests\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"MaintenanceRequestCategory\",\"relationName\":\"MaintenanceRequestCategory\"},{\"name\":\"assignments\",\"kind\":\"object\",\"type\":\"MaintenanceRequestAssignment\",\"relationName\":\"MaintenanceRequestToMaintenanceRequestAssignment\"},{\"name\":\"updates\",\"kind\":\"object\",\"type\":\"MaintenanceRequestUpdate\",\"relationName\":\"MaintenanceReqUpdates\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MaintenanceRequestCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryMaintenanceRequestCategories\"},{\"name\":\"requests\",\"kind\":\"object\",\"type\":\"MaintenanceRequest\",\"relationName\":\"MaintenanceRequestCategory\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"MaintenanceRequestAssignment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"requestId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"technicianId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"request\",\"kind\":\"object\",\"type\":\"MaintenanceRequest\",\"relationName\":\"MaintenanceRequestToMaintenanceRequestAssignment\"},{\"name\":\"technician\",\"kind\":\"object\",\"type\":\"MaintenanceTechnician\",\"relationName\":\"MaintenanceRequestAssignmentToMaintenanceTechnician\"}],\"dbName\":null},\"MaintenanceRequestUpdate\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"requestId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"request\",\"kind\":\"object\",\"type\":\"MaintenanceRequest\",\"relationName\":\"MaintenanceReqUpdates\"},{\"name\":\"attachments\",\"kind\":\"object\",\"type\":\"MaintenanceRequestAttachment\",\"relationName\":\"MaintenanceRequestAttachmentToMaintenanceRequestUpdate\"}],\"dbName\":null},\"MaintenanceRequestAttachment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"updateId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"fileUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fileName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uploadedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"update\",\"kind\":\"object\",\"type\":\"MaintenanceRequestUpdate\",\"relationName\":\"MaintenanceRequestAttachmentToMaintenanceRequestUpdate\"}],\"dbName\":null},\"MaintenanceTechnician\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"hiredAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToTechnicians\"},{\"name\":\"specializations\",\"kind\":\"object\",\"type\":\"TechnicianSpecialization\",\"relationName\":\"MaintenanceTechnicianToTechnicianSpecialization\"},{\"name\":\"assignments\",\"kind\":\"object\",\"type\":\"MaintenanceRequestAssignment\",\"relationName\":\"MaintenanceRequestAssignmentToMaintenanceTechnician\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"TechnicianSpecialization\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"technicianId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"specializationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"technician\",\"kind\":\"object\",\"type\":\"MaintenanceTechnician\",\"relationName\":\"MaintenanceTechnicianToTechnicianSpecialization\"}],\"dbName\":null},\"Operator\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"rfid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"externalId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Task_Operator\"},{\"name\":\"timeLogs\",\"kind\":\"object\",\"type\":\"OperatorTimeLog\",\"relationName\":\"OperatorToOperatorTimeLog\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToOperators\"},{\"name\":\"sensorLogs\",\"kind\":\"object\",\"type\":\"RFIDSensorLog\",\"relationName\":\"OperatorToSensorLogs\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"OperatorTimeLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"BigInt\"},{\"name\":\"operatorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"checkInAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"checkOutAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalWorkingTime\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalIdleTime\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"totalNonWorkingTime\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"efficiency\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"operator\",\"kind\":\"object\",\"type\":\"Operator\",\"relationName\":\"OperatorToOperatorTimeLog\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"Device_RFIDOperatorTimeLogs\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"Machine_RFIDOperatorTimeLogs\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Order\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"externalId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"erpSource\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderStatus\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"priority\",\"kind\":\"enum\",\"type\":\"OrderPriority\"},{\"name\":\"deadline\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"startDate\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedToId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"approvalAssignedToId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"approvedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderProducts\",\"kind\":\"object\",\"type\":\"OrderProduct\",\"relationName\":\"OrderToOrderProducts\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"FactoryToOrders\"},{\"name\":\"orderComments\",\"kind\":\"object\",\"type\":\"OrderComment\",\"relationName\":\"OrderToOrderComments\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"OrderProduct\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderProductStatus\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"order\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"OrderToOrderProducts\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"FinalProduct\",\"relationName\":\"OrderProductToProduct\"},{\"name\":\"taskGroups\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"OrderProductToTaskGroups\"},{\"name\":\"productionUnits\",\"kind\":\"object\",\"type\":\"ProductionUnit\",\"relationName\":\"OrderProductToProductionUnits\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"OrderComment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"order\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"OrderToOrderComments\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"text\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProductionUnit\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tagId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"serialNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderProductId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"currentStepId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"ProductionUnitStatus\"},{\"name\":\"logs\",\"kind\":\"object\",\"type\":\"ProductionUnitLog\",\"relationName\":\"UnitLogs\"},{\"name\":\"qcRecords\",\"kind\":\"object\",\"type\":\"ProductionUnitQC\",\"relationName\":\"UnitQCRecords\"},{\"name\":\"currentStep\",\"kind\":\"object\",\"type\":\"ProductionRouteStep\",\"relationName\":\"UnitToRouteStep\"},{\"name\":\"orderProduct\",\"kind\":\"object\",\"type\":\"OrderProduct\",\"relationName\":\"OrderProductToProductionUnits\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProductionUnitLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"productionUnitId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"details\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"stepId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"operatorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productionUnit\",\"kind\":\"object\",\"type\":\"ProductionUnit\",\"relationName\":\"UnitLogs\"},{\"name\":\"step\",\"kind\":\"object\",\"type\":\"ProductionRouteStep\",\"relationName\":\"StepToLogs\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProductionRouteStep\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productionUnitId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"stepId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"isCompleted\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"unit\",\"kind\":\"object\",\"type\":\"ProductionUnit\",\"relationName\":\"UnitToRouteStep\"},{\"name\":\"logs\",\"kind\":\"object\",\"type\":\"ProductionUnitLog\",\"relationName\":\"StepToLogs\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"ProductionUnitQC\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"productionUnitId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"inspectorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"productionUnit\",\"kind\":\"object\",\"type\":\"ProductionUnit\",\"relationName\":\"UnitQCRecords\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"OrganizationUserFactoryEntityAccess\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"floors\",\"kind\":\"object\",\"type\":\"Floor\",\"relationName\":\"UserToFloors\"},{\"name\":\"assemblyLines\",\"kind\":\"object\",\"type\":\"AssemblyLine\",\"relationName\":\"UserToAssemblyLines\"},{\"name\":\"machines\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"UserToMachines\"}],\"dbName\":null},\"OperatorOperationCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"OperatorOperationCategory_Tasks\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"Factory_OperatorOperationCategories\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Task\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"operatorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedById\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"assignedToId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"deviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskGroupId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"operatorOpCategoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"shiftId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"TaskStatus\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"targetCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"sequence\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"reworkOfTaskId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"reworkCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"machineOperationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"startedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"completedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"operator\",\"kind\":\"object\",\"type\":\"Operator\",\"relationName\":\"Task_Operator\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"Device_UsedInTasks\"},{\"name\":\"machine\",\"kind\":\"object\",\"type\":\"Machine\",\"relationName\":\"Machine_UsedInTasks\"},{\"name\":\"taskGroup\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"TaskGroupTasks\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"FactoryShift\",\"relationName\":\"Task_Shift\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"Factory_Tasks\"},{\"name\":\"operatorOpCategory\",\"kind\":\"object\",\"type\":\"OperatorOperationCategory\",\"relationName\":\"OperatorOperationCategory_Tasks\"},{\"name\":\"reworkOf\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Task_Rework\"},{\"name\":\"reworks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"Task_Rework\"},{\"name\":\"lots\",\"kind\":\"object\",\"type\":\"TaskLot\",\"relationName\":\"TaskToLots\"},{\"name\":\"inspections\",\"kind\":\"object\",\"type\":\"TaskInspection\",\"relationName\":\"TaskToTaskInspection\"},{\"name\":\"taskComments\",\"kind\":\"object\",\"type\":\"TaskComment\",\"relationName\":\"OrderToTaskComments\"},{\"name\":\"machineOperation\",\"kind\":\"object\",\"type\":\"MachineOperation\",\"relationName\":\"MachineOperationTasks\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"TaskGroup\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"TaskGroupStatus\"},{\"name\":\"targetCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"factoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productRouteId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderProductId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"deadline\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"reworkOfTaskGroupId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"reworkCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"startedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"completedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"reworkOf\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"TaskGroupRework\"},{\"name\":\"reworks\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"TaskGroupRework\"},{\"name\":\"productMachineRoute\",\"kind\":\"object\",\"type\":\"FinalProductRoute\",\"relationName\":\"FinalProductRouteToTaskGroups\"},{\"name\":\"orderProduct\",\"kind\":\"object\",\"type\":\"OrderProduct\",\"relationName\":\"OrderProductToTaskGroups\"},{\"name\":\"tasks\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"TaskGroupTasks\"},{\"name\":\"lots\",\"kind\":\"object\",\"type\":\"TaskGroupLot\",\"relationName\":\"TaskGroupToLots\"},{\"name\":\"factory\",\"kind\":\"object\",\"type\":\"Factory\",\"relationName\":\"Factory_TaskGroups\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"TaskLot\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"lotId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"task\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"TaskToLots\"},{\"name\":\"lot\",\"kind\":\"object\",\"type\":\"FactoryLot\",\"relationName\":\"TaskToLots\"}],\"dbName\":null},\"TaskGroupLot\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskGroupId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"lotId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskGroup\",\"kind\":\"object\",\"type\":\"TaskGroup\",\"relationName\":\"TaskGroupToLots\"},{\"name\":\"lot\",\"kind\":\"object\",\"type\":\"FactoryLot\",\"relationName\":\"TaskGroupToLots\"}],\"dbName\":null},\"TaskInspection\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inspectorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"passed\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"defectCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"wasteCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"task\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"TaskToTaskInspection\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"TaskComment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"taskId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"task\",\"kind\":\"object\",\"type\":\"Task\",\"relationName\":\"OrderToTaskComments\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"text\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
1139
+ defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
1140
+ config.compilerWasm = {
1141
+ getRuntime: async () => require('./query_compiler_bg.js'),
1142
+ getQueryCompilerWasmModule: async () => {
1143
+ const { Buffer } = require('node:buffer')
1144
+ const { wasm } = require('./query_compiler_bg.wasm-base64.js')
1145
+ const queryCompilerWasmFileBytes = Buffer.from(wasm, 'base64')
1146
+
1147
+ return new WebAssembly.Module(queryCompilerWasmFileBytes)
1148
+ }
1149
+ }
1150
+
1151
+ const PrismaClient = getPrismaClient(config)
1152
+ exports.PrismaClient = PrismaClient
1153
+ Object.assign(exports, Prisma)