@open-tender/store 1.1.240 → 1.1.242
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.d.ts +217 -14
- package/dist/cjs/slices/customer.js +14 -25
- package/dist/esm/slices/customer.d.ts +217 -14
- package/dist/esm/slices/customer.js +14 -22
- package/package.json +1 -1
|
@@ -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,9 +206,218 @@ 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: (
|
|
209
|
+
export declare const selectCustomerPoints: ((state: {
|
|
210
|
+
alerts: import("@open-tender/types").Alerts;
|
|
211
|
+
allergens: import("./allergens").AllergensState;
|
|
212
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
213
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
214
|
+
checkout: import("./checkout").CheckoutState;
|
|
215
|
+
config: import("./config").ConfigState;
|
|
216
|
+
customer: CustomerState;
|
|
217
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
218
|
+
deals: import("./deals").DealsState;
|
|
219
|
+
discounts: import("./discounts").DiscountsState;
|
|
220
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
221
|
+
kds: import("./kds").KdsState;
|
|
222
|
+
kiosk: import("./kiosk").KioskState;
|
|
223
|
+
menu: import("./menu").MenuState;
|
|
224
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
225
|
+
modal: import("./modal").ModalState;
|
|
226
|
+
notifications: import("@open-tender/types").Notifications;
|
|
227
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
228
|
+
order: import("./order").OrderState;
|
|
229
|
+
pos: import("./pos").PosState;
|
|
230
|
+
punches: import("./punches").PunchesState;
|
|
231
|
+
refund: import("./refund").RefundState;
|
|
232
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
233
|
+
settings: import("./settings").SettingsState;
|
|
234
|
+
sidebar: import("./sidebar").SidebarState;
|
|
235
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
236
|
+
taxes: import("./taxes").TaxesState;
|
|
237
|
+
idle: import("./idle").IdleState;
|
|
238
|
+
tags: import("./tags").TagsState;
|
|
239
|
+
}) => {
|
|
216
240
|
name: string;
|
|
217
241
|
points: `${number}.${number}` | null;
|
|
218
|
-
} | null
|
|
219
|
-
|
|
242
|
+
} | null) & {
|
|
243
|
+
clearCache: () => void;
|
|
244
|
+
resultsCount: () => number;
|
|
245
|
+
resetResultsCount: () => void;
|
|
246
|
+
} & {
|
|
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: {
|
|
264
|
+
alerts: import("@open-tender/types").Alerts;
|
|
265
|
+
allergens: import("./allergens").AllergensState;
|
|
266
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
267
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
268
|
+
checkout: import("./checkout").CheckoutState;
|
|
269
|
+
config: import("./config").ConfigState;
|
|
270
|
+
customer: CustomerState;
|
|
271
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
272
|
+
deals: import("./deals").DealsState;
|
|
273
|
+
discounts: import("./discounts").DiscountsState;
|
|
274
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
275
|
+
kds: import("./kds").KdsState;
|
|
276
|
+
kiosk: import("./kiosk").KioskState;
|
|
277
|
+
menu: import("./menu").MenuState;
|
|
278
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
279
|
+
modal: import("./modal").ModalState;
|
|
280
|
+
notifications: import("@open-tender/types").Notifications;
|
|
281
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
282
|
+
order: import("./order").OrderState;
|
|
283
|
+
pos: import("./pos").PosState;
|
|
284
|
+
punches: import("./punches").PunchesState;
|
|
285
|
+
refund: import("./refund").RefundState;
|
|
286
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
287
|
+
settings: import("./settings").SettingsState;
|
|
288
|
+
sidebar: import("./sidebar").SidebarState;
|
|
289
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
290
|
+
taxes: import("./taxes").TaxesState;
|
|
291
|
+
idle: import("./idle").IdleState;
|
|
292
|
+
tags: import("./tags").TagsState;
|
|
293
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
294
|
+
clearCache: () => void;
|
|
295
|
+
resultsCount: () => number;
|
|
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;
|
|
362
|
+
};
|
|
363
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
364
|
+
dependencies: [(state: AppState) => import("@open-tender/types").OrderType | null, ((state: {
|
|
365
|
+
alerts: import("@open-tender/types").Alerts;
|
|
366
|
+
allergens: import("./allergens").AllergensState;
|
|
367
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
368
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
369
|
+
checkout: import("./checkout").CheckoutState;
|
|
370
|
+
config: import("./config").ConfigState;
|
|
371
|
+
customer: CustomerState;
|
|
372
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
373
|
+
deals: import("./deals").DealsState;
|
|
374
|
+
discounts: import("./discounts").DiscountsState;
|
|
375
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
376
|
+
kds: import("./kds").KdsState;
|
|
377
|
+
kiosk: import("./kiosk").KioskState;
|
|
378
|
+
menu: import("./menu").MenuState;
|
|
379
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
380
|
+
modal: import("./modal").ModalState;
|
|
381
|
+
notifications: import("@open-tender/types").Notifications;
|
|
382
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
383
|
+
order: import("./order").OrderState;
|
|
384
|
+
pos: import("./pos").PosState;
|
|
385
|
+
punches: import("./punches").PunchesState;
|
|
386
|
+
refund: import("./refund").RefundState;
|
|
387
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
388
|
+
settings: import("./settings").SettingsState;
|
|
389
|
+
sidebar: import("./sidebar").SidebarState;
|
|
390
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
391
|
+
taxes: import("./taxes").TaxesState;
|
|
392
|
+
idle: import("./idle").IdleState;
|
|
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;
|
|
414
|
+
}];
|
|
415
|
+
recomputations: () => number;
|
|
416
|
+
resetRecomputations: () => void;
|
|
417
|
+
dependencyRecomputations: () => number;
|
|
418
|
+
resetDependencyRecomputations: () => void;
|
|
419
|
+
} & {
|
|
420
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
421
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
422
|
+
};
|
|
220
423
|
export declare const customerReducer: import("redux").Reducer<CustomerState>;
|
|
@@ -117,34 +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
|
-
|
|
147
|
-
return orderType ? (0, exports.selectCustomerPointsProgram)(orderType)(state) : null;
|
|
148
|
-
};
|
|
149
|
-
exports.selectPointsProgram = selectPointsProgram;
|
|
135
|
+
});
|
|
136
|
+
exports.selectPointsProgram = (0, toolkit_1.createSelector)(function (state) { return state.order.orderType; }, exports.selectCustomerPointsProgram, function (orderType, program) {
|
|
137
|
+
return orderType ? program : null;
|
|
138
|
+
});
|
|
150
139
|
exports.customerReducer = CustomerSlice.reducer;
|
|
@@ -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,9 +206,218 @@ 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: (
|
|
209
|
+
export declare const selectCustomerPoints: ((state: {
|
|
210
|
+
alerts: import("@open-tender/types").Alerts;
|
|
211
|
+
allergens: import("./allergens").AllergensState;
|
|
212
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
213
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
214
|
+
checkout: import("./checkout").CheckoutState;
|
|
215
|
+
config: import("./config").ConfigState;
|
|
216
|
+
customer: CustomerState;
|
|
217
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
218
|
+
deals: import("./deals").DealsState;
|
|
219
|
+
discounts: import("./discounts").DiscountsState;
|
|
220
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
221
|
+
kds: import("./kds").KdsState;
|
|
222
|
+
kiosk: import("./kiosk").KioskState;
|
|
223
|
+
menu: import("./menu").MenuState;
|
|
224
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
225
|
+
modal: import("./modal").ModalState;
|
|
226
|
+
notifications: import("@open-tender/types").Notifications;
|
|
227
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
228
|
+
order: import("./order").OrderState;
|
|
229
|
+
pos: import("./pos").PosState;
|
|
230
|
+
punches: import("./punches").PunchesState;
|
|
231
|
+
refund: import("./refund").RefundState;
|
|
232
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
233
|
+
settings: import("./settings").SettingsState;
|
|
234
|
+
sidebar: import("./sidebar").SidebarState;
|
|
235
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
236
|
+
taxes: import("./taxes").TaxesState;
|
|
237
|
+
idle: import("./idle").IdleState;
|
|
238
|
+
tags: import("./tags").TagsState;
|
|
239
|
+
}) => {
|
|
216
240
|
name: string;
|
|
217
241
|
points: `${number}.${number}` | null;
|
|
218
|
-
} | null
|
|
219
|
-
|
|
242
|
+
} | null) & {
|
|
243
|
+
clearCache: () => void;
|
|
244
|
+
resultsCount: () => number;
|
|
245
|
+
resetResultsCount: () => void;
|
|
246
|
+
} & {
|
|
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: {
|
|
264
|
+
alerts: import("@open-tender/types").Alerts;
|
|
265
|
+
allergens: import("./allergens").AllergensState;
|
|
266
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
267
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
268
|
+
checkout: import("./checkout").CheckoutState;
|
|
269
|
+
config: import("./config").ConfigState;
|
|
270
|
+
customer: CustomerState;
|
|
271
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
272
|
+
deals: import("./deals").DealsState;
|
|
273
|
+
discounts: import("./discounts").DiscountsState;
|
|
274
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
275
|
+
kds: import("./kds").KdsState;
|
|
276
|
+
kiosk: import("./kiosk").KioskState;
|
|
277
|
+
menu: import("./menu").MenuState;
|
|
278
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
279
|
+
modal: import("./modal").ModalState;
|
|
280
|
+
notifications: import("@open-tender/types").Notifications;
|
|
281
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
282
|
+
order: import("./order").OrderState;
|
|
283
|
+
pos: import("./pos").PosState;
|
|
284
|
+
punches: import("./punches").PunchesState;
|
|
285
|
+
refund: import("./refund").RefundState;
|
|
286
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
287
|
+
settings: import("./settings").SettingsState;
|
|
288
|
+
sidebar: import("./sidebar").SidebarState;
|
|
289
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
290
|
+
taxes: import("./taxes").TaxesState;
|
|
291
|
+
idle: import("./idle").IdleState;
|
|
292
|
+
tags: import("./tags").TagsState;
|
|
293
|
+
}) => import("@open-tender/types").LoyaltyProgram | null) & {
|
|
294
|
+
clearCache: () => void;
|
|
295
|
+
resultsCount: () => number;
|
|
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;
|
|
362
|
+
};
|
|
363
|
+
lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
|
|
364
|
+
dependencies: [(state: AppState) => import("@open-tender/types").OrderType | null, ((state: {
|
|
365
|
+
alerts: import("@open-tender/types").Alerts;
|
|
366
|
+
allergens: import("./allergens").AllergensState;
|
|
367
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
368
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
369
|
+
checkout: import("./checkout").CheckoutState;
|
|
370
|
+
config: import("./config").ConfigState;
|
|
371
|
+
customer: CustomerState;
|
|
372
|
+
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
373
|
+
deals: import("./deals").DealsState;
|
|
374
|
+
discounts: import("./discounts").DiscountsState;
|
|
375
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
376
|
+
kds: import("./kds").KdsState;
|
|
377
|
+
kiosk: import("./kiosk").KioskState;
|
|
378
|
+
menu: import("./menu").MenuState;
|
|
379
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
380
|
+
modal: import("./modal").ModalState;
|
|
381
|
+
notifications: import("@open-tender/types").Notifications;
|
|
382
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
383
|
+
order: import("./order").OrderState;
|
|
384
|
+
pos: import("./pos").PosState;
|
|
385
|
+
punches: import("./punches").PunchesState;
|
|
386
|
+
refund: import("./refund").RefundState;
|
|
387
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
388
|
+
settings: import("./settings").SettingsState;
|
|
389
|
+
sidebar: import("./sidebar").SidebarState;
|
|
390
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
391
|
+
taxes: import("./taxes").TaxesState;
|
|
392
|
+
idle: import("./idle").IdleState;
|
|
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;
|
|
414
|
+
}];
|
|
415
|
+
recomputations: () => number;
|
|
416
|
+
resetRecomputations: () => void;
|
|
417
|
+
dependencyRecomputations: () => number;
|
|
418
|
+
resetDependencyRecomputations: () => void;
|
|
419
|
+
} & {
|
|
420
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
421
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
422
|
+
};
|
|
220
423
|
export declare const customerReducer: import("redux").Reducer<CustomerState>;
|
|
@@ -106,31 +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 = function (state) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
124
|
+
});
|
|
125
|
+
export var selectPointsProgram = createSelector(function (state) { return state.order.orderType; }, selectCustomerPointsProgram, function (orderType, program) {
|
|
126
|
+
return orderType ? program : null;
|
|
127
|
+
});
|
|
136
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.242",
|
|
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",
|