@managesome/eposmatic-toolkit 0.2.305 → 0.2.307
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/lib/helpers/order/generate-order.js +39 -0
- package/lib/helpers/store/cart-actions.d.ts +1 -0
- package/lib/helpers/store/cart-actions.js +60 -1
- package/lib/helpers/utils/offers-helpers.js +4 -4
- package/lib/schemas/models/order.d.ts +24 -0
- package/lib/schemas/models/order.js +31 -0
- package/lib/schemas/types/order.d.ts +11 -1
- package/package.json +1 -1
|
@@ -36,6 +36,30 @@ function getOrderTakeAwayDetails(takeaway_details) {
|
|
|
36
36
|
estimated_takeaway_time: takeaway_details.estimated_takeaway_time != null ? new Date(takeaway_details.estimated_takeaway_time) : null,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
function getOrderWalletRedemptions(walletRedemptions) {
|
|
40
|
+
if (walletRedemptions == null)
|
|
41
|
+
return null;
|
|
42
|
+
const normalizedWalletRedemptions = {};
|
|
43
|
+
const cashbackAmount = Number(walletRedemptions.cashback_amount);
|
|
44
|
+
if (Number.isFinite(cashbackAmount) && cashbackAmount > 0) {
|
|
45
|
+
normalizedWalletRedemptions.cashback_amount = cashbackAmount;
|
|
46
|
+
}
|
|
47
|
+
const giftCardRedemption = walletRedemptions.gift_cards;
|
|
48
|
+
if (giftCardRedemption != null) {
|
|
49
|
+
const giftCardId = giftCardRedemption.gift_card_id?.toString().trim();
|
|
50
|
+
const valueRedeemed = Number(giftCardRedemption.value_redeemed);
|
|
51
|
+
if (giftCardId != null && giftCardId.length > 0 && Number.isFinite(valueRedeemed) && valueRedeemed > 0) {
|
|
52
|
+
normalizedWalletRedemptions.gift_cards = {
|
|
53
|
+
gift_card_id: giftCardId,
|
|
54
|
+
value_redeemed: valueRedeemed,
|
|
55
|
+
...(giftCardRedemption.mystery_gift_type != null
|
|
56
|
+
? { mystery_gift_type: giftCardRedemption.mystery_gift_type }
|
|
57
|
+
: {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return Object.keys(normalizedWalletRedemptions).length > 0 ? normalizedWalletRedemptions : null;
|
|
62
|
+
}
|
|
39
63
|
function generateOrderCategories(categories) {
|
|
40
64
|
if (!categories)
|
|
41
65
|
return [];
|
|
@@ -143,6 +167,10 @@ function generateOrderOnCreate(order, withIterations) {
|
|
|
143
167
|
if (!newOrder.redeemed_offers || Object.keys(newOrder.redeemed_offers).length === 0) {
|
|
144
168
|
delete newOrder.redeemed_offers;
|
|
145
169
|
}
|
|
170
|
+
newOrder.wallet_redemptions = getOrderWalletRedemptions(newOrder.wallet_redemptions);
|
|
171
|
+
if (newOrder.wallet_redemptions == null) {
|
|
172
|
+
delete newOrder.wallet_redemptions;
|
|
173
|
+
}
|
|
146
174
|
if (!newOrder.surcharge) {
|
|
147
175
|
delete newOrder.surcharge;
|
|
148
176
|
delete newOrder.surcharge_amount;
|
|
@@ -326,6 +354,17 @@ function generateOrderOnUpdate(partialUpdatedOrder) {
|
|
|
326
354
|
delete set.redeemed_offers;
|
|
327
355
|
unset['redeemed_offers'] = '';
|
|
328
356
|
}
|
|
357
|
+
if (set.wallet_redemptions === null) {
|
|
358
|
+
delete set.wallet_redemptions;
|
|
359
|
+
unset['wallet_redemptions'] = '';
|
|
360
|
+
}
|
|
361
|
+
else if (set.wallet_redemptions != null) {
|
|
362
|
+
set.wallet_redemptions = getOrderWalletRedemptions(set.wallet_redemptions);
|
|
363
|
+
if (set.wallet_redemptions == null) {
|
|
364
|
+
delete set.wallet_redemptions;
|
|
365
|
+
unset['wallet_redemptions'] = '';
|
|
366
|
+
}
|
|
367
|
+
}
|
|
329
368
|
if (set.surcharge === 0) {
|
|
330
369
|
delete set.surcharge;
|
|
331
370
|
delete set.surcharge_amount;
|
|
@@ -109,6 +109,7 @@ export declare function getChangeCourseStatusData(data: Partial<IOrder>, course_
|
|
|
109
109
|
payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | undefined;
|
|
110
110
|
order_taker_details?: (import("../../schemas").IStaffDetails | null) | undefined;
|
|
111
111
|
redeemed_offers?: (Record<string, number> | null) | undefined;
|
|
112
|
+
wallet_redemptions?: (import("../../schemas").IWalletRedemptions | null) | undefined;
|
|
112
113
|
order_settled_at?: Date | undefined;
|
|
113
114
|
order_settled_at_mins?: number | undefined;
|
|
114
115
|
createdAt_mins?: number | undefined;
|
|
@@ -388,6 +388,29 @@ function getNormalizedRedeemedOffersMap(redeemedOffers) {
|
|
|
388
388
|
}
|
|
389
389
|
return Object.keys(normalizedRedeemedOffers).length > 0 ? normalizedRedeemedOffers : null;
|
|
390
390
|
}
|
|
391
|
+
function isRedeemedOffersMapNormalized(redeemedOffers) {
|
|
392
|
+
if (redeemedOffers == null) {
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
const normalizedRedeemedOffers = getNormalizedRedeemedOffersMap(redeemedOffers);
|
|
396
|
+
const rawOfferIds = Object.keys(redeemedOffers);
|
|
397
|
+
const normalizedOfferIds = Object.keys(normalizedRedeemedOffers ?? {});
|
|
398
|
+
if (rawOfferIds.length !== normalizedOfferIds.length) {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
for (let i = 0; i < rawOfferIds.length; i++) {
|
|
402
|
+
const rawOfferId = rawOfferIds[i];
|
|
403
|
+
const normalizedOfferId = getNormalizedOfferId(rawOfferId);
|
|
404
|
+
const safeCount = toPositiveInteger(redeemedOffers[rawOfferId], 0);
|
|
405
|
+
if (normalizedOfferId == null || rawOfferId !== normalizedOfferId || safeCount <= 0) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
if ((normalizedRedeemedOffers?.[normalizedOfferId] ?? 0) !== safeCount) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
391
414
|
function areRedeemedOffersEqual(currentRedeemedOffers, nextRedeemedOffers) {
|
|
392
415
|
const normalizedCurrentRedeemedOffers = getNormalizedRedeemedOffersMap(currentRedeemedOffers);
|
|
393
416
|
const normalizedNextRedeemedOffers = getNormalizedRedeemedOffersMap(nextRedeemedOffers);
|
|
@@ -465,11 +488,13 @@ function getReconciledRedeemedOffersMap({ existingRedeemedOffers, categories, of
|
|
|
465
488
|
}
|
|
466
489
|
const existingRedeemedTimes = toPositiveInteger(nextRedeemedOffers[normalizedOfferId], 0);
|
|
467
490
|
if (existingRedeemedTimes <= 0) {
|
|
491
|
+
delete nextRedeemedOffers[normalizedOfferId];
|
|
468
492
|
continue;
|
|
469
493
|
}
|
|
470
494
|
const maxApplicableTimes = toPositiveInteger(unlockedOffersApplicableTimes?.[offer._id], 0);
|
|
471
495
|
if (maxApplicableTimes <= 0) {
|
|
472
|
-
|
|
496
|
+
// Preserve non-item claims as positive claimed-times when unlock state is temporarily unavailable.
|
|
497
|
+
nextRedeemedOffers[normalizedOfferId] = existingRedeemedTimes;
|
|
473
498
|
continue;
|
|
474
499
|
}
|
|
475
500
|
nextRedeemedOffers[normalizedOfferId] = Math.min(existingRedeemedTimes, maxApplicableTimes);
|
|
@@ -479,6 +504,33 @@ function getReconciledRedeemedOffersMap({ existingRedeemedOffers, categories, of
|
|
|
479
504
|
function getRedeemedOffersMap(existingRedeemedOffers) {
|
|
480
505
|
return getNormalizedRedeemedOffersMap(existingRedeemedOffers);
|
|
481
506
|
}
|
|
507
|
+
function getNormalizedWalletRedemptionsMap(walletRedemptions) {
|
|
508
|
+
if (walletRedemptions == null)
|
|
509
|
+
return null;
|
|
510
|
+
const normalized = {};
|
|
511
|
+
const cashbackAmount = Number(walletRedemptions.cashback_amount);
|
|
512
|
+
if (Number.isFinite(cashbackAmount) && cashbackAmount > 0) {
|
|
513
|
+
normalized.cashback_amount = cashbackAmount;
|
|
514
|
+
}
|
|
515
|
+
const giftCardRedemption = walletRedemptions.gift_cards;
|
|
516
|
+
if (giftCardRedemption != null) {
|
|
517
|
+
const giftCardId = giftCardRedemption.gift_card_id?.toString().trim();
|
|
518
|
+
const valueRedeemed = Number(giftCardRedemption.value_redeemed);
|
|
519
|
+
if (giftCardId != null && giftCardId.length > 0 && Number.isFinite(valueRedeemed) && valueRedeemed > 0) {
|
|
520
|
+
normalized.gift_cards = {
|
|
521
|
+
gift_card_id: giftCardId,
|
|
522
|
+
value_redeemed: valueRedeemed,
|
|
523
|
+
...(giftCardRedemption.mystery_gift_type != null
|
|
524
|
+
? { mystery_gift_type: giftCardRedemption.mystery_gift_type }
|
|
525
|
+
: {}),
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return Object.keys(normalized).length > 0 ? normalized : null;
|
|
530
|
+
}
|
|
531
|
+
function getWalletRedemptionsMap(existingWalletRedemptions) {
|
|
532
|
+
return getNormalizedWalletRedemptionsMap(existingWalletRedemptions);
|
|
533
|
+
}
|
|
482
534
|
function calculateCartOrderInfoAndSyncData(data, courses, listnerSettings, calculateItemMetadata) {
|
|
483
535
|
const isCompleted = data.order_status === constants_1.ORDER_STATUS_ENUM.COMPLETED;
|
|
484
536
|
/* ===============================><=============================== */
|
|
@@ -748,6 +800,7 @@ function calculateCartOrderInfoAndSyncData(data, courses, listnerSettings, calcu
|
|
|
748
800
|
categories,
|
|
749
801
|
order_discount_details,
|
|
750
802
|
redeemed_offers: getRedeemedOffersMap(data.redeemed_offers),
|
|
803
|
+
wallet_redemptions: getWalletRedemptionsMap(data.wallet_redemptions),
|
|
751
804
|
total_discount_applied,
|
|
752
805
|
delivery_details,
|
|
753
806
|
tax_amount,
|
|
@@ -1986,6 +2039,7 @@ function getRemoveOfferFromCartData(data, offer_id, courses, listnerSettings) {
|
|
|
1986
2039
|
categories: newCategories,
|
|
1987
2040
|
order_discount_details,
|
|
1988
2041
|
redeemed_offers,
|
|
2042
|
+
wallet_redemptions: getWalletRedemptionsMap(data.wallet_redemptions),
|
|
1989
2043
|
};
|
|
1990
2044
|
const newData = calculateCartOrderInfoAndSyncData(order, courses, listnerSettings);
|
|
1991
2045
|
return newData;
|
|
@@ -2066,6 +2120,7 @@ function getRemoveAllOffersFromCartData(data, courses, listnerSettings, offerIds
|
|
|
2066
2120
|
categories: newCategories,
|
|
2067
2121
|
order_discount_details,
|
|
2068
2122
|
redeemed_offers,
|
|
2123
|
+
wallet_redemptions: getWalletRedemptionsMap(data.wallet_redemptions),
|
|
2069
2124
|
};
|
|
2070
2125
|
const newData = calculateCartOrderInfoAndSyncData(order, courses, listnerSettings);
|
|
2071
2126
|
return newData;
|
|
@@ -2109,6 +2164,9 @@ offers) {
|
|
|
2109
2164
|
const orderLevelDiscountBaseAmount = (0, utils_1.getOrderSubtotalFromCategories)(categories);
|
|
2110
2165
|
let order_discount_details = data.order_discount_details;
|
|
2111
2166
|
let redeemed_offers = getNormalizedRedeemedOffersMap(data.redeemed_offers);
|
|
2167
|
+
if (!isRedeemedOffersMapNormalized(data.redeemed_offers)) {
|
|
2168
|
+
hasChanges = true;
|
|
2169
|
+
}
|
|
2112
2170
|
const redeemedOffersPresenceMap = getReconciledRedeemedOffersMap({
|
|
2113
2171
|
existingRedeemedOffers: redeemed_offers,
|
|
2114
2172
|
categories,
|
|
@@ -2354,6 +2412,7 @@ offers) {
|
|
|
2354
2412
|
categories: newCategories,
|
|
2355
2413
|
order_discount_details,
|
|
2356
2414
|
redeemed_offers,
|
|
2415
|
+
wallet_redemptions: getWalletRedemptionsMap(data.wallet_redemptions),
|
|
2357
2416
|
};
|
|
2358
2417
|
const newData = calculateCartOrderInfoAndSyncData(order, courses, listnerSettings);
|
|
2359
2418
|
return newData;
|
|
@@ -1317,7 +1317,7 @@ function getOffersWithStats({ offers, customer, vouchers, giftCards, customerOff
|
|
|
1317
1317
|
const totalItemsSelected = totalOfferItemsSelected + bachelorItems;
|
|
1318
1318
|
const maxClaimsPerOrder = max_claims == null ? Infinity : Math.max(1, max_claims);
|
|
1319
1319
|
const unlockTimesForItems = Math.floor(totalItemsSelected / (num_of_items || 1));
|
|
1320
|
-
const unlockTimesForAmount = Math.floor(orderValue /
|
|
1320
|
+
const unlockTimesForAmount = total_amount != null && total_amount > 0 ? Math.floor(orderValue / total_amount) : unlockTimesForItems;
|
|
1321
1321
|
const totalUnlockableClaims = Math.min(unlockTimesForItems, unlockTimesForAmount, maxClaimsPerOrder);
|
|
1322
1322
|
const itemsProgress = getPreUnlockProgressPercentage(bachelorItems, num_of_items || 1);
|
|
1323
1323
|
const amountProgress = getPreUnlockProgressPercentage(orderValue, total_amount || 1);
|
|
@@ -1603,7 +1603,7 @@ function getOffersWithStats({ offers, customer, vouchers, giftCards, customerOff
|
|
|
1603
1603
|
}
|
|
1604
1604
|
if (stats.progress >= 100) {
|
|
1605
1605
|
const pointBurnTimes = Math.floor(effectiveLoyaltyPointsForCurrentOffer / (num_of_points || 1));
|
|
1606
|
-
const amountTimes = Math.floor(orderValue /
|
|
1606
|
+
const amountTimes = total_amount != null && total_amount > 0 ? Math.floor(orderValue / total_amount) : pointBurnTimes;
|
|
1607
1607
|
const totalUnlockableClaims = Math.min(pointBurnTimes, amountTimes, maxClaimsPerOrder);
|
|
1608
1608
|
if (offer.reward_type === constants_1.OFFER_REWARD_TYPE_ENUM.DISCOUNT) {
|
|
1609
1609
|
if (offer.reward_discount == null)
|
|
@@ -1660,7 +1660,7 @@ function getOffersWithStats({ offers, customer, vouchers, giftCards, customerOff
|
|
|
1660
1660
|
stats.message = `🎉 You have unlocked this offer 🎉`;
|
|
1661
1661
|
}
|
|
1662
1662
|
else {
|
|
1663
|
-
stats.message = `This offer is redeemed
|
|
1663
|
+
stats.message = redeemedTimes > 0 ? `This offer is redeemed ✅` : `🎉 You have unlocked this offer 🎉`;
|
|
1664
1664
|
}
|
|
1665
1665
|
unlockedOffersApplicableTimes[offer._id] = stats.applicable_quantity;
|
|
1666
1666
|
}
|
|
@@ -1798,7 +1798,7 @@ function getOffersWithStats({ offers, customer, vouchers, giftCards, customerOff
|
|
|
1798
1798
|
stats.message = `🎉 You have unlocked this offer 🎉`;
|
|
1799
1799
|
}
|
|
1800
1800
|
else {
|
|
1801
|
-
stats.message = `This offer is redeemed
|
|
1801
|
+
stats.message = redeemedTimes > 0 ? `This offer is redeemed ✅` : `🎉 You have unlocked this offer 🎉`;
|
|
1802
1802
|
}
|
|
1803
1803
|
unlockedOffersApplicableTimes[offer._id] = stats.applicable_quantity;
|
|
1804
1804
|
}
|
|
@@ -5185,6 +5185,14 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
5185
5185
|
is_gst_inclusive?: boolean | null | undefined;
|
|
5186
5186
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
5187
5187
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
5188
|
+
wallet_redemptions?: {
|
|
5189
|
+
gift_cards?: {
|
|
5190
|
+
gift_card_id: string;
|
|
5191
|
+
value_redeemed: number;
|
|
5192
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
5193
|
+
} | null | undefined;
|
|
5194
|
+
cashback_amount?: number | null | undefined;
|
|
5195
|
+
} | null | undefined;
|
|
5188
5196
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
5189
5197
|
createdAt: NativeDate;
|
|
5190
5198
|
updatedAt: NativeDate;
|
|
@@ -10283,6 +10291,14 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
10283
10291
|
is_gst_inclusive?: boolean | null | undefined;
|
|
10284
10292
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
10285
10293
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
10294
|
+
wallet_redemptions?: {
|
|
10295
|
+
gift_cards?: {
|
|
10296
|
+
gift_card_id: string;
|
|
10297
|
+
value_redeemed: number;
|
|
10298
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
10299
|
+
} | null | undefined;
|
|
10300
|
+
cashback_amount?: number | null | undefined;
|
|
10301
|
+
} | null | undefined;
|
|
10286
10302
|
}>> & import("mongoose").FlatRecord<{
|
|
10287
10303
|
createdAt: NativeDate;
|
|
10288
10304
|
updatedAt: NativeDate;
|
|
@@ -15381,6 +15397,14 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
15381
15397
|
is_gst_inclusive?: boolean | null | undefined;
|
|
15382
15398
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
15383
15399
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
15400
|
+
wallet_redemptions?: {
|
|
15401
|
+
gift_cards?: {
|
|
15402
|
+
gift_card_id: string;
|
|
15403
|
+
value_redeemed: number;
|
|
15404
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
15405
|
+
} | null | undefined;
|
|
15406
|
+
cashback_amount?: number | null | undefined;
|
|
15407
|
+
} | null | undefined;
|
|
15384
15408
|
}> & Required<{
|
|
15385
15409
|
_id: import("mongoose").Types.ObjectId;
|
|
15386
15410
|
}> & {
|
|
@@ -228,6 +228,33 @@ const DiscountDetailsSchema = new mongoose_1.Schema({
|
|
|
228
228
|
required: true,
|
|
229
229
|
},
|
|
230
230
|
}, { _id: false, minimize: false });
|
|
231
|
+
const GiftCardRedemptionSchema = new mongoose_1.Schema({
|
|
232
|
+
gift_card_id: {
|
|
233
|
+
type: String,
|
|
234
|
+
required: true,
|
|
235
|
+
},
|
|
236
|
+
mystery_gift_type: {
|
|
237
|
+
type: String,
|
|
238
|
+
enum: constants_1.ALL_GIFT_CARD_REWARD_TYPES,
|
|
239
|
+
required: false,
|
|
240
|
+
},
|
|
241
|
+
value_redeemed: {
|
|
242
|
+
type: Number,
|
|
243
|
+
min: 0,
|
|
244
|
+
required: true,
|
|
245
|
+
},
|
|
246
|
+
}, { _id: false, minimize: false });
|
|
247
|
+
const WalletRedemptionsSchema = new mongoose_1.Schema({
|
|
248
|
+
cashback_amount: {
|
|
249
|
+
type: Number,
|
|
250
|
+
min: 0,
|
|
251
|
+
required: false,
|
|
252
|
+
},
|
|
253
|
+
gift_cards: {
|
|
254
|
+
type: GiftCardRedemptionSchema,
|
|
255
|
+
required: false,
|
|
256
|
+
},
|
|
257
|
+
}, { _id: false, minimize: false });
|
|
231
258
|
const OptionsSchema = new mongoose_1.Schema({
|
|
232
259
|
_id: {
|
|
233
260
|
type: String,
|
|
@@ -813,6 +840,10 @@ exports.OrderSchema = new mongoose_1.Schema({
|
|
|
813
840
|
of: Number,
|
|
814
841
|
required: false,
|
|
815
842
|
},
|
|
843
|
+
wallet_redemptions: {
|
|
844
|
+
type: WalletRedemptionsSchema,
|
|
845
|
+
required: false,
|
|
846
|
+
},
|
|
816
847
|
order_settled_at: {
|
|
817
848
|
type: mongoose_1.Schema.Types.Date,
|
|
818
849
|
required: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORDER_ITEM_TYPE_ENUM, ORDER_STATUS_ENUM, PAYMENT_METHOD_EXPECTED_ENUM, PAYMENT_PROVIDERS_ENUM, PAYMENT_STATUS_ENUM, PAYMENT_TYPE_ENUM, PLATFORMS_ENUM, SPLIT_BILL_TYPE_ENUM } from '../../constants';
|
|
1
|
+
import { GIFT_CARD_REWARD_TYPE_ENUM, ORDER_ITEM_TYPE_ENUM, ORDER_STATUS_ENUM, PAYMENT_METHOD_EXPECTED_ENUM, PAYMENT_PROVIDERS_ENUM, PAYMENT_STATUS_ENUM, PAYMENT_TYPE_ENUM, PLATFORMS_ENUM, SPLIT_BILL_TYPE_ENUM } from '../../constants';
|
|
2
2
|
export interface IOrderCourse {
|
|
3
3
|
name: string;
|
|
4
4
|
course_id: string;
|
|
@@ -121,6 +121,15 @@ export interface IOrderDineInDetails {
|
|
|
121
121
|
export interface IOrderTakeawayDetails {
|
|
122
122
|
estimated_takeaway_time: Date | null;
|
|
123
123
|
}
|
|
124
|
+
export interface IGiftCardRedemption {
|
|
125
|
+
gift_card_id: string;
|
|
126
|
+
mystery_gift_type?: GIFT_CARD_REWARD_TYPE_ENUM | null;
|
|
127
|
+
value_redeemed: number;
|
|
128
|
+
}
|
|
129
|
+
export interface IWalletRedemptions {
|
|
130
|
+
cashback_amount?: number | null;
|
|
131
|
+
gift_cards?: IGiftCardRedemption | null;
|
|
132
|
+
}
|
|
124
133
|
interface CommonOptionalFields {
|
|
125
134
|
delivery_details?: IOrderDeliveryDetails | null;
|
|
126
135
|
dinein_details?: IOrderDineInDetails | null;
|
|
@@ -223,6 +232,7 @@ export interface IOrder extends CommonOptionalFields {
|
|
|
223
232
|
payment_method_expected?: PAYMENT_METHOD_EXPECTED_ENUM;
|
|
224
233
|
order_taker_details?: IStaffDetails | null;
|
|
225
234
|
redeemed_offers?: Record<string, number> | null;
|
|
235
|
+
wallet_redemptions?: IWalletRedemptions | null;
|
|
226
236
|
order_settled_at: Date;
|
|
227
237
|
order_settled_at_mins: number;
|
|
228
238
|
createdAt_mins: number;
|