@open-tender/cloud 0.1.67 → 0.1.69

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.
Files changed (43) hide show
  1. package/dist/cjs/app/hooks.d.ts +31 -30
  2. package/dist/cjs/app/store.d.ts +93 -90
  3. package/dist/cjs/app/store.js +23 -23
  4. package/dist/cjs/services/api.d.ts +2 -0
  5. package/dist/cjs/services/api.js +6 -0
  6. package/dist/cjs/slices/allergens.d.ts +31 -30
  7. package/dist/cjs/slices/config.d.ts +31 -30
  8. package/dist/cjs/slices/customer/index.d.ts +7 -6
  9. package/dist/cjs/slices/customer/index.js +8 -6
  10. package/dist/cjs/slices/customer/order.d.ts +31 -30
  11. package/dist/cjs/slices/customer/pointsShop.d.ts +34 -0
  12. package/dist/cjs/slices/customer/pointsShop.js +85 -0
  13. package/dist/cjs/slices/customer/thanx.js +1 -2
  14. package/dist/cjs/slices/deals.d.ts +4 -4
  15. package/dist/cjs/slices/deals.js +6 -6
  16. package/dist/cjs/slices/index.d.ts +1 -0
  17. package/dist/cjs/slices/index.js +1 -0
  18. package/dist/cjs/slices/order.d.ts +93 -90
  19. package/dist/cjs/slices/tags.d.ts +31 -30
  20. package/dist/cjs/slices/types.d.ts +1 -0
  21. package/dist/cjs/slices/types.js +1 -0
  22. package/dist/esm/app/hooks.d.ts +31 -30
  23. package/dist/esm/app/store.d.ts +93 -90
  24. package/dist/esm/app/store.js +23 -23
  25. package/dist/esm/services/api.d.ts +2 -0
  26. package/dist/esm/services/api.js +6 -0
  27. package/dist/esm/slices/allergens.d.ts +31 -30
  28. package/dist/esm/slices/config.d.ts +31 -30
  29. package/dist/esm/slices/customer/index.d.ts +7 -6
  30. package/dist/esm/slices/customer/index.js +8 -6
  31. package/dist/esm/slices/customer/order.d.ts +31 -30
  32. package/dist/esm/slices/customer/pointsShop.d.ts +34 -0
  33. package/dist/esm/slices/customer/pointsShop.js +81 -0
  34. package/dist/esm/slices/customer/thanx.js +1 -2
  35. package/dist/esm/slices/deals.d.ts +4 -4
  36. package/dist/esm/slices/deals.js +5 -5
  37. package/dist/esm/slices/index.d.ts +1 -0
  38. package/dist/esm/slices/index.js +1 -0
  39. package/dist/esm/slices/order.d.ts +93 -90
  40. package/dist/esm/slices/tags.d.ts +31 -30
  41. package/dist/esm/slices/types.d.ts +1 -0
  42. package/dist/esm/slices/types.js +1 -0
  43. package/package.json +4 -2
@@ -29,60 +29,61 @@ export declare const selectAllergens: (state: AppState) => AllergensState;
29
29
  export declare const selectSelectedAllergens: (state: AppState) => Allergens | null;
30
30
  export declare const selectSelectedAllergenNames: ((state: import("redux").EmptyObject & {
31
31
  alerts: import("@open-tender/types").Alerts;
32
- notifications: import("@open-tender/types").Notifications;
33
32
  allergens: AllergensState;
34
33
  announcements: import("./announcements").AnnouncementsState;
34
+ checkout: import("./checkout").CheckoutState;
35
+ completedOrders: import("./completedOrders").CompletedOrdersState;
36
+ config: import("./config").ConfigState;
37
+ confirmation: import("./confirmation").ConfirmationState;
35
38
  customer: import("redux").CombinedState<{
36
39
  account: import("./customer").AccountState;
37
- allergens: import("./customer").CustomerAllergensState;
38
- addresses: import("./customer").CustomerAddressesState;
39
40
  communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
40
41
  creditCards: import("./customer").CustomerCreditCardsState;
42
+ allergens: import("./customer").CustomerAllergensState;
43
+ addresses: import("./customer").CustomerAddressesState;
41
44
  favorites: import("./customer").CustomerFavoritesState;
42
45
  fcmToken: import("./customer").CustomerFcmTokenState;
43
46
  giftCards: import("./customer").CustomerGiftCardsState;
44
- orders: import("./customer").CustomerOrdersState;
45
- order: import("./customer").CustomerOrderState;
46
- loyalty: import("./customer").CustomerLoyaltyState;
47
47
  groupOrders: import("./customer").CustomerGroupOrdersState;
48
48
  houseAccounts: import("./customer").CustomerHouseAccountsState;
49
- rewards: import("./customer").CustomerRewardsState;
49
+ loyalty: import("./customer").CustomerLoyaltyState;
50
+ order: import("./customer").CustomerOrderState;
51
+ orders: import("./customer").CustomerOrdersState;
52
+ pointsShop: import(".").PointsShopState;
50
53
  qrcode: import("./customer").CustomerQRCodeState;
54
+ rewards: import("./customer").CustomerRewardsState;
51
55
  thanx: import("./customer").CustomerThanxState;
52
56
  tpls: import("./customer").CustomerTplsState;
53
57
  }>;
54
- signUp: import("./signUp").SignUpState;
55
- revenueCenters: import("./revenueCenters").RevenueCentersState;
56
- completedOrders: import("./completedOrders").CompletedOrdersState;
57
- checkout: import("./checkout").CheckoutState;
58
- order: import("./order").OrderState;
59
- orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
60
- orderRating: import("./orderRating").OrderRatingState;
61
- deals: import("./deals").DealState;
62
- confirmation: import("./confirmation").ConfirmationState;
58
+ deals: import("./deals").DealsState;
63
59
  donations: import("./donations").DonationState;
64
- guest: import("./guest").GuestState;
65
- verifyAccount: import("./verifyAccount").VerifyAccountState;
66
- menu: import("./menu").MenuState;
67
- resetPassword: import("./resetPassword").ResetPasswordState;
68
- validTimes: import("./validTimes").ValidTimesState;
69
- menuItems: import("./menuItems").MenuItemsState;
70
- menuDisplay: import("./menuDisplay").MenuDisplayState;
60
+ geolocation: import("./geolocation").GeoLocationState;
71
61
  giftCards: import("./giftCards").GiftCardsState;
72
62
  groupOrder: import("./groupOrder").GroupOrderState;
73
- config: import("./config").ConfigState;
74
- geolocation: import("./geolocation").GeoLocationState;
63
+ guest: import("./guest").GuestState;
75
64
  loader: import("./loader").LoaderState;
76
- qr: import("./qr").QrState;
77
- misc: import("./misc").MiscState;
65
+ menu: import("./menu").MenuState;
66
+ menuDisplay: import("./menuDisplay").MenuDisplayState;
67
+ menuItems: import("./menuItems").MenuItemsState;
78
68
  modal: import("@open-tender/types").Modal;
79
- navSite: import("./navSite").NavSiteState;
69
+ misc: import("./misc").MiscState;
80
70
  nav: import("./nav").NavState;
71
+ navSite: import("./navSite").NavSiteState;
72
+ notifications: import("@open-tender/types").Notifications;
73
+ oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
74
+ order: import("./order").OrderState;
75
+ orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
76
+ orderRating: import("./orderRating").OrderRatingState;
81
77
  posts: import("./posts").PostsSlice;
82
- sidebarModal: import("./sidebarModal").SidebarModalState;
78
+ qr: import("./qr").QrState;
79
+ resetPassword: import("./resetPassword").ResetPasswordState;
80
+ revenueCenters: import("./revenueCenters").RevenueCentersState;
83
81
  sidebar: import("./sidebar").SidebarState;
82
+ sidebarModal: import("./sidebarModal").SidebarModalState;
83
+ signUp: import("./signUp").SignUpState;
84
84
  tags: import("./tags").TagsState;
85
- oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
85
+ validTimes: import("./validTimes").ValidTimesState;
86
+ verifyAccount: import("./verifyAccount").VerifyAccountState;
86
87
  }) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
87
88
  allergens: Allergens;
88
89
  selectedAllergens: Allergens | null;
@@ -85,60 +85,61 @@ export declare const selectConfigRetries: (state: AppState) => number;
85
85
  export declare const selectLightColor: (state: AppState) => string;
86
86
  export declare const selectOptIns: ((state: import("redux").EmptyObject & {
87
87
  alerts: import("@open-tender/types").Alerts;
88
- notifications: import("@open-tender/types").Notifications;
89
88
  allergens: import("./allergens").AllergensState;
90
89
  announcements: import("./announcements").AnnouncementsState;
90
+ checkout: import("./checkout").CheckoutState;
91
+ completedOrders: import("./completedOrders").CompletedOrdersState;
92
+ config: ConfigState;
93
+ confirmation: import("./confirmation").ConfirmationState;
91
94
  customer: import("redux").CombinedState<{
92
95
  account: import("./customer").AccountState;
93
- allergens: import("./customer").CustomerAllergensState;
94
- addresses: import("./customer").CustomerAddressesState;
95
96
  communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
96
97
  creditCards: import("./customer").CustomerCreditCardsState;
98
+ allergens: import("./customer").CustomerAllergensState;
99
+ addresses: import("./customer").CustomerAddressesState;
97
100
  favorites: import("./customer").CustomerFavoritesState;
98
101
  fcmToken: import("./customer").CustomerFcmTokenState;
99
102
  giftCards: import("./customer").CustomerGiftCardsState;
100
- orders: import("./customer").CustomerOrdersState;
101
- order: import("./customer").CustomerOrderState;
102
- loyalty: import("./customer").CustomerLoyaltyState;
103
103
  groupOrders: import("./customer").CustomerGroupOrdersState;
104
104
  houseAccounts: import("./customer").CustomerHouseAccountsState;
105
- rewards: import("./customer").CustomerRewardsState;
105
+ loyalty: import("./customer").CustomerLoyaltyState;
106
+ order: import("./customer").CustomerOrderState;
107
+ orders: import("./customer").CustomerOrdersState;
108
+ pointsShop: import(".").PointsShopState;
106
109
  qrcode: import("./customer").CustomerQRCodeState;
110
+ rewards: import("./customer").CustomerRewardsState;
107
111
  thanx: import("./customer").CustomerThanxState;
108
112
  tpls: import("./customer").CustomerTplsState;
109
113
  }>;
110
- signUp: import("./signUp").SignUpState;
111
- revenueCenters: import("./revenueCenters").RevenueCentersState;
112
- completedOrders: import("./completedOrders").CompletedOrdersState;
113
- checkout: import("./checkout").CheckoutState;
114
- order: import("./order").OrderState;
115
- orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
116
- orderRating: import("./orderRating").OrderRatingState;
117
- deals: import("./deals").DealState;
118
- confirmation: import("./confirmation").ConfirmationState;
114
+ deals: import("./deals").DealsState;
119
115
  donations: import("./donations").DonationState;
120
- guest: import("./guest").GuestState;
121
- verifyAccount: import("./verifyAccount").VerifyAccountState;
122
- menu: import("./menu").MenuState;
123
- resetPassword: import("./resetPassword").ResetPasswordState;
124
- validTimes: import("./validTimes").ValidTimesState;
125
- menuItems: import("./menuItems").MenuItemsState;
126
- menuDisplay: import("./menuDisplay").MenuDisplayState;
116
+ geolocation: import("./geolocation").GeoLocationState;
127
117
  giftCards: import("./giftCards").GiftCardsState;
128
118
  groupOrder: import("./groupOrder").GroupOrderState;
129
- config: ConfigState;
130
- geolocation: import("./geolocation").GeoLocationState;
119
+ guest: import("./guest").GuestState;
131
120
  loader: import("./loader").LoaderState;
132
- qr: import("./qr").QrState;
133
- misc: import("./misc").MiscState;
121
+ menu: import("./menu").MenuState;
122
+ menuDisplay: import("./menuDisplay").MenuDisplayState;
123
+ menuItems: import("./menuItems").MenuItemsState;
134
124
  modal: import("@open-tender/types").Modal;
135
- navSite: import("./navSite").NavSiteState;
125
+ misc: import("./misc").MiscState;
136
126
  nav: import("./nav").NavState;
127
+ navSite: import("./navSite").NavSiteState;
128
+ notifications: import("@open-tender/types").Notifications;
129
+ oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
130
+ order: import("./order").OrderState;
131
+ orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
132
+ orderRating: import("./orderRating").OrderRatingState;
137
133
  posts: import("./posts").PostsSlice;
138
- sidebarModal: import("./sidebarModal").SidebarModalState;
134
+ qr: import("./qr").QrState;
135
+ resetPassword: import("./resetPassword").ResetPasswordState;
136
+ revenueCenters: import("./revenueCenters").RevenueCentersState;
139
137
  sidebar: import("./sidebar").SidebarState;
138
+ sidebarModal: import("./sidebarModal").SidebarModalState;
139
+ signUp: import("./signUp").SignUpState;
140
140
  tags: import("./tags").TagsState;
141
- oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
141
+ validTimes: import("./validTimes").ValidTimesState;
142
+ verifyAccount: import("./verifyAccount").VerifyAccountState;
142
143
  }) => {
143
144
  accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | null | undefined;
144
145
  order_notifications: import("@open-tender/types").ConfigOrderNotifications | null | undefined;
@@ -1,19 +1,20 @@
1
1
  export declare const customerReducer: import("redux").Reducer<import("redux").CombinedState<{
2
2
  account: import("./account").AccountState;
3
- allergens: import("./allergens").CustomerAllergensState;
4
- addresses: import("./addresses").CustomerAddressesState;
5
3
  communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
6
4
  creditCards: import("./creditCards").CustomerCreditCardsState;
5
+ allergens: import("./allergens").CustomerAllergensState;
6
+ addresses: import("./addresses").CustomerAddressesState;
7
7
  favorites: import("./favorites").CustomerFavoritesState;
8
8
  fcmToken: import("./fcmToken").CustomerFcmTokenState;
9
9
  giftCards: import("./giftCards").CustomerGiftCardsState;
10
- orders: import("./orders").CustomerOrdersState;
11
- order: import("./order").CustomerOrderState;
12
- loyalty: import("./loyalty").CustomerLoyaltyState;
13
10
  groupOrders: import("./groupOrders").CustomerGroupOrdersState;
14
11
  houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
15
- rewards: import("./rewards").CustomerRewardsState;
12
+ loyalty: import("./loyalty").CustomerLoyaltyState;
13
+ order: import("./order").CustomerOrderState;
14
+ orders: import("./orders").CustomerOrdersState;
15
+ pointsShop: import("./pointsShop").PointsShopState;
16
16
  qrcode: import("./qrCode").CustomerQRCodeState;
17
+ rewards: import("./rewards").CustomerRewardsState;
17
18
  thanx: import("./thanx").CustomerThanxState;
18
19
  tpls: import("./tpls").CustomerTplsState;
19
20
  }>, import("redux").AnyAction>;
@@ -13,26 +13,28 @@ import { customerHouseAccountsReducer } from './houseAccounts';
13
13
  import { customerLoyaltyReducer } from './loyalty';
14
14
  import { customerOrderReducer } from './order';
15
15
  import { customerOrdersReducer } from './orders';
16
+ import { pointsShopReducer } from './pointsShop';
16
17
  import { customerQRCodeReducer } from './qrCode';
17
18
  import { customerRewardsReducer } from './rewards';
18
19
  import { customerThanxReducer } from './thanx';
19
20
  import { customerTplsReducer } from './tpls';
20
21
  export const customerReducer = combineReducers({
21
22
  [ReducerType.Account]: accountReducer,
22
- [ReducerType.CustomerAllergens]: customerAllergensReducer,
23
- [ReducerType.CustomerAddresses]: customerAddressesReducer,
24
23
  [ReducerType.CommunicationPrefs]: customerCommunicationPrefsReducer,
25
24
  [ReducerType.CreditCards]: customerCreditCardsReducer,
25
+ [ReducerType.CustomerAllergens]: customerAllergensReducer,
26
+ [ReducerType.CustomerAddresses]: customerAddressesReducer,
26
27
  [ReducerType.Favorites]: customerFavoritesReducer,
27
28
  [ReducerType.FcmToken]: customerFcmTokenReducer,
28
29
  [ReducerType.GiftCards]: customerGiftCardsReducer,
29
- [ReducerType.Orders]: customerOrdersReducer,
30
- [ReducerType.Order]: customerOrderReducer,
31
- [ReducerType.Loyalty]: customerLoyaltyReducer,
32
30
  [ReducerType.GroupOrders]: customerGroupOrdersReducer,
33
31
  [ReducerType.HouseAccounts]: customerHouseAccountsReducer,
34
- [ReducerType.Rewards]: customerRewardsReducer,
32
+ [ReducerType.Loyalty]: customerLoyaltyReducer,
33
+ [ReducerType.Order]: customerOrderReducer,
34
+ [ReducerType.Orders]: customerOrdersReducer,
35
+ [ReducerType.PointsShop]: pointsShopReducer,
35
36
  [ReducerType.QRCode]: customerQRCodeReducer,
37
+ [ReducerType.Rewards]: customerRewardsReducer,
36
38
  [ReducerType.Thanx]: customerThanxReducer,
37
39
  [ReducerType.Tpls]: customerTplsReducer
38
40
  });
@@ -35,60 +35,61 @@ export declare const updateCustomerOrderRating: import("@reduxjs/toolkit").Async
35
35
  export declare const resetCustomerOrder: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"order/resetCustomerOrder">, resetCustomerOrderError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"order/resetCustomerOrderError">, setCustomerOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setCustomerOrder">;
36
36
  export declare const selectCustomerOrder: ((state: import("redux").EmptyObject & {
37
37
  alerts: import("@open-tender/types").Alerts;
38
- notifications: import("@open-tender/types").Notifications;
39
38
  allergens: import("..").AllergensState;
40
39
  announcements: import("..").AnnouncementsState;
40
+ checkout: import("..").CheckoutState;
41
+ completedOrders: import("..").CompletedOrdersState;
42
+ config: import("..").ConfigState;
43
+ confirmation: import("..").ConfirmationState;
41
44
  customer: import("redux").CombinedState<{
42
45
  account: import("./account").AccountState;
43
- allergens: import("./allergens").CustomerAllergensState;
44
- addresses: import("./addresses").CustomerAddressesState;
45
46
  communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
46
47
  creditCards: import("./creditCards").CustomerCreditCardsState;
48
+ allergens: import("./allergens").CustomerAllergensState;
49
+ addresses: import("./addresses").CustomerAddressesState;
47
50
  favorites: import("./favorites").CustomerFavoritesState;
48
51
  fcmToken: import("./fcmToken").CustomerFcmTokenState;
49
52
  giftCards: import("./giftCards").CustomerGiftCardsState;
50
- orders: import("./orders").CustomerOrdersState;
51
- order: CustomerOrderState;
52
- loyalty: import("./loyalty").CustomerLoyaltyState;
53
53
  groupOrders: import("./groupOrders").CustomerGroupOrdersState;
54
54
  houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
55
- rewards: import("./rewards").CustomerRewardsState;
55
+ loyalty: import("./loyalty").CustomerLoyaltyState;
56
+ order: CustomerOrderState;
57
+ orders: import("./orders").CustomerOrdersState;
58
+ pointsShop: import("./pointsShop").PointsShopState;
56
59
  qrcode: import("./qrCode").CustomerQRCodeState;
60
+ rewards: import("./rewards").CustomerRewardsState;
57
61
  thanx: import("./thanx").CustomerThanxState;
58
62
  tpls: import("./tpls").CustomerTplsState;
59
63
  }>;
60
- signUp: import("..").SignUpState;
61
- revenueCenters: import("..").RevenueCentersState;
62
- completedOrders: import("..").CompletedOrdersState;
63
- checkout: import("..").CheckoutState;
64
- order: import("..").OrderState;
65
- orderFulfillment: import("..").OrderFulfillmentState;
66
- orderRating: import("..").OrderRatingState;
67
- deals: import("..").DealState;
68
- confirmation: import("..").ConfirmationState;
64
+ deals: import("..").DealsState;
69
65
  donations: import("..").DonationState;
70
- guest: import("..").GuestState;
71
- verifyAccount: import("..").VerifyAccountState;
72
- menu: import("..").MenuState;
73
- resetPassword: import("..").ResetPasswordState;
74
- validTimes: import("..").ValidTimesState;
75
- menuItems: import("..").MenuItemsState;
76
- menuDisplay: import("..").MenuDisplayState;
66
+ geolocation: import("..").GeoLocationState;
77
67
  giftCards: import("..").GiftCardsState;
78
68
  groupOrder: import("..").GroupOrderState;
79
- config: import("..").ConfigState;
80
- geolocation: import("..").GeoLocationState;
69
+ guest: import("..").GuestState;
81
70
  loader: import("..").LoaderState;
82
- qr: import("..").QrState;
83
- misc: import("..").MiscState;
71
+ menu: import("..").MenuState;
72
+ menuDisplay: import("..").MenuDisplayState;
73
+ menuItems: import("..").MenuItemsState;
84
74
  modal: import("@open-tender/types").Modal;
85
- navSite: import("..").NavSiteState;
75
+ misc: import("..").MiscState;
86
76
  nav: import("..").NavState;
77
+ navSite: import("..").NavSiteState;
78
+ notifications: import("@open-tender/types").Notifications;
79
+ oneTimePasscode: import("..").OneTimePasscodeState;
80
+ order: import("..").OrderState;
81
+ orderFulfillment: import("..").OrderFulfillmentState;
82
+ orderRating: import("..").OrderRatingState;
87
83
  posts: import("..").PostsSlice;
88
- sidebarModal: import("..").SidebarModalState;
84
+ qr: import("..").QrState;
85
+ resetPassword: import("..").ResetPasswordState;
86
+ revenueCenters: import("..").RevenueCentersState;
89
87
  sidebar: import("..").SidebarState;
88
+ sidebarModal: import("..").SidebarModalState;
89
+ signUp: import("..").SignUpState;
90
90
  tags: import("..").TagsState;
91
- oneTimePasscode: import("..").OneTimePasscodeState;
91
+ validTimes: import("..").ValidTimesState;
92
+ verifyAccount: import("..").VerifyAccountState;
92
93
  }) => {
93
94
  order: Order | null;
94
95
  loading: RequestStatus;
@@ -0,0 +1,34 @@
1
+ import { AppState } from '../../app';
2
+ import { RequestError, RequestStatus, TPLSPointsShopRewards } from '@open-tender/types';
3
+ export interface PointsShopState {
4
+ entities: TPLSPointsShopRewards;
5
+ error: RequestError;
6
+ loading: RequestStatus;
7
+ }
8
+ export declare enum PointsShopActionType {
9
+ FetchPointsShop = "pointsShop/fetchPointsShop",
10
+ ExchangePointsShopReward = "pointsShop/exchangePointsShopReward"
11
+ }
12
+ export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, void, {
13
+ state: AppState;
14
+ rejectValue: RequestError;
15
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
16
+ extra?: unknown;
17
+ serializedErrorType?: unknown;
18
+ pendingMeta?: unknown;
19
+ fulfilledMeta?: unknown;
20
+ rejectedMeta?: unknown;
21
+ }>;
22
+ export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, string, {
23
+ state: AppState;
24
+ rejectValue: RequestError;
25
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
26
+ extra?: unknown;
27
+ serializedErrorType?: unknown;
28
+ pendingMeta?: unknown;
29
+ fulfilledMeta?: unknown;
30
+ rejectedMeta?: unknown;
31
+ }>;
32
+ export declare const resetPointsShop: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"pointsShop/resetPointsShop">;
33
+ export declare const selectPointsShop: (state: AppState) => PointsShopState;
34
+ export declare const pointsShopReducer: import("redux").Reducer<PointsShopState, import("redux").AnyAction>;
@@ -0,0 +1,81 @@
1
+ import { __awaiter } from "tslib";
2
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
3
+ import { ReducerType } from '../types';
4
+ import { MISSING_CUSTOMER } from '@open-tender/types';
5
+ import { selectToken } from './account';
6
+ const initialState = {
7
+ entities: [],
8
+ error: null,
9
+ loading: 'idle'
10
+ };
11
+ export var PointsShopActionType;
12
+ (function (PointsShopActionType) {
13
+ PointsShopActionType["FetchPointsShop"] = "pointsShop/fetchPointsShop";
14
+ PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
15
+ })(PointsShopActionType || (PointsShopActionType = {}));
16
+ export const fetchPointsShop = createAsyncThunk(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ try {
18
+ const { api } = getState().config;
19
+ if (!api)
20
+ return;
21
+ const token = selectToken(getState());
22
+ if (!token)
23
+ throw new Error(MISSING_CUSTOMER);
24
+ return yield api.getPointsShop(token);
25
+ }
26
+ catch (err) {
27
+ return rejectWithValue(err);
28
+ }
29
+ }));
30
+ export const exchangePointsShopReward = createAsyncThunk(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
31
+ try {
32
+ const { api } = getState().config;
33
+ if (!api)
34
+ return;
35
+ const token = selectToken(getState());
36
+ if (!token)
37
+ throw new Error(MISSING_CUSTOMER);
38
+ yield api.postPointsShopReward(token, rewardId);
39
+ return yield api.getPointsShop(token);
40
+ }
41
+ catch (err) {
42
+ return rejectWithValue(err);
43
+ }
44
+ }));
45
+ const pointsShopSlice = createSlice({
46
+ name: ReducerType.PointsShop,
47
+ initialState,
48
+ reducers: {
49
+ resetPointsShop: () => initialState
50
+ },
51
+ extraReducers: builder => {
52
+ builder
53
+ .addCase(fetchPointsShop.fulfilled, (state, action) => {
54
+ state.entities = action.payload;
55
+ state.loading = 'idle';
56
+ state.error = null;
57
+ })
58
+ .addCase(fetchPointsShop.pending, state => {
59
+ state.loading = 'pending';
60
+ })
61
+ .addCase(fetchPointsShop.rejected, (state, action) => {
62
+ state.error = action.payload;
63
+ state.loading = 'idle';
64
+ })
65
+ .addCase(exchangePointsShopReward.fulfilled, (state, action) => {
66
+ state.entities = action.payload;
67
+ state.loading = 'idle';
68
+ state.error = null;
69
+ })
70
+ .addCase(exchangePointsShopReward.pending, state => {
71
+ state.loading = 'pending';
72
+ })
73
+ .addCase(exchangePointsShopReward.rejected, (state, action) => {
74
+ state.error = action.payload;
75
+ state.loading = 'idle';
76
+ });
77
+ }
78
+ });
79
+ export const { resetPointsShop } = pointsShopSlice.actions;
80
+ export const selectPointsShop = (state) => state.customer.pointsShop;
81
+ export const pointsShopReducer = pointsShopSlice.reducer;
@@ -18,8 +18,7 @@ export const fetchCustomerThanx = createAsyncThunk(CustomerThanxActionType.Fetch
18
18
  const token = selectToken(getState());
19
19
  if (!token)
20
20
  throw new Error(MISSING_CUSTOMER);
21
- const resp = yield api.getCustomerThanx(token);
22
- return resp;
21
+ return yield api.getCustomerThanx(token);
23
22
  }
24
23
  catch (err) {
25
24
  const error = err;
@@ -1,12 +1,12 @@
1
1
  import { AppState } from '../app';
2
2
  import { Discount, Discounts, RequestError, RequestStatus } from '@open-tender/types';
3
- export interface DealState {
3
+ export interface DealsState {
4
4
  entities: Discounts;
5
5
  error: RequestError;
6
6
  loading: RequestStatus;
7
7
  selected: Discount | null;
8
8
  }
9
- export declare enum DealActionType {
9
+ export declare enum DealsActionType {
10
10
  FetchDeals = "deals/fetchDeals"
11
11
  }
12
12
  export declare const fetchDeals: import("@reduxjs/toolkit").AsyncThunk<Discounts, void, {
@@ -20,6 +20,6 @@ export declare const fetchDeals: import("@reduxjs/toolkit").AsyncThunk<Discounts
20
20
  rejectedMeta?: unknown;
21
21
  }>;
22
22
  export declare const resetDeals: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"deals/resetDeals">, setSelectedDeals: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "deals/setSelectedDeals">;
23
- export declare const selectDeals: (state: AppState) => DealState;
23
+ export declare const selectDeals: (state: AppState) => DealsState;
24
24
  export declare const selectEligibleDeals: (state: AppState) => Discounts;
25
- export declare const dealsReducer: import("redux").Reducer<DealState, import("redux").AnyAction>;
25
+ export declare const dealsReducer: import("redux").Reducer<DealsState, import("redux").AnyAction>;
@@ -8,11 +8,11 @@ const initialState = {
8
8
  error: null,
9
9
  loading: 'idle'
10
10
  };
11
- export var DealActionType;
12
- (function (DealActionType) {
13
- DealActionType["FetchDeals"] = "deals/fetchDeals";
14
- })(DealActionType || (DealActionType = {}));
15
- export const fetchDeals = createAsyncThunk(DealActionType.FetchDeals, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
11
+ export var DealsActionType;
12
+ (function (DealsActionType) {
13
+ DealsActionType["FetchDeals"] = "deals/fetchDeals";
14
+ })(DealsActionType || (DealsActionType = {}));
15
+ export const fetchDeals = createAsyncThunk(DealsActionType.FetchDeals, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  const { api } = getState().config;
17
17
  if (!api)
18
18
  return;
@@ -25,6 +25,7 @@ export * from './oneTimePasscode';
25
25
  export * from './order';
26
26
  export * from './orderFulfillment';
27
27
  export * from './orderRating';
28
+ export * from './customer/pointsShop';
28
29
  export * from './posts';
29
30
  export * from './qr';
30
31
  export * from './resetPassword';
@@ -25,6 +25,7 @@ export * from './oneTimePasscode';
25
25
  export * from './order';
26
26
  export * from './orderFulfillment';
27
27
  export * from './orderRating';
28
+ export * from './customer/pointsShop';
28
29
  export * from './posts';
29
30
  export * from './qr';
30
31
  export * from './resetPassword';