manufacturing and gantt
This commit is contained in:
@@ -133,6 +133,7 @@ model InventoryItem {
|
||||
purchaseOrderLines PurchaseOrderLine[]
|
||||
workOrders WorkOrder[]
|
||||
workOrderMaterialIssues WorkOrderMaterialIssue[]
|
||||
operations InventoryItemOperation[]
|
||||
}
|
||||
|
||||
model Warehouse {
|
||||
@@ -476,6 +477,7 @@ model WorkOrder {
|
||||
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
|
||||
warehouse Warehouse @relation(fields: [warehouseId], references: [id], onDelete: Restrict)
|
||||
location WarehouseLocation @relation(fields: [locationId], references: [id], onDelete: Restrict)
|
||||
operations WorkOrderOperation[]
|
||||
materialIssues WorkOrderMaterialIssue[]
|
||||
completions WorkOrderCompletion[]
|
||||
|
||||
@@ -485,6 +487,58 @@ model WorkOrder {
|
||||
@@index([warehouseId, createdAt])
|
||||
}
|
||||
|
||||
model ManufacturingStation {
|
||||
id String @id @default(cuid())
|
||||
code String @unique
|
||||
name String
|
||||
description String
|
||||
queueDays Int @default(0)
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
itemOperations InventoryItemOperation[]
|
||||
workOrderOperations WorkOrderOperation[]
|
||||
}
|
||||
|
||||
model InventoryItemOperation {
|
||||
id String @id @default(cuid())
|
||||
itemId String
|
||||
stationId String
|
||||
setupMinutes Int @default(0)
|
||||
runMinutesPerUnit Int @default(0)
|
||||
moveMinutes Int @default(0)
|
||||
notes String
|
||||
position Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
item InventoryItem @relation(fields: [itemId], references: [id], onDelete: Cascade)
|
||||
station ManufacturingStation @relation(fields: [stationId], references: [id], onDelete: Restrict)
|
||||
|
||||
@@index([itemId, position])
|
||||
@@index([stationId])
|
||||
}
|
||||
|
||||
model WorkOrderOperation {
|
||||
id String @id @default(cuid())
|
||||
workOrderId String
|
||||
stationId String
|
||||
sequence Int
|
||||
setupMinutes Int @default(0)
|
||||
runMinutesPerUnit Int @default(0)
|
||||
moveMinutes Int @default(0)
|
||||
plannedMinutes Int @default(0)
|
||||
plannedStart DateTime
|
||||
plannedEnd DateTime
|
||||
notes String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
workOrder WorkOrder @relation(fields: [workOrderId], references: [id], onDelete: Cascade)
|
||||
station ManufacturingStation @relation(fields: [stationId], references: [id], onDelete: Restrict)
|
||||
|
||||
@@index([workOrderId, sequence])
|
||||
@@index([stationId, plannedStart])
|
||||
}
|
||||
|
||||
model WorkOrderMaterialIssue {
|
||||
id String @id @default(cuid())
|
||||
workOrderId String
|
||||
|
||||
Reference in New Issue
Block a user