@jetthai/cuora 1.1.304-sl → 1.1.305-dev
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,7 +2,9 @@
|
|
|
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.
|
|
5
|
+
### [1.1.305-dev](https://github.com/jetthai/cuora-module/compare/v1.1.305...v1.1.305-dev) (2024-09-11)
|
|
6
|
+
|
|
7
|
+
### [1.1.305](https://github.com/jetthai/cuora-module/compare/v1.1.304...v1.1.305) (2024-09-09)
|
|
6
8
|
|
|
7
9
|
### [1.1.304](https://github.com/jetthai/cuora-module/compare/v1.1.303...v1.1.304) (2024-09-09)
|
|
8
10
|
|
package/package.json
CHANGED
|
@@ -7,17 +7,20 @@ export default function (request) {
|
|
|
7
7
|
id: 'instant_rebate_activity',
|
|
8
8
|
context: {
|
|
9
9
|
enableCollectButton: false,
|
|
10
|
+
estimateStartTime: null,
|
|
11
|
+
estimateEndTime: null,
|
|
10
12
|
lastCollectTime: null,
|
|
11
13
|
lastEstimateTime: null,
|
|
12
14
|
collectAvailable: false,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
cumulativeValidTurnover: null,
|
|
16
|
+
cumulativeRebateAmount: null,
|
|
17
|
+
actualRebateAmount: null,
|
|
16
18
|
rewardType: null,
|
|
19
|
+
alreadyCalculatedAfterFiveMinutes: false,
|
|
17
20
|
singleMinimumAmountReceive: null,
|
|
18
21
|
remainingCount: 0,
|
|
19
22
|
dailyRedemptionLimit: 0,
|
|
20
|
-
|
|
23
|
+
reachedAmountLimit: false,
|
|
21
24
|
activityNo: null,
|
|
22
25
|
},
|
|
23
26
|
initial: 'idle',
|
|
@@ -74,12 +77,14 @@ export default function (request) {
|
|
|
74
77
|
},
|
|
75
78
|
checking: {
|
|
76
79
|
always: [
|
|
80
|
+
{ target: 'claimAmountLimitReached', cond: 'isClaimAmountLimitReached' },
|
|
77
81
|
{ target: 'claimExhausted', cond: 'isClaimExhausted' },
|
|
78
82
|
{ target: 'insufficientAmount', cond: 'isInsufficientAmount' },
|
|
79
83
|
{ target: 'claimEnable', cond: 'isClaimEnable' },
|
|
80
84
|
{ target: 'cantEstimate' },
|
|
81
85
|
],
|
|
82
86
|
},
|
|
87
|
+
claimAmountLimitReached: {},
|
|
83
88
|
claimExhausted: {},
|
|
84
89
|
insufficientAmount: {},
|
|
85
90
|
claimEnable: {
|
|
@@ -120,75 +125,100 @@ export default function (request) {
|
|
|
120
125
|
}
|
|
121
126
|
}),
|
|
122
127
|
setInitData: assign((context, event) => {
|
|
123
|
-
const {
|
|
124
|
-
|
|
128
|
+
const {
|
|
129
|
+
enableCollectButton = false,
|
|
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
|
+
}
|
|
125
146
|
}),
|
|
126
147
|
setEstimateResult: assign((context, event) => {
|
|
127
148
|
const {
|
|
149
|
+
estimateStartTime = 0,
|
|
150
|
+
estimateEndTime = 0,
|
|
128
151
|
lastCollectTime = 0,
|
|
129
152
|
collectAvailable = false,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
153
|
+
cumulativeValidTurnover = '0',
|
|
154
|
+
cumulativeRebateAmount = '0',
|
|
155
|
+
actualRebateAmount = '0',
|
|
133
156
|
rewardType = null,
|
|
134
157
|
singleMinimumAmountReceive = 0,
|
|
135
158
|
remainingCount = 0,
|
|
136
159
|
dailyRedemptionLimit = 0,
|
|
160
|
+
reachedAmountLimit = false,
|
|
137
161
|
} = event.data
|
|
138
162
|
|
|
139
163
|
return {
|
|
164
|
+
estimateStartTime,
|
|
165
|
+
estimateEndTime,
|
|
140
166
|
lastCollectTime,
|
|
141
167
|
collectAvailable,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
168
|
+
cumulativeValidTurnover,
|
|
169
|
+
cumulativeRebateAmount,
|
|
170
|
+
actualRebateAmount,
|
|
145
171
|
rewardType,
|
|
146
172
|
singleMinimumAmountReceive,
|
|
147
173
|
remainingCount,
|
|
148
174
|
dailyRedemptionLimit,
|
|
175
|
+
reachedAmountLimit,
|
|
149
176
|
}
|
|
150
177
|
}),
|
|
151
178
|
},
|
|
152
179
|
guards: {
|
|
153
180
|
isEstimatable: (context, event) => {
|
|
154
|
-
const {
|
|
155
|
-
|
|
156
|
-
|
|
181
|
+
const { lastEstimateTime, alreadyCalculatedAfterFiveMinutes } = context
|
|
182
|
+
const currentTime = new Date().getTime() / 1000
|
|
183
|
+
const fiveMinutes = 60 * 5
|
|
184
|
+
if (alreadyCalculatedAfterFiveMinutes) {
|
|
185
|
+
return Math.floor(`${currentTime}`) - Math.floor(`${lastEstimateTime}`) > fiveMinutes
|
|
157
186
|
} else {
|
|
158
|
-
|
|
159
|
-
const currentTime = new Date().getTime() / 1000
|
|
160
|
-
|
|
161
|
-
return parseInt(`${currentTime}`) - parseInt(`${lastEstimateTime}`) > fiveMinutes
|
|
187
|
+
return true
|
|
162
188
|
}
|
|
163
189
|
},
|
|
190
|
+
isClaimAmountLimitReached: (context, event) => {
|
|
191
|
+
const { reachedAmountLimit } = context
|
|
192
|
+
return reachedAmountLimit
|
|
193
|
+
},
|
|
164
194
|
isClaimExhausted: (context, event) => {
|
|
165
195
|
const { collectAvailable, remainingCount, dailyRedemptionLimit } = context
|
|
166
196
|
return !collectAvailable && parseInt(`${remainingCount}`) === parseInt(`${dailyRedemptionLimit}`)
|
|
167
197
|
},
|
|
168
198
|
isInsufficientAmount: (context, event) => {
|
|
169
|
-
const { collectAvailable, singleMinimumAmountReceive,
|
|
170
|
-
let splitArray =
|
|
199
|
+
const { collectAvailable, singleMinimumAmountReceive, actualRebateAmount } = context
|
|
200
|
+
let splitArray = actualRebateAmount?.split(',')
|
|
171
201
|
let combindString = '0'
|
|
172
202
|
if (splitArray?.length > 0) {
|
|
173
203
|
splitArray.forEach((item) => {
|
|
174
204
|
combindString += item
|
|
175
205
|
})
|
|
176
206
|
} else {
|
|
177
|
-
combindString =
|
|
207
|
+
combindString = actualRebateAmount
|
|
178
208
|
}
|
|
179
209
|
const deformatRebateAmount = parseFloat(`${combindString}`)
|
|
180
210
|
return !collectAvailable && deformatRebateAmount < parseFloat(`${singleMinimumAmountReceive}`)
|
|
181
211
|
},
|
|
182
212
|
isClaimEnable: (context, event) => {
|
|
183
|
-
const { collectAvailable, remainingCount, dailyRedemptionLimit,
|
|
184
|
-
let splitArray =
|
|
213
|
+
const { collectAvailable, remainingCount, dailyRedemptionLimit, actualRebateAmount, singleMinimumAmountReceive } = context
|
|
214
|
+
let splitArray = actualRebateAmount?.split(',')
|
|
185
215
|
let combindString = '0'
|
|
186
216
|
if (splitArray?.length > 0) {
|
|
187
217
|
splitArray.forEach((item) => {
|
|
188
218
|
combindString += item
|
|
189
219
|
})
|
|
190
220
|
} else {
|
|
191
|
-
combindString =
|
|
221
|
+
combindString = actualRebateAmount
|
|
192
222
|
}
|
|
193
223
|
const deformatRebateAmount = parseFloat(combindString)
|
|
194
224
|
return (
|
|
@@ -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
|
},
|
|
@@ -143,21 +143,7 @@ export default function (request) {
|
|
|
143
143
|
}
|
|
144
144
|
}),
|
|
145
145
|
setSignUpEmail: assign((context, event) => {
|
|
146
|
-
const {
|
|
147
|
-
email,
|
|
148
|
-
nick_name,
|
|
149
|
-
password,
|
|
150
|
-
channel,
|
|
151
|
-
subchannel,
|
|
152
|
-
bankCode,
|
|
153
|
-
bankAccount,
|
|
154
|
-
holderName,
|
|
155
|
-
branch,
|
|
156
|
-
branchCode,
|
|
157
|
-
affiliateCode,
|
|
158
|
-
countryCode,
|
|
159
|
-
phone,
|
|
160
|
-
} = event.data
|
|
146
|
+
const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
|
|
161
147
|
return {
|
|
162
148
|
signUpData: {
|
|
163
149
|
provider: 'email',
|
|
@@ -170,8 +156,6 @@ export default function (request) {
|
|
|
170
156
|
branch,
|
|
171
157
|
branchCode,
|
|
172
158
|
affiliateCode,
|
|
173
|
-
countryCode,
|
|
174
|
-
phone,
|
|
175
159
|
},
|
|
176
160
|
channel,
|
|
177
161
|
subchannel,
|