32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
model Good {
|
|
id Int @id @default(autoincrement())
|
|
name String @db.VarChar(255)
|
|
description String? @db.Text
|
|
sku String @db.VarChar(100)
|
|
localSku String @unique() @db.VarChar(100)
|
|
barcode String? @unique() @db.VarChar(100)
|
|
createdAt DateTime @default(now()) @db.Timestamp(0)
|
|
updatedAt DateTime @updatedAt @db.Timestamp(0)
|
|
deletedAt DateTime? @db.Timestamp(0)
|
|
categoryId Int?
|
|
baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0)
|
|
category GoodCategory? @relation(fields: [categoryId], references: [id])
|
|
salesInvoiceItems SalesInvoiceItem[]
|
|
|
|
@@index([categoryId])
|
|
@@map("Goods")
|
|
}
|
|
|
|
model GoodCategory {
|
|
id Int @id @default(autoincrement())
|
|
name String @db.VarChar(100)
|
|
description String? @db.Text
|
|
imageUrl String? @db.VarChar(255)
|
|
createdAt DateTime @default(now()) @db.Timestamp(0)
|
|
updatedAt DateTime @updatedAt @db.Timestamp(0)
|
|
deletedAt DateTime? @db.Timestamp(0)
|
|
goods Good[]
|
|
|
|
@@map("Good_categories")
|
|
}
|