foodbot-cart-calculations 1.0.44 → 1.0.45

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.
package/calculations.js CHANGED
@@ -8,10 +8,15 @@ function applyDistribution(body) {
8
8
  let mainCart = body
9
9
  let promotion = (body.promotion_applied && body.promotion_applied) ? body.promotion_applied : {};
10
10
  let deliveryCost = (body.delivery_cost && body.delivery_cost) ? body.delivery_cost : 0;
11
-
12
- if(body?.order_items?.delivery_discount)
11
+
12
+ if(body?.order_items?.delivery_discount) {
13
13
  body.order_items.delivery_discount = 0
14
14
  body.order_items.is_delivery_discount = false
15
+ }
16
+ if (body?.order_items?.service_discount) {
17
+ body.order_items.service_discount = 0;
18
+ body.order_items.is_service_discount = false;
19
+ }
15
20
 
16
21
  promoCalculation.setPackageDefaultDiscount(body.order_items).then(res => {
17
22
  promoCalculation.offerCalculation(res, promotion, deliveryCost).then(final => {
@@ -30,8 +35,7 @@ function applyDistribution(body) {
30
35
  }
31
36
  mainCart.store_value = 0;
32
37
 
33
- pointsCalculation.getPointsDiscount(final, body.loyalty_points_details, body.user_detais).then(pointsCal => {
34
-
38
+ pointsCalculation.getPointsDiscount(final, body.loyalty_points_details, body.user_detais, body.delivery_cost, body.service_amount).then(pointsCal => {
35
39
  if (typeof (final.store_value) == "undefined" || isNaN(final.store_value))
36
40
  final.store_value = 0
37
41
  if (body.loyalty_points_details && parseInt(body.loyalty_points_details.points_redeemed) == 0) {
@@ -73,45 +77,33 @@ function applyDistribution(body) {
73
77
  mainCart.cash_expected = parseFloat(taxData.cartTotal) + parseFloat(taxData.tax_amount);
74
78
  }
75
79
  mainCart.order_items = taxData
76
-
80
+
77
81
  let delivery_cost = body.delivery_cost ? body.delivery_cost : 0;
82
+ let service_amount = body.service_amount ? body.service_amount : 0;
78
83
  // Adjust delivery cost based on delivery discount
79
84
  if (final.is_delivery_discount) {
80
- delivery_cost = Math.max(0, delivery_cost - final.delivery_discount);
85
+ delivery_cost = Math.max(0, delivery_cost - final.delivery_discount);
81
86
  body.delivery_cost = delivery_cost; // Update body accordingly
82
87
  }
83
-
84
- let service_amount = body.service_amount?body.service_amount:0;
85
-
86
- //we took 2 value because in case of absolute we use tipValue
87
- let tipValue = body.tip_value?body.tip_value:0;
88
- let tipValueReq = body.tip_value?body.tip_value:0;
88
+ // Adjust service amount based on service discount
89
+ if (final.is_service_discount) {
90
+ service_amount = Math.max(0, service_amount - final.service_discount);
91
+ body.service_amount = service_amount;
92
+ }
93
+ //we took 2 value because in case of absolute we use tipValue
94
+ let tipValue = body.tip_value?body.tip_value:0;
95
+ let tipValueReq = body.tip_value?body.tip_value:0;
89
96
 
90
97
  if (body.tip_type && body.tip_type == 'percentage') {
91
- tipValue = (mainCart.final_amount * parseInt(tipValueReq)) / 100
92
- tipValue = parseFloat(tipValue).toFixed(2)
98
+ tipValue = (mainCart.final_amount * parseInt(tipValueReq)) / 100
99
+ tipValue = parseFloat(tipValue).toFixed(2)
93
100
  }
94
101
 
95
102
  mainCart.tip_amount = parseFloat(tipValue).toFixed(2);
96
103
 
97
- const storeValue = parseFloat(final.store_value || 0);
98
- const cartTotal = parseFloat(taxData.cartTotal || 0);
99
- const deliveryCost = parseFloat(delivery_cost || 0);
100
- const serviceAmount = parseFloat(service_amount || 0);
101
-
102
- const deliveryCovered = body.loyalty_points_details?.enable_delivery_points_usage === 1 && storeValue >= cartTotal + deliveryCost;
103
- const serviceCovered = body.loyalty_points_details?.enable_service_charge_usage === 1 && storeValue >= cartTotal + deliveryCost + serviceAmount;
104
-
105
- if (!deliveryCovered) {
106
- mainCart.final_amount += deliveryCost;
107
- mainCart.cash_expected += deliveryCost;
108
- }
109
-
110
- if (!serviceCovered) {
111
- mainCart.final_amount += serviceAmount;
112
- mainCart.cash_expected += serviceAmount;
113
- }
114
-
104
+ mainCart.final_amount = parseFloat(mainCart.final_amount) + parseFloat(delivery_cost) + parseFloat(service_amount);
105
+ mainCart.cash_expected = parseFloat(mainCart.cash_expected) + parseFloat(delivery_cost) + parseFloat(service_amount);
106
+
115
107
  //In a case when calculation of order done from pos.
116
108
  if (body.tip_type && body.tip_type == 'percentage' && body.isPos && body.isPos == 1) {
117
109
  tipValue = (mainCart.final_amount * parseInt(tipValueReq)) / 100;
@@ -120,10 +112,10 @@ function applyDistribution(body) {
120
112
 
121
113
  taxData.total_after_tax = parseFloat(taxData.total_after_tax) + parseFloat(tipValue);
122
114
  taxData.total_after_tax = parseFloat(taxData.total_after_tax).toFixed(2);
123
-
115
+
124
116
  mainCart.final_amount = parseFloat(mainCart.final_amount) + parseFloat(tipValue);
125
117
  mainCart.cash_expected = parseFloat(mainCart.cash_expected) + parseFloat(tipValue);
126
-
118
+
127
119
  taxData.final_amount = parseFloat(taxData.final_amount).toFixed(2);
128
120
  taxData.cash_expected = parseFloat(taxData.cash_expected).toFixed(2);
129
121
 
@@ -1,8 +1,10 @@
1
- function getPointsDiscount(cartObject, points, userDetails) {
1
+ function getPointsDiscount(cartObject, points, userDetails, deliveryCost = 0, serviceAmount = 0) {
2
2
  return new Promise(function (resolve, reject) {
3
3
  try {
4
4
  let itemsTotal = 0
5
5
  let carts = cartObject.item_details
6
+ let deliveryDiscount = 0;
7
+ let serviceDiscount = 0;
6
8
 
7
9
  carts.forEach(function (v) {
8
10
  delete v.points_discount_modifier;
@@ -32,25 +34,16 @@ function getPointsDiscount(cartObject, points, userDetails) {
32
34
  });
33
35
  }
34
36
  });
37
+
35
38
  if (!points) {
36
- resolve(0);
39
+ cartObject.delivery_discount = 0;
40
+ cartObject.service_discount = 0;
41
+ resolve(cartObject);
37
42
  } else {
38
43
  let pointsAmount = 0;
39
44
  let count = 0;
40
45
  let storeAmount = points.store_value ?? (points.original_store_value ?? 0);
41
46
  let indexes = [];
42
- // Attach delivery and service amount if configured
43
- cartObject.delivery_cost = cartObject.delivery_cost || 0;
44
- cartObject.service_amount = cartObject.service_amount || 0;
45
-
46
- if (points.enable_delivery_points_usage === 1) {
47
- storeAmount = parseFloat(storeAmount) + parseFloat(cartObject.delivery_cost);
48
- }
49
- if (points.enable_service_charge_usage === 1) {
50
- storeAmount = parseFloat(storeAmount) + parseFloat(cartObject.service_amount);
51
- }
52
-
53
- storeAmount = parseFloat(storeAmount).toFixed(2);
54
47
 
55
48
  if (points.redeem_categories && points.redeem_categories != '') {
56
49
  itemsTotal = 0;
@@ -83,77 +76,81 @@ function getPointsDiscount(cartObject, points, userDetails) {
83
76
  element.point_discount_status = true;
84
77
  }
85
78
  count++;
79
+ });
86
80
 
87
- if (count == carts.length) {
88
- let singlePriceDiscount = pointsAmount / itemsTotal;
89
- singlePriceDiscount = (itemsTotal && itemsTotal > 0)?parseFloat(singlePriceDiscount).toFixed(6):0;
90
-
91
- let storeValue = 0
92
- let itemDiscount = 0;
93
- let itemTotalDicount = 0;
94
-
95
- carts.forEach((item, index) => {
96
- item.points_discount = item.points_discount ? item.points_discount : 0;
97
- item.points_discount_modifier = item.points_discount_modifier ? item.points_discount_modifier : 0;
98
-
99
- if (item.isPackage == 1) {
100
- if (item.point_discount_status) {
101
- let promoDiscount = (item.promotion_discount) ? item.promotion_discount : 0;
102
- itemDiscount = ((item.item_price * item.quantity) - promoDiscount) * singlePriceDiscount;
103
- itemDiscount = parseFloat(itemDiscount).toFixed(2);
104
- itemTotalDicount = parseFloat(itemDiscount) + parseFloat(itemTotalDicount);
105
-
106
- if (itemDiscount > 0)
107
- indexes.push(index);
108
-
109
- item.points_discount = itemDiscount;
110
- item.points_discount_modifier = 0;
111
-
112
- let packDis = 0;
113
-
114
- item.package_items.forEach((packageItem, packageItemIndex) => {
115
- let packageItemPromoDiscount = (packageItem.promotion_discount) ? packageItem.promotion_discount : 0;
116
- packageItem.points_discount_modifier = 0;
117
-
118
- packageItem.points_discount = ((((packageItem.price * parseInt(item.quantity)) - parseFloat((packageItem.default_combo_discount)) - parseFloat(packageItemPromoDiscount))) * parseFloat(singlePriceDiscount)).toFixed(2);
119
- packDis = (parseFloat(packDis) + parseFloat(packageItem.points_discount)).toFixed(2);
120
-
121
- packageItem.modifiers.forEach((modi, modiIndex) => {
122
- let modiItemAmount = 0;
123
- let modiPromoDiscount = (modi.promotion_discount) ? modi.promotion_discount : 0;
124
- modiItemAmount = (((parseFloat(modi.modifier_item_price) * parseInt(modi.quantity)) * item.quantity) - modiPromoDiscount) * parseFloat(singlePriceDiscount);
125
- modiItemAmount = parseFloat(modiItemAmount).toFixed(2);
126
- itemTotalDicount = parseFloat(itemTotalDicount) + parseFloat(modiItemAmount);
127
- itemTotalDicount = parseFloat(itemTotalDicount).toFixed(2);
128
- modi.points_discount = modiItemAmount;
129
- packageItem.points_discount_modifier = (parseFloat(packageItem.points_discount_modifier) + parseFloat(modi.points_discount)).toFixed(2);
130
- });
131
- packageItem.points_discount_modifier = (parseFloat(packageItem.points_discount) + parseFloat(packageItem.points_discount_modifier)).toFixed(2);
132
- });
133
-
134
- if (itemDiscount != packDis && item.package_items) {
135
- if (packDis > itemDiscount) {
136
- let diff = (parseFloat(packDis) - parseFloat(itemDiscount)).toFixed(2);
137
- item.package_items[0].points_discount = (parseFloat(item.package_items[0].points_discount) - parseFloat(diff)).toFixed(2);
138
- } else {
139
- let diff = (parseFloat(itemDiscount) - parseFloat(packDis)).toFixed(2);
140
- item.package_items[0].points_discount = (parseFloat(item.package_items[0].points_discount) - parseFloat(diff)).toFixed(2);
141
- }
142
- }
143
- }
144
- } else {
145
- if (item.point_discount_status) {
146
- let promoDiscount = (item.promotion_discount) ? item.promotion_discount : 0;
147
- itemDiscount = ((item.item_price * item.quantity) - promoDiscount) * singlePriceDiscount;
148
- itemDiscount = parseFloat(itemDiscount).toFixed(2);
149
- itemTotalDicount = parseFloat(itemDiscount) + parseFloat(itemTotalDicount);
150
-
151
- if (itemDiscount > 0)
152
- indexes.push(index);
153
-
154
- item.points_discount = itemDiscount;
155
-
156
- item.item_modifiers.forEach((modi, modiIndex) => {
81
+ // Apply points to service charge if enabled
82
+ if (points.enable_service_charge_usage === 1 && serviceAmount > 0 && storeAmount > 0) {
83
+ cartObject.is_service_discount = true;
84
+ if (parseFloat(storeAmount) >= parseFloat(serviceAmount)) {
85
+ serviceDiscount = parseFloat(serviceAmount);
86
+ pointsAmount = parseFloat(pointsAmount) + parseFloat(serviceAmount);
87
+ storeAmount = parseFloat(storeAmount) - parseFloat(serviceAmount);
88
+ } else {
89
+ serviceDiscount = parseFloat(storeAmount);
90
+ pointsAmount = parseFloat(pointsAmount) + parseFloat(storeAmount);
91
+ storeAmount = 0;
92
+ }
93
+ serviceDiscount = parseFloat(serviceDiscount).toFixed(2);
94
+ cartObject.service_discount = serviceDiscount;
95
+ } else {
96
+ cartObject.service_discount = 0;
97
+ cartObject.is_service_discount = false;
98
+ }
99
+
100
+ // Apply points to delivery if enabled
101
+ if (points.enable_delivery_points_usage === 1 && deliveryCost > 0 && storeAmount > 0) {
102
+ cartObject.is_delivery_discount = true;
103
+ if (parseFloat(storeAmount) >= parseFloat(deliveryCost)) {
104
+ deliveryDiscount = parseFloat(deliveryCost);
105
+ pointsAmount = parseFloat(pointsAmount) + parseFloat(deliveryCost);
106
+ storeAmount = parseFloat(storeAmount) - parseFloat(deliveryCost);
107
+ } else {
108
+ deliveryDiscount = parseFloat(storeAmount);
109
+ pointsAmount = parseFloat(pointsAmount) + parseFloat(storeAmount);
110
+ storeAmount = 0;
111
+ }
112
+ deliveryDiscount = parseFloat(deliveryDiscount).toFixed(2);
113
+ cartObject.delivery_discount = deliveryDiscount;
114
+ } else {
115
+ cartObject.delivery_discount = 0;
116
+ cartObject.is_delivery_discount = false;
117
+ }
118
+
119
+ if (count == carts.length) {
120
+ let singlePriceDiscount = pointsAmount / itemsTotal;
121
+ singlePriceDiscount = (itemsTotal && itemsTotal > 0)?parseFloat(singlePriceDiscount).toFixed(6):0;
122
+
123
+ let storeValue = 0
124
+ let itemDiscount = 0;
125
+ let itemTotalDicount = 0;
126
+
127
+ carts.forEach((item, index) => {
128
+ item.points_discount = item.points_discount ? item.points_discount : 0;
129
+ item.points_discount_modifier = item.points_discount_modifier ? item.points_discount_modifier : 0;
130
+
131
+ if (item.isPackage == 1) {
132
+ if (item.point_discount_status) {
133
+ let promoDiscount = (item.promotion_discount) ? item.promotion_discount : 0;
134
+ itemDiscount = ((item.item_price * item.quantity) - promoDiscount) * singlePriceDiscount;
135
+ itemDiscount = parseFloat(itemDiscount).toFixed(2);
136
+ itemTotalDicount = parseFloat(itemDiscount) + parseFloat(itemTotalDicount);
137
+
138
+ if (itemDiscount > 0)
139
+ indexes.push(index);
140
+
141
+ item.points_discount = itemDiscount;
142
+ item.points_discount_modifier = 0;
143
+
144
+ let packDis = 0;
145
+
146
+ item.package_items.forEach((packageItem, packageItemIndex) => {
147
+ let packageItemPromoDiscount = (packageItem.promotion_discount) ? packageItem.promotion_discount : 0;
148
+ packageItem.points_discount_modifier = 0;
149
+
150
+ packageItem.points_discount = ((((packageItem.price * parseInt(item.quantity)) - parseFloat((packageItem.default_combo_discount)) - parseFloat(packageItemPromoDiscount))) * parseFloat(singlePriceDiscount)).toFixed(2);
151
+ packDis = (parseFloat(packDis) + parseFloat(packageItem.points_discount)).toFixed(2);
152
+
153
+ packageItem.modifiers.forEach((modi, modiIndex) => {
157
154
  let modiItemAmount = 0;
158
155
  let modiPromoDiscount = (modi.promotion_discount) ? modi.promotion_discount : 0;
159
156
  modiItemAmount = (((parseFloat(modi.modifier_item_price) * parseInt(modi.quantity)) * item.quantity) - modiPromoDiscount) * parseFloat(singlePriceDiscount);
@@ -161,35 +158,73 @@ function getPointsDiscount(cartObject, points, userDetails) {
161
158
  itemTotalDicount = parseFloat(itemTotalDicount) + parseFloat(modiItemAmount);
162
159
  itemTotalDicount = parseFloat(itemTotalDicount).toFixed(2);
163
160
  modi.points_discount = modiItemAmount;
161
+ packageItem.points_discount_modifier = (parseFloat(packageItem.points_discount_modifier) + parseFloat(modi.points_discount)).toFixed(2);
164
162
  });
165
-
166
- item.points_discount_modifier = itemTotalDicount;
163
+ packageItem.points_discount_modifier = (parseFloat(packageItem.points_discount) + parseFloat(packageItem.points_discount_modifier)).toFixed(2);
164
+ });
165
+
166
+ if (itemDiscount != packDis && item.package_items) {
167
+ if (packDis > itemDiscount) {
168
+ let diff = (parseFloat(packDis) - parseFloat(itemDiscount)).toFixed(2);
169
+ item.package_items[0].points_discount = (parseFloat(item.package_items[0].points_discount) - parseFloat(diff)).toFixed(2);
170
+ } else {
171
+ let diff = (parseFloat(itemDiscount) - parseFloat(packDis)).toFixed(2);
172
+ item.package_items[0].points_discount = (parseFloat(item.package_items[0].points_discount) - parseFloat(diff)).toFixed(2);
173
+ }
167
174
  }
168
175
  }
169
- });
170
-
171
- if ((Number(itemTotalDicount) < Number(pointsAmount) || Number(itemTotalDicount) > Number(pointsAmount)) && pointsAmount > 0 && itemTotalDicount > 0) {
172
- let difference = Number(pointsAmount) - Number(itemTotalDicount);
173
- difference = parseFloat(difference).toFixed(2);
174
- if (index > -1) {
175
- carts[indexes[0]].points_discount = (difference > 0) ? parseFloat(carts[indexes[0]].points_discount) + parseFloat(difference) : parseFloat(carts[indexes[0]].points_discount) - Math.abs(difference);
176
- carts[indexes[0]].points_discount = parseFloat(carts[indexes[0]].points_discount).toFixed(2);
177
- itemTotalDicount = (difference < 0) ? itemTotalDicount + difference : itemTotalDicount - Math.abs(difference);
178
- itemTotalDicount = parseFloat(itemTotalDicount).toFixed(2);
176
+ } else {
177
+ if (item.point_discount_status) {
178
+ let promoDiscount = (item.promotion_discount) ? item.promotion_discount : 0;
179
+ itemDiscount = ((item.item_price * item.quantity) - promoDiscount) * singlePriceDiscount;
180
+ itemDiscount = parseFloat(itemDiscount).toFixed(2);
181
+ itemTotalDicount = parseFloat(itemDiscount) + parseFloat(itemTotalDicount);
182
+
183
+ if (itemDiscount > 0)
184
+ indexes.push(index);
185
+
186
+ item.points_discount = itemDiscount;
187
+
188
+ item.item_modifiers.forEach((modi, modiIndex) => {
189
+ let modiItemAmount = 0;
190
+ let modiPromoDiscount = (modi.promotion_discount) ? modi.promotion_discount : 0;
191
+ modiItemAmount = (((parseFloat(modi.modifier_item_price) * parseInt(modi.quantity)) * item.quantity) - modiPromoDiscount) * parseFloat(singlePriceDiscount);
192
+ modiItemAmount = parseFloat(modiItemAmount).toFixed(2);
193
+ itemTotalDicount = parseFloat(itemTotalDicount) + parseFloat(modiItemAmount);
194
+ itemTotalDicount = parseFloat(itemTotalDicount).toFixed(2);
195
+ modi.points_discount = modiItemAmount;
196
+ });
197
+
198
+ item.points_discount_modifier = itemTotalDicount;
179
199
  }
180
200
  }
201
+ });
202
+
203
+ if ((Number(itemTotalDicount) < Number(pointsAmount) || Number(itemTotalDicount) > Number(pointsAmount)) && pointsAmount > 0 && itemTotalDicount > 0) {
204
+ let difference = Number(pointsAmount) - Number(itemTotalDicount);
205
+ difference = parseFloat(difference).toFixed(2);
206
+ if (indexes.length > 0) {
207
+ carts[indexes[0]].points_discount = (difference > 0) ? parseFloat(carts[indexes[0]].points_discount) + parseFloat(difference) : parseFloat(carts[indexes[0]].points_discount) - Math.abs(difference);
208
+ carts[indexes[0]].points_discount = parseFloat(carts[indexes[0]].points_discount).toFixed(2);
209
+ itemTotalDicount = (difference < 0) ? itemTotalDicount + difference : itemTotalDicount - Math.abs(difference);
210
+ itemTotalDicount = parseFloat(itemTotalDicount).toFixed(2);
211
+ }
212
+ }
181
213
 
182
- cartObject.item_details = carts
183
- cartObject.store_value = pointsAmount
184
- cartObject.point_discount_amount = pointsAmount
214
+ cartObject.item_details = carts
215
+ cartObject.store_value = pointsAmount
216
+ cartObject.point_discount_amount = pointsAmount
217
+ cartObject.delivery_discount = deliveryDiscount;
218
+ cartObject.service_discount = serviceDiscount;
185
219
 
186
- resolve(cartObject);
187
- }
188
- });
220
+ resolve(cartObject);
221
+ }
189
222
  } else {
190
223
  cartObject.item_details = carts
191
224
  cartObject.store_value = pointsAmount
192
225
  cartObject.point_discount_amount = pointsAmount
226
+ cartObject.delivery_discount = 0;
227
+ cartObject.service_discount = 0;
193
228
 
194
229
  resolve(cartObject);
195
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foodbot-cart-calculations",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Package for cart calculations in which it performs discount distribution and tax distribution on order",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/response.json CHANGED
@@ -1,99 +1,82 @@
1
1
  {
2
2
  "status": "success",
3
- "status_code": 201,
4
- "message": "Tax calculated successfully with few details missing",
5
- "missing_optional_fields": [
6
- "order_type",
7
- "restaurant_id",
8
- "branch_id",
9
- "request_id"
10
- ],
3
+ "status_code": 200,
4
+ "message": "Tax calculated successfully",
11
5
  "data": {
6
+ "order_type": "delivery",
7
+ "request_id": "259629f21a457bb4",
8
+ "restaurant_id": 1158,
9
+ "brand_id": "18f3f889-5f82-4268-9340-61ffac64d30a",
10
+ "branch_id": 3168,
12
11
  "order_items": {
13
- "order_type": "delivery",
14
- "request_id": "9d63b0f16dda84ec",
15
- "restaurant_id": 511,
16
- "brand_id": "7c16f7c1-cec4-11ed-8648-129754d6b903",
17
- "branch_id": 2808,
18
12
  "item_details": [
19
13
  {
20
- "menu_id": 658,
21
- "item_id": 17361,
22
- "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1710223116/prod/menu_item/file1710223116748menu_item_y0adnc.jpg",
23
- "category_id": 3363,
24
- "item_price": 120,
25
- "item_price_with_modifier": 120,
26
- "quantity": 1,
27
- "item_modifiers": [],
28
- "item_display_text": "Chicken Malai Kabab",
29
- "item_name": "Chicken Malai Kabab",
30
- "tax_rate": 16,
31
- "isPackage": 0,
32
- "package_items": [],
33
- "actual_price": 120,
34
- "item_event": "new",
35
- "tax_id": [
36
- {
37
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
38
- }
39
- ],
40
- "ieps_tax": {
41
- "status": 0
42
- },
43
- "special_instruction": "",
44
- "item_key": "17361-",
45
- "promotion_discount_modifier": 0,
46
- "total_item_price": 120,
47
- "tax_amount": "0.000000",
48
- "tax_array": [
49
- {
50
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
51
- "tax_label": "IVA 16%",
52
- "tax_rate": 16,
53
- "tax_sequence": 1,
54
- "base_price_effected": 0,
55
- "tax_amount": "0.000000",
56
- "base_price": "0.00",
57
- "tax_rate_quantity": 0
58
- }
59
- ],
60
- "tax_amount_modifier": "0.000000",
61
- "total_tax_amount": "0.000000",
62
- "point_discount_status": true,
63
- "points_discount": "120.00",
64
- "points_discount_modifier": 120,
65
- "promotion_discount": 0
66
- },
67
- {
68
- "menu_id": 658,
69
- "item_id": 21328,
70
- "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1726842156/prod/menu_item/file1726842156041menu_item_iux2iq.jpg",
71
- "category_id": 3363,
72
- "item_price": 230,
73
- "item_price_with_modifier": 240,
14
+ "menu_id": 662,
15
+ "item_id": 21239,
16
+ "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1724495427/prod/menu_item/file1724495427370menu_item_pbh8lf.jpg",
17
+ "category_id": 3888,
18
+ "item_price": 145,
19
+ "item_price_with_modifier": 145,
74
20
  "quantity": 1,
75
21
  "item_modifiers": [
76
22
  {
77
- "modifer_cat": 3217,
78
- "modifier_category_id": 3217,
79
- "modifier_caetgory_name": "Chicken Modifier",
80
- "modifier_item_id": 35014,
23
+ "modifer_cat": 5040,
24
+ "modifier_category_id": 5040,
25
+ "modifier_caetgory_name": "Elige tu base ",
26
+ "modifier_item_id": 30321,
81
27
  "modifier_sequence": "00",
82
- "modifier_item_price": 10,
83
- "modifier_item_name": "chciken 01",
28
+ "modifier_item_price": 0,
29
+ "modifier_item_name": "Arroz spicy",
30
+ "is_tax_rate_same": 1,
31
+ "ieps_tax": null,
32
+ "tax_rate": 0,
33
+ "quantity": 1,
34
+ "item_id": 21239,
35
+ "tax_id": [
36
+ {
37
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
38
+ }
39
+ ],
40
+ "modifier_trx_id": "4052-4d0e-b968",
41
+ "linked_product": "",
42
+ "price_list_id": "2e6524d5-803e-4839-933b-758d16457bd1",
43
+ "promotion_discount_modifier": 0,
44
+ "tax_amount": "0.000000",
45
+ "tax_array": [
46
+ {
47
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
48
+ "tax_label": "IVA 16%",
49
+ "tax_rate": 16,
50
+ "tax_sequence": 1,
51
+ "base_price_effected": 0,
52
+ "tax_amount": "0.000000",
53
+ "base_price": "0.00",
54
+ "tax_rate_quantity": 0
55
+ }
56
+ ],
57
+ "points_discount": "0.00"
58
+ },
59
+ {
60
+ "modifer_cat": 5045,
61
+ "modifier_category_id": 5045,
62
+ "modifier_caetgory_name": "Elige tu salsa",
63
+ "modifier_item_id": 30331,
64
+ "modifier_sequence": "10",
65
+ "modifier_item_price": 0,
66
+ "modifier_item_name": "Salsa Schezwan",
84
67
  "is_tax_rate_same": 1,
85
68
  "ieps_tax": null,
86
69
  "tax_rate": 0,
87
70
  "quantity": 1,
88
- "item_id": 21328,
71
+ "item_id": 21239,
89
72
  "tax_id": [
90
73
  {
91
74
  "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
92
75
  }
93
76
  ],
94
- "modifier_trx_id": "51ac-3372-53e9",
77
+ "modifier_trx_id": "6681-4517-48a6",
95
78
  "linked_product": "",
96
- "price_list_id": "d5f30af5-5d66-4cf0-864b-b2eca45407c4",
79
+ "price_list_id": "2e6524d5-803e-4839-933b-758d16457bd1",
97
80
  "promotion_discount_modifier": 0,
98
81
  "tax_amount": "0.000000",
99
82
  "tax_array": [
@@ -108,15 +91,15 @@
108
91
  "tax_rate_quantity": 0
109
92
  }
110
93
  ],
111
- "points_discount": "10.00"
94
+ "points_discount": "0.00"
112
95
  }
113
96
  ],
114
- "item_display_text": "Irani Chicken Kebab 02",
115
- "item_name": "Irani Chicken Kebab 02",
97
+ "item_display_text": "Beef n' broccoli",
98
+ "item_name": "Beef n' broccoli",
116
99
  "tax_rate": 16,
117
100
  "isPackage": 0,
118
101
  "package_items": [],
119
- "actual_price": 230,
102
+ "actual_price": 145,
120
103
  "item_event": "new",
121
104
  "tax_id": [
122
105
  {
@@ -127,9 +110,9 @@
127
110
  "status": 0
128
111
  },
129
112
  "special_instruction": "",
130
- "item_key": "21328-3217:35014-1",
113
+ "item_key": "21239-5040:30321-1|5045:30331-1",
131
114
  "promotion_discount_modifier": 0,
132
- "total_item_price": 240,
115
+ "total_item_price": 145,
133
116
  "tax_amount": "0.000000",
134
117
  "tax_array": [
135
118
  {
@@ -146,18 +129,18 @@
146
129
  "tax_amount_modifier": "0.000000",
147
130
  "total_tax_amount": "0.000000",
148
131
  "point_discount_status": true,
149
- "points_discount": "230.00",
150
- "points_discount_modifier": "360.00",
132
+ "points_discount": "180.00",
133
+ "points_discount_modifier": "180.00",
151
134
  "promotion_discount": 0
152
135
  }
153
136
  ],
154
- "is_delivery_discount": false,
155
- "total": "360.00",
137
+ "is_delivery_discount": true,
138
+ "total": "145.00",
156
139
  "discount": "0.00",
157
140
  "points_redeem_message": "",
158
- "store_value": "360.00",
159
- "point_discount_amount": "360.00",
160
- "points_discount": "360.00",
141
+ "store_value": 180,
142
+ "point_discount_amount": 180,
143
+ "points_discount": 180,
161
144
  "cartTotal": "0.00",
162
145
  "tax_amount": "0.000000",
163
146
  "merged_tax_array": [
@@ -177,8 +160,9 @@
177
160
  "total_after_tax": "0.00",
178
161
  "final_amount": "NaN",
179
162
  "cash_expected": "NaN",
180
- "delivery_cost": 0,
181
- "service_amount": 0
163
+ "delivery_discount": "35.00",
164
+ "service_discount": 0,
165
+ "is_service_discount": false
182
166
  },
183
167
  "tax_settings": [
184
168
  {
@@ -210,45 +194,46 @@
210
194
  "base_price_effected": 0
211
195
  }
212
196
  ],
213
- "tip_type": "percentage",
214
- "tip_value": "",
197
+ "tip_type": "absolute",
198
+ "tip_value": 0,
215
199
  "tax_type": 2,
216
- "delivery_cost": 20,
217
- "service_amount": 0,
218
- "store_value": "360.00",
219
- "store_value_without_roundoff": 20500,
200
+ "delivery_cost": 5,
201
+ "service_amount": "10",
202
+ "store_value": 180,
203
+ "store_value_without_roundoff": 406,
220
204
  "loyalty_points_details": {
221
- "points": 410,
205
+ "points": 406,
222
206
  "redeemable": "yes",
223
- "store_value": 380,
207
+ "store_value": 180,
224
208
  "redeem_categories": [
225
209
  {
226
210
  "product_id": "All",
227
211
  "category_id": "All"
228
212
  }
229
213
  ],
230
- "original_store_value": 20500,
214
+ "original_store_value": 406,
231
215
  "status": true,
232
- "points_redeemed": 8,
216
+ "points_redeemed": 180,
233
217
  "show_purchase": false,
234
- "point_amount": 380,
218
+ "point_amount": 180,
235
219
  "full_redemption": true,
236
- "enable_delivery_points_usage": 1
220
+ "enable_delivery_points_usage": 1,
221
+ "enable_service_charge_usage": 1
237
222
  },
238
223
  "user_detais": {
239
- "member_id": "05361296-42b5-4aa9-a44c-ec57e56c822f",
240
- "first_name": "JOHN",
241
- "last_name": "Wix",
224
+ "member_id": "35a7920d-653c-4156-9fbd-0c2d6f00629f",
225
+ "first_name": "Spider",
226
+ "last_name": "Man",
242
227
  "country_code": "52",
243
- "created_on": "2025-07-22T06:29:05.189Z",
244
- "reward_plan_name": "General ",
245
- "reward_plan_id": 66,
228
+ "created_on": "2025-07-28T12:30:57.280Z",
229
+ "reward_plan_name": "Refer Plan new test",
230
+ "reward_plan_id": 14,
246
231
  "calling_code": "52",
247
- "name": "JOHN Wix"
232
+ "name": "Spider Man"
248
233
  },
249
234
  "discount": "0.00",
250
- "final_amount": 0,
251
- "cash_expected": 0,
235
+ "final_amount": 15,
236
+ "cash_expected": 15,
252
237
  "tip_amount": "0.00"
253
238
  }
254
239
  }
package/sampleInput.json CHANGED
@@ -1,242 +1,231 @@
1
1
  {
2
- "order_items": {
3
2
  "order_type": "delivery",
4
- "request_id": "9d63b0f16dda84ec",
5
- "restaurant_id": 511,
6
- "brand_id": "7c16f7c1-cec4-11ed-8648-129754d6b903",
7
- "branch_id": 2808,
8
- "item_details": [
9
- {
10
- "menu_id": 658,
11
- "item_id": 17361,
12
- "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1710223116/prod/menu_item/file1710223116748menu_item_y0adnc.jpg",
13
- "category_id": 3363,
14
- "item_price": 120,
15
- "item_price_with_modifier": 120,
16
- "quantity": 1,
17
- "item_modifiers": [],
18
- "item_display_text": "Chicken Malai Kabab",
19
- "item_name": "Chicken Malai Kabab",
20
- "tax_rate": 16,
21
- "isPackage": 0,
22
- "package_items": [],
23
- "actual_price": 120,
24
- "item_event": "new",
25
- "tax_id": [
26
- {
27
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
28
- }
3
+ "request_id": "259629f21a457bb4",
4
+ "restaurant_id": 1158,
5
+ "brand_id": "18f3f889-5f82-4268-9340-61ffac64d30a",
6
+ "branch_id": 3168,
7
+ "order_items": {
8
+ "item_details": [
9
+ {
10
+ "menu_id": 662,
11
+ "item_id": 21239,
12
+ "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1724495427/prod/menu_item/file1724495427370menu_item_pbh8lf.jpg",
13
+ "category_id": 3888,
14
+ "item_price": 145,
15
+ "item_price_with_modifier": 145,
16
+ "quantity": 1,
17
+ "item_modifiers": [
18
+ {
19
+ "modifer_cat": 5040,
20
+ "modifier_category_id": 5040,
21
+ "modifier_caetgory_name": "Elige tu base ",
22
+ "modifier_item_id": 30321,
23
+ "modifier_sequence": "00",
24
+ "modifier_item_price": 0,
25
+ "modifier_item_name": "Arroz spicy",
26
+ "is_tax_rate_same": 1,
27
+ "ieps_tax": null,
28
+ "tax_rate": 0,
29
+ "quantity": 1,
30
+ "item_id": 21239,
31
+ "tax_id": [
32
+ {
33
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
34
+ }
35
+ ],
36
+ "modifier_trx_id": "4052-4d0e-b968",
37
+ "linked_product": "",
38
+ "price_list_id": "2e6524d5-803e-4839-933b-758d16457bd1",
39
+ "promotion_discount_modifier": 0,
40
+ "points_discount": "0.00",
41
+ "tax_amount": "0.000000",
42
+ "tax_array": [
43
+ {
44
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
45
+ "tax_label": "IVA 16%",
46
+ "tax_rate": 16,
47
+ "tax_sequence": 1,
48
+ "base_price_effected": 0,
49
+ "tax_amount": "0.000000",
50
+ "base_price": "0.00",
51
+ "tax_rate_quantity": 0
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "modifer_cat": 5045,
57
+ "modifier_category_id": 5045,
58
+ "modifier_caetgory_name": "Elige tu salsa",
59
+ "modifier_item_id": 30331,
60
+ "modifier_sequence": "10",
61
+ "modifier_item_price": 0,
62
+ "modifier_item_name": "Salsa Schezwan",
63
+ "is_tax_rate_same": 1,
64
+ "ieps_tax": null,
65
+ "tax_rate": 0,
66
+ "quantity": 1,
67
+ "item_id": 21239,
68
+ "tax_id": [
69
+ {
70
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
71
+ }
72
+ ],
73
+ "modifier_trx_id": "6681-4517-48a6",
74
+ "linked_product": "",
75
+ "price_list_id": "2e6524d5-803e-4839-933b-758d16457bd1",
76
+ "promotion_discount_modifier": 0,
77
+ "points_discount": "0.00",
78
+ "tax_amount": "0.000000",
79
+ "tax_array": [
80
+ {
81
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
82
+ "tax_label": "IVA 16%",
83
+ "tax_rate": 16,
84
+ "tax_sequence": 1,
85
+ "base_price_effected": 0,
86
+ "tax_amount": "0.000000",
87
+ "base_price": "0.00",
88
+ "tax_rate_quantity": 0
89
+ }
90
+ ]
91
+ }
92
+ ],
93
+ "item_display_text": "Beef n' broccoli",
94
+ "item_name": "Beef n' broccoli",
95
+ "tax_rate": 16,
96
+ "isPackage": 0,
97
+ "package_items": [],
98
+ "actual_price": 145,
99
+ "item_event": "new",
100
+ "tax_id": [
101
+ {
102
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
103
+ }
104
+ ],
105
+ "ieps_tax": {
106
+ "status": 0
107
+ },
108
+ "special_instruction": "",
109
+ "item_key": "21239-5040:30321-1|5045:30331-1",
110
+ "promotion_discount_modifier": 0,
111
+ "total_item_price": 145,
112
+ "point_discount_status": true,
113
+ "points_discount": "145.00",
114
+ "points_discount_modifier": "145.00",
115
+ "tax_amount": "0.000000",
116
+ "tax_array": [
117
+ {
118
+ "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
119
+ "tax_label": "IVA 16%",
120
+ "tax_rate": 16,
121
+ "tax_sequence": 1,
122
+ "base_price_effected": 0,
123
+ "tax_amount": "0.000000",
124
+ "base_price": "0.00",
125
+ "tax_rate_quantity": 0
126
+ }
127
+ ],
128
+ "tax_amount_modifier": "0.000000",
129
+ "total_tax_amount": "0.000000",
130
+ "promotion_discount": 0
131
+ }
29
132
  ],
30
- "ieps_tax": {
31
- "status": 0
32
- },
33
- "special_instruction": "",
34
- "item_key": "17361-",
35
- "promotion_discount_modifier": 0,
36
- "total_item_price": 120,
37
- "point_discount_status": true,
38
- "points_discount": "120.00",
39
- "points_discount_modifier": 120,
133
+ "is_delivery_discount": false,
134
+ "total": "145.00",
135
+ "discount": "0.00",
136
+ "points_redeem_message": "",
137
+ "store_value": "145.00",
138
+ "point_discount_amount": "145.00",
139
+ "points_discount": "145.00",
140
+ "cartTotal": "0.00",
40
141
  "tax_amount": "0.000000",
41
- "tax_array": [
42
- {
43
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
44
- "tax_label": "IVA 16%",
45
- "tax_rate": 16,
46
- "tax_sequence": 1,
47
- "base_price_effected": 0,
48
- "tax_amount": "0.000000",
49
- "base_price": "0.00",
50
- "tax_rate_quantity": 0
51
- }
52
- ],
53
- "tax_amount_modifier": "0.000000",
54
- "total_tax_amount": "0.000000",
55
- "promotion_discount": 0
56
- },
57
- {
58
- "menu_id": 658,
59
- "item_id": 21328,
60
- "item_image": "https://res.cloudinary.com/http-foodbot-ai/image/upload/f_auto,q_auto,fl_lossy/v1726842156/prod/menu_item/file1726842156041menu_item_iux2iq.jpg",
61
- "category_id": 3363,
62
- "item_price": 230,
63
- "item_price_with_modifier": 240,
64
- "quantity": 1,
65
- "item_modifiers": [
66
- {
67
- "modifer_cat": 3217,
68
- "modifier_category_id": 3217,
69
- "modifier_caetgory_name": "Chicken Modifier",
70
- "modifier_item_id": 35014,
71
- "modifier_sequence": "00",
72
- "modifier_item_price": 10,
73
- "modifier_item_name": "chciken 01",
74
- "is_tax_rate_same": 1,
75
- "ieps_tax": null,
76
- "tax_rate": 0,
77
- "quantity": 1,
78
- "item_id": 21328,
79
- "tax_id": [
80
- {
81
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
82
- }
83
- ],
84
- "modifier_trx_id": "51ac-3372-53e9",
85
- "linked_product": "",
86
- "price_list_id": "d5f30af5-5d66-4cf0-864b-b2eca45407c4",
87
- "promotion_discount_modifier": 0,
88
- "points_discount": "10.00",
89
- "tax_amount": "0.000000",
90
- "tax_array": [
91
- {
142
+ "merged_tax_array": [
143
+ {
92
144
  "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
93
145
  "tax_label": "IVA 16%",
94
146
  "tax_rate": 16,
95
147
  "tax_sequence": 1,
96
148
  "base_price_effected": 0,
97
149
  "tax_amount": "0.000000",
98
- "base_price": "0.00",
150
+ "base_price": "0.000000",
99
151
  "tax_rate_quantity": 0
100
- }
101
- ]
102
- }
103
- ],
104
- "item_display_text": "Irani Chicken Kebab 02",
105
- "item_name": "Irani Chicken Kebab 02",
106
- "tax_rate": 16,
107
- "isPackage": 0,
108
- "package_items": [],
109
- "actual_price": 230,
110
- "item_event": "new",
111
- "tax_id": [
112
- {
113
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021"
114
- }
152
+ }
115
153
  ],
116
- "ieps_tax": {
117
- "status": 0
118
- },
119
- "special_instruction": "",
120
- "item_key": "21328-3217:35014-1",
121
- "promotion_discount_modifier": 0,
122
- "total_item_price": 240,
123
- "point_discount_status": true,
124
- "points_discount": "230.00",
125
- "points_discount_modifier": "380.00",
126
- "tax_amount": "0.000000",
127
- "tax_array": [
128
- {
154
+ "cart_total_with_tax": "0.00",
155
+ "sub_total": "0.00",
156
+ "total_after_tax": "0.00",
157
+ "final_amount": "NaN",
158
+ "cash_expected": "NaN"
159
+ },
160
+ "tax_settings": [
161
+ {
129
162
  "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
130
163
  "tax_label": "IVA 16%",
131
164
  "tax_rate": 16,
132
165
  "tax_sequence": 1,
133
- "base_price_effected": 0,
134
- "tax_amount": "0.000000",
135
- "base_price": "0.00",
136
- "tax_rate_quantity": 0
137
- }
138
- ],
139
- "tax_amount_modifier": "0.000000",
140
- "total_tax_amount": "0.000000",
141
- "promotion_discount": 0
142
- }
143
- ],
144
- "is_delivery_discount": false,
145
- "total": "380.00",
146
- "discount": "0.00",
147
- "points_redeem_message": "",
148
- "store_value": "380.00",
149
- "point_discount_amount": "380.00",
150
- "points_discount": "380.00",
151
- "cartTotal": "0.00",
152
- "tax_amount": "0.000000",
153
- "merged_tax_array": [
154
- {
155
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
156
- "tax_label": "IVA 16%",
157
- "tax_rate": 16,
158
- "tax_sequence": 1,
159
- "base_price_effected": 0,
160
- "tax_amount": "0.000000",
161
- "base_price": "0.000000",
162
- "tax_rate_quantity": 0
163
- }
166
+ "base_price_effected": 0
167
+ },
168
+ {
169
+ "tax_id": "21036b00-bdb4-4485-aaba-d088a721a67f",
170
+ "tax_label": "IVA 8%",
171
+ "tax_rate": 8,
172
+ "tax_sequence": 1,
173
+ "base_price_effected": 0
174
+ },
175
+ {
176
+ "tax_id": "e47296aa-b5ae-449f-ab5f-ff50f43a648a",
177
+ "tax_label": "Sin IVA",
178
+ "tax_rate": 0,
179
+ "tax_sequence": 3,
180
+ "base_price_effected": 0
181
+ },
182
+ {
183
+ "tax_id": "21036b00-bdb4-4485-aaba-d088a721a67f1",
184
+ "tax_label": "IEPS 8%",
185
+ "tax_rate": 8,
186
+ "tax_sequence": 2,
187
+ "base_price_effected": 0
188
+ }
164
189
  ],
165
- "cart_total_with_tax": "0.00",
166
- "sub_total": "0.00",
167
- "total_after_tax": "0.00",
168
- "final_amount": "NaN",
169
- "cash_expected": "NaN"
170
- },
171
- "tax_settings": [
172
- {
173
- "tax_id": "425a195c-3b37-11ed-af0e-42010ad46021",
174
- "tax_label": "IVA 16%",
175
- "tax_rate": 16,
176
- "tax_sequence": 1,
177
- "base_price_effected": 0
178
- },
179
- {
180
- "tax_id": "21036b00-bdb4-4485-aaba-d088a721a67f",
181
- "tax_label": "IVA 8%",
182
- "tax_rate": 8,
183
- "tax_sequence": 1,
184
- "base_price_effected": 0
190
+ "tip_type": "absolute",
191
+ "tip_value": 0,
192
+ "tax_type": 2,
193
+ "delivery_cost": "40",
194
+ "service_amount": "10",
195
+ "store_value": "150.00",
196
+ "store_value_without_roundoff": 406,
197
+ "loyalty_points_details": {
198
+ "points": 406,
199
+ "redeemable": "yes",
200
+ "store_value": 150,
201
+ "redeem_categories": [
202
+ {
203
+ "product_id": "All",
204
+ "category_id": "All"
205
+ }
206
+ ],
207
+ "original_store_value": 406,
208
+ "status": true,
209
+ "points_redeemed": 150,
210
+ "show_purchase": false,
211
+ "point_amount": 150,
212
+ "full_redemption": true,
213
+ "enable_delivery_points_usage": 1,
214
+ "enable_service_charge_usage": 1
185
215
  },
186
- {
187
- "tax_id": "e47296aa-b5ae-449f-ab5f-ff50f43a648a",
188
- "tax_label": "Sin IVA",
189
- "tax_rate": 0,
190
- "tax_sequence": 3,
191
- "base_price_effected": 0
216
+ "user_detais": {
217
+ "member_id": "35a7920d-653c-4156-9fbd-0c2d6f00629f",
218
+ "first_name": "Spider",
219
+ "last_name": "Man",
220
+ "country_code": "52",
221
+ "created_on": "2025-07-28T12:30:57.280Z",
222
+ "reward_plan_name": "Refer Plan new test",
223
+ "reward_plan_id": 14,
224
+ "calling_code": "52",
225
+ "name": "Spider Man"
192
226
  },
193
- {
194
- "tax_id": "21036b00-bdb4-4485-aaba-d088a721a67f1",
195
- "tax_label": "IEPS 8%",
196
- "tax_rate": 8,
197
- "tax_sequence": 2,
198
- "base_price_effected": 0
199
- }
200
- ],
201
- "tip_type": "percentage",
202
- "tip_value": "",
203
- "tax_type": 2,
204
- "delivery_cost": 20,
205
- "service_amount": 0,
206
- "store_value": "380.00",
207
- "store_value_without_roundoff": 20500,
208
- "loyalty_points_details": {
209
- "points": 410,
210
- "redeemable": "yes",
211
- "store_value": 380,
212
- "redeem_categories": [
213
- {
214
- "product_id": "All",
215
- "category_id": "All"
216
- }
217
- ],
218
- "original_store_value": 20500,
219
- "status": true,
220
- "points_redeemed": 8,
221
- "show_purchase": false,
222
- "point_amount": 380,
223
- "full_redemption": true,
224
- "enable_delivery_points_usage": 1,
225
- "enable_service_charge_usage": 0
226
- },
227
- "user_detais": {
228
- "member_id": "05361296-42b5-4aa9-a44c-ec57e56c822f",
229
- "first_name": "JOHN",
230
- "last_name": "Wix",
231
- "country_code": "52",
232
- "created_on": "2025-07-22T06:29:05.189Z",
233
- "reward_plan_name": "General ",
234
- "reward_plan_id": 66,
235
- "calling_code": "52",
236
- "name": "JOHN Wix"
237
- },
238
- "discount": "0.00",
239
- "final_amount": 20,
240
- "cash_expected": 20,
241
- "tip_amount": "0.00"
242
- }
227
+ "discount": "0.00",
228
+ "final_amount": 50,
229
+ "cash_expected": 50,
230
+ "tip_amount": "0.00"
231
+ }