@open-tender/store 1.1.241 → 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.
@@ -1,4 +1,4 @@
1
- import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders, OrderType, RequestError, RequestStatus } from '@open-tender/types';
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: (orderType: OrderType | null) => ((state: {
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
- loyaltyPrograms: LoyaltyPrograms;
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: (orderType: OrderType | null) => (state: AppState) => {
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
- }) => import("@open-tender/types").LoyaltyProgram | null) & {
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: OrderType | null, resultFuncArgs_1: {
255
- alerts: import("@open-tender/types").Alerts;
256
- allergens: import("./allergens").AllergensState;
257
- arrivals: import("./arrivals").ArrivalsState;
258
- cartSummary: import("./cartSummary").CartSummaryState;
259
- checkout: import("./checkout").CheckoutState;
260
- config: import("./config").ConfigState;
261
- customer: CustomerState;
262
- customerIdentify: import("./customerIdentify").CustomerIdentifyState;
263
- deals: import("./deals").DealsState;
264
- discounts: import("./discounts").DiscountsState;
265
- errorAlerts: import("./errorAlerts").ErrorAlertsState;
266
- kds: import("./kds").KdsState;
267
- kiosk: import("./kiosk").KioskState;
268
- menu: import("./menu").MenuState;
269
- menuPages: import("./menuPages").MenuPagesState;
270
- modal: import("./modal").ModalState;
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: AppState) => {
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
- var selectCustomerPointsProgram = function (orderType) {
121
- return (0, toolkit_1.createSelector)(function (state) {
122
- var loyaltyPrograms = state.customer.loyalty;
123
- return { loyaltyPrograms: loyaltyPrograms };
124
- }, function (_a) {
125
- var loyaltyPrograms = _a.loyaltyPrograms;
126
- if (!loyaltyPrograms)
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
- exports.selectCustomerPointsProgram = selectCustomerPointsProgram;
137
- var selectCustomerPoints = function (orderType) { return function (state) {
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.selectCustomerPoints = selectCustomerPoints;
145
- exports.selectPointsProgram = (0, toolkit_1.createSelector)(function (state) { return state.order.orderType; }, function (state) { return state; }, function (orderType, state) {
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;
@@ -1,4 +1,4 @@
1
- import { Allergens, Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, LoyaltyProgramSummary, Orders, OrderType, RequestError, RequestStatus } from '@open-tender/types';
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: (orderType: OrderType | null) => ((state: {
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
- loyaltyPrograms: LoyaltyPrograms;
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: (orderType: OrderType | null) => (state: AppState) => {
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
- }) => import("@open-tender/types").LoyaltyProgram | null) & {
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: OrderType | null, resultFuncArgs_1: {
255
- alerts: import("@open-tender/types").Alerts;
256
- allergens: import("./allergens").AllergensState;
257
- arrivals: import("./arrivals").ArrivalsState;
258
- cartSummary: import("./cartSummary").CartSummaryState;
259
- checkout: import("./checkout").CheckoutState;
260
- config: import("./config").ConfigState;
261
- customer: CustomerState;
262
- customerIdentify: import("./customerIdentify").CustomerIdentifyState;
263
- deals: import("./deals").DealsState;
264
- discounts: import("./discounts").DiscountsState;
265
- errorAlerts: import("./errorAlerts").ErrorAlertsState;
266
- kds: import("./kds").KdsState;
267
- kiosk: import("./kiosk").KioskState;
268
- menu: import("./menu").MenuState;
269
- menuPages: import("./menuPages").MenuPagesState;
270
- modal: import("./modal").ModalState;
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: AppState) => {
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
- return createSelector(function (state) {
111
- var loyaltyPrograms = state.customer.loyalty;
112
- return { loyaltyPrograms: loyaltyPrograms };
113
- }, function (_a) {
114
- var loyaltyPrograms = _a.loyaltyPrograms;
115
- if (!loyaltyPrograms)
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
- export var selectCustomerPoints = function (orderType) { return function (state) {
126
- var program = selectCustomerPointsProgram(orderType)(state);
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; }, function (state) { return state; }, function (orderType, state) {
133
- return orderType ? selectCustomerPointsProgram(orderType)(state) : null;
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.241",
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",