@jetthai/cuora 1.1.302-dev-7 → 1.1.302-sl-2
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/CHANGELOG.md
CHANGED
|
@@ -2,33 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.302-
|
|
5
|
+
### [1.1.302-sl-2](https://github.com/jetthai/cuora-module/compare/v1.0.302-sl-2...v1.1.302-sl-2) (2024-09-09)
|
|
6
6
|
|
|
7
|
-
### [1.
|
|
8
|
-
|
|
9
|
-
### [1.1.302-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-4...v1.1.302-dev-5) (2024-09-11)
|
|
10
|
-
|
|
11
|
-
### [1.1.302-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.304...v1.1.302-dev-4) (2024-09-09)
|
|
12
|
-
|
|
13
|
-
### [1.1.302-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-2...v1.1.302-dev-3) (2024-09-06)
|
|
14
|
-
|
|
15
|
-
### [1.1.302-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-1...v1.1.302-dev-2) (2024-09-04)
|
|
7
|
+
### [1.0.302-sl-2](https://github.com/jetthai/cuora-module/compare/v1.0.302-sl-1...v1.0.302-sl-2) (2024-09-09)
|
|
16
8
|
|
|
17
9
|
### [1.1.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.0.302-dev-1...v1.1.302-dev-1) (2024-09-04)
|
|
18
10
|
|
|
19
11
|
### [1.0.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-dev-1) (2024-09-04)
|
|
20
12
|
|
|
21
|
-
### [1.
|
|
22
|
-
|
|
23
|
-
### [1.1.302-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-1...v1.1.302-dev-2) (2024-09-04)
|
|
24
|
-
|
|
25
|
-
### [1.1.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.0.302-dev-1...v1.1.302-dev-1) (2024-09-04)
|
|
26
|
-
|
|
27
|
-
### [1.0.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-dev-1) (2024-09-04)
|
|
28
|
-
|
|
29
|
-
### [1.1.304](https://github.com/jetthai/cuora-module/compare/v1.1.303...v1.1.304) (2024-09-09)
|
|
30
|
-
|
|
31
|
-
### [1.1.303](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.1.303) (2024-09-09)
|
|
13
|
+
### [1.0.302-sl-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-sl-1) (2024-09-09)
|
|
32
14
|
|
|
33
15
|
### [1.1.302](https://github.com/jetthai/cuora-module/compare/v1.1.301...v1.1.302) (2024-09-02)
|
|
34
16
|
|
package/package.json
CHANGED
|
@@ -7,20 +7,17 @@ export default function (request) {
|
|
|
7
7
|
id: 'instant_rebate_activity',
|
|
8
8
|
context: {
|
|
9
9
|
enableCollectButton: false,
|
|
10
|
-
estimateStartTime: null,
|
|
11
|
-
estimateEndTime: null,
|
|
12
10
|
lastCollectTime: null,
|
|
13
11
|
lastEstimateTime: null,
|
|
14
12
|
collectAvailable: false,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
settlementTime: null,
|
|
14
|
+
validTurnover: null,
|
|
15
|
+
rebateAmount: null,
|
|
18
16
|
rewardType: null,
|
|
19
|
-
alreadyCalculatedAfterFiveMinutes: false,
|
|
20
17
|
singleMinimumAmountReceive: null,
|
|
21
18
|
remainingCount: 0,
|
|
22
19
|
dailyRedemptionLimit: 0,
|
|
23
|
-
|
|
20
|
+
collectAmount: 0,
|
|
24
21
|
activityNo: null,
|
|
25
22
|
},
|
|
26
23
|
initial: 'idle',
|
|
@@ -77,14 +74,12 @@ export default function (request) {
|
|
|
77
74
|
},
|
|
78
75
|
checking: {
|
|
79
76
|
always: [
|
|
80
|
-
{ target: 'claimAmountLimitReached', cond: 'isClaimAmountLimitReached' },
|
|
81
77
|
{ target: 'claimExhausted', cond: 'isClaimExhausted' },
|
|
82
78
|
{ target: 'insufficientAmount', cond: 'isInsufficientAmount' },
|
|
83
79
|
{ target: 'claimEnable', cond: 'isClaimEnable' },
|
|
84
80
|
{ target: 'cantEstimate' },
|
|
85
81
|
],
|
|
86
82
|
},
|
|
87
|
-
claimAmountLimitReached: {},
|
|
88
83
|
claimExhausted: {},
|
|
89
84
|
insufficientAmount: {},
|
|
90
85
|
claimEnable: {
|
|
@@ -125,100 +120,75 @@ export default function (request) {
|
|
|
125
120
|
}
|
|
126
121
|
}),
|
|
127
122
|
setInitData: assign((context, event) => {
|
|
128
|
-
const {
|
|
129
|
-
|
|
130
|
-
lastCollectTime = 0,
|
|
131
|
-
lastEstimateTime = 0,
|
|
132
|
-
estimateStartTime = 0,
|
|
133
|
-
estimateEndTime = 0,
|
|
134
|
-
rewardType,
|
|
135
|
-
alreadyCalculatedAfterFiveMinutes = false,
|
|
136
|
-
} = event.data
|
|
137
|
-
return {
|
|
138
|
-
enableCollectButton,
|
|
139
|
-
lastCollectTime,
|
|
140
|
-
lastEstimateTime,
|
|
141
|
-
estimateStartTime,
|
|
142
|
-
estimateEndTime,
|
|
143
|
-
rewardType,
|
|
144
|
-
alreadyCalculatedAfterFiveMinutes,
|
|
145
|
-
}
|
|
123
|
+
const { enableCollectButton = false, lastCollectTime = 0, lastEstimateTime = 0, rewardType } = event.data
|
|
124
|
+
return { enableCollectButton, lastCollectTime, lastEstimateTime, rewardType }
|
|
146
125
|
}),
|
|
147
126
|
setEstimateResult: assign((context, event) => {
|
|
148
127
|
const {
|
|
149
|
-
estimateStartTime = 0,
|
|
150
|
-
estimateEndTime = 0,
|
|
151
128
|
lastCollectTime = 0,
|
|
152
129
|
collectAvailable = false,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
130
|
+
settlementTime = 0,
|
|
131
|
+
validTurnover = '0',
|
|
132
|
+
rebateAmount = '0',
|
|
156
133
|
rewardType = null,
|
|
157
134
|
singleMinimumAmountReceive = 0,
|
|
158
135
|
remainingCount = 0,
|
|
159
136
|
dailyRedemptionLimit = 0,
|
|
160
|
-
reachedAmountLimit = false,
|
|
161
137
|
} = event.data
|
|
162
138
|
|
|
163
139
|
return {
|
|
164
|
-
estimateStartTime,
|
|
165
|
-
estimateEndTime,
|
|
166
140
|
lastCollectTime,
|
|
167
141
|
collectAvailable,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
142
|
+
settlementTime,
|
|
143
|
+
validTurnover,
|
|
144
|
+
rebateAmount,
|
|
171
145
|
rewardType,
|
|
172
146
|
singleMinimumAmountReceive,
|
|
173
147
|
remainingCount,
|
|
174
148
|
dailyRedemptionLimit,
|
|
175
|
-
reachedAmountLimit,
|
|
176
149
|
}
|
|
177
150
|
}),
|
|
178
151
|
},
|
|
179
152
|
guards: {
|
|
180
153
|
isEstimatable: (context, event) => {
|
|
181
|
-
const {
|
|
182
|
-
|
|
183
|
-
const fiveMinutes = 60 * 5
|
|
184
|
-
if (alreadyCalculatedAfterFiveMinutes) {
|
|
185
|
-
return Math.floor(`${currentTime}`) - Math.floor(`${lastEstimateTime}`) > fiveMinutes
|
|
186
|
-
} else {
|
|
154
|
+
const { lastCollectTime, lastEstimateTime } = context
|
|
155
|
+
if (lastCollectTime === lastEstimateTime) {
|
|
187
156
|
return true
|
|
157
|
+
} else {
|
|
158
|
+
const fiveMinutes = 60 * 5
|
|
159
|
+
const currentTime = new Date().getTime() / 1000
|
|
160
|
+
|
|
161
|
+
return parseInt(`${currentTime}`) - parseInt(`${lastEstimateTime}`) > fiveMinutes
|
|
188
162
|
}
|
|
189
163
|
},
|
|
190
|
-
isClaimAmountLimitReached: (context, event) => {
|
|
191
|
-
const { reachedAmountLimit } = context
|
|
192
|
-
return reachedAmountLimit
|
|
193
|
-
},
|
|
194
164
|
isClaimExhausted: (context, event) => {
|
|
195
165
|
const { collectAvailable, remainingCount, dailyRedemptionLimit } = context
|
|
196
166
|
return !collectAvailable && parseInt(`${remainingCount}`) === parseInt(`${dailyRedemptionLimit}`)
|
|
197
167
|
},
|
|
198
168
|
isInsufficientAmount: (context, event) => {
|
|
199
|
-
const { collectAvailable, singleMinimumAmountReceive,
|
|
200
|
-
let splitArray =
|
|
169
|
+
const { collectAvailable, singleMinimumAmountReceive, rebateAmount } = context
|
|
170
|
+
let splitArray = rebateAmount?.split(',')
|
|
201
171
|
let combindString = '0'
|
|
202
172
|
if (splitArray?.length > 0) {
|
|
203
173
|
splitArray.forEach((item) => {
|
|
204
174
|
combindString += item
|
|
205
175
|
})
|
|
206
176
|
} else {
|
|
207
|
-
combindString =
|
|
177
|
+
combindString = rebateAmount
|
|
208
178
|
}
|
|
209
179
|
const deformatRebateAmount = parseFloat(`${combindString}`)
|
|
210
180
|
return !collectAvailable && deformatRebateAmount < parseFloat(`${singleMinimumAmountReceive}`)
|
|
211
181
|
},
|
|
212
182
|
isClaimEnable: (context, event) => {
|
|
213
|
-
const { collectAvailable, remainingCount, dailyRedemptionLimit,
|
|
214
|
-
let splitArray =
|
|
183
|
+
const { collectAvailable, remainingCount, dailyRedemptionLimit, rebateAmount, singleMinimumAmountReceive } = context
|
|
184
|
+
let splitArray = rebateAmount?.split(',')
|
|
215
185
|
let combindString = '0'
|
|
216
186
|
if (splitArray?.length > 0) {
|
|
217
187
|
splitArray.forEach((item) => {
|
|
218
188
|
combindString += item
|
|
219
189
|
})
|
|
220
190
|
} else {
|
|
221
|
-
combindString =
|
|
191
|
+
combindString = rebateAmount
|
|
222
192
|
}
|
|
223
193
|
const deformatRebateAmount = parseFloat(combindString)
|
|
224
194
|
return (
|
package/src/machine/auth.js
CHANGED
|
@@ -166,22 +166,10 @@ export default function (request) {
|
|
|
166
166
|
invoke: {
|
|
167
167
|
src: 'checkDeviceToken',
|
|
168
168
|
onDone: {
|
|
169
|
-
target: 'checkDeviceTokenDone',
|
|
170
|
-
},
|
|
171
|
-
onError: {
|
|
172
169
|
target: 'fetching',
|
|
173
170
|
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
checkDeviceTokenDone: {
|
|
177
|
-
invoke: {
|
|
178
|
-
src: 'fetchUserInfo',
|
|
179
|
-
onDone: {
|
|
180
|
-
target: 'pending',
|
|
181
|
-
actions: ['setUserInfo', 'extendToken'],
|
|
182
|
-
},
|
|
183
171
|
onError: {
|
|
184
|
-
target: '
|
|
172
|
+
target: 'fetching',
|
|
185
173
|
},
|
|
186
174
|
},
|
|
187
175
|
},
|
|
@@ -45,7 +45,9 @@ export default function (request) {
|
|
|
45
45
|
enable: {
|
|
46
46
|
invoke: {
|
|
47
47
|
src: 'add',
|
|
48
|
-
onDone: {
|
|
48
|
+
onDone: {
|
|
49
|
+
target: 'disable',
|
|
50
|
+
},
|
|
49
51
|
onError: {
|
|
50
52
|
actions: 'removeFromList',
|
|
51
53
|
},
|
|
@@ -60,7 +62,9 @@ export default function (request) {
|
|
|
60
62
|
enable: {
|
|
61
63
|
invoke: {
|
|
62
64
|
src: 'remove',
|
|
63
|
-
onDone: {
|
|
65
|
+
onDone: {
|
|
66
|
+
target: 'disable',
|
|
67
|
+
},
|
|
64
68
|
onError: {
|
|
65
69
|
actions: 'addToList',
|
|
66
70
|
},
|