@jetthai/cuora 1.1.23 → 1.1.25

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,6 +2,10 @@
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.25](https://github.com/jetthai/cuora-module/compare/v1.1.24...v1.1.25) (2023-01-04)
6
+
7
+ ### [1.1.24](https://github.com/jetthai/cuora-module/compare/v1.1.23...v1.1.24) (2023-01-04)
8
+
5
9
  ### [1.1.23](https://github.com/jetthai/cuora-module/compare/v1.1.22...v1.1.23) (2023-01-03)
6
10
 
7
11
  ### [1.1.22](https://github.com/jetthai/cuora-module/compare/v1.1.21...v1.1.22) (2023-01-03)
package/dist/bundle.mjs CHANGED
@@ -14806,6 +14806,7 @@ function withdraw_vn (request) {
14806
14806
  attachmentType: null, // null | 'withdraw' | 'pool'
14807
14807
  maximumWithdrawAmount: 0,
14808
14808
  enableWithdrawAmount: 0,
14809
+ enableWithdraw: false,
14809
14810
 
14810
14811
  amount: null,
14811
14812
  bank: null,
@@ -15117,6 +15118,7 @@ function withdraw_vn (request) {
15117
15118
  maximumWithdrawAmount: +maximumWithdrawAmount,
15118
15119
  enableWithdrawAmount: +enableWithdrawAmount,
15119
15120
  amount: +enableWithdrawAmount,
15121
+ enableWithdraw,
15120
15122
  }
15121
15123
  }),
15122
15124
  setOtp: assign((context, event) => {
@@ -15171,13 +15173,12 @@ function withdraw_vn (request) {
15171
15173
  return bank && amount > 0
15172
15174
  },
15173
15175
  isConvertible: (context, event) => {
15174
- const { balance, withdrawLimit } = context;
15175
- return balance > 0 && withdrawLimit === 0
15176
+ const { enableWithdraw } = context;
15177
+ return enableWithdraw
15176
15178
  },
15177
15179
  isNotWithdrawable: (context, event) => {
15178
- const { balance, withdrawLimit, paymentDetail } = context;
15179
- const minWithdrawAmount = paymentDetail[0]?.minimum || 0;
15180
- return withdrawLimit !== 0 || balance < minWithdrawAmount
15180
+ const { enableWithdraw } = context;
15181
+ return !enableWithdraw
15181
15182
  },
15182
15183
  isOtpRequired: (context, event) => {
15183
15184
  return event.data?.status === 'otp-verifying'
@@ -15278,6 +15279,7 @@ function withdraw_crypto (request) {
15278
15279
 
15279
15280
  maxWithdrawAmount: null,
15280
15281
  availableWithdrawAmount: null,
15282
+ enableWithdraw: false,
15281
15283
 
15282
15284
  attachmentType: null, // null | 'withdraw' | 'pool'
15283
15285
 
@@ -15606,6 +15608,7 @@ function withdraw_crypto (request) {
15606
15608
  maximumWithdrawAmount: +maximumWithdrawAmount,
15607
15609
  enableWithdrawAmount: +enableWithdrawAmount,
15608
15610
  amount: +enableWithdrawAmount,
15611
+ enableWithdraw,
15609
15612
  }
15610
15613
 
15611
15614
  // const rules = event.data.rules.filter((rule) => rule.maxWithdrawAmount > 0)
@@ -15714,13 +15717,12 @@ function withdraw_crypto (request) {
15714
15717
  return selectedNetwork && address && amount && charge
15715
15718
  },
15716
15719
  isConvertible: (context, event) => {
15717
- const { balance, withdrawLimit } = context;
15718
- return balance > 0 && withdrawLimit === 0
15720
+ const { enableWithdraw } = context;
15721
+ return enableWithdraw
15719
15722
  },
15720
15723
  isNotWithdrawable: (context, event) => {
15721
- const { balance, withdrawLimit, paymentDetail } = context;
15722
- const minWithdrawAmount = paymentDetail[0]?.minimum || 0;
15723
- return withdrawLimit !== 0 || balance < minWithdrawAmount
15724
+ const { enableWithdraw } = context;
15725
+ return !enableWithdraw
15724
15726
  },
15725
15727
  isCalculable: (context, event) => {
15726
15728
  const { selectedNetwork, amount } = context;
@@ -20341,6 +20343,7 @@ function promotions (request) {
20341
20343
  initial: 'loading',
20342
20344
  context: {
20343
20345
  noBonus: {},
20346
+ userInfo: {},
20344
20347
  withdrawRule: {},
20345
20348
  promotionsList: [],
20346
20349
  selectedPromo: {},
@@ -20412,9 +20415,21 @@ function promotions (request) {
20412
20415
  {
20413
20416
  actions: {
20414
20417
  setInitData: assign((context, event) => {
20415
- const { noBonus } = context;
20418
+ const { noBonus, userInfo } = context;
20419
+ const promotionsList = JSON.parse(JSON.stringify(event.data));
20420
+ if (userInfo.withdraw_rule.includes('FREE_LIMIT')) {
20421
+ promotionsList.map((item) => {
20422
+ item.attendEnable = false;
20423
+ return item
20424
+ });
20425
+ } else {
20426
+ promotionsList.map((item) => {
20427
+ item.attendEnable = true;
20428
+ return item
20429
+ });
20430
+ }
20416
20431
  return {
20417
- promotionsList: event.data,
20432
+ promotionsList,
20418
20433
  selectedPromo: noBonus,
20419
20434
  }
20420
20435
  }),
@@ -20451,7 +20466,7 @@ function promotions (request) {
20451
20466
  },
20452
20467
  fetchWithdrawRulePreview: async (context, event) => {
20453
20468
  const { selectedPromo, amount } = context;
20454
- const { data } = await request.send(
20469
+ const data = await request.send(
20455
20470
  payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
20456
20471
  );
20457
20472
  return data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -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: event.data,
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 { data } = await request.send(
134
+ const data = await request.send(
122
135
  payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
123
136
  )
124
137
  return data
@@ -24,6 +24,7 @@ export default function (request) {
24
24
 
25
25
  maxWithdrawAmount: null,
26
26
  availableWithdrawAmount: null,
27
+ enableWithdraw: false,
27
28
 
28
29
  attachmentType: null, // null | 'withdraw' | 'pool'
29
30
 
@@ -352,6 +353,7 @@ export default function (request) {
352
353
  maximumWithdrawAmount: +maximumWithdrawAmount,
353
354
  enableWithdrawAmount: +enableWithdrawAmount,
354
355
  amount: +enableWithdrawAmount,
356
+ enableWithdraw,
355
357
  }
356
358
 
357
359
  // const rules = event.data.rules.filter((rule) => rule.maxWithdrawAmount > 0)
@@ -460,13 +462,12 @@ export default function (request) {
460
462
  return selectedNetwork && address && amount && charge
461
463
  },
462
464
  isConvertible: (context, event) => {
463
- const { balance, withdrawLimit } = context
464
- return balance > 0 && withdrawLimit === 0
465
+ const { enableWithdraw } = context
466
+ return enableWithdraw
465
467
  },
466
468
  isNotWithdrawable: (context, event) => {
467
- const { balance, withdrawLimit, paymentDetail } = context
468
- const minWithdrawAmount = paymentDetail[0]?.minimum || 0
469
- return withdrawLimit !== 0 || balance < minWithdrawAmount
469
+ const { enableWithdraw } = context
470
+ return !enableWithdraw
470
471
  },
471
472
  isCalculable: (context, event) => {
472
473
  const { selectedNetwork, amount } = context
@@ -26,6 +26,7 @@ export default function (request) {
26
26
  attachmentType: null, // null | 'withdraw' | 'pool'
27
27
  maximumWithdrawAmount: 0,
28
28
  enableWithdrawAmount: 0,
29
+ enableWithdraw: false,
29
30
 
30
31
  amount: null,
31
32
  bank: null,
@@ -337,6 +338,7 @@ export default function (request) {
337
338
  maximumWithdrawAmount: +maximumWithdrawAmount,
338
339
  enableWithdrawAmount: +enableWithdrawAmount,
339
340
  amount: +enableWithdrawAmount,
341
+ enableWithdraw,
340
342
  }
341
343
  }),
342
344
  setOtp: assign((context, event) => {
@@ -391,13 +393,12 @@ export default function (request) {
391
393
  return bank && amount > 0
392
394
  },
393
395
  isConvertible: (context, event) => {
394
- const { balance, withdrawLimit } = context
395
- return balance > 0 && withdrawLimit === 0
396
+ const { enableWithdraw } = context
397
+ return enableWithdraw
396
398
  },
397
399
  isNotWithdrawable: (context, event) => {
398
- const { balance, withdrawLimit, paymentDetail } = context
399
- const minWithdrawAmount = paymentDetail[0]?.minimum || 0
400
- return withdrawLimit !== 0 || balance < minWithdrawAmount
400
+ const { enableWithdraw } = context
401
+ return !enableWithdraw
401
402
  },
402
403
  isOtpRequired: (context, event) => {
403
404
  return event.data?.status === 'otp-verifying'