@jetthai/cuora 1.1.363 → 1.1.364-dev-5

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,41 +2,35 @@
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.363](https://github.com/jetthai/cuora-module/compare/v1.1.362...v1.1.363) (2025-06-23)
5
+ ### [1.1.364-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-4...v1.1.364-dev-5) (2025-04-08)
6
6
 
7
- ### [1.1.362](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.362) (2025-06-20)
8
-
9
- ### [1.1.361](https://github.com/jetthai/cuora-module/compare/v1.1.360...v1.1.361) (2025-06-03)
10
-
11
- ### [1.1.360](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.360) (2025-06-03)
12
-
13
- ### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
7
+ ### [1.1.353](https://github.com/jetthai/cuora-module/compare/v1.1.352...v1.1.353) (2025-04-02)
14
8
 
15
- ### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
9
+ ### [1.1.352](https://github.com/jetthai/cuora-module/compare/v1.1.346-ranking-1...v1.1.352) (2025-04-02)
16
10
 
17
- ### [1.1.357](https://github.com/jetthai/cuora-module/compare/v1.1.356...v1.1.357) (2025-05-06)
11
+ ### [1.1.351](https://github.com/jetthai/cuora-module/compare/v1.1.350...v1.1.351) (2025-04-02)
18
12
 
19
- ### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.356) (2025-04-29)
13
+ ### [1.1.350](https://github.com/jetthai/cuora-module/compare/v1.1.349...v1.1.350) (2025-03-31)
20
14
 
21
- ### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
15
+ ### [1.1.349](https://github.com/jetthai/cuora-module/compare/v1.1.348...v1.1.349) (2025-03-30)
22
16
 
23
- ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
17
+ ### [1.1.348](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-3...v1.1.348) (2025-03-30)
24
18
 
25
- ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
19
+ ### [1.1.347](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-2...v1.1.347) (2025-03-30)
26
20
 
27
- ### [1.1.353](https://github.com/jetthai/cuora-module/compare/v1.1.352...v1.1.353) (2025-04-02)
21
+ ### [1.1.346-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.346-ranking-1...v1.1.346-dev-4) (2025-04-02)
28
22
 
29
- ### [1.1.352](https://github.com/jetthai/cuora-module/compare/v1.1.351...v1.1.352) (2025-04-02)
23
+ ### [1.1.346-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-2...v1.1.346-dev-3) (2025-03-30)
30
24
 
31
- ### [1.1.351](https://github.com/jetthai/cuora-module/compare/v1.1.350...v1.1.351) (2025-04-02)
25
+ ### [1.1.346-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-1...v1.1.346-dev-2) (2025-03-28)
32
26
 
33
- ### [1.1.350](https://github.com/jetthai/cuora-module/compare/v1.1.349...v1.1.350) (2025-03-31)
27
+ ### [1.1.346-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.346...v1.1.346-dev-1) (2025-03-28)
34
28
 
35
- ### [1.1.349](https://github.com/jetthai/cuora-module/compare/v1.1.348...v1.1.349) (2025-03-30)
29
+ ### [1.1.346-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-2...v1.1.346-dev-3) (2025-03-30)
36
30
 
37
- ### [1.1.348](https://github.com/jetthai/cuora-module/compare/v1.1.347...v1.1.348) (2025-03-30)
31
+ ### [1.1.346-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.346-dev-1...v1.1.346-dev-2) (2025-03-28)
38
32
 
39
- ### [1.1.347](https://github.com/jetthai/cuora-module/compare/v1.1.346...v1.1.347) (2025-03-30)
33
+ ### [1.1.346-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.346...v1.1.346-dev-1) (2025-03-28)
40
34
 
41
35
  ### [1.1.346](https://github.com/jetthai/cuora-module/compare/v1.1.345...v1.1.346) (2025-03-27)
42
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.363",
3
+ "version": "1.1.364-dev-5",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/resetGitBranch.sh CHANGED
@@ -59,53 +59,4 @@ git branch --set-upstream-to=origin/dev dev
59
59
  if [ $? -ne 0 ]; then
60
60
  echo "設定 dev 分支的上游分支為 origin/dev 失敗"
61
61
  exit 1
62
- fi
63
-
64
- # 切換到 master 分支
65
- git checkout master
66
- if [ $? -ne 0 ]; then
67
- echo "切換到 master 分支失敗"
68
- exit 1
69
- fi
70
-
71
- # 刪除本地的 qa 分支
72
- git branch -D qa
73
- if [ $? -ne 0 ]; then
74
- echo "刪除本地 qa 分支失敗"
75
- exit 1
76
- fi
77
-
78
- # 刪除遠端的 qa 分支
79
- git push origin --delete qa
80
- if [ $? -ne 0 ]; then
81
- echo "刪除遠端 qa 分支失敗"
82
- exit 1
83
- fi
84
-
85
- # 建立並切換到新的 qa 分支
86
- git checkout -b qa
87
- if [ $? -ne 0 ]; then
88
- echo "建立並切換到新的 qa 分支失敗"
89
- exit 1
90
- fi
91
-
92
- # 強制推送新的 qa 分支到遠端
93
- git push -f origin qa
94
- if [ $? -ne 0 ]; then
95
- echo "強制推送新的 qa 分支到遠端失敗"
96
- exit 1
97
- fi
98
-
99
- # 設定 qa 分支的上游分支為 origin/qa
100
- git branch --set-upstream-to=origin/qa qa
101
- if [ $? -ne 0 ]; then
102
- echo "設定 qa 分支的上游分支為 origin/qa 失敗"
103
- exit 1
104
- fi
105
-
106
- # 切換到 master 分支
107
- git checkout master
108
- if [ $? -ne 0 ]; then
109
- echo "切換到 master 分支失敗"
110
- exit 1
111
62
  fi
@@ -69,10 +69,10 @@ export default {
69
69
  method: 'get',
70
70
  params: { rewardType },
71
71
  }),
72
- getRewardList: ({ rewardType, count, appSecret, orderColumn }) => ({
72
+ getRewardList: ({ rewardType, count, appSecret }) => ({
73
73
  url: 'activities/rewards',
74
74
  method: 'get',
75
- params: { rewardType, count, appSecret, orderColumn },
75
+ params: { rewardType, count, appSecret },
76
76
  }),
77
77
  getCashRainReward: ({ activityNo, appSecret }) => ({
78
78
  url: `activities/cashRain`,
package/src/api/game.js CHANGED
@@ -4,10 +4,9 @@ export default {
4
4
  removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
5
5
  getStatements: () => ({ url: 'game/statements', method: 'get' }),
6
6
  playGame: (params) => ({ url: 'game/play', method: 'get', params }),
7
- demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
8
7
  logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
9
8
 
10
- getGameTags: ({ q, lang, limit = 20 }) => ({ url: 'game/search', method: 'get', params: { q, lang, limit } }),
9
+ getGameTags: ({ q, lang }) => ({ url: 'game/search', method: 'get', params: { q, lang } }),
11
10
  getGameSearchHome: () => ({ url: 'game/search/home', method: 'get' }),
12
11
  getGameSearchList: ({ id, index, q, click, clickDefault, providerName }) => ({
13
12
  url: 'game/search/list',
@@ -19,8 +19,6 @@ export default {
19
19
  lastNameTh,
20
20
  firstNameEn,
21
21
  lastNameEn,
22
- firstNameLocale,
23
- lastNameLocale,
24
22
  bonus,
25
23
  paymentProvider,
26
24
  pixType,
@@ -43,8 +41,6 @@ export default {
43
41
  lastNameTh,
44
42
  firstNameEn,
45
43
  lastNameEn,
46
- firstNameLocale,
47
- lastNameLocale,
48
44
  bonus,
49
45
  paymentProvider,
50
46
  pixType,
@@ -246,5 +242,4 @@ export default {
246
242
  getPendingOrder: ({ transferType }) => ({ url: 'payment/v2/pendingOrder', method: 'post', params: { transferType } }),
247
243
  withdrawCheck: () => ({ url: `payment/v2/withdrawCheck`, method: 'post' }),
248
244
  updateUtr: ({ applyId, utr }) => ({ url: 'payment/v2/updateUtr', method: 'post', params: { applyId, utr } }),
249
- uploadCommonSlip: ({ applyId, slip }) => ({ url: 'payment/v2/uploadCommonSlip', method: 'post', params: { applyId, slip } }),
250
245
  }
@@ -1,9 +1,9 @@
1
1
  export default {
2
2
  // 未登入排名資料
3
- getTournament: ({ activityNo, cycle, round, site }) => ({
3
+ getTournament: ({ activityNo }) => ({
4
4
  url: 'tournament/detail',
5
- method: 'post',
6
- params: { activityNo, cycle, round, site },
5
+ method: 'get',
6
+ params: { activityNo },
7
7
  isPublic: true,
8
8
  }),
9
9
  // 登入後排名預設期數資料
@@ -11,7 +11,6 @@ export default {
11
11
  url: 'ranking/detail/option',
12
12
  method: 'get',
13
13
  params: { activityNo },
14
- isPublic: true,
15
14
  }),
16
15
  // 登入後排名資料
17
16
  getRankingDetail: ({ activityNo, cycle, round }) => ({
@@ -77,6 +77,10 @@ export default function (request) {
77
77
  SET_UNREAD: {
78
78
  actions: 'setUnread',
79
79
  },
80
+ REFRESH: {
81
+ target: '#activity.fetchingList',
82
+ actions: 'leaveGame',
83
+ },
80
84
  RESET_ACTIVITIES: {
81
85
  actions: 'resetActivities',
82
86
  },
@@ -85,12 +89,6 @@ export default function (request) {
85
89
  },
86
90
  },
87
91
  },
88
- on: {
89
- REFRESH: {
90
- target: '#activity.fetchingList',
91
- actions: 'leaveGame',
92
- },
93
- },
94
92
  },
95
93
  {
96
94
  actions: {
@@ -184,7 +182,8 @@ export default function (request) {
184
182
  services: {
185
183
  fetchList: async (context, event) => {
186
184
  const hasToken = request.getToken()
187
- const apiCallable = hasToken
185
+ const isDoubleWallet = context.siteConfig?.walletMode === '4'
186
+ const apiCallable = hasToken && isDoubleWallet
188
187
  const [{ data }, promotionList] = await Promise.all([
189
188
  hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
190
189
  apiCallable && !context.isPlaying ? request.send(payment.getPromotionsList()) : [],
@@ -33,10 +33,6 @@ export default function (request) {
33
33
  target: 'loading',
34
34
  actions: 'setActivityNo',
35
35
  },
36
- SET_ACTIVITY: {
37
- target: 'loading',
38
- actions: 'setActivity',
39
- },
40
36
  },
41
37
  },
42
38
  loading: {
@@ -91,18 +87,8 @@ export default function (request) {
91
87
  }
92
88
  }),
93
89
  setActivityDetail: assign((context, event) => {
94
- let activityDetail = event.data
95
- if (context.activityDetail && (!event.data || Object.keys(event.data).length === 0)) {
96
- activityDetail = context.activityDetail
97
- }
98
- return {
99
- activityDetail,
100
- }
101
- }),
102
- setActivity: assign((context, event) => {
103
90
  return {
104
- activityDetail: event.data.activityDetail,
105
- activityNo: event.data.activityNo,
91
+ activityDetail: event.data,
106
92
  }
107
93
  }),
108
94
  setInitData: assign((context, event) => {
@@ -125,12 +111,18 @@ export default function (request) {
125
111
 
126
112
  let nextDepositLimit = '0'
127
113
  let nextTurnoverLimit = '0'
114
+ let currentTurnover = '0'
115
+ let currentDeposit = '0'
128
116
  const maxReachLevel = conditions?.[conditions?.length - 1]
129
117
  // 若已達到最高等級,所有數值皆以最高等級顯示
130
118
  if (maxReachLevel && nextCycleCardCurrentReachLevel?.title === maxReachLevel.title) {
119
+ currentDeposit = maxReachLevel.depositLimit
120
+ currentTurnover = maxReachLevel.turnoverLimit
131
121
  nextDepositLimit = maxReachLevel.depositLimit
132
122
  nextTurnoverLimit = maxReachLevel.turnoverLimit
133
123
  } else {
124
+ currentDeposit = accumulateTotalDeposit
125
+ currentTurnover = accumulateTotalValidTurnover
134
126
  nextDepositLimit = nextCycleCardNextReachLevel?.depositLimit
135
127
  nextTurnoverLimit = nextCycleCardNextReachLevel?.turnoverLimit
136
128
  }
@@ -147,8 +139,8 @@ export default function (request) {
147
139
  lastCycleCard,
148
140
  nextDepositLimit,
149
141
  nextTurnoverLimit,
150
- accumulateTotalDeposit,
151
- accumulateTotalValidTurnover,
142
+ accumulateTotalDeposit: currentDeposit,
143
+ accumulateTotalValidTurnover: currentTurnover,
152
144
  retainAmount,
153
145
  yesterdayRewardsAmount,
154
146
  calculateWalletMode,
@@ -27,8 +27,6 @@ export default function (request) {
27
27
  branchCode: null,
28
28
  accountNumber: null,
29
29
  holderName: null,
30
- lastNameLocale: null,
31
- firstNameLocale: null,
32
30
  pixType: null,
33
31
  },
34
32
  states: {
@@ -116,20 +114,6 @@ export default function (request) {
116
114
  }
117
115
  }),
118
116
  },
119
- SET_FIRST_NAME: {
120
- actions: assign((context, event) => {
121
- return {
122
- firstNameLocale: event.data,
123
- }
124
- }),
125
- },
126
- SET_LAST_NAME: {
127
- actions: assign((context, event) => {
128
- return {
129
- lastNameLocale: event.data,
130
- }
131
- }),
132
- },
133
117
  SET_PIX_TYPE: {
134
118
  actions: assign((context, event) => {
135
119
  return {
@@ -172,8 +156,6 @@ export default function (request) {
172
156
  return {
173
157
  hasAnyAccount: bankInfo.length > 0,
174
158
  holderName: bankInfo[0]?.holderName,
175
- firstNameLocale: bankInfo[0]?.firstNameLocale || null,
176
- lastNameLocale: bankInfo[0]?.lastNameLocale || null,
177
159
  paymentList,
178
160
  bank: null, // 不預選銀行,玩家可能不知道這裡可以選 by Gordan
179
161
  }
@@ -185,21 +167,21 @@ export default function (request) {
185
167
 
186
168
  if (bindingType === 'CRYPTO') {
187
169
  // 虛擬貨幣
188
- const { crypto, network, cryptoAddress, holderName, firstNameLocale, lastNameLocale } = context
189
- return crypto && network && cryptoAddress && (holderName || (firstNameLocale && lastNameLocale))
170
+ const { crypto, network, cryptoAddress, holderName } = context
171
+ return crypto && network && cryptoAddress && holderName
190
172
  } else if (bindingType === 'EWALLET') {
191
173
  // 電子錢包
192
- const { walletCode, accountNumber, holderName, firstNameLocale, lastNameLocale } = context
193
- return walletCode?.bankCode && accountNumber && (holderName || (firstNameLocale && lastNameLocale))
174
+ const { walletCode, accountNumber, holderName } = context
175
+ return walletCode?.bankCode && accountNumber && holderName
194
176
  } else {
195
177
  // 一般銀行
196
178
  if (currency === 'INR') {
197
179
  // 如果是印度幣別
198
- const { bank, ifscCode, accountNumber, branch, holderName, firstNameLocale, lastNameLocale } = context
199
- return bank.bankCode && ifscCode && accountNumber && branch && (holderName || (firstNameLocale && lastNameLocale))
180
+ const { bank, ifscCode, accountNumber, branch, holderName } = context
181
+ return bank.bankCode && ifscCode && accountNumber && branch && holderName
200
182
  } else {
201
- const { bank, accountNumber, branch, holderName, firstNameLocale, lastNameLocale } = context
202
- return bank.bankCode && accountNumber && branch && (holderName || (firstNameLocale && lastNameLocale))
183
+ const { bank, accountNumber, branch, holderName } = context
184
+ return bank.bankCode && accountNumber && branch && holderName
203
185
  }
204
186
  }
205
187
  },
@@ -213,22 +195,8 @@ export default function (request) {
213
195
  return { paymentList, paymentInfo }
214
196
  },
215
197
  updatePaymentInfo: async (context, event) => {
216
- const {
217
- bindingType,
218
- bank,
219
- ifscCode,
220
- crypto,
221
- network,
222
- cryptoAddress,
223
- walletCode,
224
- branch,
225
- branchCode,
226
- accountNumber,
227
- holderName,
228
- firstNameLocale,
229
- lastNameLocale,
230
- pixType,
231
- } = context
198
+ const { bindingType, bank, ifscCode, crypto, network, cryptoAddress, walletCode, branch, branchCode, accountNumber, holderName, pixType } =
199
+ context
232
200
  return await request.send(
233
201
  payment.updatePaymentInfo({
234
202
  bindingType,
@@ -242,8 +210,6 @@ export default function (request) {
242
210
  branchCode,
243
211
  bankAccount: accountNumber,
244
212
  holderName,
245
- firstNameLocale,
246
- lastNameLocale,
247
213
  pixType,
248
214
  })
249
215
  )
@@ -113,7 +113,6 @@ export default function (request) {
113
113
  actions: 'resetByEnterGame',
114
114
  },
115
115
  LEAVE_GAME_REFRESH: {
116
- target: '.updating',
117
116
  actions: 'leaveGame',
118
117
  },
119
118
  },
@@ -293,8 +292,7 @@ export default function (request) {
293
292
  return { announcementList: { data } }
294
293
  }),
295
294
  setFeeds: assign((context, event) => {
296
- const { announcementList, broadcastList, mailBoxInfo } = event.data
297
- const { siteConfig } = context
295
+ const { announcementList, broadcastList, mailBoxInfo, siteConfig } = event.data
298
296
  const promotions = announcementList?.announcements?.filter?.((item) => item.category === 3) || []
299
297
  const customerMessageEnable = siteConfig?.csChat?.some((item) => item.enable && item.name === 'customermessage')
300
298
  if (!customerMessageEnable) {
@@ -58,6 +58,7 @@ export default function (request) {
58
58
  always: [
59
59
  {
60
60
  target: 'loaded',
61
+ cond: 'isDoubleWalletMode',
61
62
  },
62
63
  {
63
64
  target: 'calculating',
@@ -90,7 +91,7 @@ export default function (request) {
90
91
  SUBMIT: [
91
92
  {
92
93
  target: 'pending',
93
- cond: (context, event) => !!context.calculation,
94
+ cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
94
95
  },
95
96
  {
96
97
  target: 'submitting',
@@ -128,7 +129,7 @@ export default function (request) {
128
129
  SUBMIT: [
129
130
  {
130
131
  target: 'pending',
131
- cond: (context, event) => !!context.calculation,
132
+ cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
132
133
  },
133
134
  {
134
135
  target: 'submitting',
@@ -246,6 +247,9 @@ export default function (request) {
246
247
  }),
247
248
  },
248
249
  guards: {
250
+ isDoubleWalletMode: (context, event) => {
251
+ return context.siteConfig?.walletMode === '4'
252
+ },
249
253
  isCalculable: (context, event) => {
250
254
  const {
251
255
  amount,
@@ -72,8 +72,8 @@ export default function (request) {
72
72
  target: 'fetching',
73
73
  cond: (context, event) => {
74
74
  const { siteConfig = {}, promotion = {} } = context
75
- const { bonusPreviewEnable } = siteConfig
76
- return bonusPreviewEnable && promotion.activityNo != 'none'
75
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
76
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
77
77
  },
78
78
  },
79
79
  { target: 'loaded' },
@@ -49,8 +49,8 @@ export default function (request) {
49
49
  target: 'fetching',
50
50
  cond: (context, event) => {
51
51
  const { siteConfig = {}, promotion = {}, selectedCard } = context
52
- const { bonusPreviewEnable } = siteConfig
53
- return !!selectedCard && bonusPreviewEnable && promotion.activityNo != 'none'
52
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
53
+ return !!selectedCard && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
54
54
  },
55
55
  },
56
56
  { target: 'loaded' },
@@ -78,8 +78,8 @@ export default function (request) {
78
78
  actions: 'setCard',
79
79
  cond: (context, event) => {
80
80
  const { siteConfig = {}, promotion = {} } = context
81
- const { bonusPreviewEnable } = siteConfig
82
- return bonusPreviewEnable && promotion.activityNo != 'none'
81
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
82
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
83
83
  },
84
84
  },
85
85
  {
@@ -87,6 +87,11 @@ export default function (request) {
87
87
  },
88
88
  ],
89
89
  SELECT_AMOUNT: [
90
+ {
91
+ target: 'pending',
92
+ actions: 'setAmount',
93
+ cond: 'isFreeWalletMode',
94
+ },
90
95
  {
91
96
  target: 'debouncing',
92
97
  actions: 'setAmount',
@@ -94,6 +99,19 @@ export default function (request) {
94
99
  ],
95
100
  },
96
101
  },
102
+ pending: {
103
+ on: {
104
+ SELECT_AMOUNT: {
105
+ actions: 'setAmount',
106
+ },
107
+ CONFIRM: {
108
+ target: 'debouncing',
109
+ },
110
+ BACK: {
111
+ target: 'loaded',
112
+ },
113
+ },
114
+ },
97
115
  debouncing: {
98
116
  on: {
99
117
  SELECT_AMOUNT: {
@@ -114,6 +132,19 @@ export default function (request) {
114
132
  invoke: {
115
133
  src: 'fetchCalculation',
116
134
  onDone: [
135
+ {
136
+ target: 'submitting',
137
+ actions: 'setCalculation',
138
+ cond: (context, event) => {
139
+ const { siteConfig = {}, selectedCard = {} } = context
140
+ return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
141
+ },
142
+ },
143
+ {
144
+ target: 'cardInfo',
145
+ actions: 'setCalculation',
146
+ cond: 'isFreeWalletMode',
147
+ },
117
148
  {
118
149
  target: 'calculated',
119
150
  actions: 'setCalculation',
@@ -127,10 +158,17 @@ export default function (request) {
127
158
  calculable: {
128
159
  entry: 'clearCalculation',
129
160
  on: {
130
- SELECT_AMOUNT: {
131
- target: 'debouncing',
132
- actions: 'setAmount',
133
- },
161
+ SELECT_AMOUNT: [
162
+ {
163
+ target: 'pending',
164
+ actions: 'setAmount',
165
+ cond: 'isFreeWalletMode',
166
+ },
167
+ {
168
+ target: 'debouncing',
169
+ actions: 'setAmount',
170
+ },
171
+ ],
134
172
  BACK: {
135
173
  target: 'loaded',
136
174
  },
@@ -178,8 +216,8 @@ export default function (request) {
178
216
  actions: 'setCard',
179
217
  cond: (context, event) => {
180
218
  const { siteConfig = {}, promotion = {} } = context
181
- const { bonusPreviewEnable } = siteConfig
182
- return bonusPreviewEnable && promotion.activityNo != 'none'
219
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
220
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
183
221
  },
184
222
  },
185
223
  {
@@ -287,6 +325,9 @@ export default function (request) {
287
325
  }),
288
326
  },
289
327
  guards: {
328
+ isFreeWalletMode: (context, event) => {
329
+ return context.siteConfig?.walletMode === '2'
330
+ },
290
331
  isSubmittable: (context, event) => {
291
332
  const { cardNumber, serialNumber } = context
292
333
  return cardNumber && serialNumber
@@ -75,8 +75,24 @@ export default function (request) {
75
75
  },
76
76
  },
77
77
  step1: {
78
- initial: 'idle',
78
+ initial: 'promotion',
79
79
  states: {
80
+ promotion: {
81
+ always: [
82
+ {
83
+ target: 'idle',
84
+ cond: 'isDoubleWalletMode',
85
+ },
86
+ {
87
+ target: 'calculating',
88
+ actions: 'setPromotionDefaultAmount',
89
+ cond: 'hasMinPromotionDeposit',
90
+ },
91
+ {
92
+ target: 'idle',
93
+ },
94
+ ],
95
+ },
80
96
  idle: {},
81
97
  calculating: {
82
98
  invoke: {
@@ -121,10 +137,11 @@ export default function (request) {
121
137
  {
122
138
  target: 'pending',
123
139
  cond: (context, event) => {
124
- const { calculation, promotion } = context
140
+ const { siteConfig = {}, calculation, promotion } = context
141
+ const { walletMode } = siteConfig
125
142
  const { promotionsNo, activityNo } = promotion
126
143
  const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
127
- return !!calculation && !isNoBonus
144
+ return walletMode === '4' && !!calculation && !isNoBonus
128
145
  },
129
146
  },
130
147
  {
@@ -368,6 +385,9 @@ export default function (request) {
368
385
  }),
369
386
  },
370
387
  guards: {
388
+ isDoubleWalletMode: (context, event) => {
389
+ return context.siteConfig?.walletMode === '4'
390
+ },
371
391
  isCalculable: (context, event) => {
372
392
  const {
373
393
  amount,