feat(products): port missing variant fields from henza and redesign variant modal

This commit is contained in:
mahmood
2026-10-25 16:06:17 +03:30
parent 143d9aefbb
commit 55d27151c9
236 changed files with 1009 additions and 352 deletions
@@ -0,0 +1,5 @@
-- AlterTable: Add legacy variant fields (color, rialWage, details, description)
ALTER TABLE "ProductVariant" ADD COLUMN IF NOT EXISTS "color" INTEGER;
ALTER TABLE "ProductVariant" ADD COLUMN IF NOT EXISTS "rialWage" DECIMAL(18,0);
ALTER TABLE "ProductVariant" ADD COLUMN IF NOT EXISTS "details" TEXT;
ALTER TABLE "ProductVariant" ADD COLUMN IF NOT EXISTS "description" TEXT;
+9
View File
@@ -728,6 +728,15 @@ model ProductVariant {
isPreOrder Boolean @default(false)
isActive Boolean @default(true)
/// Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد
color Int?
/// Legacy rial_pay — fixed Rial making charge per variant.
rialWage Decimal? @db.Decimal(18, 0)
/// Legacy details — short description for variant.
details String? @db.Text
/// Legacy description — full description for variant.
description String? @db.Text
/// The gallery image shown for this variant, picked from its own product's
/// images — never a re-uploaded copy. onDelete: SetNull because dropping an
/// image must never cascade into the variant: OrderItem rows reference