@open-tender/cloud 0.1.75 → 0.1.77
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/dist/cjs/slices/customer/loyalty.d.ts +64 -1
- package/dist/cjs/slices/customer/loyalty.js +6 -2
- package/dist/cjs/slices/customer/tpls.d.ts +186 -0
- package/dist/cjs/slices/customer/tpls.js +19 -1
- package/dist/esm/slices/customer/loyalty.d.ts +64 -1
- package/dist/esm/slices/customer/loyalty.js +7 -3
- package/dist/esm/slices/customer/tpls.d.ts +186 -0
- package/dist/esm/slices/customer/tpls.js +19 -1
- package/package.json +1 -1
|
@@ -28,7 +28,70 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
|
|
|
28
28
|
loading: RequestStatus;
|
|
29
29
|
error: RequestError;
|
|
30
30
|
};
|
|
31
|
-
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => (state:
|
|
31
|
+
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
32
|
+
alerts: import("@open-tender/types").Alerts;
|
|
33
|
+
allergens: import("..").AllergensState;
|
|
34
|
+
announcements: import("..").AnnouncementsState;
|
|
35
|
+
checkout: import("..").CheckoutState;
|
|
36
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
37
|
+
config: import("..").ConfigState;
|
|
38
|
+
confirmation: import("..").ConfirmationState;
|
|
39
|
+
customer: import("redux").CombinedState<{
|
|
40
|
+
account: import("./account").AccountState;
|
|
41
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
42
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
43
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
44
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
45
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
46
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
47
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
48
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
49
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
50
|
+
loyalty: CustomerLoyaltyState;
|
|
51
|
+
order: import("./order").CustomerOrderState;
|
|
52
|
+
orders: import("./orders").CustomerOrdersState;
|
|
53
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
54
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
55
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
56
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
57
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
58
|
+
}>;
|
|
59
|
+
deals: import("..").DealsState;
|
|
60
|
+
donations: import("..").DonationState;
|
|
61
|
+
geolocation: import("..").GeoLocationState;
|
|
62
|
+
giftCards: import("..").GiftCardsState;
|
|
63
|
+
groupOrder: import("..").GroupOrderState;
|
|
64
|
+
guest: import("..").GuestState;
|
|
65
|
+
loader: import("..").LoaderState;
|
|
66
|
+
menu: import("..").MenuState;
|
|
67
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
68
|
+
menuItems: import("..").MenuItemsState;
|
|
69
|
+
modal: import("@open-tender/types").Modal;
|
|
70
|
+
misc: import("..").MiscState;
|
|
71
|
+
nav: import("..").NavState;
|
|
72
|
+
navSite: import("..").NavSiteState;
|
|
73
|
+
notifications: import("@open-tender/types").Notifications;
|
|
74
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
75
|
+
order: import("..").OrderState;
|
|
76
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
77
|
+
orderRating: import("..").OrderRatingState;
|
|
78
|
+
posts: import("..").PostsSlice;
|
|
79
|
+
qr: import("..").QrState;
|
|
80
|
+
resetPassword: import("..").ResetPasswordState;
|
|
81
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
82
|
+
sidebar: import("..").SidebarState;
|
|
83
|
+
sidebarModal: import("..").SidebarModalState;
|
|
84
|
+
signUp: import("..").SignUpState;
|
|
85
|
+
tags: import("..").TagsState;
|
|
86
|
+
validTimes: import("..").ValidTimesState;
|
|
87
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
88
|
+
}) => import("@open-tender/types").CustomerLoyalty | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
89
|
+
loyalty: CustomerLoyaltyState;
|
|
90
|
+
}) => import("@open-tender/types").CustomerLoyalty | null, {
|
|
91
|
+
clearCache: () => void;
|
|
92
|
+
}> & {
|
|
93
|
+
clearCache: () => void;
|
|
94
|
+
};
|
|
32
95
|
export declare const selectCustomerPoints: (orderType: OrderType | null) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
|
|
33
96
|
export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
|
|
34
97
|
export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
|
|
@@ -72,12 +72,16 @@ const selectCustomerLoyaltyProgram = (state) => {
|
|
|
72
72
|
return { program, loading, error };
|
|
73
73
|
};
|
|
74
74
|
exports.selectCustomerLoyaltyProgram = selectCustomerLoyaltyProgram;
|
|
75
|
-
const selectCustomerPointsProgram = (orderType) => (state) => {
|
|
75
|
+
const selectCustomerPointsProgram = (orderType) => (0, toolkit_1.createSelector)((state) => {
|
|
76
76
|
const { loyalty } = state.customer;
|
|
77
|
+
return { loyalty };
|
|
78
|
+
}, ({ loyalty }) => {
|
|
79
|
+
if (!loyalty)
|
|
80
|
+
return null;
|
|
77
81
|
const programs = loyalty.entities.filter(i => i.loyalty_type === 'POINTS' &&
|
|
78
82
|
(i.spend.order_type === null || i.spend.order_type === orderType));
|
|
79
83
|
return programs.length ? programs[0] : null;
|
|
80
|
-
};
|
|
84
|
+
});
|
|
81
85
|
exports.selectCustomerPointsProgram = selectCustomerPointsProgram;
|
|
82
86
|
const selectCustomerPoints = (orderType) => (state) => {
|
|
83
87
|
const program = (0, exports.selectCustomerPointsProgram)(orderType)(state);
|
|
@@ -20,4 +20,190 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
20
20
|
}>;
|
|
21
21
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
22
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
|
+
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
24
|
+
alerts: import("@open-tender/types").Alerts;
|
|
25
|
+
allergens: import("..").AllergensState;
|
|
26
|
+
announcements: import("..").AnnouncementsState;
|
|
27
|
+
checkout: import("..").CheckoutState;
|
|
28
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
29
|
+
config: import("..").ConfigState;
|
|
30
|
+
confirmation: import("..").ConfirmationState;
|
|
31
|
+
customer: import("redux").CombinedState<{
|
|
32
|
+
account: import("./account").AccountState;
|
|
33
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
34
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
35
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
36
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
37
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
38
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
39
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
40
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
41
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
42
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
43
|
+
order: import("./order").CustomerOrderState;
|
|
44
|
+
orders: import("./orders").CustomerOrdersState;
|
|
45
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
46
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
47
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
48
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
49
|
+
tpls: CustomerTplsState;
|
|
50
|
+
}>;
|
|
51
|
+
deals: import("..").DealsState;
|
|
52
|
+
donations: import("..").DonationState;
|
|
53
|
+
geolocation: import("..").GeoLocationState;
|
|
54
|
+
giftCards: import("..").GiftCardsState;
|
|
55
|
+
groupOrder: import("..").GroupOrderState;
|
|
56
|
+
guest: import("..").GuestState;
|
|
57
|
+
loader: import("..").LoaderState;
|
|
58
|
+
menu: import("..").MenuState;
|
|
59
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
60
|
+
menuItems: import("..").MenuItemsState;
|
|
61
|
+
modal: import("@open-tender/types").Modal;
|
|
62
|
+
misc: import("..").MiscState;
|
|
63
|
+
nav: import("..").NavState;
|
|
64
|
+
navSite: import("..").NavSiteState;
|
|
65
|
+
notifications: import("@open-tender/types").Notifications;
|
|
66
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
67
|
+
order: import("..").OrderState;
|
|
68
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
69
|
+
orderRating: import("..").OrderRatingState;
|
|
70
|
+
posts: import("..").PostsSlice;
|
|
71
|
+
qr: import("..").QrState;
|
|
72
|
+
resetPassword: import("..").ResetPasswordState;
|
|
73
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
74
|
+
sidebar: import("..").SidebarState;
|
|
75
|
+
sidebarModal: import("..").SidebarModalState;
|
|
76
|
+
signUp: import("..").SignUpState;
|
|
77
|
+
tags: import("..").TagsState;
|
|
78
|
+
validTimes: import("..").ValidTimesState;
|
|
79
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
80
|
+
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSPoints | null | undefined) => number | null, {
|
|
81
|
+
clearCache: () => void;
|
|
82
|
+
}> & {
|
|
83
|
+
clearCache: () => void;
|
|
84
|
+
};
|
|
85
|
+
export declare const selectCustomerTplsRewards: ((state: import("redux").EmptyObject & {
|
|
86
|
+
alerts: import("@open-tender/types").Alerts;
|
|
87
|
+
allergens: import("..").AllergensState;
|
|
88
|
+
announcements: import("..").AnnouncementsState;
|
|
89
|
+
checkout: import("..").CheckoutState;
|
|
90
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
91
|
+
config: import("..").ConfigState;
|
|
92
|
+
confirmation: import("..").ConfirmationState;
|
|
93
|
+
customer: import("redux").CombinedState<{
|
|
94
|
+
account: import("./account").AccountState;
|
|
95
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
96
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
97
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
98
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
99
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
100
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
101
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
102
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
103
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
104
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
105
|
+
order: import("./order").CustomerOrderState;
|
|
106
|
+
orders: import("./orders").CustomerOrdersState;
|
|
107
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
108
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
109
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
110
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
111
|
+
tpls: CustomerTplsState;
|
|
112
|
+
}>;
|
|
113
|
+
deals: import("..").DealsState;
|
|
114
|
+
donations: import("..").DonationState;
|
|
115
|
+
geolocation: import("..").GeoLocationState;
|
|
116
|
+
giftCards: import("..").GiftCardsState;
|
|
117
|
+
groupOrder: import("..").GroupOrderState;
|
|
118
|
+
guest: import("..").GuestState;
|
|
119
|
+
loader: import("..").LoaderState;
|
|
120
|
+
menu: import("..").MenuState;
|
|
121
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
122
|
+
menuItems: import("..").MenuItemsState;
|
|
123
|
+
modal: import("@open-tender/types").Modal;
|
|
124
|
+
misc: import("..").MiscState;
|
|
125
|
+
nav: import("..").NavState;
|
|
126
|
+
navSite: import("..").NavSiteState;
|
|
127
|
+
notifications: import("@open-tender/types").Notifications;
|
|
128
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
129
|
+
order: import("..").OrderState;
|
|
130
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
131
|
+
orderRating: import("..").OrderRatingState;
|
|
132
|
+
posts: import("..").PostsSlice;
|
|
133
|
+
qr: import("..").QrState;
|
|
134
|
+
resetPassword: import("..").ResetPasswordState;
|
|
135
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
136
|
+
sidebar: import("..").SidebarState;
|
|
137
|
+
sidebarModal: import("..").SidebarModalState;
|
|
138
|
+
signUp: import("..").SignUpState;
|
|
139
|
+
tags: import("..").TagsState;
|
|
140
|
+
validTimes: import("..").ValidTimesState;
|
|
141
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
142
|
+
}) => import("@open-tender/types").TPLSRewards) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSRewards | undefined) => import("@open-tender/types").TPLSRewards, {
|
|
143
|
+
clearCache: () => void;
|
|
144
|
+
}> & {
|
|
145
|
+
clearCache: () => void;
|
|
146
|
+
};
|
|
147
|
+
export declare const selectCustomerTplsProgress: ((state: import("redux").EmptyObject & {
|
|
148
|
+
alerts: import("@open-tender/types").Alerts;
|
|
149
|
+
allergens: import("..").AllergensState;
|
|
150
|
+
announcements: import("..").AnnouncementsState;
|
|
151
|
+
checkout: import("..").CheckoutState;
|
|
152
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
153
|
+
config: import("..").ConfigState;
|
|
154
|
+
confirmation: import("..").ConfirmationState;
|
|
155
|
+
customer: import("redux").CombinedState<{
|
|
156
|
+
account: import("./account").AccountState;
|
|
157
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
158
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
159
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
160
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
161
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
162
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
163
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
164
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
165
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
166
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
167
|
+
order: import("./order").CustomerOrderState;
|
|
168
|
+
orders: import("./orders").CustomerOrdersState;
|
|
169
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
170
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
171
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
172
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
173
|
+
tpls: CustomerTplsState;
|
|
174
|
+
}>;
|
|
175
|
+
deals: import("..").DealsState;
|
|
176
|
+
donations: import("..").DonationState;
|
|
177
|
+
geolocation: import("..").GeoLocationState;
|
|
178
|
+
giftCards: import("..").GiftCardsState;
|
|
179
|
+
groupOrder: import("..").GroupOrderState;
|
|
180
|
+
guest: import("..").GuestState;
|
|
181
|
+
loader: import("..").LoaderState;
|
|
182
|
+
menu: import("..").MenuState;
|
|
183
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
184
|
+
menuItems: import("..").MenuItemsState;
|
|
185
|
+
modal: import("@open-tender/types").Modal;
|
|
186
|
+
misc: import("..").MiscState;
|
|
187
|
+
nav: import("..").NavState;
|
|
188
|
+
navSite: import("..").NavSiteState;
|
|
189
|
+
notifications: import("@open-tender/types").Notifications;
|
|
190
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
191
|
+
order: import("..").OrderState;
|
|
192
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
193
|
+
orderRating: import("..").OrderRatingState;
|
|
194
|
+
posts: import("..").PostsSlice;
|
|
195
|
+
qr: import("..").QrState;
|
|
196
|
+
resetPassword: import("..").ResetPasswordState;
|
|
197
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
198
|
+
sidebar: import("..").SidebarState;
|
|
199
|
+
sidebarModal: import("..").SidebarModalState;
|
|
200
|
+
signUp: import("..").SignUpState;
|
|
201
|
+
tags: import("..").TagsState;
|
|
202
|
+
validTimes: import("..").ValidTimesState;
|
|
203
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
204
|
+
}) => import("@open-tender/types").TPLSProgress | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSProgress | null | undefined) => import("@open-tender/types").TPLSProgress | null, {
|
|
205
|
+
clearCache: () => void;
|
|
206
|
+
}> & {
|
|
207
|
+
clearCache: () => void;
|
|
208
|
+
};
|
|
23
209
|
export declare const customerTplsReducer: import("redux").Reducer<CustomerTplsState, import("redux").AnyAction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customerTplsReducer = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
3
|
+
exports.customerTplsReducer = exports.selectCustomerTplsProgress = exports.selectCustomerTplsRewards = exports.selectCustomerTplsPoints = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -54,4 +54,22 @@ const customerTplsSlice = (0, toolkit_1.createSlice)({
|
|
|
54
54
|
exports.resetCustomerTpls = customerTplsSlice.actions.resetCustomerTpls;
|
|
55
55
|
const selectCustomerTpls = (state) => state.customer.tpls;
|
|
56
56
|
exports.selectCustomerTpls = selectCustomerTpls;
|
|
57
|
+
exports.selectCustomerTplsPoints = (0, toolkit_1.createSelector)((state) => {
|
|
58
|
+
const { points } = state.customer.tpls.tpls || {};
|
|
59
|
+
return points;
|
|
60
|
+
}, points => {
|
|
61
|
+
return points ? points.balance : null;
|
|
62
|
+
});
|
|
63
|
+
exports.selectCustomerTplsRewards = (0, toolkit_1.createSelector)((state) => {
|
|
64
|
+
const { rewards } = state.customer.tpls.tpls || {};
|
|
65
|
+
return rewards;
|
|
66
|
+
}, rewards => {
|
|
67
|
+
return rewards !== null && rewards !== void 0 ? rewards : [];
|
|
68
|
+
});
|
|
69
|
+
exports.selectCustomerTplsProgress = (0, toolkit_1.createSelector)((state) => {
|
|
70
|
+
const { progress } = state.customer.tpls.tpls || {};
|
|
71
|
+
return progress;
|
|
72
|
+
}, progress => {
|
|
73
|
+
return progress !== null && progress !== void 0 ? progress : null;
|
|
74
|
+
});
|
|
57
75
|
exports.customerTplsReducer = customerTplsSlice.reducer;
|
|
@@ -28,7 +28,70 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
|
|
|
28
28
|
loading: RequestStatus;
|
|
29
29
|
error: RequestError;
|
|
30
30
|
};
|
|
31
|
-
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => (state:
|
|
31
|
+
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
32
|
+
alerts: import("@open-tender/types").Alerts;
|
|
33
|
+
allergens: import("..").AllergensState;
|
|
34
|
+
announcements: import("..").AnnouncementsState;
|
|
35
|
+
checkout: import("..").CheckoutState;
|
|
36
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
37
|
+
config: import("..").ConfigState;
|
|
38
|
+
confirmation: import("..").ConfirmationState;
|
|
39
|
+
customer: import("redux").CombinedState<{
|
|
40
|
+
account: import("./account").AccountState;
|
|
41
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
42
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
43
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
44
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
45
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
46
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
47
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
48
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
49
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
50
|
+
loyalty: CustomerLoyaltyState;
|
|
51
|
+
order: import("./order").CustomerOrderState;
|
|
52
|
+
orders: import("./orders").CustomerOrdersState;
|
|
53
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
54
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
55
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
56
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
57
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
58
|
+
}>;
|
|
59
|
+
deals: import("..").DealsState;
|
|
60
|
+
donations: import("..").DonationState;
|
|
61
|
+
geolocation: import("..").GeoLocationState;
|
|
62
|
+
giftCards: import("..").GiftCardsState;
|
|
63
|
+
groupOrder: import("..").GroupOrderState;
|
|
64
|
+
guest: import("..").GuestState;
|
|
65
|
+
loader: import("..").LoaderState;
|
|
66
|
+
menu: import("..").MenuState;
|
|
67
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
68
|
+
menuItems: import("..").MenuItemsState;
|
|
69
|
+
modal: import("@open-tender/types").Modal;
|
|
70
|
+
misc: import("..").MiscState;
|
|
71
|
+
nav: import("..").NavState;
|
|
72
|
+
navSite: import("..").NavSiteState;
|
|
73
|
+
notifications: import("@open-tender/types").Notifications;
|
|
74
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
75
|
+
order: import("..").OrderState;
|
|
76
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
77
|
+
orderRating: import("..").OrderRatingState;
|
|
78
|
+
posts: import("..").PostsSlice;
|
|
79
|
+
qr: import("..").QrState;
|
|
80
|
+
resetPassword: import("..").ResetPasswordState;
|
|
81
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
82
|
+
sidebar: import("..").SidebarState;
|
|
83
|
+
sidebarModal: import("..").SidebarModalState;
|
|
84
|
+
signUp: import("..").SignUpState;
|
|
85
|
+
tags: import("..").TagsState;
|
|
86
|
+
validTimes: import("..").ValidTimesState;
|
|
87
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
88
|
+
}) => import("@open-tender/types").CustomerLoyalty | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
89
|
+
loyalty: CustomerLoyaltyState;
|
|
90
|
+
}) => import("@open-tender/types").CustomerLoyalty | null, {
|
|
91
|
+
clearCache: () => void;
|
|
92
|
+
}> & {
|
|
93
|
+
clearCache: () => void;
|
|
94
|
+
};
|
|
32
95
|
export declare const selectCustomerPoints: (orderType: OrderType | null) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
|
|
33
96
|
export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
|
|
34
97
|
export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { createAsyncThunk, createSelector, createSlice } from '@reduxjs/toolkit';
|
|
3
3
|
import { ReducerType } from '../types';
|
|
4
4
|
import { MISSING_CUSTOMER } from '@open-tender/types';
|
|
5
5
|
import { checkAuth, selectToken } from './account';
|
|
@@ -66,12 +66,16 @@ export const selectCustomerLoyaltyProgram = (state) => {
|
|
|
66
66
|
const program = programs.length ? programs[0] : null;
|
|
67
67
|
return { program, loading, error };
|
|
68
68
|
};
|
|
69
|
-
export const selectCustomerPointsProgram = (orderType) => (state) => {
|
|
69
|
+
export const selectCustomerPointsProgram = (orderType) => createSelector((state) => {
|
|
70
70
|
const { loyalty } = state.customer;
|
|
71
|
+
return { loyalty };
|
|
72
|
+
}, ({ loyalty }) => {
|
|
73
|
+
if (!loyalty)
|
|
74
|
+
return null;
|
|
71
75
|
const programs = loyalty.entities.filter(i => i.loyalty_type === 'POINTS' &&
|
|
72
76
|
(i.spend.order_type === null || i.spend.order_type === orderType));
|
|
73
77
|
return programs.length ? programs[0] : null;
|
|
74
|
-
};
|
|
78
|
+
});
|
|
75
79
|
export const selectCustomerPoints = (orderType) => (state) => {
|
|
76
80
|
const program = selectCustomerPointsProgram(orderType)(state);
|
|
77
81
|
return program ? program.points : null;
|
|
@@ -20,4 +20,190 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
20
20
|
}>;
|
|
21
21
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
22
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
|
+
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
24
|
+
alerts: import("@open-tender/types").Alerts;
|
|
25
|
+
allergens: import("..").AllergensState;
|
|
26
|
+
announcements: import("..").AnnouncementsState;
|
|
27
|
+
checkout: import("..").CheckoutState;
|
|
28
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
29
|
+
config: import("..").ConfigState;
|
|
30
|
+
confirmation: import("..").ConfirmationState;
|
|
31
|
+
customer: import("redux").CombinedState<{
|
|
32
|
+
account: import("./account").AccountState;
|
|
33
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
34
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
35
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
36
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
37
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
38
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
39
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
40
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
41
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
42
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
43
|
+
order: import("./order").CustomerOrderState;
|
|
44
|
+
orders: import("./orders").CustomerOrdersState;
|
|
45
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
46
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
47
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
48
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
49
|
+
tpls: CustomerTplsState;
|
|
50
|
+
}>;
|
|
51
|
+
deals: import("..").DealsState;
|
|
52
|
+
donations: import("..").DonationState;
|
|
53
|
+
geolocation: import("..").GeoLocationState;
|
|
54
|
+
giftCards: import("..").GiftCardsState;
|
|
55
|
+
groupOrder: import("..").GroupOrderState;
|
|
56
|
+
guest: import("..").GuestState;
|
|
57
|
+
loader: import("..").LoaderState;
|
|
58
|
+
menu: import("..").MenuState;
|
|
59
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
60
|
+
menuItems: import("..").MenuItemsState;
|
|
61
|
+
modal: import("@open-tender/types").Modal;
|
|
62
|
+
misc: import("..").MiscState;
|
|
63
|
+
nav: import("..").NavState;
|
|
64
|
+
navSite: import("..").NavSiteState;
|
|
65
|
+
notifications: import("@open-tender/types").Notifications;
|
|
66
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
67
|
+
order: import("..").OrderState;
|
|
68
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
69
|
+
orderRating: import("..").OrderRatingState;
|
|
70
|
+
posts: import("..").PostsSlice;
|
|
71
|
+
qr: import("..").QrState;
|
|
72
|
+
resetPassword: import("..").ResetPasswordState;
|
|
73
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
74
|
+
sidebar: import("..").SidebarState;
|
|
75
|
+
sidebarModal: import("..").SidebarModalState;
|
|
76
|
+
signUp: import("..").SignUpState;
|
|
77
|
+
tags: import("..").TagsState;
|
|
78
|
+
validTimes: import("..").ValidTimesState;
|
|
79
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
80
|
+
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSPoints | null | undefined) => number | null, {
|
|
81
|
+
clearCache: () => void;
|
|
82
|
+
}> & {
|
|
83
|
+
clearCache: () => void;
|
|
84
|
+
};
|
|
85
|
+
export declare const selectCustomerTplsRewards: ((state: import("redux").EmptyObject & {
|
|
86
|
+
alerts: import("@open-tender/types").Alerts;
|
|
87
|
+
allergens: import("..").AllergensState;
|
|
88
|
+
announcements: import("..").AnnouncementsState;
|
|
89
|
+
checkout: import("..").CheckoutState;
|
|
90
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
91
|
+
config: import("..").ConfigState;
|
|
92
|
+
confirmation: import("..").ConfirmationState;
|
|
93
|
+
customer: import("redux").CombinedState<{
|
|
94
|
+
account: import("./account").AccountState;
|
|
95
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
96
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
97
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
98
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
99
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
100
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
101
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
102
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
103
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
104
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
105
|
+
order: import("./order").CustomerOrderState;
|
|
106
|
+
orders: import("./orders").CustomerOrdersState;
|
|
107
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
108
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
109
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
110
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
111
|
+
tpls: CustomerTplsState;
|
|
112
|
+
}>;
|
|
113
|
+
deals: import("..").DealsState;
|
|
114
|
+
donations: import("..").DonationState;
|
|
115
|
+
geolocation: import("..").GeoLocationState;
|
|
116
|
+
giftCards: import("..").GiftCardsState;
|
|
117
|
+
groupOrder: import("..").GroupOrderState;
|
|
118
|
+
guest: import("..").GuestState;
|
|
119
|
+
loader: import("..").LoaderState;
|
|
120
|
+
menu: import("..").MenuState;
|
|
121
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
122
|
+
menuItems: import("..").MenuItemsState;
|
|
123
|
+
modal: import("@open-tender/types").Modal;
|
|
124
|
+
misc: import("..").MiscState;
|
|
125
|
+
nav: import("..").NavState;
|
|
126
|
+
navSite: import("..").NavSiteState;
|
|
127
|
+
notifications: import("@open-tender/types").Notifications;
|
|
128
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
129
|
+
order: import("..").OrderState;
|
|
130
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
131
|
+
orderRating: import("..").OrderRatingState;
|
|
132
|
+
posts: import("..").PostsSlice;
|
|
133
|
+
qr: import("..").QrState;
|
|
134
|
+
resetPassword: import("..").ResetPasswordState;
|
|
135
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
136
|
+
sidebar: import("..").SidebarState;
|
|
137
|
+
sidebarModal: import("..").SidebarModalState;
|
|
138
|
+
signUp: import("..").SignUpState;
|
|
139
|
+
tags: import("..").TagsState;
|
|
140
|
+
validTimes: import("..").ValidTimesState;
|
|
141
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
142
|
+
}) => import("@open-tender/types").TPLSRewards) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSRewards | undefined) => import("@open-tender/types").TPLSRewards, {
|
|
143
|
+
clearCache: () => void;
|
|
144
|
+
}> & {
|
|
145
|
+
clearCache: () => void;
|
|
146
|
+
};
|
|
147
|
+
export declare const selectCustomerTplsProgress: ((state: import("redux").EmptyObject & {
|
|
148
|
+
alerts: import("@open-tender/types").Alerts;
|
|
149
|
+
allergens: import("..").AllergensState;
|
|
150
|
+
announcements: import("..").AnnouncementsState;
|
|
151
|
+
checkout: import("..").CheckoutState;
|
|
152
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
153
|
+
config: import("..").ConfigState;
|
|
154
|
+
confirmation: import("..").ConfirmationState;
|
|
155
|
+
customer: import("redux").CombinedState<{
|
|
156
|
+
account: import("./account").AccountState;
|
|
157
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
158
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
159
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
160
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
161
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
162
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
163
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
164
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
165
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
166
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
167
|
+
order: import("./order").CustomerOrderState;
|
|
168
|
+
orders: import("./orders").CustomerOrdersState;
|
|
169
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
170
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
171
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
172
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
173
|
+
tpls: CustomerTplsState;
|
|
174
|
+
}>;
|
|
175
|
+
deals: import("..").DealsState;
|
|
176
|
+
donations: import("..").DonationState;
|
|
177
|
+
geolocation: import("..").GeoLocationState;
|
|
178
|
+
giftCards: import("..").GiftCardsState;
|
|
179
|
+
groupOrder: import("..").GroupOrderState;
|
|
180
|
+
guest: import("..").GuestState;
|
|
181
|
+
loader: import("..").LoaderState;
|
|
182
|
+
menu: import("..").MenuState;
|
|
183
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
184
|
+
menuItems: import("..").MenuItemsState;
|
|
185
|
+
modal: import("@open-tender/types").Modal;
|
|
186
|
+
misc: import("..").MiscState;
|
|
187
|
+
nav: import("..").NavState;
|
|
188
|
+
navSite: import("..").NavSiteState;
|
|
189
|
+
notifications: import("@open-tender/types").Notifications;
|
|
190
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
191
|
+
order: import("..").OrderState;
|
|
192
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
193
|
+
orderRating: import("..").OrderRatingState;
|
|
194
|
+
posts: import("..").PostsSlice;
|
|
195
|
+
qr: import("..").QrState;
|
|
196
|
+
resetPassword: import("..").ResetPasswordState;
|
|
197
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
198
|
+
sidebar: import("..").SidebarState;
|
|
199
|
+
sidebarModal: import("..").SidebarModalState;
|
|
200
|
+
signUp: import("..").SignUpState;
|
|
201
|
+
tags: import("..").TagsState;
|
|
202
|
+
validTimes: import("..").ValidTimesState;
|
|
203
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
204
|
+
}) => import("@open-tender/types").TPLSProgress | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSProgress | null | undefined) => import("@open-tender/types").TPLSProgress | null, {
|
|
205
|
+
clearCache: () => void;
|
|
206
|
+
}> & {
|
|
207
|
+
clearCache: () => void;
|
|
208
|
+
};
|
|
23
209
|
export declare const customerTplsReducer: import("redux").Reducer<CustomerTplsState, import("redux").AnyAction>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { createAsyncThunk, createSelector, createSlice } from '@reduxjs/toolkit';
|
|
3
3
|
import { ReducerType } from '../types';
|
|
4
4
|
import { MISSING_CUSTOMER } from '@open-tender/types';
|
|
5
5
|
import { checkAuth, selectToken } from './account';
|
|
@@ -50,4 +50,22 @@ const customerTplsSlice = createSlice({
|
|
|
50
50
|
});
|
|
51
51
|
export const { resetCustomerTpls } = customerTplsSlice.actions;
|
|
52
52
|
export const selectCustomerTpls = (state) => state.customer.tpls;
|
|
53
|
+
export const selectCustomerTplsPoints = createSelector((state) => {
|
|
54
|
+
const { points } = state.customer.tpls.tpls || {};
|
|
55
|
+
return points;
|
|
56
|
+
}, points => {
|
|
57
|
+
return points ? points.balance : null;
|
|
58
|
+
});
|
|
59
|
+
export const selectCustomerTplsRewards = createSelector((state) => {
|
|
60
|
+
const { rewards } = state.customer.tpls.tpls || {};
|
|
61
|
+
return rewards;
|
|
62
|
+
}, rewards => {
|
|
63
|
+
return rewards !== null && rewards !== void 0 ? rewards : [];
|
|
64
|
+
});
|
|
65
|
+
export const selectCustomerTplsProgress = createSelector((state) => {
|
|
66
|
+
const { progress } = state.customer.tpls.tpls || {};
|
|
67
|
+
return progress;
|
|
68
|
+
}, progress => {
|
|
69
|
+
return progress !== null && progress !== void 0 ? progress : null;
|
|
70
|
+
});
|
|
53
71
|
export const customerTplsReducer = customerTplsSlice.reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|