feat: TASK-101 - optimize Prisma schema, compound indexes, wholesale price and Rx fields

This commit is contained in:
parsa aghaei committed 2026-07-26 16:25:01 +03:30
1 parent 5377ddbfbf
commit 08c968300f
3 files changed
+8 -4

No files matched your search

+4
View File
@@ -127,6 +127,8 @@ model Product {
categoryId String @map("category_id") @db.Uuid
categorySlug String @map("category_slug") @db.VarChar(100)
priceValue Decimal @map("price_value") @db.Decimal(15, 2)
wholesalePrice Decimal? @map("wholesale_price") @db.Decimal(15, 2)
requiresRx Boolean @default(false) @map("requires_rx")
buyPrice Decimal @default(0) @map("buy_price") @db.Decimal(15, 2)
priceDisplay String @map("price_display") @db.VarChar(50)
unit String @db.VarChar(50)
@@ -150,6 +152,8 @@ model Product {
@@index([categorySlug])
@@index([suitableFor])
@@index([productGroup])
@@index([requiresRx])
@@index([categorySlug, suitableFor])
@@map("products")
}