@delpa/mt-prisma 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/generated/client/edge.js +63 -3
- package/dist/generated/generated/client/index-browser.js +61 -1
- package/dist/generated/generated/client/index.d.ts +7095 -164
- package/dist/generated/generated/client/index.js +63 -3
- package/dist/generated/generated/client/package.json +1 -1
- package/dist/generated/generated/client/schema.prisma +91 -6
- package/generated/client/edge.js +63 -3
- package/generated/client/index-browser.js +61 -1
- package/generated/client/index.d.ts +7095 -164
- package/generated/client/index.js +63 -3
- package/generated/client/package.json +1 -1
- package/generated/client/schema.prisma +91 -6
- package/package.json +1 -1
- package/prisma/migrations/20260121144101_add_equipament_table/migration.sql +92 -0
- package/prisma/migrations/20260121180634_add_vehicle_id_to_equipment/migration.sql +8 -0
- package/prisma/migrations/20260122143027_add_route_optimization_fields/migration.sql +9 -0
- package/prisma/schema.prisma +86 -0
package/prisma/schema.prisma
CHANGED
|
@@ -86,6 +86,12 @@ enum AddressType {
|
|
|
86
86
|
OTHER
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
enum EquipmentStatus {
|
|
90
|
+
ACTIVE
|
|
91
|
+
INACTIVE
|
|
92
|
+
MAINTENANCE
|
|
93
|
+
}
|
|
94
|
+
|
|
89
95
|
model Client {
|
|
90
96
|
id String @id @default(uuid()) @db.Uuid
|
|
91
97
|
tax_id String?
|
|
@@ -179,6 +185,7 @@ model companies {
|
|
|
179
185
|
clients Client[]
|
|
180
186
|
vehicles Vehicle[]
|
|
181
187
|
user_companies UserCompany[]
|
|
188
|
+
equipments Equipment[]
|
|
182
189
|
|
|
183
190
|
@@map("companies")
|
|
184
191
|
}
|
|
@@ -323,6 +330,7 @@ model Vehicle {
|
|
|
323
330
|
model VehicleModel? @relation(fields: [model_id], references: [id], onDelete: SetNull)
|
|
324
331
|
company companies? @relation(fields: [company_id], references: [id], onDelete: Cascade)
|
|
325
332
|
routes Route[]
|
|
333
|
+
equipments Equipment[]
|
|
326
334
|
|
|
327
335
|
@@index([company_id])
|
|
328
336
|
@@index([brand_id])
|
|
@@ -340,6 +348,16 @@ model Route {
|
|
|
340
348
|
status RouteStatus @default(PENDING)
|
|
341
349
|
started_at DateTime?
|
|
342
350
|
completed_at DateTime?
|
|
351
|
+
|
|
352
|
+
optimized_at DateTime?
|
|
353
|
+
optimization_polyline String?
|
|
354
|
+
optimization_distance_meters Int?
|
|
355
|
+
optimization_duration_seconds Int?
|
|
356
|
+
optimization_distance_saved_meters Int?
|
|
357
|
+
optimization_duration_saved_seconds Int?
|
|
358
|
+
optimization_percentage Float?
|
|
359
|
+
optimization_waypoint_order Json?
|
|
360
|
+
|
|
343
361
|
created_at DateTime @default(now())
|
|
344
362
|
updated_at DateTime @updatedAt
|
|
345
363
|
|
|
@@ -415,4 +433,72 @@ model AddressHandlingUnit {
|
|
|
415
433
|
@@index([handling_unit_id])
|
|
416
434
|
|
|
417
435
|
@@map("address_handling_units")
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
model EquipmentBrand {
|
|
439
|
+
id String @id @default(uuid()) @db.Uuid
|
|
440
|
+
name String @unique
|
|
441
|
+
logo_url String?
|
|
442
|
+
is_active Boolean @default(true)
|
|
443
|
+
created_at DateTime @default(now())
|
|
444
|
+
updated_at DateTime @updatedAt
|
|
445
|
+
|
|
446
|
+
models EquipmentModel[]
|
|
447
|
+
equipments Equipment[]
|
|
448
|
+
|
|
449
|
+
@@map("equipment_brands")
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
model EquipmentModel {
|
|
453
|
+
id String @id @default(uuid()) @db.Uuid
|
|
454
|
+
name String
|
|
455
|
+
brand_id String @db.Uuid
|
|
456
|
+
is_active Boolean @default(true)
|
|
457
|
+
created_at DateTime @default(now())
|
|
458
|
+
updated_at DateTime @updatedAt
|
|
459
|
+
|
|
460
|
+
brand EquipmentBrand @relation(fields: [brand_id], references: [id], onDelete: Cascade)
|
|
461
|
+
equipment Equipment[]
|
|
462
|
+
|
|
463
|
+
@@unique([name, brand_id])
|
|
464
|
+
@@index([brand_id])
|
|
465
|
+
@@map("equipment_models")
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
model Equipment {
|
|
470
|
+
id String @id @default(uuid()) @db.Uuid
|
|
471
|
+
title String
|
|
472
|
+
plate String? @unique
|
|
473
|
+
year Int?
|
|
474
|
+
color VehicleColor?
|
|
475
|
+
brand_id String? @db.Uuid
|
|
476
|
+
model_id String? @db.Uuid
|
|
477
|
+
axles Int?
|
|
478
|
+
chassis_number String? @unique
|
|
479
|
+
weight Float?
|
|
480
|
+
weight_unit WeightUnits @default(KG)
|
|
481
|
+
length Float?
|
|
482
|
+
width Float?
|
|
483
|
+
height Float?
|
|
484
|
+
dimension_unit DimensionUnits @default(CM)
|
|
485
|
+
pallets Int?
|
|
486
|
+
load_capacity Float?
|
|
487
|
+
status EquipmentStatus @default(ACTIVE)
|
|
488
|
+
company_id String? @db.Uuid
|
|
489
|
+
vehicle_id String? @db.Uuid
|
|
490
|
+
created_at DateTime @default(now())
|
|
491
|
+
updated_at DateTime @updatedAt
|
|
492
|
+
|
|
493
|
+
brand EquipmentBrand? @relation(fields: [brand_id], references: [id], onDelete: SetNull)
|
|
494
|
+
model EquipmentModel? @relation(fields: [model_id], references: [id], onDelete: SetNull)
|
|
495
|
+
company companies? @relation(fields: [company_id], references: [id], onDelete: SetNull)
|
|
496
|
+
vehicle Vehicle? @relation(fields: [vehicle_id], references: [id], onDelete: SetNull)
|
|
497
|
+
|
|
498
|
+
@@index([company_id])
|
|
499
|
+
@@index([brand_id])
|
|
500
|
+
@@index([model_id])
|
|
501
|
+
@@index([vehicle_id])
|
|
502
|
+
@@index([plate])
|
|
503
|
+
@@map("equipments")
|
|
418
504
|
}
|