diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-26 11:16:32 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-26 11:16:32 +0700 |
| commit | 9dc7af1641f06f3c7cffda102febe90c806ffee1 (patch) | |
| tree | e82bd0209247d5b85e7434e81bde8f2d9b525289 /src/utils/solrMapping.js | |
| parent | 461d2786935c5c9b3cf627c44fc06fcd1c3e8075 (diff) | |
| parent | 1c56a76f979a6e433d70634b92b1887fb1f19509 (diff) | |
Merge branch 'new-release' into Feature/switch-account
Diffstat (limited to 'src/utils/solrMapping.js')
| -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 0d50b99b..f73e966a 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) { @@ -83,6 +83,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; }); }; @@ -149,4 +157,3 @@ const flashsaleTime = (endDate) => { isFlashSale: flashsaleEndDate > currentTime, }; }; - |
