@open-tender/cloud 0.1.68 → 0.1.70
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/app/hooks.d.ts +7 -7
- package/dist/cjs/app/store.d.ts +21 -21
- package/dist/cjs/app/store.js +0 -1
- package/dist/cjs/services/api.d.ts +2 -2
- package/dist/cjs/services/api.js +6 -6
- package/dist/cjs/slices/allergens.d.ts +7 -7
- package/dist/cjs/slices/config.d.ts +7 -7
- package/dist/cjs/slices/customer/index.d.ts +7 -6
- package/dist/cjs/slices/customer/index.js +8 -6
- package/dist/cjs/slices/customer/order.d.ts +7 -7
- package/dist/cjs/slices/{pointsShop.d.ts → customer/pointsShop.d.ts} +1 -1
- package/dist/cjs/slices/{pointsShop.js → customer/pointsShop.js} +19 -11
- package/dist/cjs/slices/index.d.ts +0 -1
- package/dist/cjs/slices/index.js +0 -1
- package/dist/cjs/slices/order.d.ts +21 -21
- package/dist/cjs/slices/tags.d.ts +7 -7
- package/dist/esm/app/hooks.d.ts +7 -7
- package/dist/esm/app/store.d.ts +21 -21
- package/dist/esm/app/store.js +1 -2
- package/dist/esm/services/api.d.ts +2 -2
- package/dist/esm/services/api.js +6 -6
- package/dist/esm/slices/allergens.d.ts +7 -7
- package/dist/esm/slices/config.d.ts +7 -7
- package/dist/esm/slices/customer/index.d.ts +7 -6
- package/dist/esm/slices/customer/index.js +8 -6
- package/dist/esm/slices/customer/order.d.ts +7 -7
- package/dist/esm/slices/{pointsShop.d.ts → customer/pointsShop.d.ts} +1 -1
- package/dist/esm/slices/{pointsShop.js → customer/pointsShop.js} +19 -11
- package/dist/esm/slices/index.d.ts +0 -1
- package/dist/esm/slices/index.js +0 -1
- package/dist/esm/slices/order.d.ts +21 -21
- package/dist/esm/slices/tags.d.ts +7 -7
- package/package.json +1 -1
package/dist/cjs/app/hooks.d.ts
CHANGED
|
@@ -10,20 +10,21 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
10
10
|
confirmation: import("..").ConfirmationState;
|
|
11
11
|
customer: import("redux").CombinedState<{
|
|
12
12
|
account: import("..").AccountState;
|
|
13
|
-
allergens: import("..").CustomerAllergensState;
|
|
14
|
-
addresses: import("..").CustomerAddressesState;
|
|
15
13
|
communicationPreferences: import("..").CustomerCommunicationPrefsState;
|
|
16
14
|
creditCards: import("..").CustomerCreditCardsState;
|
|
15
|
+
allergens: import("..").CustomerAllergensState;
|
|
16
|
+
addresses: import("..").CustomerAddressesState;
|
|
17
17
|
favorites: import("..").CustomerFavoritesState;
|
|
18
18
|
fcmToken: import("..").CustomerFcmTokenState;
|
|
19
19
|
giftCards: import("..").CustomerGiftCardsState;
|
|
20
|
-
orders: import("..").CustomerOrdersState;
|
|
21
|
-
order: import("..").CustomerOrderState;
|
|
22
|
-
loyalty: import("..").CustomerLoyaltyState;
|
|
23
20
|
groupOrders: import("..").CustomerGroupOrdersState;
|
|
24
21
|
houseAccounts: import("..").CustomerHouseAccountsState;
|
|
25
|
-
|
|
22
|
+
loyalty: import("..").CustomerLoyaltyState;
|
|
23
|
+
order: import("..").CustomerOrderState;
|
|
24
|
+
orders: import("..").CustomerOrdersState;
|
|
25
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
26
26
|
qrcode: import("..").CustomerQRCodeState;
|
|
27
|
+
rewards: import("..").CustomerRewardsState;
|
|
27
28
|
thanx: import("..").CustomerThanxState;
|
|
28
29
|
tpls: import("..").CustomerTplsState;
|
|
29
30
|
}>;
|
|
@@ -46,7 +47,6 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
46
47
|
order: import("..").OrderState;
|
|
47
48
|
orderFulfillment: import("..").OrderFulfillmentState;
|
|
48
49
|
orderRating: import("..").OrderRatingState;
|
|
49
|
-
pointsShop: import("..").PointsShopState;
|
|
50
50
|
posts: import("..").PostsSlice;
|
|
51
51
|
qr: import("..").QrState;
|
|
52
52
|
resetPassword: import("..").ResetPasswordState;
|
package/dist/cjs/app/store.d.ts
CHANGED
|
@@ -9,20 +9,21 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
9
9
|
confirmation: import("../slices").ConfirmationState;
|
|
10
10
|
customer: import("redux").CombinedState<{
|
|
11
11
|
account: import("../slices").AccountState;
|
|
12
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
13
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
14
12
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
15
13
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
14
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
15
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
16
16
|
favorites: import("../slices").CustomerFavoritesState;
|
|
17
17
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
18
18
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
19
|
-
orders: import("../slices").CustomerOrdersState;
|
|
20
|
-
order: import("../slices").CustomerOrderState;
|
|
21
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
22
19
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
23
20
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
24
|
-
|
|
21
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
22
|
+
order: import("../slices").CustomerOrderState;
|
|
23
|
+
orders: import("../slices").CustomerOrdersState;
|
|
24
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
25
25
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
26
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
26
27
|
thanx: import("../slices").CustomerThanxState;
|
|
27
28
|
tpls: import("../slices").CustomerTplsState;
|
|
28
29
|
}>;
|
|
@@ -45,7 +46,6 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
45
46
|
order: import("../slices").OrderState;
|
|
46
47
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
47
48
|
orderRating: import("../slices").OrderRatingState;
|
|
48
|
-
pointsShop: import("../slices").PointsShopState;
|
|
49
49
|
posts: import("../slices").PostsSlice;
|
|
50
50
|
qr: import("../slices").QrState;
|
|
51
51
|
resetPassword: import("../slices").ResetPasswordState;
|
|
@@ -68,20 +68,21 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
68
68
|
confirmation: import("../slices").ConfirmationState;
|
|
69
69
|
customer: import("redux").CombinedState<{
|
|
70
70
|
account: import("../slices").AccountState;
|
|
71
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
72
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
73
71
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
74
72
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
73
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
74
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
75
75
|
favorites: import("../slices").CustomerFavoritesState;
|
|
76
76
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
77
77
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
78
|
-
orders: import("../slices").CustomerOrdersState;
|
|
79
|
-
order: import("../slices").CustomerOrderState;
|
|
80
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
81
78
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
82
79
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
83
|
-
|
|
80
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
81
|
+
order: import("../slices").CustomerOrderState;
|
|
82
|
+
orders: import("../slices").CustomerOrdersState;
|
|
83
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
84
84
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
85
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
85
86
|
thanx: import("../slices").CustomerThanxState;
|
|
86
87
|
tpls: import("../slices").CustomerTplsState;
|
|
87
88
|
}>;
|
|
@@ -104,7 +105,6 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
104
105
|
order: import("../slices").OrderState;
|
|
105
106
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
106
107
|
orderRating: import("../slices").OrderRatingState;
|
|
107
|
-
pointsShop: import("../slices").PointsShopState;
|
|
108
108
|
posts: import("../slices").PostsSlice;
|
|
109
109
|
qr: import("../slices").QrState;
|
|
110
110
|
resetPassword: import("../slices").ResetPasswordState;
|
|
@@ -125,20 +125,21 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
125
125
|
confirmation: import("../slices").ConfirmationState;
|
|
126
126
|
customer: import("redux").CombinedState<{
|
|
127
127
|
account: import("../slices").AccountState;
|
|
128
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
129
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
130
128
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
131
129
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
130
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
131
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
132
132
|
favorites: import("../slices").CustomerFavoritesState;
|
|
133
133
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
134
134
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
135
|
-
orders: import("../slices").CustomerOrdersState;
|
|
136
|
-
order: import("../slices").CustomerOrderState;
|
|
137
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
138
135
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
139
136
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
140
|
-
|
|
137
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
138
|
+
order: import("../slices").CustomerOrderState;
|
|
139
|
+
orders: import("../slices").CustomerOrdersState;
|
|
140
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
141
141
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
142
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
142
143
|
thanx: import("../slices").CustomerThanxState;
|
|
143
144
|
tpls: import("../slices").CustomerTplsState;
|
|
144
145
|
}>;
|
|
@@ -161,7 +162,6 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
161
162
|
order: import("../slices").OrderState;
|
|
162
163
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
163
164
|
orderRating: import("../slices").OrderRatingState;
|
|
164
|
-
pointsShop: import("../slices").PointsShopState;
|
|
165
165
|
posts: import("../slices").PostsSlice;
|
|
166
166
|
qr: import("../slices").QrState;
|
|
167
167
|
resetPassword: import("../slices").ResetPasswordState;
|
package/dist/cjs/app/store.js
CHANGED
|
@@ -32,7 +32,6 @@ exports.appReducer = (0, toolkit_1.combineReducers)({
|
|
|
32
32
|
[types_1.ReducerType.Order]: slices_1.orderReducer,
|
|
33
33
|
[types_1.ReducerType.OrderFulfillment]: slices_1.orderFulfillmentReducer,
|
|
34
34
|
[types_1.ReducerType.OrderRating]: slices_1.orderRatingReducer,
|
|
35
|
-
[types_1.ReducerType.PointsShop]: slices_1.pointsShopReducer,
|
|
36
35
|
[types_1.ReducerType.Posts]: slices_1.postsReducer,
|
|
37
36
|
[types_1.ReducerType.Qr]: slices_1.qrReducer,
|
|
38
37
|
[types_1.ReducerType.ResetPassword]: slices_1.resetPasswordReducer,
|
|
@@ -66,8 +66,6 @@ declare class OpenTenderAPI {
|
|
|
66
66
|
getMenuItems(revenueCenterId: number, serviceType: ServiceType): Promise<unknown>;
|
|
67
67
|
getMenuDisplay(revenueCenterId: number, serviceType: ServiceType, weekday: Weekday, minutes: number): Promise<unknown>;
|
|
68
68
|
getMenuPages(): Promise<unknown>;
|
|
69
|
-
getPointsShop(): Promise<unknown>;
|
|
70
|
-
postPointsShopReward(rewardId: string): Promise<unknown>;
|
|
71
69
|
getDeals(customerId: number): Promise<unknown>;
|
|
72
70
|
getAnnouncements(page: string): Promise<unknown>;
|
|
73
71
|
getAnnouncementPage(page: string): Promise<unknown>;
|
|
@@ -118,6 +116,8 @@ declare class OpenTenderAPI {
|
|
|
118
116
|
postVerifyAccount(verifyToken: string): Promise<unknown>;
|
|
119
117
|
getCustomerQRCode(token: string): Promise<unknown>;
|
|
120
118
|
getCustomerRewards(token: string): Promise<unknown>;
|
|
119
|
+
getPointsShop(token: string): Promise<unknown>;
|
|
120
|
+
postPointsShopReward(token: string, rewardId: string): Promise<unknown>;
|
|
121
121
|
getCustomerOrders(token: string, limit: number, timing: string): Promise<unknown>;
|
|
122
122
|
getCustomerOrder(token: string, orderId: number): Promise<unknown>;
|
|
123
123
|
postCustomerGroupOrder(token: string, data: any): Promise<GroupOrder | null | undefined>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -354,12 +354,6 @@ class OpenTenderAPI {
|
|
|
354
354
|
getMenuPages() {
|
|
355
355
|
return this.request(`/menu-pages`);
|
|
356
356
|
}
|
|
357
|
-
getPointsShop() {
|
|
358
|
-
return this.request(`/points-shop/rewards`);
|
|
359
|
-
}
|
|
360
|
-
postPointsShopReward(rewardId) {
|
|
361
|
-
return this.request(`/points-shop/rewards/${rewardId}/exchange`, 'POST');
|
|
362
|
-
}
|
|
363
357
|
getDeals(customerId) {
|
|
364
358
|
const params = customerId ? `&customer_id=${customerId}` : '';
|
|
365
359
|
return this.request(`/deals?with_related=true${params}`);
|
|
@@ -559,6 +553,12 @@ class OpenTenderAPI {
|
|
|
559
553
|
getCustomerRewards(token) {
|
|
560
554
|
return this.request(`/customer/rewards?with_related=true`, 'GET', null, null, token);
|
|
561
555
|
}
|
|
556
|
+
getPointsShop(token) {
|
|
557
|
+
return this.request(`/points-shop/rewards`, 'GET', null, null, token);
|
|
558
|
+
}
|
|
559
|
+
postPointsShopReward(token, rewardId) {
|
|
560
|
+
return this.request(`/points-shop/rewards/${rewardId}/exchange`, 'POST', null, null, token);
|
|
561
|
+
}
|
|
562
562
|
getCustomerOrders(token, limit, timing) {
|
|
563
563
|
let params = [];
|
|
564
564
|
if (limit)
|
|
@@ -37,20 +37,21 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
37
37
|
confirmation: import("./confirmation").ConfirmationState;
|
|
38
38
|
customer: import("redux").CombinedState<{
|
|
39
39
|
account: import("./customer").AccountState;
|
|
40
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
41
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
42
40
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
43
41
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
42
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
43
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
44
44
|
favorites: import("./customer").CustomerFavoritesState;
|
|
45
45
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
46
46
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
47
|
-
orders: import("./customer").CustomerOrdersState;
|
|
48
|
-
order: import("./customer").CustomerOrderState;
|
|
49
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
47
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
51
48
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
52
|
-
|
|
49
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
|
+
order: import("./customer").CustomerOrderState;
|
|
51
|
+
orders: import("./customer").CustomerOrdersState;
|
|
52
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
53
53
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
54
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
54
55
|
thanx: import("./customer").CustomerThanxState;
|
|
55
56
|
tpls: import("./customer").CustomerTplsState;
|
|
56
57
|
}>;
|
|
@@ -73,7 +74,6 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
73
74
|
order: import("./order").OrderState;
|
|
74
75
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
75
76
|
orderRating: import("./orderRating").OrderRatingState;
|
|
76
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
77
77
|
posts: import("./posts").PostsSlice;
|
|
78
78
|
qr: import("./qr").QrState;
|
|
79
79
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -93,20 +93,21 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
93
93
|
confirmation: import("./confirmation").ConfirmationState;
|
|
94
94
|
customer: import("redux").CombinedState<{
|
|
95
95
|
account: import("./customer").AccountState;
|
|
96
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
97
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
98
96
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
99
97
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
98
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
99
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
100
100
|
favorites: import("./customer").CustomerFavoritesState;
|
|
101
101
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
102
102
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
103
|
-
orders: import("./customer").CustomerOrdersState;
|
|
104
|
-
order: import("./customer").CustomerOrderState;
|
|
105
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
106
103
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
107
104
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
108
|
-
|
|
105
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
106
|
+
order: import("./customer").CustomerOrderState;
|
|
107
|
+
orders: import("./customer").CustomerOrdersState;
|
|
108
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
109
109
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
110
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
110
111
|
thanx: import("./customer").CustomerThanxState;
|
|
111
112
|
tpls: import("./customer").CustomerTplsState;
|
|
112
113
|
}>;
|
|
@@ -129,7 +130,6 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
129
130
|
order: import("./order").OrderState;
|
|
130
131
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
131
132
|
orderRating: import("./orderRating").OrderRatingState;
|
|
132
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
133
133
|
posts: import("./posts").PostsSlice;
|
|
134
134
|
qr: import("./qr").QrState;
|
|
135
135
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -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
|
-
|
|
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>;
|
|
@@ -17,26 +17,28 @@ const houseAccounts_1 = require("./houseAccounts");
|
|
|
17
17
|
const loyalty_1 = require("./loyalty");
|
|
18
18
|
const order_1 = require("./order");
|
|
19
19
|
const orders_1 = require("./orders");
|
|
20
|
+
const pointsShop_1 = require("./pointsShop");
|
|
20
21
|
const qrCode_1 = require("./qrCode");
|
|
21
22
|
const rewards_1 = require("./rewards");
|
|
22
23
|
const thanx_1 = require("./thanx");
|
|
23
24
|
const tpls_1 = require("./tpls");
|
|
24
25
|
exports.customerReducer = (0, redux_1.combineReducers)({
|
|
25
26
|
[types_1.ReducerType.Account]: account_1.accountReducer,
|
|
26
|
-
[types_1.ReducerType.CustomerAllergens]: allergens_1.customerAllergensReducer,
|
|
27
|
-
[types_1.ReducerType.CustomerAddresses]: addresses_1.customerAddressesReducer,
|
|
28
27
|
[types_1.ReducerType.CommunicationPrefs]: communicationPreferences_1.customerCommunicationPrefsReducer,
|
|
29
28
|
[types_1.ReducerType.CreditCards]: creditCards_1.customerCreditCardsReducer,
|
|
29
|
+
[types_1.ReducerType.CustomerAllergens]: allergens_1.customerAllergensReducer,
|
|
30
|
+
[types_1.ReducerType.CustomerAddresses]: addresses_1.customerAddressesReducer,
|
|
30
31
|
[types_1.ReducerType.Favorites]: favorites_1.customerFavoritesReducer,
|
|
31
32
|
[types_1.ReducerType.FcmToken]: fcmToken_1.customerFcmTokenReducer,
|
|
32
33
|
[types_1.ReducerType.GiftCards]: giftCards_1.customerGiftCardsReducer,
|
|
33
|
-
[types_1.ReducerType.Orders]: orders_1.customerOrdersReducer,
|
|
34
|
-
[types_1.ReducerType.Order]: order_1.customerOrderReducer,
|
|
35
|
-
[types_1.ReducerType.Loyalty]: loyalty_1.customerLoyaltyReducer,
|
|
36
34
|
[types_1.ReducerType.GroupOrders]: groupOrders_1.customerGroupOrdersReducer,
|
|
37
35
|
[types_1.ReducerType.HouseAccounts]: houseAccounts_1.customerHouseAccountsReducer,
|
|
38
|
-
[types_1.ReducerType.
|
|
36
|
+
[types_1.ReducerType.Loyalty]: loyalty_1.customerLoyaltyReducer,
|
|
37
|
+
[types_1.ReducerType.Order]: order_1.customerOrderReducer,
|
|
38
|
+
[types_1.ReducerType.Orders]: orders_1.customerOrdersReducer,
|
|
39
|
+
[types_1.ReducerType.PointsShop]: pointsShop_1.pointsShopReducer,
|
|
39
40
|
[types_1.ReducerType.QRCode]: qrCode_1.customerQRCodeReducer,
|
|
41
|
+
[types_1.ReducerType.Rewards]: rewards_1.customerRewardsReducer,
|
|
40
42
|
[types_1.ReducerType.Thanx]: thanx_1.customerThanxReducer,
|
|
41
43
|
[types_1.ReducerType.Tpls]: tpls_1.customerTplsReducer
|
|
42
44
|
});
|
|
@@ -43,20 +43,21 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
43
43
|
confirmation: import("..").ConfirmationState;
|
|
44
44
|
customer: import("redux").CombinedState<{
|
|
45
45
|
account: import("./account").AccountState;
|
|
46
|
-
allergens: import("./allergens").CustomerAllergensState;
|
|
47
|
-
addresses: import("./addresses").CustomerAddressesState;
|
|
48
46
|
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
49
47
|
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
48
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
49
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
50
50
|
favorites: import("./favorites").CustomerFavoritesState;
|
|
51
51
|
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
52
52
|
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
53
|
-
orders: import("./orders").CustomerOrdersState;
|
|
54
|
-
order: CustomerOrderState;
|
|
55
|
-
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
56
53
|
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
57
54
|
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
58
|
-
|
|
55
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
56
|
+
order: CustomerOrderState;
|
|
57
|
+
orders: import("./orders").CustomerOrdersState;
|
|
58
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
59
59
|
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
60
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
60
61
|
thanx: import("./thanx").CustomerThanxState;
|
|
61
62
|
tpls: import("./tpls").CustomerTplsState;
|
|
62
63
|
}>;
|
|
@@ -79,7 +80,6 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
79
80
|
order: import("..").OrderState;
|
|
80
81
|
orderFulfillment: import("..").OrderFulfillmentState;
|
|
81
82
|
orderRating: import("..").OrderRatingState;
|
|
82
|
-
pointsShop: import("..").PointsShopState;
|
|
83
83
|
posts: import("..").PostsSlice;
|
|
84
84
|
qr: import("..").QrState;
|
|
85
85
|
resetPassword: import("..").ResetPasswordState;
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.exchangePointsShopReward = exports.fetchPointsShop = exports.PointsShopActionType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const types_1 = require("
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const types_2 = require("@open-tender/types");
|
|
8
|
+
const account_1 = require("./account");
|
|
7
9
|
const initialState = {
|
|
8
10
|
entities: [],
|
|
9
11
|
error: null,
|
|
@@ -15,23 +17,29 @@ var PointsShopActionType;
|
|
|
15
17
|
PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
|
|
16
18
|
})(PointsShopActionType = exports.PointsShopActionType || (exports.PointsShopActionType = {}));
|
|
17
19
|
exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const { api } = getState().config;
|
|
19
|
-
if (!api)
|
|
20
|
-
return;
|
|
21
20
|
try {
|
|
22
|
-
|
|
21
|
+
const { api } = getState().config;
|
|
22
|
+
if (!api)
|
|
23
|
+
return;
|
|
24
|
+
const token = (0, account_1.selectToken)(getState());
|
|
25
|
+
if (!token)
|
|
26
|
+
throw new Error(types_2.MISSING_CUSTOMER);
|
|
27
|
+
return yield api.getPointsShop(token);
|
|
23
28
|
}
|
|
24
29
|
catch (err) {
|
|
25
30
|
return rejectWithValue(err);
|
|
26
31
|
}
|
|
27
32
|
}));
|
|
28
33
|
exports.exchangePointsShopReward = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
const { api } = getState().config;
|
|
30
|
-
if (!api)
|
|
31
|
-
return;
|
|
32
34
|
try {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const { api } = getState().config;
|
|
36
|
+
if (!api)
|
|
37
|
+
return;
|
|
38
|
+
const token = (0, account_1.selectToken)(getState());
|
|
39
|
+
if (!token)
|
|
40
|
+
throw new Error(types_2.MISSING_CUSTOMER);
|
|
41
|
+
yield api.postPointsShopReward(token, rewardId);
|
|
42
|
+
return yield api.getPointsShop(token);
|
|
35
43
|
}
|
|
36
44
|
catch (err) {
|
|
37
45
|
return rejectWithValue(err);
|
|
@@ -72,6 +80,6 @@ const pointsShopSlice = (0, toolkit_1.createSlice)({
|
|
|
72
80
|
}
|
|
73
81
|
});
|
|
74
82
|
exports.resetPointsShop = pointsShopSlice.actions.resetPointsShop;
|
|
75
|
-
const selectPointsShop = (state) => state.pointsShop;
|
|
83
|
+
const selectPointsShop = (state) => state.customer.pointsShop;
|
|
76
84
|
exports.selectPointsShop = selectPointsShop;
|
|
77
85
|
exports.pointsShopReducer = pointsShopSlice.reducer;
|
package/dist/cjs/slices/index.js
CHANGED
|
@@ -28,7 +28,6 @@ tslib_1.__exportStar(require("./oneTimePasscode"), exports);
|
|
|
28
28
|
tslib_1.__exportStar(require("./order"), exports);
|
|
29
29
|
tslib_1.__exportStar(require("./orderFulfillment"), exports);
|
|
30
30
|
tslib_1.__exportStar(require("./orderRating"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./pointsShop"), exports);
|
|
32
31
|
tslib_1.__exportStar(require("./posts"), exports);
|
|
33
32
|
tslib_1.__exportStar(require("./qr"), exports);
|
|
34
33
|
tslib_1.__exportStar(require("./resetPassword"), exports);
|
|
@@ -128,20 +128,21 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
128
128
|
confirmation: import("./confirmation").ConfirmationState;
|
|
129
129
|
customer: import("redux").CombinedState<{
|
|
130
130
|
account: import("./customer").AccountState;
|
|
131
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
132
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
133
131
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
134
132
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
133
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
134
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
135
135
|
favorites: import("./customer").CustomerFavoritesState;
|
|
136
136
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
137
137
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
138
|
-
orders: import("./customer").CustomerOrdersState;
|
|
139
|
-
order: import("./customer").CustomerOrderState;
|
|
140
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
141
138
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
142
139
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
143
|
-
|
|
140
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
141
|
+
order: import("./customer").CustomerOrderState;
|
|
142
|
+
orders: import("./customer").CustomerOrdersState;
|
|
143
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
144
144
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
145
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
145
146
|
thanx: import("./customer").CustomerThanxState;
|
|
146
147
|
tpls: import("./customer").CustomerTplsState;
|
|
147
148
|
}>;
|
|
@@ -164,7 +165,6 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
164
165
|
order: OrderState;
|
|
165
166
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
166
167
|
orderRating: import("./orderRating").OrderRatingState;
|
|
167
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
168
168
|
posts: import("./posts").PostsSlice;
|
|
169
169
|
qr: import("./qr").QrState;
|
|
170
170
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -201,20 +201,21 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
201
201
|
confirmation: import("./confirmation").ConfirmationState;
|
|
202
202
|
customer: import("redux").CombinedState<{
|
|
203
203
|
account: import("./customer").AccountState;
|
|
204
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
205
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
206
204
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
207
205
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
206
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
207
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
208
208
|
favorites: import("./customer").CustomerFavoritesState;
|
|
209
209
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
210
210
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
211
|
-
orders: import("./customer").CustomerOrdersState;
|
|
212
|
-
order: import("./customer").CustomerOrderState;
|
|
213
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
214
211
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
215
212
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
216
|
-
|
|
213
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
214
|
+
order: import("./customer").CustomerOrderState;
|
|
215
|
+
orders: import("./customer").CustomerOrdersState;
|
|
216
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
217
217
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
218
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
218
219
|
thanx: import("./customer").CustomerThanxState;
|
|
219
220
|
tpls: import("./customer").CustomerTplsState;
|
|
220
221
|
}>;
|
|
@@ -237,7 +238,6 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
237
238
|
order: OrderState;
|
|
238
239
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
239
240
|
orderRating: import("./orderRating").OrderRatingState;
|
|
240
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
241
241
|
posts: import("./posts").PostsSlice;
|
|
242
242
|
qr: import("./qr").QrState;
|
|
243
243
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -269,20 +269,21 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
269
269
|
confirmation: import("./confirmation").ConfirmationState;
|
|
270
270
|
customer: import("redux").CombinedState<{
|
|
271
271
|
account: import("./customer").AccountState;
|
|
272
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
273
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
274
272
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
275
273
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
274
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
275
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
276
276
|
favorites: import("./customer").CustomerFavoritesState;
|
|
277
277
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
278
278
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
279
|
-
orders: import("./customer").CustomerOrdersState;
|
|
280
|
-
order: import("./customer").CustomerOrderState;
|
|
281
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
282
279
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
283
280
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
284
|
-
|
|
281
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
282
|
+
order: import("./customer").CustomerOrderState;
|
|
283
|
+
orders: import("./customer").CustomerOrdersState;
|
|
284
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
285
285
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
286
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
286
287
|
thanx: import("./customer").CustomerThanxState;
|
|
287
288
|
tpls: import("./customer").CustomerTplsState;
|
|
288
289
|
}>;
|
|
@@ -305,7 +306,6 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
305
306
|
order: OrderState;
|
|
306
307
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
307
308
|
orderRating: import("./orderRating").OrderRatingState;
|
|
308
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
309
309
|
posts: import("./posts").PostsSlice;
|
|
310
310
|
qr: import("./qr").QrState;
|
|
311
311
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -37,20 +37,21 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
37
37
|
confirmation: import("./confirmation").ConfirmationState;
|
|
38
38
|
customer: import("redux").CombinedState<{
|
|
39
39
|
account: import("./customer").AccountState;
|
|
40
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
41
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
42
40
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
43
41
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
42
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
43
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
44
44
|
favorites: import("./customer").CustomerFavoritesState;
|
|
45
45
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
46
46
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
47
|
-
orders: import("./customer").CustomerOrdersState;
|
|
48
|
-
order: import("./customer").CustomerOrderState;
|
|
49
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
47
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
51
48
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
52
|
-
|
|
49
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
|
+
order: import("./customer").CustomerOrderState;
|
|
51
|
+
orders: import("./customer").CustomerOrdersState;
|
|
52
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
53
53
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
54
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
54
55
|
thanx: import("./customer").CustomerThanxState;
|
|
55
56
|
tpls: import("./customer").CustomerTplsState;
|
|
56
57
|
}>;
|
|
@@ -73,7 +74,6 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
73
74
|
order: import("./order").OrderState;
|
|
74
75
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
75
76
|
orderRating: import("./orderRating").OrderRatingState;
|
|
76
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
77
77
|
posts: import("./posts").PostsSlice;
|
|
78
78
|
qr: import("./qr").QrState;
|
|
79
79
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
package/dist/esm/app/hooks.d.ts
CHANGED
|
@@ -10,20 +10,21 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
10
10
|
confirmation: import("..").ConfirmationState;
|
|
11
11
|
customer: import("redux").CombinedState<{
|
|
12
12
|
account: import("..").AccountState;
|
|
13
|
-
allergens: import("..").CustomerAllergensState;
|
|
14
|
-
addresses: import("..").CustomerAddressesState;
|
|
15
13
|
communicationPreferences: import("..").CustomerCommunicationPrefsState;
|
|
16
14
|
creditCards: import("..").CustomerCreditCardsState;
|
|
15
|
+
allergens: import("..").CustomerAllergensState;
|
|
16
|
+
addresses: import("..").CustomerAddressesState;
|
|
17
17
|
favorites: import("..").CustomerFavoritesState;
|
|
18
18
|
fcmToken: import("..").CustomerFcmTokenState;
|
|
19
19
|
giftCards: import("..").CustomerGiftCardsState;
|
|
20
|
-
orders: import("..").CustomerOrdersState;
|
|
21
|
-
order: import("..").CustomerOrderState;
|
|
22
|
-
loyalty: import("..").CustomerLoyaltyState;
|
|
23
20
|
groupOrders: import("..").CustomerGroupOrdersState;
|
|
24
21
|
houseAccounts: import("..").CustomerHouseAccountsState;
|
|
25
|
-
|
|
22
|
+
loyalty: import("..").CustomerLoyaltyState;
|
|
23
|
+
order: import("..").CustomerOrderState;
|
|
24
|
+
orders: import("..").CustomerOrdersState;
|
|
25
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
26
26
|
qrcode: import("..").CustomerQRCodeState;
|
|
27
|
+
rewards: import("..").CustomerRewardsState;
|
|
27
28
|
thanx: import("..").CustomerThanxState;
|
|
28
29
|
tpls: import("..").CustomerTplsState;
|
|
29
30
|
}>;
|
|
@@ -46,7 +47,6 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
46
47
|
order: import("..").OrderState;
|
|
47
48
|
orderFulfillment: import("..").OrderFulfillmentState;
|
|
48
49
|
orderRating: import("..").OrderRatingState;
|
|
49
|
-
pointsShop: import("..").PointsShopState;
|
|
50
50
|
posts: import("..").PostsSlice;
|
|
51
51
|
qr: import("..").QrState;
|
|
52
52
|
resetPassword: import("..").ResetPasswordState;
|
package/dist/esm/app/store.d.ts
CHANGED
|
@@ -9,20 +9,21 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
9
9
|
confirmation: import("../slices").ConfirmationState;
|
|
10
10
|
customer: import("redux").CombinedState<{
|
|
11
11
|
account: import("../slices").AccountState;
|
|
12
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
13
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
14
12
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
15
13
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
14
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
15
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
16
16
|
favorites: import("../slices").CustomerFavoritesState;
|
|
17
17
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
18
18
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
19
|
-
orders: import("../slices").CustomerOrdersState;
|
|
20
|
-
order: import("../slices").CustomerOrderState;
|
|
21
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
22
19
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
23
20
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
24
|
-
|
|
21
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
22
|
+
order: import("../slices").CustomerOrderState;
|
|
23
|
+
orders: import("../slices").CustomerOrdersState;
|
|
24
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
25
25
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
26
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
26
27
|
thanx: import("../slices").CustomerThanxState;
|
|
27
28
|
tpls: import("../slices").CustomerTplsState;
|
|
28
29
|
}>;
|
|
@@ -45,7 +46,6 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
45
46
|
order: import("../slices").OrderState;
|
|
46
47
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
47
48
|
orderRating: import("../slices").OrderRatingState;
|
|
48
|
-
pointsShop: import("../slices").PointsShopState;
|
|
49
49
|
posts: import("../slices").PostsSlice;
|
|
50
50
|
qr: import("../slices").QrState;
|
|
51
51
|
resetPassword: import("../slices").ResetPasswordState;
|
|
@@ -68,20 +68,21 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
68
68
|
confirmation: import("../slices").ConfirmationState;
|
|
69
69
|
customer: import("redux").CombinedState<{
|
|
70
70
|
account: import("../slices").AccountState;
|
|
71
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
72
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
73
71
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
74
72
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
73
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
74
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
75
75
|
favorites: import("../slices").CustomerFavoritesState;
|
|
76
76
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
77
77
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
78
|
-
orders: import("../slices").CustomerOrdersState;
|
|
79
|
-
order: import("../slices").CustomerOrderState;
|
|
80
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
81
78
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
82
79
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
83
|
-
|
|
80
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
81
|
+
order: import("../slices").CustomerOrderState;
|
|
82
|
+
orders: import("../slices").CustomerOrdersState;
|
|
83
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
84
84
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
85
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
85
86
|
thanx: import("../slices").CustomerThanxState;
|
|
86
87
|
tpls: import("../slices").CustomerTplsState;
|
|
87
88
|
}>;
|
|
@@ -104,7 +105,6 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
104
105
|
order: import("../slices").OrderState;
|
|
105
106
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
106
107
|
orderRating: import("../slices").OrderRatingState;
|
|
107
|
-
pointsShop: import("../slices").PointsShopState;
|
|
108
108
|
posts: import("../slices").PostsSlice;
|
|
109
109
|
qr: import("../slices").QrState;
|
|
110
110
|
resetPassword: import("../slices").ResetPasswordState;
|
|
@@ -125,20 +125,21 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
125
125
|
confirmation: import("../slices").ConfirmationState;
|
|
126
126
|
customer: import("redux").CombinedState<{
|
|
127
127
|
account: import("../slices").AccountState;
|
|
128
|
-
allergens: import("../slices").CustomerAllergensState;
|
|
129
|
-
addresses: import("../slices").CustomerAddressesState;
|
|
130
128
|
communicationPreferences: import("../slices").CustomerCommunicationPrefsState;
|
|
131
129
|
creditCards: import("../slices").CustomerCreditCardsState;
|
|
130
|
+
allergens: import("../slices").CustomerAllergensState;
|
|
131
|
+
addresses: import("../slices").CustomerAddressesState;
|
|
132
132
|
favorites: import("../slices").CustomerFavoritesState;
|
|
133
133
|
fcmToken: import("../slices").CustomerFcmTokenState;
|
|
134
134
|
giftCards: import("../slices").CustomerGiftCardsState;
|
|
135
|
-
orders: import("../slices").CustomerOrdersState;
|
|
136
|
-
order: import("../slices").CustomerOrderState;
|
|
137
|
-
loyalty: import("../slices").CustomerLoyaltyState;
|
|
138
135
|
groupOrders: import("../slices").CustomerGroupOrdersState;
|
|
139
136
|
houseAccounts: import("../slices").CustomerHouseAccountsState;
|
|
140
|
-
|
|
137
|
+
loyalty: import("../slices").CustomerLoyaltyState;
|
|
138
|
+
order: import("../slices").CustomerOrderState;
|
|
139
|
+
orders: import("../slices").CustomerOrdersState;
|
|
140
|
+
pointsShop: import("../slices/customer/pointsShop").PointsShopState;
|
|
141
141
|
qrcode: import("../slices").CustomerQRCodeState;
|
|
142
|
+
rewards: import("../slices").CustomerRewardsState;
|
|
142
143
|
thanx: import("../slices").CustomerThanxState;
|
|
143
144
|
tpls: import("../slices").CustomerTplsState;
|
|
144
145
|
}>;
|
|
@@ -161,7 +162,6 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
161
162
|
order: import("../slices").OrderState;
|
|
162
163
|
orderFulfillment: import("../slices").OrderFulfillmentState;
|
|
163
164
|
orderRating: import("../slices").OrderRatingState;
|
|
164
|
-
pointsShop: import("../slices").PointsShopState;
|
|
165
165
|
posts: import("../slices").PostsSlice;
|
|
166
166
|
qr: import("../slices").QrState;
|
|
167
167
|
resetPassword: import("../slices").ResetPasswordState;
|
package/dist/esm/app/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { alertsReducer, allergensReducer, announcementsReducer, checkoutReducer, completedOrdersReducer, configReducer, confirmationReducer, customerReducer, dealsReducer, donationsReducer, geolocationReducer, giftCardsReducer, groupOrderReducer, guestReducer, loaderReducer, menuDisplayReducer, menuItemsReducer, menuReducer, miscReducer, modalReducer, navReducer, navSiteReducer, notificationsReducer, oneTimePasscodeReducer, orderFulfillmentReducer, orderRatingReducer, orderReducer, postsReducer,
|
|
2
|
+
import { alertsReducer, allergensReducer, announcementsReducer, checkoutReducer, completedOrdersReducer, configReducer, confirmationReducer, customerReducer, dealsReducer, donationsReducer, geolocationReducer, giftCardsReducer, groupOrderReducer, guestReducer, loaderReducer, menuDisplayReducer, menuItemsReducer, menuReducer, miscReducer, modalReducer, navReducer, navSiteReducer, notificationsReducer, oneTimePasscodeReducer, orderFulfillmentReducer, orderRatingReducer, orderReducer, postsReducer, qrReducer, resetPasswordReducer, revenueCentersReducer, sidebarModalReducer, sidebarReducer, signUpReducer, tagsReducer, validTimesReducer, verifyAccountReducer } from '../slices';
|
|
3
3
|
import { ReducerType } from '../slices/types';
|
|
4
4
|
export const appReducer = combineReducers({
|
|
5
5
|
[ReducerType.Alerts]: alertsReducer,
|
|
@@ -29,7 +29,6 @@ export const appReducer = combineReducers({
|
|
|
29
29
|
[ReducerType.Order]: orderReducer,
|
|
30
30
|
[ReducerType.OrderFulfillment]: orderFulfillmentReducer,
|
|
31
31
|
[ReducerType.OrderRating]: orderRatingReducer,
|
|
32
|
-
[ReducerType.PointsShop]: pointsShopReducer,
|
|
33
32
|
[ReducerType.Posts]: postsReducer,
|
|
34
33
|
[ReducerType.Qr]: qrReducer,
|
|
35
34
|
[ReducerType.ResetPassword]: resetPasswordReducer,
|
|
@@ -66,8 +66,6 @@ declare class OpenTenderAPI {
|
|
|
66
66
|
getMenuItems(revenueCenterId: number, serviceType: ServiceType): Promise<unknown>;
|
|
67
67
|
getMenuDisplay(revenueCenterId: number, serviceType: ServiceType, weekday: Weekday, minutes: number): Promise<unknown>;
|
|
68
68
|
getMenuPages(): Promise<unknown>;
|
|
69
|
-
getPointsShop(): Promise<unknown>;
|
|
70
|
-
postPointsShopReward(rewardId: string): Promise<unknown>;
|
|
71
69
|
getDeals(customerId: number): Promise<unknown>;
|
|
72
70
|
getAnnouncements(page: string): Promise<unknown>;
|
|
73
71
|
getAnnouncementPage(page: string): Promise<unknown>;
|
|
@@ -118,6 +116,8 @@ declare class OpenTenderAPI {
|
|
|
118
116
|
postVerifyAccount(verifyToken: string): Promise<unknown>;
|
|
119
117
|
getCustomerQRCode(token: string): Promise<unknown>;
|
|
120
118
|
getCustomerRewards(token: string): Promise<unknown>;
|
|
119
|
+
getPointsShop(token: string): Promise<unknown>;
|
|
120
|
+
postPointsShopReward(token: string, rewardId: string): Promise<unknown>;
|
|
121
121
|
getCustomerOrders(token: string, limit: number, timing: string): Promise<unknown>;
|
|
122
122
|
getCustomerOrder(token: string, orderId: number): Promise<unknown>;
|
|
123
123
|
postCustomerGroupOrder(token: string, data: any): Promise<GroupOrder | null | undefined>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -352,12 +352,6 @@ class OpenTenderAPI {
|
|
|
352
352
|
getMenuPages() {
|
|
353
353
|
return this.request(`/menu-pages`);
|
|
354
354
|
}
|
|
355
|
-
getPointsShop() {
|
|
356
|
-
return this.request(`/points-shop/rewards`);
|
|
357
|
-
}
|
|
358
|
-
postPointsShopReward(rewardId) {
|
|
359
|
-
return this.request(`/points-shop/rewards/${rewardId}/exchange`, 'POST');
|
|
360
|
-
}
|
|
361
355
|
getDeals(customerId) {
|
|
362
356
|
const params = customerId ? `&customer_id=${customerId}` : '';
|
|
363
357
|
return this.request(`/deals?with_related=true${params}`);
|
|
@@ -557,6 +551,12 @@ class OpenTenderAPI {
|
|
|
557
551
|
getCustomerRewards(token) {
|
|
558
552
|
return this.request(`/customer/rewards?with_related=true`, 'GET', null, null, token);
|
|
559
553
|
}
|
|
554
|
+
getPointsShop(token) {
|
|
555
|
+
return this.request(`/points-shop/rewards`, 'GET', null, null, token);
|
|
556
|
+
}
|
|
557
|
+
postPointsShopReward(token, rewardId) {
|
|
558
|
+
return this.request(`/points-shop/rewards/${rewardId}/exchange`, 'POST', null, null, token);
|
|
559
|
+
}
|
|
560
560
|
getCustomerOrders(token, limit, timing) {
|
|
561
561
|
let params = [];
|
|
562
562
|
if (limit)
|
|
@@ -37,20 +37,21 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
37
37
|
confirmation: import("./confirmation").ConfirmationState;
|
|
38
38
|
customer: import("redux").CombinedState<{
|
|
39
39
|
account: import("./customer").AccountState;
|
|
40
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
41
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
42
40
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
43
41
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
42
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
43
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
44
44
|
favorites: import("./customer").CustomerFavoritesState;
|
|
45
45
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
46
46
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
47
|
-
orders: import("./customer").CustomerOrdersState;
|
|
48
|
-
order: import("./customer").CustomerOrderState;
|
|
49
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
47
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
51
48
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
52
|
-
|
|
49
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
|
+
order: import("./customer").CustomerOrderState;
|
|
51
|
+
orders: import("./customer").CustomerOrdersState;
|
|
52
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
53
53
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
54
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
54
55
|
thanx: import("./customer").CustomerThanxState;
|
|
55
56
|
tpls: import("./customer").CustomerTplsState;
|
|
56
57
|
}>;
|
|
@@ -73,7 +74,6 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
73
74
|
order: import("./order").OrderState;
|
|
74
75
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
75
76
|
orderRating: import("./orderRating").OrderRatingState;
|
|
76
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
77
77
|
posts: import("./posts").PostsSlice;
|
|
78
78
|
qr: import("./qr").QrState;
|
|
79
79
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -93,20 +93,21 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
93
93
|
confirmation: import("./confirmation").ConfirmationState;
|
|
94
94
|
customer: import("redux").CombinedState<{
|
|
95
95
|
account: import("./customer").AccountState;
|
|
96
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
97
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
98
96
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
99
97
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
98
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
99
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
100
100
|
favorites: import("./customer").CustomerFavoritesState;
|
|
101
101
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
102
102
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
103
|
-
orders: import("./customer").CustomerOrdersState;
|
|
104
|
-
order: import("./customer").CustomerOrderState;
|
|
105
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
106
103
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
107
104
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
108
|
-
|
|
105
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
106
|
+
order: import("./customer").CustomerOrderState;
|
|
107
|
+
orders: import("./customer").CustomerOrdersState;
|
|
108
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
109
109
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
110
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
110
111
|
thanx: import("./customer").CustomerThanxState;
|
|
111
112
|
tpls: import("./customer").CustomerTplsState;
|
|
112
113
|
}>;
|
|
@@ -129,7 +130,6 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
129
130
|
order: import("./order").OrderState;
|
|
130
131
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
131
132
|
orderRating: import("./orderRating").OrderRatingState;
|
|
132
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
133
133
|
posts: import("./posts").PostsSlice;
|
|
134
134
|
qr: import("./qr").QrState;
|
|
135
135
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -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
|
-
|
|
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.
|
|
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
|
});
|
|
@@ -43,20 +43,21 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
43
43
|
confirmation: import("..").ConfirmationState;
|
|
44
44
|
customer: import("redux").CombinedState<{
|
|
45
45
|
account: import("./account").AccountState;
|
|
46
|
-
allergens: import("./allergens").CustomerAllergensState;
|
|
47
|
-
addresses: import("./addresses").CustomerAddressesState;
|
|
48
46
|
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
49
47
|
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
48
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
49
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
50
50
|
favorites: import("./favorites").CustomerFavoritesState;
|
|
51
51
|
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
52
52
|
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
53
|
-
orders: import("./orders").CustomerOrdersState;
|
|
54
|
-
order: CustomerOrderState;
|
|
55
|
-
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
56
53
|
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
57
54
|
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
58
|
-
|
|
55
|
+
loyalty: import("./loyalty").CustomerLoyaltyState;
|
|
56
|
+
order: CustomerOrderState;
|
|
57
|
+
orders: import("./orders").CustomerOrdersState;
|
|
58
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
59
59
|
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
60
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
60
61
|
thanx: import("./thanx").CustomerThanxState;
|
|
61
62
|
tpls: import("./tpls").CustomerTplsState;
|
|
62
63
|
}>;
|
|
@@ -79,7 +80,6 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
79
80
|
order: import("..").OrderState;
|
|
80
81
|
orderFulfillment: import("..").OrderFulfillmentState;
|
|
81
82
|
orderRating: import("..").OrderRatingState;
|
|
82
|
-
pointsShop: import("..").PointsShopState;
|
|
83
83
|
posts: import("..").PostsSlice;
|
|
84
84
|
qr: import("..").QrState;
|
|
85
85
|
resetPassword: import("..").ResetPasswordState;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
|
-
import { ReducerType } from '
|
|
3
|
+
import { ReducerType } from '../types';
|
|
4
|
+
import { MISSING_CUSTOMER } from '@open-tender/types';
|
|
5
|
+
import { selectToken } from './account';
|
|
4
6
|
const initialState = {
|
|
5
7
|
entities: [],
|
|
6
8
|
error: null,
|
|
@@ -12,23 +14,29 @@ export var PointsShopActionType;
|
|
|
12
14
|
PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
|
|
13
15
|
})(PointsShopActionType || (PointsShopActionType = {}));
|
|
14
16
|
export const fetchPointsShop = createAsyncThunk(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
const { api } = getState().config;
|
|
16
|
-
if (!api)
|
|
17
|
-
return;
|
|
18
17
|
try {
|
|
19
|
-
|
|
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);
|
|
20
25
|
}
|
|
21
26
|
catch (err) {
|
|
22
27
|
return rejectWithValue(err);
|
|
23
28
|
}
|
|
24
29
|
}));
|
|
25
30
|
export const exchangePointsShopReward = createAsyncThunk(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const { api } = getState().config;
|
|
27
|
-
if (!api)
|
|
28
|
-
return;
|
|
29
31
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
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);
|
|
32
40
|
}
|
|
33
41
|
catch (err) {
|
|
34
42
|
return rejectWithValue(err);
|
|
@@ -69,5 +77,5 @@ const pointsShopSlice = createSlice({
|
|
|
69
77
|
}
|
|
70
78
|
});
|
|
71
79
|
export const { resetPointsShop } = pointsShopSlice.actions;
|
|
72
|
-
export const selectPointsShop = (state) => state.pointsShop;
|
|
80
|
+
export const selectPointsShop = (state) => state.customer.pointsShop;
|
|
73
81
|
export const pointsShopReducer = pointsShopSlice.reducer;
|
package/dist/esm/slices/index.js
CHANGED
|
@@ -128,20 +128,21 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
128
128
|
confirmation: import("./confirmation").ConfirmationState;
|
|
129
129
|
customer: import("redux").CombinedState<{
|
|
130
130
|
account: import("./customer").AccountState;
|
|
131
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
132
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
133
131
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
134
132
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
133
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
134
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
135
135
|
favorites: import("./customer").CustomerFavoritesState;
|
|
136
136
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
137
137
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
138
|
-
orders: import("./customer").CustomerOrdersState;
|
|
139
|
-
order: import("./customer").CustomerOrderState;
|
|
140
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
141
138
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
142
139
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
143
|
-
|
|
140
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
141
|
+
order: import("./customer").CustomerOrderState;
|
|
142
|
+
orders: import("./customer").CustomerOrdersState;
|
|
143
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
144
144
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
145
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
145
146
|
thanx: import("./customer").CustomerThanxState;
|
|
146
147
|
tpls: import("./customer").CustomerTplsState;
|
|
147
148
|
}>;
|
|
@@ -164,7 +165,6 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
164
165
|
order: OrderState;
|
|
165
166
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
166
167
|
orderRating: import("./orderRating").OrderRatingState;
|
|
167
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
168
168
|
posts: import("./posts").PostsSlice;
|
|
169
169
|
qr: import("./qr").QrState;
|
|
170
170
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -201,20 +201,21 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
201
201
|
confirmation: import("./confirmation").ConfirmationState;
|
|
202
202
|
customer: import("redux").CombinedState<{
|
|
203
203
|
account: import("./customer").AccountState;
|
|
204
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
205
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
206
204
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
207
205
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
206
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
207
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
208
208
|
favorites: import("./customer").CustomerFavoritesState;
|
|
209
209
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
210
210
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
211
|
-
orders: import("./customer").CustomerOrdersState;
|
|
212
|
-
order: import("./customer").CustomerOrderState;
|
|
213
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
214
211
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
215
212
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
216
|
-
|
|
213
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
214
|
+
order: import("./customer").CustomerOrderState;
|
|
215
|
+
orders: import("./customer").CustomerOrdersState;
|
|
216
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
217
217
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
218
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
218
219
|
thanx: import("./customer").CustomerThanxState;
|
|
219
220
|
tpls: import("./customer").CustomerTplsState;
|
|
220
221
|
}>;
|
|
@@ -237,7 +238,6 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
237
238
|
order: OrderState;
|
|
238
239
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
239
240
|
orderRating: import("./orderRating").OrderRatingState;
|
|
240
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
241
241
|
posts: import("./posts").PostsSlice;
|
|
242
242
|
qr: import("./qr").QrState;
|
|
243
243
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -269,20 +269,21 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
269
269
|
confirmation: import("./confirmation").ConfirmationState;
|
|
270
270
|
customer: import("redux").CombinedState<{
|
|
271
271
|
account: import("./customer").AccountState;
|
|
272
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
273
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
274
272
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
275
273
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
274
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
275
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
276
276
|
favorites: import("./customer").CustomerFavoritesState;
|
|
277
277
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
278
278
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
279
|
-
orders: import("./customer").CustomerOrdersState;
|
|
280
|
-
order: import("./customer").CustomerOrderState;
|
|
281
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
282
279
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
283
280
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
284
|
-
|
|
281
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
282
|
+
order: import("./customer").CustomerOrderState;
|
|
283
|
+
orders: import("./customer").CustomerOrdersState;
|
|
284
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
285
285
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
286
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
286
287
|
thanx: import("./customer").CustomerThanxState;
|
|
287
288
|
tpls: import("./customer").CustomerTplsState;
|
|
288
289
|
}>;
|
|
@@ -305,7 +306,6 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
305
306
|
order: OrderState;
|
|
306
307
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
307
308
|
orderRating: import("./orderRating").OrderRatingState;
|
|
308
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
309
309
|
posts: import("./posts").PostsSlice;
|
|
310
310
|
qr: import("./qr").QrState;
|
|
311
311
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
|
@@ -37,20 +37,21 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
37
37
|
confirmation: import("./confirmation").ConfirmationState;
|
|
38
38
|
customer: import("redux").CombinedState<{
|
|
39
39
|
account: import("./customer").AccountState;
|
|
40
|
-
allergens: import("./customer").CustomerAllergensState;
|
|
41
|
-
addresses: import("./customer").CustomerAddressesState;
|
|
42
40
|
communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
|
|
43
41
|
creditCards: import("./customer").CustomerCreditCardsState;
|
|
42
|
+
allergens: import("./customer").CustomerAllergensState;
|
|
43
|
+
addresses: import("./customer").CustomerAddressesState;
|
|
44
44
|
favorites: import("./customer").CustomerFavoritesState;
|
|
45
45
|
fcmToken: import("./customer").CustomerFcmTokenState;
|
|
46
46
|
giftCards: import("./customer").CustomerGiftCardsState;
|
|
47
|
-
orders: import("./customer").CustomerOrdersState;
|
|
48
|
-
order: import("./customer").CustomerOrderState;
|
|
49
|
-
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
47
|
groupOrders: import("./customer").CustomerGroupOrdersState;
|
|
51
48
|
houseAccounts: import("./customer").CustomerHouseAccountsState;
|
|
52
|
-
|
|
49
|
+
loyalty: import("./customer").CustomerLoyaltyState;
|
|
50
|
+
order: import("./customer").CustomerOrderState;
|
|
51
|
+
orders: import("./customer").CustomerOrdersState;
|
|
52
|
+
pointsShop: import("./customer/pointsShop").PointsShopState;
|
|
53
53
|
qrcode: import("./customer").CustomerQRCodeState;
|
|
54
|
+
rewards: import("./customer").CustomerRewardsState;
|
|
54
55
|
thanx: import("./customer").CustomerThanxState;
|
|
55
56
|
tpls: import("./customer").CustomerTplsState;
|
|
56
57
|
}>;
|
|
@@ -73,7 +74,6 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
73
74
|
order: import("./order").OrderState;
|
|
74
75
|
orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
|
|
75
76
|
orderRating: import("./orderRating").OrderRatingState;
|
|
76
|
-
pointsShop: import("./pointsShop").PointsShopState;
|
|
77
77
|
posts: import("./posts").PostsSlice;
|
|
78
78
|
qr: import("./qr").QrState;
|
|
79
79
|
resetPassword: import("./resetPassword").ResetPasswordState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|