@open-tender/cloud 0.4.15 → 0.4.16

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 (51) hide show
  1. package/dist/cjs/app/hooks.d.ts +1 -1
  2. package/dist/cjs/app/store.d.ts +3 -3
  3. package/dist/cjs/services/api.d.ts +2 -2
  4. package/dist/cjs/services/api.js +8 -8
  5. package/dist/cjs/slices/allergens.d.ts +1 -1
  6. package/dist/cjs/slices/announcements.d.ts +2 -2
  7. package/dist/cjs/slices/config.d.ts +2 -2
  8. package/dist/cjs/slices/customer/creditCards.d.ts +1 -1
  9. package/dist/cjs/slices/customer/index.d.ts +2 -2
  10. package/dist/cjs/slices/customer/index.js +3 -3
  11. package/dist/cjs/slices/customer/loyalty.d.ts +2 -2
  12. package/dist/cjs/slices/customer/order.d.ts +1 -1
  13. package/dist/cjs/slices/customer/pointsShop.d.ts +9 -9
  14. package/dist/cjs/slices/customer/pointsShop.js +7 -7
  15. package/dist/cjs/slices/customer/tpls.d.ts +3 -3
  16. package/dist/cjs/slices/customer/tplsPointsShop.d.ts +38 -0
  17. package/dist/cjs/slices/customer/tplsPointsShop.js +88 -0
  18. package/dist/cjs/slices/groupOrder.d.ts +4 -4
  19. package/dist/cjs/slices/order.d.ts +3 -3
  20. package/dist/cjs/slices/quote.d.ts +1 -1
  21. package/dist/cjs/slices/tags.d.ts +1 -1
  22. package/dist/cjs/slices/types.d.ts +1 -1
  23. package/dist/cjs/slices/types.js +1 -1
  24. package/dist/esm/app/hooks.d.ts +1 -1
  25. package/dist/esm/app/store.d.ts +3 -3
  26. package/dist/esm/services/api.d.ts +2 -2
  27. package/dist/esm/services/api.js +8 -8
  28. package/dist/esm/slices/allergens.d.ts +1 -1
  29. package/dist/esm/slices/announcements.d.ts +2 -2
  30. package/dist/esm/slices/config.d.ts +2 -2
  31. package/dist/esm/slices/customer/creditCards.d.ts +1 -1
  32. package/dist/esm/slices/customer/index.d.ts +2 -2
  33. package/dist/esm/slices/customer/index.js +3 -3
  34. package/dist/esm/slices/customer/loyalty.d.ts +2 -2
  35. package/dist/esm/slices/customer/order.d.ts +1 -1
  36. package/dist/esm/slices/customer/pointsShop.d.ts +9 -9
  37. package/dist/esm/slices/customer/pointsShop.js +7 -7
  38. package/dist/esm/slices/customer/tpls.d.ts +3 -3
  39. package/dist/esm/slices/customer/tplsPointsShop.d.ts +38 -0
  40. package/dist/esm/slices/customer/tplsPointsShop.js +84 -0
  41. package/dist/esm/slices/groupOrder.d.ts +4 -4
  42. package/dist/esm/slices/order.d.ts +3 -3
  43. package/dist/esm/slices/quote.d.ts +1 -1
  44. package/dist/esm/slices/tags.d.ts +1 -1
  45. package/dist/esm/slices/types.d.ts +1 -1
  46. package/dist/esm/slices/types.js +1 -1
  47. package/package.json +2 -2
  48. package/dist/cjs/slices/customer/pointsShopV2.d.ts +0 -38
  49. package/dist/cjs/slices/customer/pointsShopV2.js +0 -88
  50. package/dist/esm/slices/customer/pointsShopV2.d.ts +0 -38
  51. package/dist/esm/slices/customer/pointsShopV2.js +0 -84
@@ -24,7 +24,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
24
24
  order: import("..").CustomerOrderState;
25
25
  orders: import("..").CustomerOrdersState;
26
26
  pointsShop: import("..").PointsShopState;
27
- pointsShopV2: import("..").PointsShopV2State;
27
+ tplsPointsShop: import("..").TplsPointsShopState;
28
28
  qrcode: import("..").CustomerQRCodeState;
29
29
  rewards: import("..").CustomerRewardsState;
30
30
  thanx: import("..").CustomerThanxState;
@@ -23,7 +23,7 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
23
23
  order: import("../slices").CustomerOrderState;
24
24
  orders: import("../slices").CustomerOrdersState;
25
25
  pointsShop: import("../slices").PointsShopState;
26
- pointsShopV2: import("../slices").PointsShopV2State;
26
+ tplsPointsShop: import("../slices").TplsPointsShopState;
27
27
  qrcode: import("../slices").CustomerQRCodeState;
28
28
  rewards: import("../slices").CustomerRewardsState;
29
29
  thanx: import("../slices").CustomerThanxState;
@@ -87,7 +87,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
87
87
  order: import("../slices").CustomerOrderState;
88
88
  orders: import("../slices").CustomerOrdersState;
89
89
  pointsShop: import("../slices").PointsShopState;
90
- pointsShopV2: import("../slices").PointsShopV2State;
90
+ tplsPointsShop: import("../slices").TplsPointsShopState;
91
91
  qrcode: import("../slices").CustomerQRCodeState;
92
92
  rewards: import("../slices").CustomerRewardsState;
93
93
  thanx: import("../slices").CustomerThanxState;
@@ -149,7 +149,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
149
149
  order: import("../slices").CustomerOrderState;
150
150
  orders: import("../slices").CustomerOrdersState;
151
151
  pointsShop: import("../slices").PointsShopState;
152
- pointsShopV2: import("../slices").PointsShopV2State;
152
+ tplsPointsShop: import("../slices").TplsPointsShopState;
153
153
  qrcode: import("../slices").CustomerQRCodeState;
154
154
  rewards: import("../slices").CustomerRewardsState;
155
155
  thanx: import("../slices").CustomerThanxState;
@@ -119,10 +119,10 @@ declare class OpenTenderAPI {
119
119
  postVerifyAccount(verifyToken: string): Promise<unknown>;
120
120
  getCustomerQRCode(token: string): Promise<unknown>;
121
121
  getCustomerRewards(token: string): Promise<unknown>;
122
- getPointsShopV2(token: string): Promise<unknown>;
123
- postPointsShopRewardV2(token: string, rewardId: string): Promise<unknown>;
124
122
  getPointsShop(token: string): Promise<unknown>;
125
123
  postPointsShopReward(token: string, rewardId: string): Promise<unknown>;
124
+ getTplsPointsShop(token: string): Promise<unknown>;
125
+ postTplsPointsShopReward(token: string, rewardId: string): Promise<unknown>;
126
126
  getCustomerOrders(token: string, limit: number, timing: string): Promise<unknown>;
127
127
  getCustomerOrder(token: string, orderId: number): Promise<unknown>;
128
128
  getQuote(token: string | null, orderUuid: string): Promise<unknown>;
@@ -562,17 +562,17 @@ class OpenTenderAPI {
562
562
  getCustomerRewards(token) {
563
563
  return this.request(`/customer/rewards?with_related=true`, 'GET', null, null, token);
564
564
  }
565
- getPointsShopV2(token) {
566
- return this.request(`/v2/points-shop`, 'GET', null, null, token);
567
- }
568
- postPointsShopRewardV2(token, rewardId) {
569
- return this.request(`/v2/points-shop/${rewardId}/exchange`, 'POST', null, null, token);
570
- }
571
565
  getPointsShop(token) {
572
- return this.request(`/points-shop/rewards`, 'GET', null, null, token);
566
+ return this.request(`/points-shop`, 'GET', null, null, token);
573
567
  }
574
568
  postPointsShopReward(token, rewardId) {
575
- return this.request(`/points-shop/rewards/${rewardId}/exchange`, 'POST', null, null, token);
569
+ return this.request(`/points-shop/${rewardId}/exchange`, 'POST', null, null, token);
570
+ }
571
+ getTplsPointsShop(token) {
572
+ return this.request(`/tpls/points-shop`, 'GET', null, null, token);
573
+ }
574
+ postTplsPointsShopReward(token, rewardId) {
575
+ return this.request(`/tpls/points-shop/${rewardId}/exchange`, 'POST', null, null, token);
576
576
  }
577
577
  getCustomerOrders(token, limit, timing) {
578
578
  let params = [];
@@ -51,7 +51,7 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
51
51
  order: import("./customer").CustomerOrderState;
52
52
  orders: import("./customer").CustomerOrdersState;
53
53
  pointsShop: import("./customer").PointsShopState;
54
- pointsShopV2: import("./customer").PointsShopV2State;
54
+ tplsPointsShop: import("./customer").TplsPointsShopState;
55
55
  qrcode: import("./customer").CustomerQRCodeState;
56
56
  rewards: import("./customer").CustomerRewardsState;
57
57
  thanx: import("./customer").CustomerThanxState;
@@ -48,7 +48,7 @@ export declare const selectAnnouncementsPage: (page: AnnouncementPageType) => ((
48
48
  order: import("./customer").CustomerOrderState;
49
49
  orders: import("./customer").CustomerOrdersState;
50
50
  pointsShop: import("./customer").PointsShopState;
51
- pointsShopV2: import("./customer").PointsShopV2State;
51
+ tplsPointsShop: import("./customer").TplsPointsShopState;
52
52
  qrcode: import("./customer").CustomerQRCodeState;
53
53
  rewards: import("./customer").CustomerRewardsState;
54
54
  thanx: import("./customer").CustomerThanxState;
@@ -129,7 +129,7 @@ export declare const selectHasAnnouncementsPage: (page: AnnouncementPageType) =>
129
129
  order: import("./customer").CustomerOrderState;
130
130
  orders: import("./customer").CustomerOrdersState;
131
131
  pointsShop: import("./customer").PointsShopState;
132
- pointsShopV2: import("./customer").PointsShopV2State;
132
+ tplsPointsShop: import("./customer").TplsPointsShopState;
133
133
  qrcode: import("./customer").CustomerQRCodeState;
134
134
  rewards: import("./customer").CustomerRewardsState;
135
135
  thanx: import("./customer").CustomerThanxState;
@@ -111,7 +111,7 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
111
111
  order: import("./customer").CustomerOrderState;
112
112
  orders: import("./customer").CustomerOrdersState;
113
113
  pointsShop: import("./customer").PointsShopState;
114
- pointsShopV2: import("./customer").PointsShopV2State;
114
+ tplsPointsShop: import("./customer").TplsPointsShopState;
115
115
  qrcode: import("./customer").CustomerQRCodeState;
116
116
  rewards: import("./customer").CustomerRewardsState;
117
117
  thanx: import("./customer").CustomerThanxState;
@@ -192,7 +192,7 @@ export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObjec
192
192
  order: import("./customer").CustomerOrderState;
193
193
  orders: import("./customer").CustomerOrdersState;
194
194
  pointsShop: import("./customer").PointsShopState;
195
- pointsShopV2: import("./customer").PointsShopV2State;
195
+ tplsPointsShop: import("./customer").TplsPointsShopState;
196
196
  qrcode: import("./customer").CustomerQRCodeState;
197
197
  rewards: import("./customer").CustomerRewardsState;
198
198
  thanx: import("./customer").CustomerThanxState;
@@ -90,7 +90,7 @@ export declare const selectCustomerCreditCardsForPayment: ((state: import("redux
90
90
  order: import("./order").CustomerOrderState;
91
91
  orders: import("./orders").CustomerOrdersState;
92
92
  pointsShop: import("./pointsShop").PointsShopState;
93
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
93
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
94
94
  qrcode: import("./qrCode").CustomerQRCodeState;
95
95
  rewards: import("./rewards").CustomerRewardsState;
96
96
  thanx: import("./thanx").CustomerThanxState;
@@ -14,7 +14,7 @@ export declare const customerReducer: import("redux").Reducer<import("redux").Co
14
14
  order: import("./order").CustomerOrderState;
15
15
  orders: import("./orders").CustomerOrdersState;
16
16
  pointsShop: import("./pointsShop").PointsShopState;
17
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
17
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
18
18
  qrcode: import("./qrCode").CustomerQRCodeState;
19
19
  rewards: import("./rewards").CustomerRewardsState;
20
20
  thanx: import("./thanx").CustomerThanxState;
@@ -35,8 +35,8 @@ export * from './loyalty';
35
35
  export * from './order';
36
36
  export * from './orders';
37
37
  export * from './pointsShop';
38
- export * from './pointsShopV2';
39
38
  export * from './qrCode';
40
39
  export * from './rewards';
41
40
  export * from './thanx';
42
41
  export * from './tpls';
42
+ export * from './tplsPointsShop';
@@ -19,7 +19,7 @@ const loyalty_1 = require("./loyalty");
19
19
  const order_1 = require("./order");
20
20
  const orders_1 = require("./orders");
21
21
  const pointsShop_1 = require("./pointsShop");
22
- const pointsShopV2_1 = require("./pointsShopV2");
22
+ const tplsPointsShop_1 = require("./tplsPointsShop");
23
23
  const qrCode_1 = require("./qrCode");
24
24
  const rewards_1 = require("./rewards");
25
25
  const thanx_1 = require("./thanx");
@@ -40,7 +40,7 @@ exports.customerReducer = (0, redux_1.combineReducers)({
40
40
  [types_1.ReducerType.Order]: order_1.customerOrderReducer,
41
41
  [types_1.ReducerType.Orders]: orders_1.customerOrdersReducer,
42
42
  [types_1.ReducerType.PointsShop]: pointsShop_1.pointsShopReducer,
43
- [types_1.ReducerType.PointsShopV2]: pointsShopV2_1.pointsShopV2Reducer,
43
+ [types_1.ReducerType.TplsPointsShop]: tplsPointsShop_1.tplsPointsShopReducer,
44
44
  [types_1.ReducerType.QRCode]: qrCode_1.customerQRCodeReducer,
45
45
  [types_1.ReducerType.Rewards]: rewards_1.customerRewardsReducer,
46
46
  [types_1.ReducerType.Thanx]: thanx_1.customerThanxReducer,
@@ -61,8 +61,8 @@ tslib_1.__exportStar(require("./loyalty"), exports);
61
61
  tslib_1.__exportStar(require("./order"), exports);
62
62
  tslib_1.__exportStar(require("./orders"), exports);
63
63
  tslib_1.__exportStar(require("./pointsShop"), exports);
64
- tslib_1.__exportStar(require("./pointsShopV2"), exports);
65
64
  tslib_1.__exportStar(require("./qrCode"), exports);
66
65
  tslib_1.__exportStar(require("./rewards"), exports);
67
66
  tslib_1.__exportStar(require("./thanx"), exports);
68
67
  tslib_1.__exportStar(require("./tpls"), exports);
68
+ tslib_1.__exportStar(require("./tplsPointsShop"), exports);
@@ -47,7 +47,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: import("redux").Empt
47
47
  order: import("./order").CustomerOrderState;
48
48
  orders: import("./orders").CustomerOrdersState;
49
49
  pointsShop: import("./pointsShop").PointsShopState;
50
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
50
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
51
51
  qrcode: import("./qrCode").CustomerQRCodeState;
52
52
  rewards: import("./rewards").CustomerRewardsState;
53
53
  thanx: import("./thanx").CustomerThanxState;
@@ -126,7 +126,7 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
126
126
  order: import("./order").CustomerOrderState;
127
127
  orders: import("./orders").CustomerOrdersState;
128
128
  pointsShop: import("./pointsShop").PointsShopState;
129
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
129
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
130
130
  qrcode: import("./qrCode").CustomerQRCodeState;
131
131
  rewards: import("./rewards").CustomerRewardsState;
132
132
  thanx: import("./thanx").CustomerThanxState;
@@ -57,7 +57,7 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
57
57
  order: CustomerOrderState;
58
58
  orders: import("./orders").CustomerOrdersState;
59
59
  pointsShop: import("./pointsShop").PointsShopState;
60
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
60
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
61
61
  qrcode: import("./qrCode").CustomerQRCodeState;
62
62
  rewards: import("./rewards").CustomerRewardsState;
63
63
  thanx: import("./thanx").CustomerThanxState;
@@ -1,16 +1,16 @@
1
1
  import { AppState } from '../../app';
2
- import { RequestError, RequestStatus, TPLSPointsShopReward, TPLSPointsShopRewards } from '@open-tender/types';
2
+ import { Discount, Discounts, RequestError, RequestStatus } from '@open-tender/types';
3
3
  export interface PointsShopState {
4
- entities: TPLSPointsShopRewards;
5
- data: TPLSPointsShopReward | null;
4
+ entities: Discounts;
5
+ data: Discount | null;
6
6
  error: RequestError;
7
7
  loading: RequestStatus;
8
8
  }
9
9
  export declare enum PointsShopActionType {
10
- FetchPointsShop = "pointsShop/fetchPointsShop",
11
- ExchangePointsShopReward = "pointsShop/exchangePointsShopReward"
10
+ FetchPointsShop = "pointsShopV2/fetchPointsShop",
11
+ ExchangePointsShopReward = "pointsShopV2/exchangePointsShopReward"
12
12
  }
13
- export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, void, {
13
+ export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<Discounts, void, {
14
14
  state: AppState;
15
15
  rejectValue: RequestError;
16
16
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -20,9 +20,9 @@ export declare const fetchPointsShop: import("@reduxjs/toolkit").AsyncThunk<TPLS
20
20
  fulfilledMeta?: unknown;
21
21
  rejectedMeta?: unknown;
22
22
  }>;
23
- export declare const exchangePointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
24
- data: TPLSPointsShopReward;
25
- entities: TPLSPointsShopRewards;
23
+ export declare const exchangePointsShopRewardV2: import("@reduxjs/toolkit").AsyncThunk<{
24
+ data: Discount;
25
+ entities: Discounts;
26
26
  }, string, {
27
27
  state: AppState;
28
28
  rejectValue: RequestError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.exchangePointsShopReward = exports.fetchPointsShop = exports.PointsShopActionType = void 0;
3
+ exports.pointsShopReducer = exports.selectPointsShop = exports.resetPointsShop = exports.exchangePointsShopRewardV2 = exports.fetchPointsShop = exports.PointsShopActionType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const types_1 = require("../types");
@@ -14,8 +14,8 @@ const initialState = {
14
14
  };
15
15
  var PointsShopActionType;
16
16
  (function (PointsShopActionType) {
17
- PointsShopActionType["FetchPointsShop"] = "pointsShop/fetchPointsShop";
18
- PointsShopActionType["ExchangePointsShopReward"] = "pointsShop/exchangePointsShopReward";
17
+ PointsShopActionType["FetchPointsShop"] = "pointsShopV2/fetchPointsShop";
18
+ PointsShopActionType["ExchangePointsShopReward"] = "pointsShopV2/exchangePointsShopReward";
19
19
  })(PointsShopActionType = exports.PointsShopActionType || (exports.PointsShopActionType = {}));
20
20
  exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.FetchPointsShop, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
21
21
  try {
@@ -31,7 +31,7 @@ exports.fetchPointsShop = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.F
31
31
  return rejectWithValue(err);
32
32
  }
33
33
  }));
34
- exports.exchangePointsShopReward = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
34
+ exports.exchangePointsShopRewardV2 = (0, toolkit_1.createAsyncThunk)(PointsShopActionType.ExchangePointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
35
  try {
36
36
  const { api } = getState().config;
37
37
  if (!api)
@@ -67,16 +67,16 @@ const pointsShopSlice = (0, toolkit_1.createSlice)({
67
67
  state.error = action.payload;
68
68
  state.loading = 'idle';
69
69
  })
70
- .addCase(exports.exchangePointsShopReward.fulfilled, (state, action) => {
70
+ .addCase(exports.exchangePointsShopRewardV2.fulfilled, (state, action) => {
71
71
  state.entities = action.payload.entities;
72
72
  state.data = action.payload.data;
73
73
  state.loading = 'idle';
74
74
  state.error = null;
75
75
  })
76
- .addCase(exports.exchangePointsShopReward.pending, state => {
76
+ .addCase(exports.exchangePointsShopRewardV2.pending, state => {
77
77
  state.loading = 'pending';
78
78
  })
79
- .addCase(exports.exchangePointsShopReward.rejected, (state, action) => {
79
+ .addCase(exports.exchangePointsShopRewardV2.rejected, (state, action) => {
80
80
  state.error = action.payload;
81
81
  state.loading = 'idle';
82
82
  });
@@ -55,7 +55,7 @@ export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObj
55
55
  order: import("./order").CustomerOrderState;
56
56
  orders: import("./orders").CustomerOrdersState;
57
57
  pointsShop: import("./pointsShop").PointsShopState;
58
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
58
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
59
59
  qrcode: import("./qrCode").CustomerQRCodeState;
60
60
  rewards: import("./rewards").CustomerRewardsState;
61
61
  thanx: import("./thanx").CustomerThanxState;
@@ -122,7 +122,7 @@ export declare const selectCustomerTplsRewards: ((state: import("redux").EmptyOb
122
122
  order: import("./order").CustomerOrderState;
123
123
  orders: import("./orders").CustomerOrdersState;
124
124
  pointsShop: import("./pointsShop").PointsShopState;
125
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
125
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
126
126
  qrcode: import("./qrCode").CustomerQRCodeState;
127
127
  rewards: import("./rewards").CustomerRewardsState;
128
128
  thanx: import("./thanx").CustomerThanxState;
@@ -189,7 +189,7 @@ export declare const selectCustomerTplsProgress: ((state: import("redux").EmptyO
189
189
  order: import("./order").CustomerOrderState;
190
190
  orders: import("./orders").CustomerOrdersState;
191
191
  pointsShop: import("./pointsShop").PointsShopState;
192
- pointsShopV2: import("./pointsShopV2").PointsShopV2State;
192
+ tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
193
193
  qrcode: import("./qrCode").CustomerQRCodeState;
194
194
  rewards: import("./rewards").CustomerRewardsState;
195
195
  thanx: import("./thanx").CustomerThanxState;
@@ -0,0 +1,38 @@
1
+ import { AppState } from '../../app';
2
+ import { RequestError, RequestStatus, TPLSPointsShopReward, TPLSPointsShopRewards } from '@open-tender/types';
3
+ export interface TplsPointsShopState {
4
+ entities: TPLSPointsShopRewards;
5
+ data: TPLSPointsShopReward | null;
6
+ error: RequestError;
7
+ loading: RequestStatus;
8
+ }
9
+ export declare enum TplsPointsShopActionType {
10
+ FetchTplsPointsShop = "pointsShop/fetchTplsPointsShop",
11
+ ExchangeTplsPointsShopReward = "pointsShop/exchangeTplsPointsShopReward"
12
+ }
13
+ export declare const fetchTplsPointsShop: import("@reduxjs/toolkit").AsyncThunk<TPLSPointsShopRewards, void, {
14
+ state: AppState;
15
+ rejectValue: RequestError;
16
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
17
+ extra?: unknown;
18
+ serializedErrorType?: unknown;
19
+ pendingMeta?: unknown;
20
+ fulfilledMeta?: unknown;
21
+ rejectedMeta?: unknown;
22
+ }>;
23
+ export declare const exchangeTplsPointsShopReward: import("@reduxjs/toolkit").AsyncThunk<{
24
+ data: TPLSPointsShopReward;
25
+ entities: TPLSPointsShopRewards;
26
+ }, string, {
27
+ state: AppState;
28
+ rejectValue: RequestError;
29
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
30
+ extra?: unknown;
31
+ serializedErrorType?: unknown;
32
+ pendingMeta?: unknown;
33
+ fulfilledMeta?: unknown;
34
+ rejectedMeta?: unknown;
35
+ }>;
36
+ export declare const resetTplsPointsShop: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tplsPointsShop/resetTplsPointsShop">;
37
+ export declare const selectTplsPointsShop: (state: AppState) => TplsPointsShopState;
38
+ export declare const tplsPointsShopReducer: import("redux").Reducer<TplsPointsShopState, import("redux").AnyAction>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tplsPointsShopReducer = exports.selectTplsPointsShop = exports.resetTplsPointsShop = exports.exchangeTplsPointsShopReward = exports.fetchTplsPointsShop = exports.TplsPointsShopActionType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const types_1 = require("../types");
7
+ const types_2 = require("@open-tender/types");
8
+ const account_1 = require("./account");
9
+ const initialState = {
10
+ entities: [],
11
+ data: null,
12
+ error: null,
13
+ loading: 'idle'
14
+ };
15
+ var TplsPointsShopActionType;
16
+ (function (TplsPointsShopActionType) {
17
+ TplsPointsShopActionType["FetchTplsPointsShop"] = "pointsShop/fetchTplsPointsShop";
18
+ TplsPointsShopActionType["ExchangeTplsPointsShopReward"] = "pointsShop/exchangeTplsPointsShopReward";
19
+ })(TplsPointsShopActionType = exports.TplsPointsShopActionType || (exports.TplsPointsShopActionType = {}));
20
+ exports.fetchTplsPointsShop = (0, toolkit_1.createAsyncThunk)(TplsPointsShopActionType.FetchTplsPointsShop, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
21
+ try {
22
+ const { api } = getState().config;
23
+ if (!api)
24
+ return;
25
+ const token = (0, account_1.selectToken)(getState());
26
+ if (!token)
27
+ throw new Error(types_2.MISSING_CUSTOMER);
28
+ return yield api.getTplsPointsShop(token);
29
+ }
30
+ catch (err) {
31
+ return rejectWithValue(err);
32
+ }
33
+ }));
34
+ exports.exchangeTplsPointsShopReward = (0, toolkit_1.createAsyncThunk)(TplsPointsShopActionType.ExchangeTplsPointsShopReward, (rewardId, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
+ try {
36
+ const { api } = getState().config;
37
+ if (!api)
38
+ return { data: null, entities: [] };
39
+ const token = (0, account_1.selectToken)(getState());
40
+ if (!token)
41
+ throw new Error(types_2.MISSING_CUSTOMER);
42
+ const data = yield api.postTplsPointsShopReward(token, rewardId);
43
+ const entities = yield api.getTplsPointsShop(token);
44
+ return { data, entities };
45
+ }
46
+ catch (err) {
47
+ return rejectWithValue(err);
48
+ }
49
+ }));
50
+ const tplsPointsShopSlice = (0, toolkit_1.createSlice)({
51
+ name: types_1.ReducerType.TplsPointsShop,
52
+ initialState,
53
+ reducers: {
54
+ resetTplsPointsShop: () => initialState
55
+ },
56
+ extraReducers: builder => {
57
+ builder
58
+ .addCase(exports.fetchTplsPointsShop.fulfilled, (state, action) => {
59
+ state.entities = action.payload;
60
+ state.loading = 'idle';
61
+ state.error = null;
62
+ })
63
+ .addCase(exports.fetchTplsPointsShop.pending, state => {
64
+ state.loading = 'pending';
65
+ })
66
+ .addCase(exports.fetchTplsPointsShop.rejected, (state, action) => {
67
+ state.error = action.payload;
68
+ state.loading = 'idle';
69
+ })
70
+ .addCase(exports.exchangeTplsPointsShopReward.fulfilled, (state, action) => {
71
+ state.entities = action.payload.entities;
72
+ state.data = action.payload.data;
73
+ state.loading = 'idle';
74
+ state.error = null;
75
+ })
76
+ .addCase(exports.exchangeTplsPointsShopReward.pending, state => {
77
+ state.loading = 'pending';
78
+ })
79
+ .addCase(exports.exchangeTplsPointsShopReward.rejected, (state, action) => {
80
+ state.error = action.payload;
81
+ state.loading = 'idle';
82
+ });
83
+ }
84
+ });
85
+ exports.resetTplsPointsShop = tplsPointsShopSlice.actions.resetTplsPointsShop;
86
+ const selectTplsPointsShop = (state) => state.customer.tplsPointsShop;
87
+ exports.selectTplsPointsShop = selectTplsPointsShop;
88
+ exports.tplsPointsShopReducer = tplsPointsShopSlice.reducer;
@@ -130,7 +130,7 @@ export declare const selectSpendingLimit: ((state: import("redux").EmptyObject &
130
130
  order: import("./customer").CustomerOrderState;
131
131
  orders: import("./customer").CustomerOrdersState;
132
132
  pointsShop: import("./customer").PointsShopState;
133
- pointsShopV2: import("./customer").PointsShopV2State;
133
+ tplsPointsShop: import("./customer").TplsPointsShopState;
134
134
  qrcode: import("./customer").CustomerQRCodeState;
135
135
  rewards: import("./customer").CustomerRewardsState;
136
136
  thanx: import("./customer").CustomerThanxState;
@@ -200,7 +200,7 @@ export declare const selectGroupOrderClosed: ((state: import("redux").EmptyObjec
200
200
  order: import("./customer").CustomerOrderState;
201
201
  orders: import("./customer").CustomerOrdersState;
202
202
  pointsShop: import("./customer").PointsShopState;
203
- pointsShopV2: import("./customer").PointsShopV2State;
203
+ tplsPointsShop: import("./customer").TplsPointsShopState;
204
204
  qrcode: import("./customer").CustomerQRCodeState;
205
205
  rewards: import("./customer").CustomerRewardsState;
206
206
  thanx: import("./customer").CustomerThanxState;
@@ -272,7 +272,7 @@ export declare const selectGroupOrderTests: ((state: import("redux").EmptyObject
272
272
  order: import("./customer").CustomerOrderState;
273
273
  orders: import("./customer").CustomerOrdersState;
274
274
  pointsShop: import("./customer").PointsShopState;
275
- pointsShopV2: import("./customer").PointsShopV2State;
275
+ tplsPointsShop: import("./customer").TplsPointsShopState;
276
276
  qrcode: import("./customer").CustomerQRCodeState;
277
277
  rewards: import("./customer").CustomerRewardsState;
278
278
  thanx: import("./customer").CustomerThanxState;
@@ -353,7 +353,7 @@ export declare const selectGroupOrderPrepTimes: ((state: import("redux").EmptyOb
353
353
  order: import("./customer").CustomerOrderState;
354
354
  orders: import("./customer").CustomerOrdersState;
355
355
  pointsShop: import("./customer").PointsShopState;
356
- pointsShopV2: import("./customer").PointsShopV2State;
356
+ tplsPointsShop: import("./customer").TplsPointsShopState;
357
357
  qrcode: import("./customer").CustomerQRCodeState;
358
358
  rewards: import("./customer").CustomerRewardsState;
359
359
  thanx: import("./customer").CustomerThanxState;
@@ -152,7 +152,7 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
152
152
  order: import("./customer").CustomerOrderState;
153
153
  orders: import("./customer").CustomerOrdersState;
154
154
  pointsShop: import("./customer").PointsShopState;
155
- pointsShopV2: import("./customer").PointsShopV2State;
155
+ tplsPointsShop: import("./customer").TplsPointsShopState;
156
156
  qrcode: import("./customer").CustomerQRCodeState;
157
157
  rewards: import("./customer").CustomerRewardsState;
158
158
  thanx: import("./customer").CustomerThanxState;
@@ -230,7 +230,7 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
230
230
  order: import("./customer").CustomerOrderState;
231
231
  orders: import("./customer").CustomerOrdersState;
232
232
  pointsShop: import("./customer").PointsShopState;
233
- pointsShopV2: import("./customer").PointsShopV2State;
233
+ tplsPointsShop: import("./customer").TplsPointsShopState;
234
234
  qrcode: import("./customer").CustomerQRCodeState;
235
235
  rewards: import("./customer").CustomerRewardsState;
236
236
  thanx: import("./customer").CustomerThanxState;
@@ -303,7 +303,7 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
303
303
  order: import("./customer").CustomerOrderState;
304
304
  orders: import("./customer").CustomerOrdersState;
305
305
  pointsShop: import("./customer").PointsShopState;
306
- pointsShopV2: import("./customer").PointsShopV2State;
306
+ tplsPointsShop: import("./customer").TplsPointsShopState;
307
307
  qrcode: import("./customer").CustomerQRCodeState;
308
308
  rewards: import("./customer").CustomerRewardsState;
309
309
  thanx: import("./customer").CustomerThanxState;
@@ -43,7 +43,7 @@ export declare const selectQuote: ((state: import("redux").EmptyObject & {
43
43
  order: import("./customer").CustomerOrderState;
44
44
  orders: import("./customer").CustomerOrdersState;
45
45
  pointsShop: import("./customer").PointsShopState;
46
- pointsShopV2: import("./customer").PointsShopV2State;
46
+ tplsPointsShop: import("./customer").TplsPointsShopState;
47
47
  qrcode: import("./customer").CustomerQRCodeState;
48
48
  rewards: import("./customer").CustomerRewardsState;
49
49
  thanx: import("./customer").CustomerThanxState;
@@ -51,7 +51,7 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
51
51
  order: import("./customer").CustomerOrderState;
52
52
  orders: import("./customer").CustomerOrdersState;
53
53
  pointsShop: import("./customer").PointsShopState;
54
- pointsShopV2: import("./customer").PointsShopV2State;
54
+ tplsPointsShop: import("./customer").TplsPointsShopState;
55
55
  qrcode: import("./customer").CustomerQRCodeState;
56
56
  rewards: import("./customer").CustomerRewardsState;
57
57
  thanx: import("./customer").CustomerThanxState;
@@ -40,7 +40,6 @@ export declare enum ReducerType {
40
40
  Orders = "orders",
41
41
  Posts = "posts",
42
42
  PointsShop = "pointsShop",
43
- PointsShopV2 = "pointsShopV2",
44
43
  PushNotifications = "pushNotifications",
45
44
  Qr = "qr",
46
45
  QRCode = "qrcode",
@@ -56,6 +55,7 @@ export declare enum ReducerType {
56
55
  Terms = "terms",
57
56
  Thanx = "thanx",
58
57
  Tpls = "tpls",
58
+ TplsPointsShop = "tplsPointsShop",
59
59
  ValidTimes = "validTimes",
60
60
  VerifyAccount = "verifyAccount"
61
61
  }
@@ -44,7 +44,6 @@ var ReducerType;
44
44
  ReducerType["Orders"] = "orders";
45
45
  ReducerType["Posts"] = "posts";
46
46
  ReducerType["PointsShop"] = "pointsShop";
47
- ReducerType["PointsShopV2"] = "pointsShopV2";
48
47
  ReducerType["PushNotifications"] = "pushNotifications";
49
48
  ReducerType["Qr"] = "qr";
50
49
  ReducerType["QRCode"] = "qrcode";
@@ -60,6 +59,7 @@ var ReducerType;
60
59
  ReducerType["Terms"] = "terms";
61
60
  ReducerType["Thanx"] = "thanx";
62
61
  ReducerType["Tpls"] = "tpls";
62
+ ReducerType["TplsPointsShop"] = "tplsPointsShop";
63
63
  ReducerType["ValidTimes"] = "validTimes";
64
64
  ReducerType["VerifyAccount"] = "verifyAccount";
65
65
  })(ReducerType = exports.ReducerType || (exports.ReducerType = {}));
@@ -24,7 +24,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
24
24
  order: import("..").CustomerOrderState;
25
25
  orders: import("..").CustomerOrdersState;
26
26
  pointsShop: import("..").PointsShopState;
27
- pointsShopV2: import("..").PointsShopV2State;
27
+ tplsPointsShop: import("..").TplsPointsShopState;
28
28
  qrcode: import("..").CustomerQRCodeState;
29
29
  rewards: import("..").CustomerRewardsState;
30
30
  thanx: import("..").CustomerThanxState;
@@ -23,7 +23,7 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
23
23
  order: import("../slices").CustomerOrderState;
24
24
  orders: import("../slices").CustomerOrdersState;
25
25
  pointsShop: import("../slices").PointsShopState;
26
- pointsShopV2: import("../slices").PointsShopV2State;
26
+ tplsPointsShop: import("../slices").TplsPointsShopState;
27
27
  qrcode: import("../slices").CustomerQRCodeState;
28
28
  rewards: import("../slices").CustomerRewardsState;
29
29
  thanx: import("../slices").CustomerThanxState;
@@ -87,7 +87,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
87
87
  order: import("../slices").CustomerOrderState;
88
88
  orders: import("../slices").CustomerOrdersState;
89
89
  pointsShop: import("../slices").PointsShopState;
90
- pointsShopV2: import("../slices").PointsShopV2State;
90
+ tplsPointsShop: import("../slices").TplsPointsShopState;
91
91
  qrcode: import("../slices").CustomerQRCodeState;
92
92
  rewards: import("../slices").CustomerRewardsState;
93
93
  thanx: import("../slices").CustomerThanxState;
@@ -149,7 +149,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
149
149
  order: import("../slices").CustomerOrderState;
150
150
  orders: import("../slices").CustomerOrdersState;
151
151
  pointsShop: import("../slices").PointsShopState;
152
- pointsShopV2: import("../slices").PointsShopV2State;
152
+ tplsPointsShop: import("../slices").TplsPointsShopState;
153
153
  qrcode: import("../slices").CustomerQRCodeState;
154
154
  rewards: import("../slices").CustomerRewardsState;
155
155
  thanx: import("../slices").CustomerThanxState;
@@ -119,10 +119,10 @@ declare class OpenTenderAPI {
119
119
  postVerifyAccount(verifyToken: string): Promise<unknown>;
120
120
  getCustomerQRCode(token: string): Promise<unknown>;
121
121
  getCustomerRewards(token: string): Promise<unknown>;
122
- getPointsShopV2(token: string): Promise<unknown>;
123
- postPointsShopRewardV2(token: string, rewardId: string): Promise<unknown>;
124
122
  getPointsShop(token: string): Promise<unknown>;
125
123
  postPointsShopReward(token: string, rewardId: string): Promise<unknown>;
124
+ getTplsPointsShop(token: string): Promise<unknown>;
125
+ postTplsPointsShopReward(token: string, rewardId: string): Promise<unknown>;
126
126
  getCustomerOrders(token: string, limit: number, timing: string): Promise<unknown>;
127
127
  getCustomerOrder(token: string, orderId: number): Promise<unknown>;
128
128
  getQuote(token: string | null, orderUuid: string): Promise<unknown>;