summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-25 14:07:26 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-25 14:07:26 +0700
commite7313b4d7006bed37a408d26f15028892839b73a (patch)
treed0d6c9455ca6aac305efc094639dd6886b34fb14 /src/utils
parentd1c0e083ac8f64dfaa8505fc11e30728dbd5a58d (diff)
parente8f640d3fd4984fe5854c2faf7ead9b3b5aebbf2 (diff)
Merge branch 'new-release' into bug-product
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/solrMapping.js32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js
index ff851f6c..fad1263a 100644
--- a/src/utils/solrMapping.js
+++ b/src/utils/solrMapping.js
@@ -1,3 +1,28 @@
+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;
@@ -36,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,
+ isTkdn: product?.tkdn_b || false,
+ isSni: product?.sni_b || false,
newVoucherPastiHemat: [],
- voucherPastiHemat:product?.voucher_pastihemat || []
+ is_in_bu: product?.is_in_bu_b || false,
+ voucherPastiHemat: product?.voucher_pastihemat || [],
};
if (product.manufacture_id_i && product.manufacture_name_s) {