diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-09 10:01:12 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-09 10:01:12 +0700 |
| commit | afd84f86d2f26a3e0347dab7552060717030df19 (patch) | |
| tree | d63d095e16a6dd052fb7d6858e78c1aac1115794 /src/utils | |
| parent | f8133c76306d9f70e01ac510c74dcfabe7f79b37 (diff) | |
| parent | 495b327ba0a45b17f4f0156f846ebe8bddbcd075 (diff) | |
Merge branch 'release' into CR/product_detail
# Conflicts:
# src-migrate/modules/product-detail/components/ProductDetail.tsx
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/solrMapping.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js index d4694eb2..0d50b99b 100644 --- a/src/utils/solrMapping.js +++ b/src/utils/solrMapping.js @@ -1,3 +1,29 @@ +export const promoMappingSolr = (promotions) => { + return promotions.map((promotion) =>{ + let productMapped = { + id: promotion.id, + program_id: promotion.program_id_i, + name: promotion.name_s, + type: { + value: promotion.type_value_s, + label: promotion.type_label_s, + }, + limit: promotion.package_limit_i, + limit_user: promotion.package_limit_user_i, + limit_trx: promotion.package_limit_trx_i, + price: promotion.price_f, + sequence: promotion.sequence_i, + 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) + }; + return productMapped; + }) +}; + + export const productMappingSolr = (products, pricelist) => { return products.map((product) => { let price = product.price_tier1_v2_f || 0; @@ -38,6 +64,7 @@ export const productMappingSolr = (products, pricelist) => { 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 || [] }; @@ -122,3 +149,4 @@ const flashsaleTime = (endDate) => { isFlashSale: flashsaleEndDate > currentTime, }; }; + |
