fix bug of edit product

This commit is contained in:
2026-09-30 21:16:29 +03:30
parent 38cabb0957
commit be00478aa4
15 changed files with 150 additions and 119 deletions
+1 -23
View File
@@ -143,7 +143,6 @@ model Company {
updatedAt DateTime @updatedAt
bankAccounts BankAccount[]
catalogs Catalog[]
products Product[]
orders Order[]
customers Customer[]
@@ -169,35 +168,16 @@ model BankAccount {
@@index([companyId])
}
model Catalog {
id String @id @default(cuid())
companyId String
name String
code String
description String?
imageUrl String?
displayOrder Int @default(0)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
products Product[]
@@unique([companyId, code])
@@index([companyId])
}
model Product {
id String @id @default(cuid())
companyId String
catalogId String
name String
code String
color String
description String?
minMeterage Float @default(30)
orderMultiplier Float @default(10)
/// قیمت هر متر (تومان) برای نمایش کاتالوگ / پیش‌فاکتور
basePrice Float?
stock Float?
isActive Boolean @default(true)
@@ -219,7 +199,6 @@ model Product {
updatedAt DateTime @updatedAt
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
catalog Catalog @relation(fields: [catalogId], references: [id], onDelete: Cascade)
brand Brand? @relation(fields: [brandId], references: [id], onDelete: SetNull)
cartItems CartItem[]
orderItems OrderItem[]
@@ -229,7 +208,6 @@ model Product {
productSuggestions ProductSuggestion[]
@@unique([companyId, code])
@@index([catalogId])
@@index([companyId])
@@index([brandId])
@@index([usageCategory])