fix(shop): map requiresRx in productService, enable backend query param filtering, and classify 11 prescription vs 24 OTC products
This commit is contained in:
1 parent
df6c56b1e8
commit
989f77e106
5 files changed
+20
-4
No files matched your search
@@ -201,6 +201,9 @@ async function main() {
|
||||
const nameEn = `${baseNameEn} - ${sizeLabel}`;
|
||||
const priceDisplay = `${sellPrice.toLocaleString()} تومان`;
|
||||
|
||||
const RX_PRODUCTS = ['canina-canhydrox-gag', 'canina-petvital-gag', 'canina-herz-vital', 'canina-petvital-arthro-tabletten', 'canina-immun-booster', 'canina-petvital-bio-aktivator', 'canina-rinderblut-pulver', 'canina-velox-gelenkenergie'];
|
||||
const requiresRx = RX_PRODUCTS.includes(baseSlug);
|
||||
|
||||
const product = await prisma.product.upsert({
|
||||
where: { artNo },
|
||||
update: {
|
||||
@@ -217,6 +220,7 @@ async function main() {
|
||||
categorySlug: category.slug,
|
||||
priceValue: sellPrice,
|
||||
wholesalePrice: Math.round(sellPrice * 0.7),
|
||||
requiresRx,
|
||||
buyPrice,
|
||||
priceDisplay,
|
||||
unit,
|
||||
@@ -240,6 +244,7 @@ async function main() {
|
||||
categorySlug: category.slug,
|
||||
priceValue: sellPrice,
|
||||
wholesalePrice: Math.round(sellPrice * 0.7),
|
||||
requiresRx,
|
||||
buyPrice,
|
||||
priceDisplay,
|
||||
unit,
|
||||
|
||||
Reference in new issue
Block a user