@managesome/eposmatic-toolkit 0.2.283 → 0.2.284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,7 +52,7 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
|
|
|
52
52
|
let applyLoyalty;
|
|
53
53
|
let applyVoucher;
|
|
54
54
|
const excludeRefs = undefined;
|
|
55
|
-
|
|
55
|
+
let zeroPriceRefs = undefined;
|
|
56
56
|
// Step 1: Check if loyalty discount or voucher discount is applied
|
|
57
57
|
if (isLoyaltyDiscountApplied) {
|
|
58
58
|
const offer = offers.find((o) => o._id === orderItem.item_discount_details?.loyalty_discount_id);
|
|
@@ -60,20 +60,20 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
|
|
|
60
60
|
return;
|
|
61
61
|
// const rewardItems = offer?.reward_items;
|
|
62
62
|
let refs = [];
|
|
63
|
-
let
|
|
63
|
+
let offerZeroPriceRefs = [];
|
|
64
64
|
let applicable_quantity = 1;
|
|
65
65
|
if (offer.reward_type === constants_1.OFFER_REWARD_TYPE_ENUM.ITEMS) {
|
|
66
66
|
if (offer.reward_items == null)
|
|
67
67
|
return;
|
|
68
68
|
refs = offer.reward_items.exclusive_refs.concat(item._id) ?? [];
|
|
69
|
-
|
|
69
|
+
offerZeroPriceRefs = offer.reward_items.excluded_refs;
|
|
70
70
|
applicable_quantity = offer.reward_items.num_of_items || 1;
|
|
71
71
|
}
|
|
72
72
|
else if (offer.reward_type === constants_1.OFFER_REWARD_TYPE_ENUM.DISCOUNT_ITEMS) {
|
|
73
73
|
if (offer.reward_discount_items == null)
|
|
74
74
|
return;
|
|
75
75
|
refs = offer.reward_discount_items.exclusive_refs.concat(item._id) ?? [];
|
|
76
|
-
|
|
76
|
+
offerZeroPriceRefs = offer.reward_discount_items.excluded_refs;
|
|
77
77
|
applicable_quantity = offer.reward_discount_items.num_of_items || 1;
|
|
78
78
|
}
|
|
79
79
|
let discount_details = null;
|
|
@@ -92,7 +92,7 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
|
|
|
92
92
|
discount_details,
|
|
93
93
|
applicable_quantity,
|
|
94
94
|
};
|
|
95
|
-
|
|
95
|
+
zeroPriceRefs = offerZeroPriceRefs;
|
|
96
96
|
}
|
|
97
97
|
if (isVoucherDiscountApplied) {
|
|
98
98
|
const offer = offers.find((o) => o._id === orderItem.item_discount_details?.voucher_discount_id);
|
|
@@ -100,20 +100,20 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
|
|
|
100
100
|
return;
|
|
101
101
|
// const rewardItems = offer?.reward_items;
|
|
102
102
|
let refs = [];
|
|
103
|
-
let
|
|
103
|
+
let offerZeroPriceRefs = [];
|
|
104
104
|
let applicable_quantity = 1;
|
|
105
105
|
if (offer.reward_type === constants_1.OFFER_REWARD_TYPE_ENUM.ITEMS) {
|
|
106
106
|
if (offer.reward_items == null)
|
|
107
107
|
return;
|
|
108
108
|
refs = offer.reward_items.exclusive_refs.concat(item._id) ?? [];
|
|
109
|
-
|
|
109
|
+
offerZeroPriceRefs = offer.reward_items.excluded_refs;
|
|
110
110
|
applicable_quantity = offer.reward_items.num_of_items || 1;
|
|
111
111
|
}
|
|
112
112
|
else if (offer.reward_type === constants_1.OFFER_REWARD_TYPE_ENUM.DISCOUNT_ITEMS) {
|
|
113
113
|
if (offer.reward_discount_items == null)
|
|
114
114
|
return;
|
|
115
115
|
refs = offer.reward_discount_items.exclusive_refs.concat(item._id) ?? [];
|
|
116
|
-
|
|
116
|
+
offerZeroPriceRefs = offer.reward_discount_items.excluded_refs;
|
|
117
117
|
applicable_quantity = offer.reward_discount_items.num_of_items || 1;
|
|
118
118
|
}
|
|
119
119
|
let discount_details = null;
|
|
@@ -132,7 +132,7 @@ function getEditItemProps({ item, orderItemCategoryId, orderItem, offers, isLoya
|
|
|
132
132
|
discount_details,
|
|
133
133
|
applicable_quantity,
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
zeroPriceRefs = offerZeroPriceRefs;
|
|
136
136
|
}
|
|
137
137
|
// TODO: We need to add use case for HalfHalf and Specials
|
|
138
138
|
const props = {
|