@managesome/eposmatic-toolkit 0.2.331 → 0.2.333
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.
|
@@ -57,7 +57,7 @@ export interface ISetAddItemToCartActionPayload {
|
|
|
57
57
|
item: IOrderItem;
|
|
58
58
|
chosen_course_id: string | null;
|
|
59
59
|
replace_id?: string;
|
|
60
|
-
rewardClaim?: IRewardClaim
|
|
60
|
+
rewardClaim?: IRewardClaim;
|
|
61
61
|
}
|
|
62
62
|
export declare const getOrderItemComaparableData: (item: IOrderItem) => Partial<IOrderItem>;
|
|
63
63
|
export declare function getAddItemToCartData(data: Partial<IOrder>, payload: ISetAddItemToCartActionPayload, courses: ICourse[], listnerSettings: ICartListnerSettings): Partial<IOrder>;
|
|
@@ -2090,7 +2090,37 @@ function getUpdateCartInfoData(data, payload, courses, listnerSettings, syncCont
|
|
|
2090
2090
|
...payload,
|
|
2091
2091
|
};
|
|
2092
2092
|
const newData = calculateCartOrderInfoAndSyncData(order, courses, listnerSettings, undefined, syncContext);
|
|
2093
|
-
|
|
2093
|
+
if (newData.redeemed_offers != null) {
|
|
2094
|
+
return newData;
|
|
2095
|
+
}
|
|
2096
|
+
const categories = newData.categories ?? [];
|
|
2097
|
+
let hasItemsInCart = false;
|
|
2098
|
+
outer: for (let i = 0; i < categories.length; i++) {
|
|
2099
|
+
const items = categories[i].items ?? [];
|
|
2100
|
+
for (let j = 0; j < items.length; j++) {
|
|
2101
|
+
const quantity = Number(items[j].quantity ?? 0);
|
|
2102
|
+
if (Number.isFinite(quantity) && quantity > 0) {
|
|
2103
|
+
hasItemsInCart = true;
|
|
2104
|
+
break outer;
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
if (!hasItemsInCart) {
|
|
2109
|
+
return newData;
|
|
2110
|
+
}
|
|
2111
|
+
const hasRedeemedOffersInPayload = Object.prototype.hasOwnProperty.call(payload, 'redeemed_offers');
|
|
2112
|
+
// Respect explicit clear requests.
|
|
2113
|
+
if (hasRedeemedOffersInPayload && payload.redeemed_offers == null) {
|
|
2114
|
+
return newData;
|
|
2115
|
+
}
|
|
2116
|
+
const fallbackRedeemedOffers = getRedeemedOffersMap(hasRedeemedOffersInPayload ? payload.redeemed_offers : data.redeemed_offers);
|
|
2117
|
+
if (fallbackRedeemedOffers == null) {
|
|
2118
|
+
return newData;
|
|
2119
|
+
}
|
|
2120
|
+
return {
|
|
2121
|
+
...newData,
|
|
2122
|
+
redeemed_offers: fallbackRedeemedOffers,
|
|
2123
|
+
};
|
|
2094
2124
|
}
|
|
2095
2125
|
/* ======================><====================== */
|
|
2096
2126
|
function getRemoveItemFromCartData(data, payload, courses, listnerSettings) {
|
|
@@ -21,11 +21,18 @@ export declare const ReservationsSchema: Schema<any, import("mongoose").Model<an
|
|
|
21
21
|
reservation_duration: number;
|
|
22
22
|
reservation_status: RESERVATION_STATUS_ENUM;
|
|
23
23
|
tables?: import("mongoose").Types.ObjectId[] | null | undefined;
|
|
24
|
+
staff_details?: {
|
|
25
|
+
staff_id: string;
|
|
26
|
+
staff_name: string;
|
|
27
|
+
staff_mobile: string;
|
|
28
|
+
staff_email: string;
|
|
29
|
+
} | null | undefined;
|
|
24
30
|
customer_email?: string | null | undefined;
|
|
25
31
|
cancellation_requested?: boolean | null | undefined;
|
|
26
32
|
cancellation_requested_at?: NativeDate | null | undefined;
|
|
27
33
|
cancellation_requested_by?: string | null | undefined;
|
|
28
34
|
cancellation_request_note?: string | null | undefined;
|
|
35
|
+
order_from?: import("../../constants").ORDER_FROM_ENUM | null | undefined;
|
|
29
36
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
30
37
|
createdAt: NativeDate;
|
|
31
38
|
updatedAt: NativeDate;
|
|
@@ -43,11 +50,18 @@ export declare const ReservationsSchema: Schema<any, import("mongoose").Model<an
|
|
|
43
50
|
reservation_duration: number;
|
|
44
51
|
reservation_status: RESERVATION_STATUS_ENUM;
|
|
45
52
|
tables?: import("mongoose").Types.ObjectId[] | null | undefined;
|
|
53
|
+
staff_details?: {
|
|
54
|
+
staff_id: string;
|
|
55
|
+
staff_name: string;
|
|
56
|
+
staff_mobile: string;
|
|
57
|
+
staff_email: string;
|
|
58
|
+
} | null | undefined;
|
|
46
59
|
customer_email?: string | null | undefined;
|
|
47
60
|
cancellation_requested?: boolean | null | undefined;
|
|
48
61
|
cancellation_requested_at?: NativeDate | null | undefined;
|
|
49
62
|
cancellation_requested_by?: string | null | undefined;
|
|
50
63
|
cancellation_request_note?: string | null | undefined;
|
|
64
|
+
order_from?: import("../../constants").ORDER_FROM_ENUM | null | undefined;
|
|
51
65
|
}>> & import("mongoose").FlatRecord<{
|
|
52
66
|
createdAt: NativeDate;
|
|
53
67
|
updatedAt: NativeDate;
|
|
@@ -65,11 +79,18 @@ export declare const ReservationsSchema: Schema<any, import("mongoose").Model<an
|
|
|
65
79
|
reservation_duration: number;
|
|
66
80
|
reservation_status: RESERVATION_STATUS_ENUM;
|
|
67
81
|
tables?: import("mongoose").Types.ObjectId[] | null | undefined;
|
|
82
|
+
staff_details?: {
|
|
83
|
+
staff_id: string;
|
|
84
|
+
staff_name: string;
|
|
85
|
+
staff_mobile: string;
|
|
86
|
+
staff_email: string;
|
|
87
|
+
} | null | undefined;
|
|
68
88
|
customer_email?: string | null | undefined;
|
|
69
89
|
cancellation_requested?: boolean | null | undefined;
|
|
70
90
|
cancellation_requested_at?: NativeDate | null | undefined;
|
|
71
91
|
cancellation_requested_by?: string | null | undefined;
|
|
72
92
|
cancellation_request_note?: string | null | undefined;
|
|
93
|
+
order_from?: import("../../constants").ORDER_FROM_ENUM | null | undefined;
|
|
73
94
|
}> & Required<{
|
|
74
95
|
_id: import("mongoose").Types.ObjectId;
|
|
75
96
|
}> & {
|
|
@@ -3,6 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RESERVATIONS_COLLECTION_NAME = exports.ReservationsSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
|
+
const StaffDetailsSchema = new mongoose_1.Schema({
|
|
7
|
+
staff_id: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
staff_name: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
15
|
+
staff_mobile: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: null,
|
|
18
|
+
},
|
|
19
|
+
staff_email: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
}, { _id: false, minimize: false });
|
|
6
24
|
exports.ReservationsSchema = new mongoose_1.Schema({
|
|
7
25
|
_id: {
|
|
8
26
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
@@ -75,6 +93,15 @@ exports.ReservationsSchema = new mongoose_1.Schema({
|
|
|
75
93
|
type: String,
|
|
76
94
|
required: false,
|
|
77
95
|
},
|
|
96
|
+
staff_details: {
|
|
97
|
+
type: StaffDetailsSchema,
|
|
98
|
+
required: false,
|
|
99
|
+
},
|
|
100
|
+
order_from: {
|
|
101
|
+
type: String,
|
|
102
|
+
enum: constants_1.ALL_ORDER_FROM_NAMES,
|
|
103
|
+
required: false,
|
|
104
|
+
},
|
|
78
105
|
createdAt_mins: {
|
|
79
106
|
type: Number,
|
|
80
107
|
required: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RESERVATION_STATUS_ENUM } from '../../constants';
|
|
1
|
+
import { ORDER_FROM_ENUM, RESERVATION_STATUS_ENUM } from '../../constants';
|
|
2
|
+
import { IStaffDetails } from './order';
|
|
2
3
|
export interface IReservation {
|
|
3
4
|
_id: string;
|
|
4
5
|
tenant_id: string;
|
|
@@ -15,6 +16,8 @@ export interface IReservation {
|
|
|
15
16
|
cancellation_requested_at?: Date | null;
|
|
16
17
|
cancellation_requested_by?: string | null;
|
|
17
18
|
cancellation_request_note?: string | null;
|
|
19
|
+
staff_details?: IStaffDetails | null;
|
|
20
|
+
order_from?: ORDER_FROM_ENUM | null;
|
|
18
21
|
createdAt_mins: number;
|
|
19
22
|
createdAt: Date;
|
|
20
23
|
updatedAt: Date;
|