@open-tender/store 1.0.33 → 1.0.34

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.
@@ -2,11 +2,12 @@ import { AppState } from '../app';
2
2
  import { Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, Orders, RequestError, RequestStatus } from '@open-tender/types';
3
3
  export interface CustomerState {
4
4
  account: Customer | null;
5
- giftCards: GiftCards;
5
+ deals: Discounts;
6
6
  favorites: Favorites;
7
+ giftCards: GiftCards;
7
8
  loyalty: LoyaltyPrograms;
8
- rewards: Discounts;
9
9
  orders: Orders;
10
+ rewards: Discounts;
10
11
  loading: RequestStatus;
11
12
  error: RequestError;
12
13
  }
@@ -29,9 +30,10 @@ export declare const fetchCustomer: import("@reduxjs/toolkit").AsyncThunk<Custom
29
30
  export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"customer/resetCustomer">;
30
31
  export declare const selectCustomer: (state: AppState) => CustomerState;
31
32
  export declare const selectCustomerAccount: (state: AppState) => Customer | null;
32
- export declare const selectCustomerGiftCards: (state: AppState) => GiftCards;
33
+ export declare const selectCustomerDeals: (state: AppState) => Discounts;
33
34
  export declare const selectCustomerFavorites: (state: AppState) => Favorites;
35
+ export declare const selectCustomerGiftCards: (state: AppState) => GiftCards;
34
36
  export declare const selectCustomerLoyalty: (state: AppState) => LoyaltyPrograms;
35
- export declare const selectCustomerRewards: (state: AppState) => Discounts;
36
37
  export declare const selectCustomerOrders: (state: AppState) => Orders;
38
+ export declare const selectCustomerRewards: (state: AppState) => Discounts;
37
39
  export declare const customerReducer: import("redux").Reducer<CustomerState>;
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customerReducer = exports.selectCustomerOrders = exports.selectCustomerRewards = exports.selectCustomerLoyalty = exports.selectCustomerFavorites = exports.selectCustomerGiftCards = exports.selectCustomerAccount = exports.selectCustomer = exports.resetCustomer = exports.fetchCustomer = exports.CustomerActionType = void 0;
3
+ exports.customerReducer = exports.selectCustomerRewards = exports.selectCustomerOrders = exports.selectCustomerLoyalty = exports.selectCustomerGiftCards = exports.selectCustomerFavorites = exports.selectCustomerDeals = exports.selectCustomerAccount = exports.selectCustomer = exports.resetCustomer = exports.fetchCustomer = exports.CustomerActionType = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var toolkit_1 = require("@reduxjs/toolkit");
6
6
  var types_1 = require("./types");
7
7
  var initialState = {
8
8
  account: null,
9
- giftCards: [],
9
+ deals: [],
10
10
  favorites: [],
11
+ giftCards: [],
11
12
  loyalty: [],
12
- rewards: [],
13
13
  orders: [],
14
+ rewards: [],
14
15
  loading: 'idle',
15
16
  error: null
16
17
  };
@@ -47,13 +48,14 @@ var CustomerSlice = (0, toolkit_1.createSlice)({
47
48
  extraReducers: function (builder) {
48
49
  builder
49
50
  .addCase(exports.fetchCustomer.fulfilled, function (state, action) {
50
- var _a = action.payload, _b = _a.ACCOUNT, ACCOUNT = _b === void 0 ? null : _b, _c = _a.GIFT_CARDS, GIFT_CARDS = _c === void 0 ? [] : _c, _d = _a.FAVORITES, FAVORITES = _d === void 0 ? [] : _d, _e = _a.LOYALTY, LOYALTY = _e === void 0 ? [] : _e, _f = _a.REWARDS, REWARDS = _f === void 0 ? [] : _f, _g = _a.ORDERS, ORDERS = _g === void 0 ? [] : _g;
51
+ var _a = action.payload, _b = _a.ACCOUNT, ACCOUNT = _b === void 0 ? null : _b, _c = _a.DEALS, DEALS = _c === void 0 ? [] : _c, _d = _a.FAVORITES, FAVORITES = _d === void 0 ? [] : _d, _e = _a.GIFT_CARDS, GIFT_CARDS = _e === void 0 ? [] : _e, _f = _a.LOYALTY, LOYALTY = _f === void 0 ? [] : _f, _g = _a.ORDERS, ORDERS = _g === void 0 ? [] : _g, _h = _a.REWARDS, REWARDS = _h === void 0 ? [] : _h;
51
52
  state.account = ACCOUNT;
52
- state.giftCards = GIFT_CARDS;
53
+ state.deals = DEALS;
53
54
  state.favorites = FAVORITES;
55
+ state.giftCards = GIFT_CARDS;
54
56
  state.loyalty = LOYALTY;
55
- state.rewards = REWARDS;
56
57
  state.orders = ORDERS;
58
+ state.rewards = REWARDS;
57
59
  state.loading = 'idle';
58
60
  state.error = null;
59
61
  })
@@ -71,18 +73,20 @@ var selectCustomer = function (state) { return state.customer; };
71
73
  exports.selectCustomer = selectCustomer;
72
74
  var selectCustomerAccount = function (state) { return state.customer.account; };
73
75
  exports.selectCustomerAccount = selectCustomerAccount;
74
- var selectCustomerGiftCards = function (state) {
75
- return state.customer.giftCards;
76
- };
77
- exports.selectCustomerGiftCards = selectCustomerGiftCards;
76
+ var selectCustomerDeals = function (state) { return state.customer.deals; };
77
+ exports.selectCustomerDeals = selectCustomerDeals;
78
78
  var selectCustomerFavorites = function (state) {
79
79
  return state.customer.favorites;
80
80
  };
81
81
  exports.selectCustomerFavorites = selectCustomerFavorites;
82
+ var selectCustomerGiftCards = function (state) {
83
+ return state.customer.giftCards;
84
+ };
85
+ exports.selectCustomerGiftCards = selectCustomerGiftCards;
82
86
  var selectCustomerLoyalty = function (state) { return state.customer.loyalty; };
83
87
  exports.selectCustomerLoyalty = selectCustomerLoyalty;
84
- var selectCustomerRewards = function (state) { return state.customer.rewards; };
85
- exports.selectCustomerRewards = selectCustomerRewards;
86
88
  var selectCustomerOrders = function (state) { return state.customer.orders; };
87
89
  exports.selectCustomerOrders = selectCustomerOrders;
90
+ var selectCustomerRewards = function (state) { return state.customer.rewards; };
91
+ exports.selectCustomerRewards = selectCustomerRewards;
88
92
  exports.customerReducer = CustomerSlice.reducer;
@@ -2,11 +2,12 @@ import { AppState } from '../app';
2
2
  import { Customer, CustomerEndpoints, CustomerEntities, Discounts, Favorites, GiftCards, LoyaltyPrograms, Orders, RequestError, RequestStatus } from '@open-tender/types';
3
3
  export interface CustomerState {
4
4
  account: Customer | null;
5
- giftCards: GiftCards;
5
+ deals: Discounts;
6
6
  favorites: Favorites;
7
+ giftCards: GiftCards;
7
8
  loyalty: LoyaltyPrograms;
8
- rewards: Discounts;
9
9
  orders: Orders;
10
+ rewards: Discounts;
10
11
  loading: RequestStatus;
11
12
  error: RequestError;
12
13
  }
@@ -29,9 +30,10 @@ export declare const fetchCustomer: import("@reduxjs/toolkit").AsyncThunk<Custom
29
30
  export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"customer/resetCustomer">;
30
31
  export declare const selectCustomer: (state: AppState) => CustomerState;
31
32
  export declare const selectCustomerAccount: (state: AppState) => Customer | null;
32
- export declare const selectCustomerGiftCards: (state: AppState) => GiftCards;
33
+ export declare const selectCustomerDeals: (state: AppState) => Discounts;
33
34
  export declare const selectCustomerFavorites: (state: AppState) => Favorites;
35
+ export declare const selectCustomerGiftCards: (state: AppState) => GiftCards;
34
36
  export declare const selectCustomerLoyalty: (state: AppState) => LoyaltyPrograms;
35
- export declare const selectCustomerRewards: (state: AppState) => Discounts;
36
37
  export declare const selectCustomerOrders: (state: AppState) => Orders;
38
+ export declare const selectCustomerRewards: (state: AppState) => Discounts;
37
39
  export declare const customerReducer: import("redux").Reducer<CustomerState>;
@@ -3,11 +3,12 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
3
3
  import { ReducerType } from './types';
4
4
  var initialState = {
5
5
  account: null,
6
- giftCards: [],
6
+ deals: [],
7
7
  favorites: [],
8
+ giftCards: [],
8
9
  loyalty: [],
9
- rewards: [],
10
10
  orders: [],
11
+ rewards: [],
11
12
  loading: 'idle',
12
13
  error: null
13
14
  };
@@ -44,13 +45,14 @@ var CustomerSlice = createSlice({
44
45
  extraReducers: function (builder) {
45
46
  builder
46
47
  .addCase(fetchCustomer.fulfilled, function (state, action) {
47
- var _a = action.payload, _b = _a.ACCOUNT, ACCOUNT = _b === void 0 ? null : _b, _c = _a.GIFT_CARDS, GIFT_CARDS = _c === void 0 ? [] : _c, _d = _a.FAVORITES, FAVORITES = _d === void 0 ? [] : _d, _e = _a.LOYALTY, LOYALTY = _e === void 0 ? [] : _e, _f = _a.REWARDS, REWARDS = _f === void 0 ? [] : _f, _g = _a.ORDERS, ORDERS = _g === void 0 ? [] : _g;
48
+ var _a = action.payload, _b = _a.ACCOUNT, ACCOUNT = _b === void 0 ? null : _b, _c = _a.DEALS, DEALS = _c === void 0 ? [] : _c, _d = _a.FAVORITES, FAVORITES = _d === void 0 ? [] : _d, _e = _a.GIFT_CARDS, GIFT_CARDS = _e === void 0 ? [] : _e, _f = _a.LOYALTY, LOYALTY = _f === void 0 ? [] : _f, _g = _a.ORDERS, ORDERS = _g === void 0 ? [] : _g, _h = _a.REWARDS, REWARDS = _h === void 0 ? [] : _h;
48
49
  state.account = ACCOUNT;
49
- state.giftCards = GIFT_CARDS;
50
+ state.deals = DEALS;
50
51
  state.favorites = FAVORITES;
52
+ state.giftCards = GIFT_CARDS;
51
53
  state.loyalty = LOYALTY;
52
- state.rewards = REWARDS;
53
54
  state.orders = ORDERS;
55
+ state.rewards = REWARDS;
54
56
  state.loading = 'idle';
55
57
  state.error = null;
56
58
  })
@@ -66,13 +68,14 @@ var CustomerSlice = createSlice({
66
68
  export var resetCustomer = CustomerSlice.actions.resetCustomer;
67
69
  export var selectCustomer = function (state) { return state.customer; };
68
70
  export var selectCustomerAccount = function (state) { return state.customer.account; };
69
- export var selectCustomerGiftCards = function (state) {
70
- return state.customer.giftCards;
71
- };
71
+ export var selectCustomerDeals = function (state) { return state.customer.deals; };
72
72
  export var selectCustomerFavorites = function (state) {
73
73
  return state.customer.favorites;
74
74
  };
75
+ export var selectCustomerGiftCards = function (state) {
76
+ return state.customer.giftCards;
77
+ };
75
78
  export var selectCustomerLoyalty = function (state) { return state.customer.loyalty; };
76
- export var selectCustomerRewards = function (state) { return state.customer.rewards; };
77
79
  export var selectCustomerOrders = function (state) { return state.customer.orders; };
80
+ export var selectCustomerRewards = function (state) { return state.customer.rewards; };
78
81
  export var customerReducer = CustomerSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
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",
@@ -58,9 +58,9 @@
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@emotion/react": "^11.11.1",
61
- "@open-tender/types": "^0.4.34",
61
+ "@open-tender/types": "^0.4.35",
62
62
  "@open-tender/ui": "^0.1.22",
63
- "@open-tender/utils": "^0.4.14",
63
+ "@open-tender/utils": "^0.4.15",
64
64
  "@reduxjs/toolkit": "^2.0.1",
65
65
  "date-fns": "2.30.0",
66
66
  "date-fns-tz": "^2.0.0",