summaryrefslogtreecommitdiff
path: root/src/utils/solrMapping.js
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-20 16:52:16 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-20 16:52:16 +0700
commita784f4623448ff846dbc5c8259405e6cce8fffb7 (patch)
tree016da331ea5a18ef2c3c1264728b1199b5e9172a /src/utils/solrMapping.js
parent1db54e16f970b4e09df89d432efd5a66ac775eb6 (diff)
parentb7e7696d675d0c2e36364f7cbedb0483a343048d (diff)
Merge branch 'release' into Feature/new-register
Diffstat (limited to 'src/utils/solrMapping.js')
-rw-r--r--src/utils/solrMapping.js28
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,
};
};
+