@managesome/eposmatic-toolkit 0.2.317 → 0.2.319
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 +22 -8
- package/lib/helpers/store/cart-actions.d.ts +12 -3
- package/lib/helpers/store/cart-actions.js +573 -22
- package/lib/helpers/store/common-order-actions.d.ts +1 -0
- package/lib/helpers/store/common-order-actions.js +41 -0
- package/lib/helpers/utils/offer-apply-helpers.js +22 -370
- package/lib/helpers/utils/offers-helpers.d.ts +2 -2
- package/lib/helpers/utils/offers-helpers.js +48 -18
- package/lib/schemas/models/order.d.ts +33 -9
- package/lib/schemas/models/order.js +2 -2
- package/lib/schemas/types/order.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5186,11 +5186,19 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
5186
5186
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
5187
5187
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
5188
5188
|
wallet_redemptions?: {
|
|
5189
|
-
gift_cards?: {
|
|
5189
|
+
gift_cards?: import("mongoose").Types.DocumentArray<{
|
|
5190
|
+
redeemed_times: number;
|
|
5190
5191
|
gift_card_id: string;
|
|
5191
|
-
value_redeemed: number;
|
|
5192
5192
|
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
5193
|
-
}
|
|
5193
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
5194
|
+
redeemed_times: number;
|
|
5195
|
+
gift_card_id: string;
|
|
5196
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
5197
|
+
}> & {
|
|
5198
|
+
redeemed_times: number;
|
|
5199
|
+
gift_card_id: string;
|
|
5200
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
5201
|
+
}> | null | undefined;
|
|
5194
5202
|
cashback_amount?: number | null | undefined;
|
|
5195
5203
|
} | null | undefined;
|
|
5196
5204
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -10292,11 +10300,19 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
10292
10300
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
10293
10301
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
10294
10302
|
wallet_redemptions?: {
|
|
10295
|
-
gift_cards?: {
|
|
10303
|
+
gift_cards?: import("mongoose").Types.DocumentArray<{
|
|
10304
|
+
redeemed_times: number;
|
|
10296
10305
|
gift_card_id: string;
|
|
10297
|
-
value_redeemed: number;
|
|
10298
10306
|
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
10299
|
-
}
|
|
10307
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
10308
|
+
redeemed_times: number;
|
|
10309
|
+
gift_card_id: string;
|
|
10310
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
10311
|
+
}> & {
|
|
10312
|
+
redeemed_times: number;
|
|
10313
|
+
gift_card_id: string;
|
|
10314
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
10315
|
+
}> | null | undefined;
|
|
10300
10316
|
cashback_amount?: number | null | undefined;
|
|
10301
10317
|
} | null | undefined;
|
|
10302
10318
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -15398,11 +15414,19 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
15398
15414
|
tax_invoice_provider_charges?: number | null | undefined;
|
|
15399
15415
|
redeemed_offers?: Map<string, number> | null | undefined;
|
|
15400
15416
|
wallet_redemptions?: {
|
|
15401
|
-
gift_cards?: {
|
|
15417
|
+
gift_cards?: import("mongoose").Types.DocumentArray<{
|
|
15418
|
+
redeemed_times: number;
|
|
15402
15419
|
gift_card_id: string;
|
|
15403
|
-
value_redeemed: number;
|
|
15404
15420
|
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
15405
|
-
}
|
|
15421
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
15422
|
+
redeemed_times: number;
|
|
15423
|
+
gift_card_id: string;
|
|
15424
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
15425
|
+
}> & {
|
|
15426
|
+
redeemed_times: number;
|
|
15427
|
+
gift_card_id: string;
|
|
15428
|
+
mystery_gift_type?: import("../../constants").GIFT_CARD_REWARD_TYPE_ENUM | null | undefined;
|
|
15429
|
+
}> | null | undefined;
|
|
15406
15430
|
cashback_amount?: number | null | undefined;
|
|
15407
15431
|
} | null | undefined;
|
|
15408
15432
|
}> & Required<{
|
|
@@ -238,7 +238,7 @@ const GiftCardRedemptionSchema = new mongoose_1.Schema({
|
|
|
238
238
|
enum: constants_1.ALL_GIFT_CARD_REWARD_TYPES,
|
|
239
239
|
required: false,
|
|
240
240
|
},
|
|
241
|
-
|
|
241
|
+
redeemed_times: {
|
|
242
242
|
type: Number,
|
|
243
243
|
min: 0,
|
|
244
244
|
required: true,
|
|
@@ -251,7 +251,7 @@ const WalletRedemptionsSchema = new mongoose_1.Schema({
|
|
|
251
251
|
required: false,
|
|
252
252
|
},
|
|
253
253
|
gift_cards: {
|
|
254
|
-
type: GiftCardRedemptionSchema,
|
|
254
|
+
type: [GiftCardRedemptionSchema],
|
|
255
255
|
required: false,
|
|
256
256
|
},
|
|
257
257
|
}, { _id: false, minimize: false });
|
|
@@ -124,11 +124,11 @@ export interface IOrderTakeawayDetails {
|
|
|
124
124
|
export interface IGiftCardRedemption {
|
|
125
125
|
gift_card_id: string;
|
|
126
126
|
mystery_gift_type?: GIFT_CARD_REWARD_TYPE_ENUM | null;
|
|
127
|
-
|
|
127
|
+
redeemed_times: number;
|
|
128
128
|
}
|
|
129
129
|
export interface IWalletRedemptions {
|
|
130
130
|
cashback_amount?: number | null;
|
|
131
|
-
gift_cards?: IGiftCardRedemption | null;
|
|
131
|
+
gift_cards?: IGiftCardRedemption[] | null;
|
|
132
132
|
}
|
|
133
133
|
interface CommonOptionalFields {
|
|
134
134
|
delivery_details?: IOrderDeliveryDetails | null;
|