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
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
bankAccounts BankAccount[]
|
bankAccounts BankAccount[]
|
||||||
catalogs Catalog[]
|
|
||||||
products Product[]
|
products Product[]
|
||||||
orders Order[]
|
orders Order[]
|
||||||
customers Customer[]
|
customers Customer[]
|
||||||
@@ -169,35 +168,16 @@ model BankAccount {
|
|||||||
@@index([companyId])
|
@@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 {
|
model Product {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
companyId String
|
companyId String
|
||||||
catalogId String
|
|
||||||
name String
|
name String
|
||||||
code String
|
code String
|
||||||
color String
|
color String
|
||||||
description String?
|
description String?
|
||||||
minMeterage Float @default(30)
|
minMeterage Float @default(30)
|
||||||
orderMultiplier Float @default(10)
|
orderMultiplier Float @default(10)
|
||||||
|
/// قیمت هر متر (تومان) برای نمایش کاتالوگ / پیشفاکتور
|
||||||
basePrice Float?
|
basePrice Float?
|
||||||
stock Float?
|
stock Float?
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
@@ -214,21 +194,21 @@ model Product {
|
|||||||
subtitle String?
|
subtitle String?
|
||||||
rollMeters Float @default(50)
|
rollMeters Float @default(50)
|
||||||
isNew Boolean @default(false)
|
isNew Boolean @default(false)
|
||||||
|
brandId String?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
|
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[]
|
cartItems CartItem[]
|
||||||
orderItems OrderItem[]
|
orderItems OrderItem[]
|
||||||
favorites ProductFavorite[]
|
favorites ProductFavorite[]
|
||||||
catalogRequestItems CatalogRequestItem[]
|
catalogRequestItems CatalogRequestItem[]
|
||||||
stockNotifyRequests StockNotifyRequest[]
|
|
||||||
productSuggestions ProductSuggestion[]
|
productSuggestions ProductSuggestion[]
|
||||||
|
|
||||||
@@unique([companyId, code])
|
@@unique([companyId, code])
|
||||||
@@index([catalogId])
|
|
||||||
@@index([companyId])
|
@@index([companyId])
|
||||||
|
@@index([brandId])
|
||||||
@@index([usageCategory])
|
@@index([usageCategory])
|
||||||
@@index([season])
|
@@index([season])
|
||||||
}
|
}
|
||||||
@@ -260,23 +240,22 @@ model Customer {
|
|||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||||
levelDef CustomerLevelDef? @relation(fields: [levelDefId], references: [id], onDelete: SetNull)
|
levelDef CustomerLevelDef? @relation(fields: [levelDefId], references: [id], onDelete: SetNull)
|
||||||
assignedAgent Customer? @relation("AgentCustomers", fields: [assignedAgentId], references: [id], onDelete: SetNull)
|
assignedAgent Customer? @relation("AgentCustomers", fields: [assignedAgentId], references: [id], onDelete: SetNull)
|
||||||
agentCustomers Customer[] @relation("AgentCustomers")
|
agentCustomers Customer[] @relation("AgentCustomers")
|
||||||
carts Cart[]
|
carts Cart[]
|
||||||
orders Order[]
|
orders Order[]
|
||||||
notifications CustomerNotification[]
|
notifications CustomerNotification[]
|
||||||
meetings MeetingInteraction[] @relation("MeetingCustomer")
|
meetings MeetingInteraction[] @relation("MeetingCustomer")
|
||||||
meetingsAsAgent MeetingInteraction[] @relation("MeetingAgent")
|
meetingsAsAgent MeetingInteraction[] @relation("MeetingAgent")
|
||||||
reminders Reminder[] @relation("ReminderOwner")
|
reminders Reminder[] @relation("ReminderOwner")
|
||||||
remindersAbout Reminder[] @relation("ReminderCustomer")
|
remindersAbout Reminder[] @relation("ReminderCustomer")
|
||||||
favorites ProductFavorite[]
|
favorites ProductFavorite[]
|
||||||
catalogRequests CatalogRequest[]
|
catalogRequests CatalogRequest[]
|
||||||
stockNotifyRequests StockNotifyRequest[]
|
productSuggestions ProductSuggestion[]
|
||||||
productSuggestions ProductSuggestion[]
|
customerBrands CustomerBrand[]
|
||||||
customerBrands CustomerBrand[]
|
addresses CustomerAddress[]
|
||||||
addresses CustomerAddress[]
|
|
||||||
|
|
||||||
@@index([companyId])
|
@@index([companyId])
|
||||||
@@index([appRole])
|
@@index([appRole])
|
||||||
@@ -585,6 +564,7 @@ model InternalMessage {
|
|||||||
senderName String
|
senderName String
|
||||||
subject String
|
subject String
|
||||||
preview String
|
preview String
|
||||||
|
link String?
|
||||||
isRead Boolean @default(false)
|
isRead Boolean @default(false)
|
||||||
sentAt DateTime @default(now())
|
sentAt DateTime @default(now())
|
||||||
}
|
}
|
||||||
@@ -658,6 +638,7 @@ model Brand {
|
|||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
customers CustomerBrand[]
|
customers CustomerBrand[]
|
||||||
|
products Product[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model CustomerBrand {
|
model CustomerBrand {
|
||||||
@@ -741,21 +722,6 @@ model CatalogItemMovement {
|
|||||||
@@index([itemId])
|
@@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 {
|
model ProductSuggestion {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
customerId String
|
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"
|
"outDir": "./dist"
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"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