inventory1
This commit is contained in:
@@ -101,6 +101,24 @@ model FileAttachment {
|
||||
companyLogoFor CompanyProfile? @relation("CompanyLogo")
|
||||
}
|
||||
|
||||
model InventoryItem {
|
||||
id String @id @default(cuid())
|
||||
sku String @unique
|
||||
name String
|
||||
description String
|
||||
type String
|
||||
status String
|
||||
unitOfMeasure String
|
||||
isSellable Boolean @default(true)
|
||||
isPurchasable Boolean @default(true)
|
||||
defaultCost Float?
|
||||
notes String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
bomLines InventoryBomLine[] @relation("InventoryBomParent")
|
||||
usedInBomLines InventoryBomLine[] @relation("InventoryBomComponent")
|
||||
}
|
||||
|
||||
model Customer {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
@@ -134,6 +152,23 @@ model Customer {
|
||||
childCustomers Customer[] @relation("CustomerHierarchy")
|
||||
}
|
||||
|
||||
model InventoryBomLine {
|
||||
id String @id @default(cuid())
|
||||
parentItemId String
|
||||
componentItemId String
|
||||
quantity Float
|
||||
unitOfMeasure String
|
||||
notes String
|
||||
position Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
parentItem InventoryItem @relation("InventoryBomParent", fields: [parentItemId], references: [id], onDelete: Cascade)
|
||||
componentItem InventoryItem @relation("InventoryBomComponent", fields: [componentItemId], references: [id], onDelete: Restrict)
|
||||
|
||||
@@index([parentItemId, position])
|
||||
@@index([componentItemId])
|
||||
}
|
||||
|
||||
model Vendor {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
|
||||
Reference in New Issue
Block a user