@open-tender/store 1.1.241 → 1.1.244
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/components/TagsButton.js +4 -4
- package/dist/cjs/slices/customer.d.ts +113 -50
- package/dist/cjs/slices/customer.js +13 -22
- package/dist/esm/components/TagsButton.js +4 -4
- package/dist/esm/slices/customer.d.ts +113 -50
- package/dist/esm/slices/customer.js +13 -20
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ var react_1 = require("react");
|
|
|
4
4
|
var hooks_1 = require("../app/hooks");
|
|
5
5
|
var slices_1 = require("../slices");
|
|
6
6
|
var TagsButton = function (_a) {
|
|
7
|
-
var _b, _c;
|
|
7
|
+
var _b, _c, _d;
|
|
8
8
|
var children = _a.children;
|
|
9
9
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).tagsButton;
|
|
10
10
|
var isTagsModalShown = (0, hooks_1.useAppSelector)(slices_1.selectShowTagsModal);
|
|
@@ -18,9 +18,9 @@ var TagsButton = function (_a) {
|
|
|
18
18
|
return children({
|
|
19
19
|
config: config,
|
|
20
20
|
handlers: handlers,
|
|
21
|
-
isSelected: selectedTags.length > 0 ||
|
|
22
|
-
selectedTags: (
|
|
23
|
-
selectedAllergens: (
|
|
21
|
+
isSelected: selectedTags.length > 0 || ((_b = selectedAllergens === null || selectedAllergens === void 0 ? void 0 : selectedAllergens.length) !== null && _b !== void 0 ? _b : 0) > 0,
|
|
22
|
+
selectedTags: (_c = selectedTags.length) !== null && _c !== void 0 ? _c : 0,
|
|
23
|
+
selectedAllergens: (_d = selectedAllergens === null || selectedAllergens === void 0 ? void 0 : selectedAllergens.length) !== null && _d !== void 0 ? _d : 0
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
exports.default = TagsButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders,
|
|
1
|
+
import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface CustomerState {
|
|
4
4
|
account: Customer | null;
|
|
@@ -155,7 +155,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
|
|
|
155
155
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
156
156
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
157
157
|
};
|
|
158
|
-
export declare const selectCustomerPointsProgram: (
|
|
158
|
+
export declare const selectCustomerPointsProgram: ((state: {
|
|
159
159
|
alerts: import("@open-tender/types").Alerts;
|
|
160
160
|
allergens: import("./allergens").AllergensState;
|
|
161
161
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -190,20 +190,14 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
190
190
|
resultsCount: () => number;
|
|
191
191
|
resetResultsCount: () => void;
|
|
192
192
|
} & {
|
|
193
|
-
resultFunc: (resultFuncArgs_0:
|
|
194
|
-
|
|
195
|
-
}) => import("@open-tender/types").LoyaltyProgram | null;
|
|
196
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
197
|
-
loyaltyPrograms: LoyaltyPrograms;
|
|
198
|
-
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
193
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
194
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
199
195
|
clearCache: () => void;
|
|
200
196
|
resultsCount: () => number;
|
|
201
197
|
resetResultsCount: () => void;
|
|
202
198
|
};
|
|
203
199
|
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
204
|
-
dependencies: [(state: AppState) =>
|
|
205
|
-
loyaltyPrograms: LoyaltyPrograms;
|
|
206
|
-
}];
|
|
200
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
207
201
|
recomputations: () => number;
|
|
208
202
|
resetRecomputations: () => void;
|
|
209
203
|
dependencyRecomputations: () => number;
|
|
@@ -212,11 +206,7 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
212
206
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
213
207
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
214
208
|
};
|
|
215
|
-
export declare const selectCustomerPoints: (
|
|
216
|
-
name: string;
|
|
217
|
-
points: `${number}.${number}` | null;
|
|
218
|
-
} | null;
|
|
219
|
-
export declare const selectPointsProgram: ((state: {
|
|
209
|
+
export declare const selectCustomerPoints: ((state: {
|
|
220
210
|
alerts: import("@open-tender/types").Alerts;
|
|
221
211
|
allergens: import("./allergens").AllergensState;
|
|
222
212
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -246,43 +236,31 @@ export declare const selectPointsProgram: ((state: {
|
|
|
246
236
|
taxes: import("./taxes").TaxesState;
|
|
247
237
|
idle: import("./idle").IdleState;
|
|
248
238
|
tags: import("./tags").TagsState;
|
|
249
|
-
}) =>
|
|
239
|
+
}) => {
|
|
240
|
+
name: string;
|
|
241
|
+
points: `${number}.${number}` | null;
|
|
242
|
+
} | null) & {
|
|
250
243
|
clearCache: () => void;
|
|
251
244
|
resultsCount: () => number;
|
|
252
245
|
resetResultsCount: () => void;
|
|
253
246
|
} & {
|
|
254
|
-
resultFunc: (resultFuncArgs_0:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
notifications: import("@open-tender/types").Notifications;
|
|
272
|
-
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
273
|
-
order: import("./order").OrderState;
|
|
274
|
-
pos: import("./pos").PosState;
|
|
275
|
-
punches: import("./punches").PunchesState;
|
|
276
|
-
refund: import("./refund").RefundState;
|
|
277
|
-
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
278
|
-
settings: import("./settings").SettingsState;
|
|
279
|
-
sidebar: import("./sidebar").SidebarState;
|
|
280
|
-
surcharges: import("./surcharges").SurchargesState;
|
|
281
|
-
taxes: import("./taxes").TaxesState;
|
|
282
|
-
idle: import("./idle").IdleState;
|
|
283
|
-
tags: import("./tags").TagsState;
|
|
284
|
-
}) => import("@open-tender/types").LoyaltyProgram | null;
|
|
285
|
-
memoizedResultFunc: ((resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
|
|
247
|
+
resultFunc: (resultFuncArgs_0: import("@open-tender/types").LoyaltyProgram | null) => {
|
|
248
|
+
name: string;
|
|
249
|
+
points: `${number}.${number}` | null;
|
|
250
|
+
} | null;
|
|
251
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@open-tender/types").LoyaltyProgram | null) => {
|
|
252
|
+
name: string;
|
|
253
|
+
points: `${number}.${number}` | null;
|
|
254
|
+
} | null) & {
|
|
255
|
+
clearCache: () => void;
|
|
256
|
+
resultsCount: () => number;
|
|
257
|
+
resetResultsCount: () => void;
|
|
258
|
+
};
|
|
259
|
+
lastResult: () => {
|
|
260
|
+
name: string;
|
|
261
|
+
points: `${number}.${number}` | null;
|
|
262
|
+
} | null;
|
|
263
|
+
dependencies: [((state: {
|
|
286
264
|
alerts: import("@open-tender/types").Alerts;
|
|
287
265
|
allergens: import("./allergens").AllergensState;
|
|
288
266
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -316,9 +294,74 @@ export declare const selectPointsProgram: ((state: {
|
|
|
316
294
|
clearCache: () => void;
|
|
317
295
|
resultsCount: () => number;
|
|
318
296
|
resetResultsCount: () => void;
|
|
297
|
+
} & {
|
|
298
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
299
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
300
|
+
clearCache: () => void;
|
|
301
|
+
resultsCount: () => number;
|
|
302
|
+
resetResultsCount: () => void;
|
|
303
|
+
};
|
|
304
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
305
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
306
|
+
recomputations: () => number;
|
|
307
|
+
resetRecomputations: () => void;
|
|
308
|
+
dependencyRecomputations: () => number;
|
|
309
|
+
resetDependencyRecomputations: () => void;
|
|
310
|
+
} & {
|
|
311
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
312
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
313
|
+
}];
|
|
314
|
+
recomputations: () => number;
|
|
315
|
+
resetRecomputations: () => void;
|
|
316
|
+
dependencyRecomputations: () => number;
|
|
317
|
+
resetDependencyRecomputations: () => void;
|
|
318
|
+
} & {
|
|
319
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
320
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
321
|
+
};
|
|
322
|
+
export declare const selectPointsProgram: ((state: {
|
|
323
|
+
alerts: import("@open-tender/types").Alerts;
|
|
324
|
+
allergens: import("./allergens").AllergensState;
|
|
325
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
326
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
327
|
+
checkout: import("./checkout").CheckoutState;
|
|
328
|
+
config: import("./config").ConfigState;
|
|
329
|
+
customer: CustomerState;
|
|
330
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
331
|
+
deals: import("./deals").DealsState;
|
|
332
|
+
discounts: import("./discounts").DiscountsState;
|
|
333
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
334
|
+
kds: import("./kds").KdsState;
|
|
335
|
+
kiosk: import("./kiosk").KioskState;
|
|
336
|
+
menu: import("./menu").MenuState;
|
|
337
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
338
|
+
modal: import("./modal").ModalState;
|
|
339
|
+
notifications: import("@open-tender/types").Notifications;
|
|
340
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
341
|
+
order: import("./order").OrderState;
|
|
342
|
+
pos: import("./pos").PosState;
|
|
343
|
+
punches: import("./punches").PunchesState;
|
|
344
|
+
refund: import("./refund").RefundState;
|
|
345
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
346
|
+
settings: import("./settings").SettingsState;
|
|
347
|
+
sidebar: import("./sidebar").SidebarState;
|
|
348
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
349
|
+
taxes: import("./taxes").TaxesState;
|
|
350
|
+
idle: import("./idle").IdleState;
|
|
351
|
+
tags: import("./tags").TagsState;
|
|
352
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
353
|
+
clearCache: () => void;
|
|
354
|
+
resultsCount: () => number;
|
|
355
|
+
resetResultsCount: () => void;
|
|
356
|
+
} & {
|
|
357
|
+
resultFunc: (resultFuncArgs_0: import("@open-tender/types").OrderType | null, resultFuncArgs_1: import("@open-tender/types").LoyaltyProgram | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
358
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@open-tender/types").OrderType | null, resultFuncArgs_1: import("@open-tender/types").LoyaltyProgram | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
359
|
+
clearCache: () => void;
|
|
360
|
+
resultsCount: () => number;
|
|
361
|
+
resetResultsCount: () => void;
|
|
319
362
|
};
|
|
320
363
|
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
321
|
-
dependencies: [(state: AppState) => OrderType | null, (state:
|
|
364
|
+
dependencies: [(state: AppState) => import("@open-tender/types").OrderType | null, ((state: {
|
|
322
365
|
alerts: import("@open-tender/types").Alerts;
|
|
323
366
|
allergens: import("./allergens").AllergensState;
|
|
324
367
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -348,6 +391,26 @@ export declare const selectPointsProgram: ((state: {
|
|
|
348
391
|
taxes: import("./taxes").TaxesState;
|
|
349
392
|
idle: import("./idle").IdleState;
|
|
350
393
|
tags: import("./tags").TagsState;
|
|
394
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
395
|
+
clearCache: () => void;
|
|
396
|
+
resultsCount: () => number;
|
|
397
|
+
resetResultsCount: () => void;
|
|
398
|
+
} & {
|
|
399
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
400
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
401
|
+
clearCache: () => void;
|
|
402
|
+
resultsCount: () => number;
|
|
403
|
+
resetResultsCount: () => void;
|
|
404
|
+
};
|
|
405
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
406
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
407
|
+
recomputations: () => number;
|
|
408
|
+
resetRecomputations: () => void;
|
|
409
|
+
dependencyRecomputations: () => number;
|
|
410
|
+
resetDependencyRecomputations: () => void;
|
|
411
|
+
} & {
|
|
412
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
413
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
351
414
|
}];
|
|
352
415
|
recomputations: () => number;
|
|
353
416
|
resetRecomputations: () => void;
|
|
@@ -117,32 +117,23 @@ exports.selectCustomerLoyaltyProgram = (0, toolkit_1.createSelector)(function (s
|
|
|
117
117
|
var program = programs.length ? programs[0] : null;
|
|
118
118
|
return { program: program, loading: loading, error: error };
|
|
119
119
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return null;
|
|
128
|
-
var programs = loyaltyPrograms.filter(function (i) {
|
|
129
|
-
var _a;
|
|
130
|
-
return ((_a = i.perk) === null || _a === void 0 ? void 0 : _a.loyalty_perk) === 'BANKABLE_POINTS' &&
|
|
131
|
-
(i.earn_order_type === null || i.earn_order_type === orderType);
|
|
132
|
-
});
|
|
133
|
-
return programs.length ? programs[0] : null;
|
|
120
|
+
exports.selectCustomerPointsProgram = (0, toolkit_1.createSelector)(function (state) { return state.customer.loyalty; }, function (state) { return state.order.orderType; }, function (loyaltyPrograms, orderType) {
|
|
121
|
+
if (!loyaltyPrograms)
|
|
122
|
+
return null;
|
|
123
|
+
var programs = loyaltyPrograms.filter(function (i) {
|
|
124
|
+
var _a;
|
|
125
|
+
return ((_a = i.perk) === null || _a === void 0 ? void 0 : _a.loyalty_perk) === 'BANKABLE_POINTS' &&
|
|
126
|
+
(i.earn_order_type === null || i.earn_order_type === orderType);
|
|
134
127
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var program = (0, exports.selectCustomerPointsProgram)(orderType)(state);
|
|
128
|
+
return programs.length ? programs[0] : null;
|
|
129
|
+
});
|
|
130
|
+
exports.selectCustomerPoints = (0, toolkit_1.createSelector)(exports.selectCustomerPointsProgram, function (program) {
|
|
139
131
|
if (!program || !program.perk)
|
|
140
132
|
return null;
|
|
141
133
|
var spend_name = program.spend_name, perk = program.perk;
|
|
142
134
|
return { name: spend_name, points: perk.credit };
|
|
143
|
-
};
|
|
144
|
-
exports.
|
|
145
|
-
|
|
146
|
-
return orderType ? (0, exports.selectCustomerPointsProgram)(orderType)(state) : null;
|
|
135
|
+
});
|
|
136
|
+
exports.selectPointsProgram = (0, toolkit_1.createSelector)(function (state) { return state.order.orderType; }, exports.selectCustomerPointsProgram, function (orderType, program) {
|
|
137
|
+
return orderType ? program : null;
|
|
147
138
|
});
|
|
148
139
|
exports.customerReducer = CustomerSlice.reducer;
|
|
@@ -2,7 +2,7 @@ import { useCallback } from 'react';
|
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
3
|
import { selectKioskConfig, selectSelectedAllergens, selectSelectedTags, selectShowTagsModal, toggleTagsModal } from '../slices';
|
|
4
4
|
var TagsButton = function (_a) {
|
|
5
|
-
var _b, _c;
|
|
5
|
+
var _b, _c, _d;
|
|
6
6
|
var children = _a.children;
|
|
7
7
|
var config = useAppSelector(selectKioskConfig).tagsButton;
|
|
8
8
|
var isTagsModalShown = useAppSelector(selectShowTagsModal);
|
|
@@ -16,9 +16,9 @@ var TagsButton = function (_a) {
|
|
|
16
16
|
return children({
|
|
17
17
|
config: config,
|
|
18
18
|
handlers: handlers,
|
|
19
|
-
isSelected: selectedTags.length > 0 ||
|
|
20
|
-
selectedTags: (
|
|
21
|
-
selectedAllergens: (
|
|
19
|
+
isSelected: selectedTags.length > 0 || ((_b = selectedAllergens === null || selectedAllergens === void 0 ? void 0 : selectedAllergens.length) !== null && _b !== void 0 ? _b : 0) > 0,
|
|
20
|
+
selectedTags: (_c = selectedTags.length) !== null && _c !== void 0 ? _c : 0,
|
|
21
|
+
selectedAllergens: (_d = selectedAllergens === null || selectedAllergens === void 0 ? void 0 : selectedAllergens.length) !== null && _d !== void 0 ? _d : 0
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
export default TagsButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders,
|
|
1
|
+
import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface CustomerState {
|
|
4
4
|
account: Customer | null;
|
|
@@ -155,7 +155,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
|
|
|
155
155
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
156
156
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
157
157
|
};
|
|
158
|
-
export declare const selectCustomerPointsProgram: (
|
|
158
|
+
export declare const selectCustomerPointsProgram: ((state: {
|
|
159
159
|
alerts: import("@open-tender/types").Alerts;
|
|
160
160
|
allergens: import("./allergens").AllergensState;
|
|
161
161
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -190,20 +190,14 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
190
190
|
resultsCount: () => number;
|
|
191
191
|
resetResultsCount: () => void;
|
|
192
192
|
} & {
|
|
193
|
-
resultFunc: (resultFuncArgs_0:
|
|
194
|
-
|
|
195
|
-
}) => import("@open-tender/types").LoyaltyProgram | null;
|
|
196
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
197
|
-
loyaltyPrograms: LoyaltyPrograms;
|
|
198
|
-
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
193
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
194
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
199
195
|
clearCache: () => void;
|
|
200
196
|
resultsCount: () => number;
|
|
201
197
|
resetResultsCount: () => void;
|
|
202
198
|
};
|
|
203
199
|
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
204
|
-
dependencies: [(state: AppState) =>
|
|
205
|
-
loyaltyPrograms: LoyaltyPrograms;
|
|
206
|
-
}];
|
|
200
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
207
201
|
recomputations: () => number;
|
|
208
202
|
resetRecomputations: () => void;
|
|
209
203
|
dependencyRecomputations: () => number;
|
|
@@ -212,11 +206,7 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
212
206
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
213
207
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
214
208
|
};
|
|
215
|
-
export declare const selectCustomerPoints: (
|
|
216
|
-
name: string;
|
|
217
|
-
points: `${number}.${number}` | null;
|
|
218
|
-
} | null;
|
|
219
|
-
export declare const selectPointsProgram: ((state: {
|
|
209
|
+
export declare const selectCustomerPoints: ((state: {
|
|
220
210
|
alerts: import("@open-tender/types").Alerts;
|
|
221
211
|
allergens: import("./allergens").AllergensState;
|
|
222
212
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -246,43 +236,31 @@ export declare const selectPointsProgram: ((state: {
|
|
|
246
236
|
taxes: import("./taxes").TaxesState;
|
|
247
237
|
idle: import("./idle").IdleState;
|
|
248
238
|
tags: import("./tags").TagsState;
|
|
249
|
-
}) =>
|
|
239
|
+
}) => {
|
|
240
|
+
name: string;
|
|
241
|
+
points: `${number}.${number}` | null;
|
|
242
|
+
} | null) & {
|
|
250
243
|
clearCache: () => void;
|
|
251
244
|
resultsCount: () => number;
|
|
252
245
|
resetResultsCount: () => void;
|
|
253
246
|
} & {
|
|
254
|
-
resultFunc: (resultFuncArgs_0:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
notifications: import("@open-tender/types").Notifications;
|
|
272
|
-
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
273
|
-
order: import("./order").OrderState;
|
|
274
|
-
pos: import("./pos").PosState;
|
|
275
|
-
punches: import("./punches").PunchesState;
|
|
276
|
-
refund: import("./refund").RefundState;
|
|
277
|
-
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
278
|
-
settings: import("./settings").SettingsState;
|
|
279
|
-
sidebar: import("./sidebar").SidebarState;
|
|
280
|
-
surcharges: import("./surcharges").SurchargesState;
|
|
281
|
-
taxes: import("./taxes").TaxesState;
|
|
282
|
-
idle: import("./idle").IdleState;
|
|
283
|
-
tags: import("./tags").TagsState;
|
|
284
|
-
}) => import("@open-tender/types").LoyaltyProgram | null;
|
|
285
|
-
memoizedResultFunc: ((resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
|
|
247
|
+
resultFunc: (resultFuncArgs_0: import("@open-tender/types").LoyaltyProgram | null) => {
|
|
248
|
+
name: string;
|
|
249
|
+
points: `${number}.${number}` | null;
|
|
250
|
+
} | null;
|
|
251
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@open-tender/types").LoyaltyProgram | null) => {
|
|
252
|
+
name: string;
|
|
253
|
+
points: `${number}.${number}` | null;
|
|
254
|
+
} | null) & {
|
|
255
|
+
clearCache: () => void;
|
|
256
|
+
resultsCount: () => number;
|
|
257
|
+
resetResultsCount: () => void;
|
|
258
|
+
};
|
|
259
|
+
lastResult: () => {
|
|
260
|
+
name: string;
|
|
261
|
+
points: `${number}.${number}` | null;
|
|
262
|
+
} | null;
|
|
263
|
+
dependencies: [((state: {
|
|
286
264
|
alerts: import("@open-tender/types").Alerts;
|
|
287
265
|
allergens: import("./allergens").AllergensState;
|
|
288
266
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -316,9 +294,74 @@ export declare const selectPointsProgram: ((state: {
|
|
|
316
294
|
clearCache: () => void;
|
|
317
295
|
resultsCount: () => number;
|
|
318
296
|
resetResultsCount: () => void;
|
|
297
|
+
} & {
|
|
298
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
299
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
300
|
+
clearCache: () => void;
|
|
301
|
+
resultsCount: () => number;
|
|
302
|
+
resetResultsCount: () => void;
|
|
303
|
+
};
|
|
304
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
305
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
306
|
+
recomputations: () => number;
|
|
307
|
+
resetRecomputations: () => void;
|
|
308
|
+
dependencyRecomputations: () => number;
|
|
309
|
+
resetDependencyRecomputations: () => void;
|
|
310
|
+
} & {
|
|
311
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
312
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
313
|
+
}];
|
|
314
|
+
recomputations: () => number;
|
|
315
|
+
resetRecomputations: () => void;
|
|
316
|
+
dependencyRecomputations: () => number;
|
|
317
|
+
resetDependencyRecomputations: () => void;
|
|
318
|
+
} & {
|
|
319
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
320
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
321
|
+
};
|
|
322
|
+
export declare const selectPointsProgram: ((state: {
|
|
323
|
+
alerts: import("@open-tender/types").Alerts;
|
|
324
|
+
allergens: import("./allergens").AllergensState;
|
|
325
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
326
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
327
|
+
checkout: import("./checkout").CheckoutState;
|
|
328
|
+
config: import("./config").ConfigState;
|
|
329
|
+
customer: CustomerState;
|
|
330
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
331
|
+
deals: import("./deals").DealsState;
|
|
332
|
+
discounts: import("./discounts").DiscountsState;
|
|
333
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
334
|
+
kds: import("./kds").KdsState;
|
|
335
|
+
kiosk: import("./kiosk").KioskState;
|
|
336
|
+
menu: import("./menu").MenuState;
|
|
337
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
338
|
+
modal: import("./modal").ModalState;
|
|
339
|
+
notifications: import("@open-tender/types").Notifications;
|
|
340
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
341
|
+
order: import("./order").OrderState;
|
|
342
|
+
pos: import("./pos").PosState;
|
|
343
|
+
punches: import("./punches").PunchesState;
|
|
344
|
+
refund: import("./refund").RefundState;
|
|
345
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
346
|
+
settings: import("./settings").SettingsState;
|
|
347
|
+
sidebar: import("./sidebar").SidebarState;
|
|
348
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
349
|
+
taxes: import("./taxes").TaxesState;
|
|
350
|
+
idle: import("./idle").IdleState;
|
|
351
|
+
tags: import("./tags").TagsState;
|
|
352
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
353
|
+
clearCache: () => void;
|
|
354
|
+
resultsCount: () => number;
|
|
355
|
+
resetResultsCount: () => void;
|
|
356
|
+
} & {
|
|
357
|
+
resultFunc: (resultFuncArgs_0: import("@open-tender/types").OrderType | null, resultFuncArgs_1: import("@open-tender/types").LoyaltyProgram | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
358
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@open-tender/types").OrderType | null, resultFuncArgs_1: import("@open-tender/types").LoyaltyProgram | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
359
|
+
clearCache: () => void;
|
|
360
|
+
resultsCount: () => number;
|
|
361
|
+
resetResultsCount: () => void;
|
|
319
362
|
};
|
|
320
363
|
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
321
|
-
dependencies: [(state: AppState) => OrderType | null, (state:
|
|
364
|
+
dependencies: [(state: AppState) => import("@open-tender/types").OrderType | null, ((state: {
|
|
322
365
|
alerts: import("@open-tender/types").Alerts;
|
|
323
366
|
allergens: import("./allergens").AllergensState;
|
|
324
367
|
arrivals: import("./arrivals").ArrivalsState;
|
|
@@ -348,6 +391,26 @@ export declare const selectPointsProgram: ((state: {
|
|
|
348
391
|
taxes: import("./taxes").TaxesState;
|
|
349
392
|
idle: import("./idle").IdleState;
|
|
350
393
|
tags: import("./tags").TagsState;
|
|
394
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
395
|
+
clearCache: () => void;
|
|
396
|
+
resultsCount: () => number;
|
|
397
|
+
resetResultsCount: () => void;
|
|
398
|
+
} & {
|
|
399
|
+
resultFunc: (resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null;
|
|
400
|
+
memoizedResultFunc: ((resultFuncArgs_0: LoyaltyPrograms, resultFuncArgs_1: import("@open-tender/types").OrderType | null) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
401
|
+
clearCache: () => void;
|
|
402
|
+
resultsCount: () => number;
|
|
403
|
+
resetResultsCount: () => void;
|
|
404
|
+
};
|
|
405
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
406
|
+
dependencies: [(state: AppState) => LoyaltyPrograms, (state: AppState) => import("@open-tender/types").OrderType | null];
|
|
407
|
+
recomputations: () => number;
|
|
408
|
+
resetRecomputations: () => void;
|
|
409
|
+
dependencyRecomputations: () => number;
|
|
410
|
+
resetDependencyRecomputations: () => void;
|
|
411
|
+
} & {
|
|
412
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
413
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
351
414
|
}];
|
|
352
415
|
recomputations: () => number;
|
|
353
416
|
resetRecomputations: () => void;
|
|
@@ -106,30 +106,23 @@ export var selectCustomerLoyaltyProgram = createSelector(function (state) { retu
|
|
|
106
106
|
var program = programs.length ? programs[0] : null;
|
|
107
107
|
return { program: program, loading: loading, error: error };
|
|
108
108
|
});
|
|
109
|
-
export var selectCustomerPointsProgram = function (orderType) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return null;
|
|
117
|
-
var programs = loyaltyPrograms.filter(function (i) {
|
|
118
|
-
var _a;
|
|
119
|
-
return ((_a = i.perk) === null || _a === void 0 ? void 0 : _a.loyalty_perk) === 'BANKABLE_POINTS' &&
|
|
120
|
-
(i.earn_order_type === null || i.earn_order_type === orderType);
|
|
121
|
-
});
|
|
122
|
-
return programs.length ? programs[0] : null;
|
|
109
|
+
export var selectCustomerPointsProgram = createSelector(function (state) { return state.customer.loyalty; }, function (state) { return state.order.orderType; }, function (loyaltyPrograms, orderType) {
|
|
110
|
+
if (!loyaltyPrograms)
|
|
111
|
+
return null;
|
|
112
|
+
var programs = loyaltyPrograms.filter(function (i) {
|
|
113
|
+
var _a;
|
|
114
|
+
return ((_a = i.perk) === null || _a === void 0 ? void 0 : _a.loyalty_perk) === 'BANKABLE_POINTS' &&
|
|
115
|
+
(i.earn_order_type === null || i.earn_order_type === orderType);
|
|
123
116
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
return programs.length ? programs[0] : null;
|
|
118
|
+
});
|
|
119
|
+
export var selectCustomerPoints = createSelector(selectCustomerPointsProgram, function (program) {
|
|
127
120
|
if (!program || !program.perk)
|
|
128
121
|
return null;
|
|
129
122
|
var spend_name = program.spend_name, perk = program.perk;
|
|
130
123
|
return { name: spend_name, points: perk.credit };
|
|
131
|
-
};
|
|
132
|
-
export var selectPointsProgram = createSelector(function (state) { return state.order.orderType; },
|
|
133
|
-
return orderType ?
|
|
124
|
+
});
|
|
125
|
+
export var selectPointsProgram = createSelector(function (state) { return state.order.orderType; }, selectCustomerPointsProgram, function (orderType, program) {
|
|
126
|
+
return orderType ? program : null;
|
|
134
127
|
});
|
|
135
128
|
export var customerReducer = CustomerSlice.reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.244",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|