diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-09-04 03:00:30 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2024-09-04 03:00:30 +0000 |
| commit | 69c9ecc99c487c16129f5dcb66c4775453589220 (patch) | |
| tree | 7aead541e26b5166ae3d2049fc732c7030e4e9c6 /src/utils | |
| parent | 985f29aa1d9b8cbea49d25c30099f88c86bdc13f (diff) | |
| parent | f6a398c036d2ab833ecb798fa88e641e2f801bb0 (diff) | |
Merged in backup-release (pull request #289)
Backup release
Approved-by: trisusilo
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/solrMapping.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/utils/solrMapping.js b/src/utils/solrMapping.js index fee474be..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; @@ -123,3 +149,4 @@ const flashsaleTime = (endDate) => { isFlashSale: flashsaleEndDate > currentTime, }; }; + |
