@jetthai/cuora 1.1.23 → 1.1.24
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 +2 -0
- package/dist/bundle.mjs +16 -3
- package/package.json +1 -1
- package/src/machine/promotions.js +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.24](https://github.com/jetthai/cuora-module/compare/v1.1.23...v1.1.24) (2023-01-04)
|
|
6
|
+
|
|
5
7
|
### [1.1.23](https://github.com/jetthai/cuora-module/compare/v1.1.22...v1.1.23) (2023-01-03)
|
|
6
8
|
|
|
7
9
|
### [1.1.22](https://github.com/jetthai/cuora-module/compare/v1.1.21...v1.1.22) (2023-01-03)
|
package/dist/bundle.mjs
CHANGED
|
@@ -20341,6 +20341,7 @@ function promotions (request) {
|
|
|
20341
20341
|
initial: 'loading',
|
|
20342
20342
|
context: {
|
|
20343
20343
|
noBonus: {},
|
|
20344
|
+
userInfo: {},
|
|
20344
20345
|
withdrawRule: {},
|
|
20345
20346
|
promotionsList: [],
|
|
20346
20347
|
selectedPromo: {},
|
|
@@ -20412,9 +20413,21 @@ function promotions (request) {
|
|
|
20412
20413
|
{
|
|
20413
20414
|
actions: {
|
|
20414
20415
|
setInitData: assign((context, event) => {
|
|
20415
|
-
const { noBonus } = context;
|
|
20416
|
+
const { noBonus, userInfo } = context;
|
|
20417
|
+
const promotionsList = JSON.parse(JSON.stringify(event.data));
|
|
20418
|
+
if (userInfo.withdraw_rule.includes('FREE_LIMIT')) {
|
|
20419
|
+
promotionsList.map((item) => {
|
|
20420
|
+
item.attendEnable = false;
|
|
20421
|
+
return item
|
|
20422
|
+
});
|
|
20423
|
+
} else {
|
|
20424
|
+
promotionsList.map((item) => {
|
|
20425
|
+
item.attendEnable = true;
|
|
20426
|
+
return item
|
|
20427
|
+
});
|
|
20428
|
+
}
|
|
20416
20429
|
return {
|
|
20417
|
-
promotionsList
|
|
20430
|
+
promotionsList,
|
|
20418
20431
|
selectedPromo: noBonus,
|
|
20419
20432
|
}
|
|
20420
20433
|
}),
|
|
@@ -20451,7 +20464,7 @@ function promotions (request) {
|
|
|
20451
20464
|
},
|
|
20452
20465
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
20453
20466
|
const { selectedPromo, amount } = context;
|
|
20454
|
-
const
|
|
20467
|
+
const data = await request.send(
|
|
20455
20468
|
payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
|
|
20456
20469
|
);
|
|
20457
20470
|
return data
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export default function (request) {
|
|
|
8
8
|
initial: 'loading',
|
|
9
9
|
context: {
|
|
10
10
|
noBonus: {},
|
|
11
|
+
userInfo: {},
|
|
11
12
|
withdrawRule: {},
|
|
12
13
|
promotionsList: [],
|
|
13
14
|
selectedPromo: {},
|
|
@@ -79,9 +80,21 @@ export default function (request) {
|
|
|
79
80
|
{
|
|
80
81
|
actions: {
|
|
81
82
|
setInitData: assign((context, event) => {
|
|
82
|
-
const { noBonus } = context
|
|
83
|
+
const { noBonus, userInfo } = context
|
|
84
|
+
const promotionsList = JSON.parse(JSON.stringify(event.data))
|
|
85
|
+
if (userInfo.withdraw_rule.includes('FREE_LIMIT')) {
|
|
86
|
+
promotionsList.map((item) => {
|
|
87
|
+
item.attendEnable = false
|
|
88
|
+
return item
|
|
89
|
+
})
|
|
90
|
+
} else {
|
|
91
|
+
promotionsList.map((item) => {
|
|
92
|
+
item.attendEnable = true
|
|
93
|
+
return item
|
|
94
|
+
})
|
|
95
|
+
}
|
|
83
96
|
return {
|
|
84
|
-
promotionsList
|
|
97
|
+
promotionsList,
|
|
85
98
|
selectedPromo: noBonus,
|
|
86
99
|
}
|
|
87
100
|
}),
|
|
@@ -118,7 +131,7 @@ export default function (request) {
|
|
|
118
131
|
},
|
|
119
132
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
120
133
|
const { selectedPromo, amount } = context
|
|
121
|
-
const
|
|
134
|
+
const data = await request.send(
|
|
122
135
|
payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
|
|
123
136
|
)
|
|
124
137
|
return data
|