@jetthai/cuora 1.1.25 → 1.1.27
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 +8 -4
- package/dist/bundle.mjs +39 -10
- package/package.json +1 -1
- package/src/machine/deposit/loadcard_vn.js +20 -3
- package/src/machine/promotions.js +18 -6
- package/src/machine/reward.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.27](https://github.com/jetthai/cuora-module/compare/v1.1.26...v1.1.27) (2023-01-05)
|
|
6
|
+
|
|
7
|
+
### [1.1.15-1](https://github.com/jetthai/cuora-module/compare/v1.1.22...v1.1.15-1) (2023-01-03)
|
|
8
|
+
|
|
9
|
+
### [1.1.26](https://github.com/jetthai/cuora-module/compare/v1.1.25...v1.1.26) (2023-01-04)
|
|
10
|
+
|
|
5
11
|
### [1.1.25](https://github.com/jetthai/cuora-module/compare/v1.1.24...v1.1.25) (2023-01-04)
|
|
6
12
|
|
|
7
13
|
### [1.1.24](https://github.com/jetthai/cuora-module/compare/v1.1.23...v1.1.24) (2023-01-04)
|
|
@@ -26,6 +32,8 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
26
32
|
|
|
27
33
|
### [1.1.14](https://github.com/jetthai/cuora-module/compare/v1.1.13...v1.1.14) (2022-12-24)
|
|
28
34
|
|
|
35
|
+
### [1.1.15-1](https://github.com/jetthai/cuora-module/compare/v1.1.15...v1.1.15-1) (2023-01-03)
|
|
36
|
+
|
|
29
37
|
### [1.1.15](https://github.com/jetthai/cuora-module/compare/v1.1.14...v1.1.15) (2022-12-24)
|
|
30
38
|
|
|
31
39
|
### [1.1.14](https://github.com/jetthai/cuora-module/compare/v1.1.13...v1.1.14) (2022-12-24)
|
|
@@ -78,10 +86,6 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
78
86
|
|
|
79
87
|
## [1.1.0](https://github.com/jetthai/cuora-module/compare/v1.0.205...v1.1.0) (2022-11-30)
|
|
80
88
|
|
|
81
|
-
### Features
|
|
82
|
-
|
|
83
|
-
- add context.base for 3rdParty redirection ([dba1a60](https://github.com/jetthai/cuora-module/commit/dba1a60881f78444a2e83b2ad8dcde2ffcadb43b))
|
|
84
|
-
|
|
85
89
|
### [1.0.205](https://github.com/jetthai/cuora-module/compare/v1.0.204...v1.0.205) (2022-11-23)
|
|
86
90
|
|
|
87
91
|
### [1.0.204](https://github.com/jetthai/cuora-module/compare/v1.0.203...v1.0.204) (2022-11-21)
|
package/dist/bundle.mjs
CHANGED
|
@@ -13186,7 +13186,7 @@ function reward (request) {
|
|
|
13186
13186
|
},
|
|
13187
13187
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
13188
13188
|
const { receiveNo } = context;
|
|
13189
|
-
const
|
|
13189
|
+
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }));
|
|
13190
13190
|
return data
|
|
13191
13191
|
},
|
|
13192
13192
|
receiveReward: async (context, event) => {
|
|
@@ -16528,6 +16528,7 @@ function loadcard_vn (request) {
|
|
|
16528
16528
|
currentCategory: 'loadcard',
|
|
16529
16529
|
currentMethod: null,
|
|
16530
16530
|
currentPayment: null,
|
|
16531
|
+
result: null,
|
|
16531
16532
|
},
|
|
16532
16533
|
states: {
|
|
16533
16534
|
loading: {
|
|
@@ -16716,9 +16717,15 @@ function loadcard_vn (request) {
|
|
|
16716
16717
|
target: 'debouncing',
|
|
16717
16718
|
actions: 'setAmount',
|
|
16718
16719
|
},
|
|
16719
|
-
CONFIRM:
|
|
16720
|
-
|
|
16721
|
-
|
|
16720
|
+
CONFIRM: [
|
|
16721
|
+
{
|
|
16722
|
+
target: 'submitting',
|
|
16723
|
+
cond: 'jumpLinkEnable',
|
|
16724
|
+
},
|
|
16725
|
+
{
|
|
16726
|
+
target: 'cardInfo',
|
|
16727
|
+
},
|
|
16728
|
+
],
|
|
16722
16729
|
BACK: {
|
|
16723
16730
|
target: 'defaultMode',
|
|
16724
16731
|
},
|
|
@@ -16751,6 +16758,7 @@ function loadcard_vn (request) {
|
|
|
16751
16758
|
src: 'submitDeposit',
|
|
16752
16759
|
onDone: {
|
|
16753
16760
|
target: 'submitted',
|
|
16761
|
+
actions: 'setResult',
|
|
16754
16762
|
},
|
|
16755
16763
|
onError: {
|
|
16756
16764
|
target: 'cardInfo',
|
|
@@ -16823,6 +16831,11 @@ function loadcard_vn (request) {
|
|
|
16823
16831
|
calculation: null,
|
|
16824
16832
|
}
|
|
16825
16833
|
}),
|
|
16834
|
+
setResult: assign((context, event) => {
|
|
16835
|
+
return {
|
|
16836
|
+
result: event.data,
|
|
16837
|
+
}
|
|
16838
|
+
}),
|
|
16826
16839
|
},
|
|
16827
16840
|
guards: {
|
|
16828
16841
|
isPromotionApplyMode: (context, event) => {
|
|
@@ -16832,6 +16845,10 @@ function loadcard_vn (request) {
|
|
|
16832
16845
|
const { cardNumber, serialNumber } = context;
|
|
16833
16846
|
return cardNumber && serialNumber
|
|
16834
16847
|
},
|
|
16848
|
+
jumpLinkEnable: (context, event) => {
|
|
16849
|
+
const { selectedCard } = context;
|
|
16850
|
+
return selectedCard.jumpLinkEnable === 1
|
|
16851
|
+
},
|
|
16835
16852
|
},
|
|
16836
16853
|
services: {
|
|
16837
16854
|
fetchInitData: async (context, event) => {
|
|
@@ -20344,6 +20361,7 @@ function promotions (request) {
|
|
|
20344
20361
|
context: {
|
|
20345
20362
|
noBonus: {},
|
|
20346
20363
|
userInfo: {},
|
|
20364
|
+
siteConfig: {},
|
|
20347
20365
|
withdrawRule: {},
|
|
20348
20366
|
promotionsList: [],
|
|
20349
20367
|
selectedPromo: {},
|
|
@@ -20351,10 +20369,10 @@ function promotions (request) {
|
|
|
20351
20369
|
states: {
|
|
20352
20370
|
loading: {
|
|
20353
20371
|
invoke: {
|
|
20354
|
-
src: '
|
|
20372
|
+
src: 'fetchPromotionsList',
|
|
20355
20373
|
onDone: {
|
|
20356
20374
|
target: 'loaded',
|
|
20357
|
-
actions: '
|
|
20375
|
+
actions: 'setPromotionsList',
|
|
20358
20376
|
},
|
|
20359
20377
|
onError: {
|
|
20360
20378
|
target: 'fail',
|
|
@@ -20414,10 +20432,21 @@ function promotions (request) {
|
|
|
20414
20432
|
},
|
|
20415
20433
|
{
|
|
20416
20434
|
actions: {
|
|
20417
|
-
|
|
20418
|
-
const { noBonus, userInfo } = context;
|
|
20435
|
+
setPromotionsList: assign((context, event) => {
|
|
20419
20436
|
const promotionsList = JSON.parse(JSON.stringify(event.data));
|
|
20420
|
-
|
|
20437
|
+
const { noBonus, userInfo, siteConfig } = context;
|
|
20438
|
+
const { withdraw_rule, balance } = userInfo;
|
|
20439
|
+
const { currencyConversionLimit } = siteConfig;
|
|
20440
|
+
const balanceAvailable = parseFloat(`${balance}`) < parseFloat(`${currencyConversionLimit}`);
|
|
20441
|
+
const isFreeLimitRule = withdraw_rule.includes('FREE_LIMIT');
|
|
20442
|
+
const includesDefaultRule = withdraw_rule === 'DEFAULT' || withdraw_rule.includes('FREE_DEFAULT');
|
|
20443
|
+
|
|
20444
|
+
if (!balanceAvailable && includesDefaultRule) {
|
|
20445
|
+
promotionsList.map((item) => {
|
|
20446
|
+
item.attendEnable = !item.withdrawRule.includes('FREE_LIMIT');
|
|
20447
|
+
return item
|
|
20448
|
+
});
|
|
20449
|
+
} else if (!balanceAvailable && isFreeLimitRule) {
|
|
20421
20450
|
promotionsList.map((item) => {
|
|
20422
20451
|
item.attendEnable = false;
|
|
20423
20452
|
return item
|
|
@@ -20461,7 +20490,7 @@ function promotions (request) {
|
|
|
20461
20490
|
},
|
|
20462
20491
|
},
|
|
20463
20492
|
services: {
|
|
20464
|
-
|
|
20493
|
+
fetchPromotionsList: async (context, event) => {
|
|
20465
20494
|
return await request.send(payment.getPromotionsList())
|
|
20466
20495
|
},
|
|
20467
20496
|
fetchWithdrawRulePreview: async (context, event) => {
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ export default function (request) {
|
|
|
24
24
|
currentCategory: 'loadcard',
|
|
25
25
|
currentMethod: null,
|
|
26
26
|
currentPayment: null,
|
|
27
|
+
result: null,
|
|
27
28
|
},
|
|
28
29
|
states: {
|
|
29
30
|
loading: {
|
|
@@ -212,9 +213,15 @@ export default function (request) {
|
|
|
212
213
|
target: 'debouncing',
|
|
213
214
|
actions: 'setAmount',
|
|
214
215
|
},
|
|
215
|
-
CONFIRM:
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
CONFIRM: [
|
|
217
|
+
{
|
|
218
|
+
target: 'submitting',
|
|
219
|
+
cond: 'jumpLinkEnable',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
target: 'cardInfo',
|
|
223
|
+
},
|
|
224
|
+
],
|
|
218
225
|
BACK: {
|
|
219
226
|
target: 'defaultMode',
|
|
220
227
|
},
|
|
@@ -247,6 +254,7 @@ export default function (request) {
|
|
|
247
254
|
src: 'submitDeposit',
|
|
248
255
|
onDone: {
|
|
249
256
|
target: 'submitted',
|
|
257
|
+
actions: 'setResult',
|
|
250
258
|
},
|
|
251
259
|
onError: {
|
|
252
260
|
target: 'cardInfo',
|
|
@@ -319,6 +327,11 @@ export default function (request) {
|
|
|
319
327
|
calculation: null,
|
|
320
328
|
}
|
|
321
329
|
}),
|
|
330
|
+
setResult: assign((context, event) => {
|
|
331
|
+
return {
|
|
332
|
+
result: event.data,
|
|
333
|
+
}
|
|
334
|
+
}),
|
|
322
335
|
},
|
|
323
336
|
guards: {
|
|
324
337
|
isPromotionApplyMode: (context, event) => {
|
|
@@ -328,6 +341,10 @@ export default function (request) {
|
|
|
328
341
|
const { cardNumber, serialNumber } = context
|
|
329
342
|
return cardNumber && serialNumber
|
|
330
343
|
},
|
|
344
|
+
jumpLinkEnable: (context, event) => {
|
|
345
|
+
const { selectedCard } = context
|
|
346
|
+
return selectedCard.jumpLinkEnable === 1
|
|
347
|
+
},
|
|
331
348
|
},
|
|
332
349
|
services: {
|
|
333
350
|
fetchInitData: async (context, event) => {
|
|
@@ -9,6 +9,7 @@ export default function (request) {
|
|
|
9
9
|
context: {
|
|
10
10
|
noBonus: {},
|
|
11
11
|
userInfo: {},
|
|
12
|
+
siteConfig: {},
|
|
12
13
|
withdrawRule: {},
|
|
13
14
|
promotionsList: [],
|
|
14
15
|
selectedPromo: {},
|
|
@@ -16,10 +17,10 @@ export default function (request) {
|
|
|
16
17
|
states: {
|
|
17
18
|
loading: {
|
|
18
19
|
invoke: {
|
|
19
|
-
src: '
|
|
20
|
+
src: 'fetchPromotionsList',
|
|
20
21
|
onDone: {
|
|
21
22
|
target: 'loaded',
|
|
22
|
-
actions: '
|
|
23
|
+
actions: 'setPromotionsList',
|
|
23
24
|
},
|
|
24
25
|
onError: {
|
|
25
26
|
target: 'fail',
|
|
@@ -79,10 +80,21 @@ export default function (request) {
|
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
82
|
actions: {
|
|
82
|
-
|
|
83
|
-
const { noBonus, userInfo } = context
|
|
83
|
+
setPromotionsList: assign((context, event) => {
|
|
84
84
|
const promotionsList = JSON.parse(JSON.stringify(event.data))
|
|
85
|
-
|
|
85
|
+
const { noBonus, userInfo, siteConfig } = context
|
|
86
|
+
const { withdraw_rule, balance } = userInfo
|
|
87
|
+
const { currencyConversionLimit } = siteConfig
|
|
88
|
+
const balanceAvailable = parseFloat(`${balance}`) < parseFloat(`${currencyConversionLimit}`)
|
|
89
|
+
const isFreeLimitRule = withdraw_rule.includes('FREE_LIMIT')
|
|
90
|
+
const includesDefaultRule = withdraw_rule === 'DEFAULT' || withdraw_rule.includes('FREE_DEFAULT')
|
|
91
|
+
|
|
92
|
+
if (!balanceAvailable && includesDefaultRule) {
|
|
93
|
+
promotionsList.map((item) => {
|
|
94
|
+
item.attendEnable = !item.withdrawRule.includes('FREE_LIMIT')
|
|
95
|
+
return item
|
|
96
|
+
})
|
|
97
|
+
} else if (!balanceAvailable && isFreeLimitRule) {
|
|
86
98
|
promotionsList.map((item) => {
|
|
87
99
|
item.attendEnable = false
|
|
88
100
|
return item
|
|
@@ -126,7 +138,7 @@ export default function (request) {
|
|
|
126
138
|
},
|
|
127
139
|
},
|
|
128
140
|
services: {
|
|
129
|
-
|
|
141
|
+
fetchPromotionsList: async (context, event) => {
|
|
130
142
|
return await request.send(payment.getPromotionsList())
|
|
131
143
|
},
|
|
132
144
|
fetchWithdrawRulePreview: async (context, event) => {
|
package/src/machine/reward.js
CHANGED
|
@@ -159,7 +159,7 @@ export default function (request) {
|
|
|
159
159
|
},
|
|
160
160
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
161
161
|
const { receiveNo } = context
|
|
162
|
-
const
|
|
162
|
+
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|
|
163
163
|
return data
|
|
164
164
|
},
|
|
165
165
|
receiveReward: async (context, event) => {
|