chore: rebuild runtime bundle for colorsJson fix
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Product" ADD COLUMN "brandId" TEXT;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Product_brandId_idx" ON "Product"("brandId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Product" ADD CONSTRAINT "Product_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE "InternalMessage" ADD COLUMN "link" TEXT;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Remove Catalog as independent entity; Product is the sole merchandise unit.
|
||||
ALTER TABLE "Product" DROP CONSTRAINT IF EXISTS "Product_catalogId_fkey";
|
||||
DROP INDEX IF EXISTS "Product_catalogId_idx";
|
||||
ALTER TABLE "Product" DROP COLUMN IF EXISTS "catalogId";
|
||||
DROP TABLE IF EXISTS "Catalog";
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS "StockNotifyRequest";
|
||||
+22
-56
@@ -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)
|
||||
@@ -214,21 +194,21 @@ model Product {
|
||||
subtitle String?
|
||||
rollMeters Float @default(50)
|
||||
isNew Boolean @default(false)
|
||||
brandId String?
|
||||
createdAt DateTime @default(now())
|
||||
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[]
|
||||
favorites ProductFavorite[]
|
||||
catalogRequestItems CatalogRequestItem[]
|
||||
stockNotifyRequests StockNotifyRequest[]
|
||||
productSuggestions ProductSuggestion[]
|
||||
|
||||
@@unique([companyId, code])
|
||||
@@index([catalogId])
|
||||
@@index([companyId])
|
||||
@@index([brandId])
|
||||
@@index([usageCategory])
|
||||
@@index([season])
|
||||
}
|
||||
@@ -260,23 +240,22 @@ model Customer {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||
levelDef CustomerLevelDef? @relation(fields: [levelDefId], references: [id], onDelete: SetNull)
|
||||
assignedAgent Customer? @relation("AgentCustomers", fields: [assignedAgentId], references: [id], onDelete: SetNull)
|
||||
agentCustomers Customer[] @relation("AgentCustomers")
|
||||
carts Cart[]
|
||||
orders Order[]
|
||||
notifications CustomerNotification[]
|
||||
meetings MeetingInteraction[] @relation("MeetingCustomer")
|
||||
meetingsAsAgent MeetingInteraction[] @relation("MeetingAgent")
|
||||
reminders Reminder[] @relation("ReminderOwner")
|
||||
remindersAbout Reminder[] @relation("ReminderCustomer")
|
||||
favorites ProductFavorite[]
|
||||
catalogRequests CatalogRequest[]
|
||||
stockNotifyRequests StockNotifyRequest[]
|
||||
productSuggestions ProductSuggestion[]
|
||||
customerBrands CustomerBrand[]
|
||||
addresses CustomerAddress[]
|
||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||
levelDef CustomerLevelDef? @relation(fields: [levelDefId], references: [id], onDelete: SetNull)
|
||||
assignedAgent Customer? @relation("AgentCustomers", fields: [assignedAgentId], references: [id], onDelete: SetNull)
|
||||
agentCustomers Customer[] @relation("AgentCustomers")
|
||||
carts Cart[]
|
||||
orders Order[]
|
||||
notifications CustomerNotification[]
|
||||
meetings MeetingInteraction[] @relation("MeetingCustomer")
|
||||
meetingsAsAgent MeetingInteraction[] @relation("MeetingAgent")
|
||||
reminders Reminder[] @relation("ReminderOwner")
|
||||
remindersAbout Reminder[] @relation("ReminderCustomer")
|
||||
favorites ProductFavorite[]
|
||||
catalogRequests CatalogRequest[]
|
||||
productSuggestions ProductSuggestion[]
|
||||
customerBrands CustomerBrand[]
|
||||
addresses CustomerAddress[]
|
||||
|
||||
@@index([companyId])
|
||||
@@index([appRole])
|
||||
@@ -585,6 +564,7 @@ model InternalMessage {
|
||||
senderName String
|
||||
subject String
|
||||
preview String
|
||||
link String?
|
||||
isRead Boolean @default(false)
|
||||
sentAt DateTime @default(now())
|
||||
}
|
||||
@@ -658,6 +638,7 @@ model Brand {
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
customers CustomerBrand[]
|
||||
products Product[]
|
||||
}
|
||||
|
||||
model CustomerBrand {
|
||||
@@ -741,21 +722,6 @@ model CatalogItemMovement {
|
||||
@@index([itemId])
|
||||
}
|
||||
|
||||
model StockNotifyRequest {
|
||||
id String @id @default(cuid())
|
||||
customerId String
|
||||
productId String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
notifiedAt DateTime?
|
||||
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([customerId, productId])
|
||||
@@index([productId, active])
|
||||
}
|
||||
|
||||
model ProductSuggestion {
|
||||
id String @id @default(cuid())
|
||||
customerId String
|
||||
|
||||
+12
-50
File diff suppressed because one or more lines are too long
+652
-987
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,5 +5,5 @@
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
|
||||
"exclude": ["node_modules", "test", "dist", "**/*spec.ts", "src/catalogs/**/*"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user