diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-26 11:33:58 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-26 11:33:58 +0700 |
| commit | 8fe167e2e03efcd3d7058c22f4efc6db961de71f (patch) | |
| tree | 9734734660e6088cebd1738d8ac161834630937f /src/utils | |
| parent | d4cb977d050a54b9daa1658b6de6e82878ca4c9b (diff) | |
| parent | 1c56a76f979a6e433d70634b92b1887fb1f19509 (diff) | |
Merge branch 'new-release' into CR/product_detail
# Conflicts:
# package.json
# src/utils/solrMapping.js
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/solrMapping.js | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js index 1618c40a..9b3488b2 100644 --- a/src/utils/solrMapping.js +++ b/src/utils/solrMapping.js @@ -1,5 +1,5 @@ export const promoMappingSolr = (promotions) => { - return promotions.map((promotion) =>{ + return promotions.map((promotion) => { let productMapped = { id: promotion.id, program_id: promotion.program_id_i, @@ -16,14 +16,13 @@ export const promoMappingSolr = (promotions) => { total_qty: promotion.total_qty_i, products: JSON.parse(promotion.products_s) || '', product_id: promotion.product_ids[0], - qty_sold_f:promotion.total_qty_sold_f, - free_products: JSON.parse(promotion.free_products_s) + qty_sold_f: promotion.total_qty_sold_f, + free_products: JSON.parse(promotion.free_products_s), }; return productMapped; - }) + }); }; - export const productMappingSolr = (products, pricelist) => { return products.map((product) => { let price = product.price_tier1_v2_f || 0; @@ -62,10 +61,11 @@ export const productMappingSolr = (products, pricelist) => { tag: product?.flashsale_tag_s || 'FLASH SALE', }, qtySold: product?.qty_sold_f || 0, - isTkdn:product?.tkdn_b || false, - isSni:product?.sni_b || false, - is_in_bu:product?.is_in_bu_b || false, - voucherPastiHemat:product?.voucher_pastihemat || [], + isTkdn: product?.tkdn_b || false, + isSni: product?.sni_b || false, + newVoucherPastiHemat: [], + is_in_bu: product?.is_in_bu_b || false, + voucherPastiHemat: product?.voucher_pastihemat || [], }; if (product.manufacture_id_i && product.manufacture_name_s) { @@ -84,6 +84,14 @@ export const productMappingSolr = (products, pricelist) => { name: product.category_name_s || '', }, ]; + productMapped.newVoucherPastiHemat = [ + { + min_purchase: product.voucher_min_purchase_f || 0, + discount_type: product.voucher_discount_type_s || '', + discount_amount: product.voucher_discount_amount_f || 0, + max_discount: product.voucher_max_discount_f || 0, + }, + ]; return productMapped; }); }; @@ -150,4 +158,3 @@ const flashsaleTime = (endDate) => { isFlashSale: flashsaleEndDate > currentTime, }; }; - |
