Initial admin edits
This commit is contained in:
+28
-49
@@ -11,6 +11,7 @@ datasource db {
|
||||
enum SettlementType {
|
||||
cash
|
||||
check
|
||||
cash_check
|
||||
}
|
||||
|
||||
enum CheckRegistrationMode {
|
||||
@@ -175,6 +176,8 @@ model Product {
|
||||
code String
|
||||
color String
|
||||
description String?
|
||||
/// مشخصات آزاد محصول (نمایش در specs-extra اپ)
|
||||
specs String? @db.Text
|
||||
minMeterage Float @default(30)
|
||||
orderMultiplier Float @default(10)
|
||||
/// قیمت هر متر (تومان) برای نمایش کاتالوگ / پیشفاکتور
|
||||
@@ -194,12 +197,10 @@ 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)
|
||||
brand Brand? @relation(fields: [brandId], references: [id], onDelete: SetNull)
|
||||
cartItems CartItem[]
|
||||
orderItems OrderItem[]
|
||||
favorites ProductFavorite[]
|
||||
@@ -208,7 +209,6 @@ model Product {
|
||||
|
||||
@@unique([companyId, code])
|
||||
@@index([companyId])
|
||||
@@index([brandId])
|
||||
@@index([usageCategory])
|
||||
@@index([season])
|
||||
}
|
||||
@@ -254,7 +254,6 @@ model Customer {
|
||||
favorites ProductFavorite[]
|
||||
catalogRequests CatalogRequest[]
|
||||
productSuggestions ProductSuggestion[]
|
||||
customerBrands CustomerBrand[]
|
||||
addresses CustomerAddress[]
|
||||
|
||||
@@index([companyId])
|
||||
@@ -482,31 +481,35 @@ model Shipment {
|
||||
}
|
||||
|
||||
model SystemSettings {
|
||||
id String @id @default("default")
|
||||
maxMeteragePerInvoice Int @default(5000)
|
||||
cashInvoiceValidityHours Int @default(8)
|
||||
defaultSettlementCheck Boolean @default(true)
|
||||
defaultSettlementCash Boolean @default(true)
|
||||
id String @id @default("default")
|
||||
maxMeteragePerInvoice Int @default(5000)
|
||||
cashInvoiceValidityHours Int @default(8)
|
||||
defaultSettlementCheck Boolean @default(true)
|
||||
defaultSettlementCash Boolean @default(true)
|
||||
defaultSettlementCashCheck Boolean @default(false)
|
||||
/// حداقل سفارش: تعداد طاقه از هر محصول (§۱۹)
|
||||
minOrderRollsPerProduct Int @default(1)
|
||||
minOrderRollsPerProduct Int @default(1)
|
||||
/// نمایش قیمت عمومی در کاتالوگ (پیشفرض خاموش)
|
||||
showCatalogPublicPrice Boolean @default(false)
|
||||
showCatalogPublicPrice Boolean @default(false)
|
||||
/// اجازه قیمتگذاری توسط واسطه (§۱۹)
|
||||
allowAgentPricing Boolean @default(false)
|
||||
allowAgentPricing Boolean @default(false)
|
||||
/// کف قیمت واحد برای قیمتگذاری واسطه (ریال) — اختیاری
|
||||
agentMinUnitPrice Int?
|
||||
smsOrderRegistered Boolean @default(true)
|
||||
smsPricingReady Boolean @default(true)
|
||||
smsPaymentReminder Boolean @default(true)
|
||||
smsCheckReview Boolean @default(true)
|
||||
smsShippingUpdate Boolean @default(true)
|
||||
supportPhone String?
|
||||
supportEmail String?
|
||||
agentMinUnitPrice Int?
|
||||
smsOrderRegistered Boolean @default(true)
|
||||
smsPricingReady Boolean @default(true)
|
||||
smsPaymentReminder Boolean @default(true)
|
||||
smsCheckReview Boolean @default(true)
|
||||
smsShippingUpdate Boolean @default(true)
|
||||
supportPhone String?
|
||||
supportEmail String?
|
||||
supportWhatsapp String?
|
||||
supportTelegram String?
|
||||
supportInstagram String?
|
||||
/// تصاویر دستههای کاربرد/فصل اپ کاربر: { trousers: dataUrl, summer: dataUrl, ... }
|
||||
categoryImagesJson Json?
|
||||
categoryImagesJson Json?
|
||||
/// تعاریف دستهها (کاربرد/فصل). اگر خالی باشد از مقادیر پیشفرض کد استفاده میشود.
|
||||
categoryDefsJson Json?
|
||||
updatedAt DateTime @updatedAt
|
||||
categoryDefsJson Json?
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
/// بنرهای قابل مدیریت بخشهای اپ کاربر
|
||||
@@ -517,6 +520,8 @@ model AppBanner {
|
||||
subtitle String?
|
||||
ctaLabel String?
|
||||
ctaLink String?
|
||||
/// لینک کلیک روی تصویر بنر (مستقل از لینک دکمه)
|
||||
bannerLink String?
|
||||
imageUrl String?
|
||||
displayOrder Int @default(0)
|
||||
isActive Boolean @default(true)
|
||||
@@ -627,32 +632,6 @@ model ProductFavorite {
|
||||
@@index([customerId])
|
||||
}
|
||||
|
||||
model Brand {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
slug String? @unique
|
||||
description String?
|
||||
isActive Boolean @default(true)
|
||||
displayOrder Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
customers CustomerBrand[]
|
||||
products Product[]
|
||||
}
|
||||
|
||||
model CustomerBrand {
|
||||
customerId String
|
||||
brandId String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([customerId, brandId])
|
||||
@@index([brandId])
|
||||
}
|
||||
|
||||
model CustomerLevelDef {
|
||||
id String @id @default(cuid())
|
||||
code String @unique
|
||||
|
||||
Reference in New Issue
Block a user