@jetthai/cuora 1.1.188-branchCode-1 → 1.1.188
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,10 +2,6 @@
|
|
|
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.188-branchCode-1](https://github.com/jetthai/cuora-module/compare/v1.1.188-branchCode...v1.1.188-branchCode-1) (2023-10-12)
|
|
6
|
-
|
|
7
|
-
### [1.1.188-branchCode](https://github.com/jetthai/cuora-module/compare/v1.1.188...v1.1.188-branchCode) (2023-10-11)
|
|
8
|
-
|
|
9
5
|
### [1.1.188](https://github.com/jetthai/cuora-module/compare/v1.1.187...v1.1.188) (2023-10-06)
|
|
10
6
|
|
|
11
7
|
### [1.1.187](https://github.com/jetthai/cuora-module/compare/v1.1.186...v1.1.187) (2023-10-03)
|
package/package.json
CHANGED
|
@@ -4,14 +4,13 @@ import common from '../../api/common.js'
|
|
|
4
4
|
import { max } from '../../util/index.js'
|
|
5
5
|
|
|
6
6
|
export default function (request, context) {
|
|
7
|
-
const { paymentDetail = [], promotion, selectedAmount
|
|
7
|
+
const { paymentDetail = [], promotion, selectedAmount } = context || {}
|
|
8
8
|
|
|
9
9
|
return createMachine(
|
|
10
10
|
{
|
|
11
11
|
id: 'manual_cash',
|
|
12
12
|
initial: 'loading',
|
|
13
13
|
context: {
|
|
14
|
-
siteConfig,
|
|
15
14
|
paymentDetail,
|
|
16
15
|
promotion,
|
|
17
16
|
selectedAmount,
|
|
@@ -24,8 +23,6 @@ export default function (request, context) {
|
|
|
24
23
|
selectedUserBank: null,
|
|
25
24
|
userAccountNumber: null,
|
|
26
25
|
userAccountName: null,
|
|
27
|
-
userAccountBranchName: null,
|
|
28
|
-
userAccountBranchCode: null,
|
|
29
26
|
depositTime: null,
|
|
30
27
|
receipt: null,
|
|
31
28
|
|
|
@@ -82,12 +79,6 @@ export default function (request, context) {
|
|
|
82
79
|
SELECT_USER_BANK: {
|
|
83
80
|
actions: 'setUserBank',
|
|
84
81
|
},
|
|
85
|
-
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
86
|
-
actions: 'setUserAccountBranchName',
|
|
87
|
-
},
|
|
88
|
-
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
89
|
-
actions: 'setUserAccountBranchCode',
|
|
90
|
-
},
|
|
91
82
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
92
83
|
actions: 'setUserAccountNumber',
|
|
93
84
|
},
|
|
@@ -177,8 +168,6 @@ export default function (request, context) {
|
|
|
177
168
|
selectedUserBank: userBanks[0],
|
|
178
169
|
userAccountNumber: userBanks[0].accountNumber,
|
|
179
170
|
userAccountName: userBanks[0].holderName,
|
|
180
|
-
userAccountBranchName: userBanks[0].branch,
|
|
181
|
-
userAccountBranchCode: userBanks[0].branchCode,
|
|
182
171
|
}
|
|
183
172
|
}),
|
|
184
173
|
setHouseBank: assign((context, event) => {
|
|
@@ -205,23 +194,11 @@ export default function (request, context) {
|
|
|
205
194
|
}
|
|
206
195
|
}),
|
|
207
196
|
setUserBank: assign((context, event) => {
|
|
208
|
-
const { accountNumber, holderName
|
|
197
|
+
const { accountNumber, holderName } = event.data
|
|
209
198
|
return {
|
|
210
199
|
selectedUserBank: event.data,
|
|
211
200
|
userAccountNumber: accountNumber,
|
|
212
201
|
userAccountName: holderName,
|
|
213
|
-
userAccountBranchName: branch,
|
|
214
|
-
userAccountBranchCode: branchCode,
|
|
215
|
-
}
|
|
216
|
-
}),
|
|
217
|
-
setUserAccountBranchName: assign((context, event) => {
|
|
218
|
-
return {
|
|
219
|
-
userAccountBranchName: event.data,
|
|
220
|
-
}
|
|
221
|
-
}),
|
|
222
|
-
setUserAccountBranchCode: assign((context, event) => {
|
|
223
|
-
return {
|
|
224
|
-
userAccountBranchCode: event.data,
|
|
225
202
|
}
|
|
226
203
|
}),
|
|
227
204
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -267,15 +244,8 @@ export default function (request, context) {
|
|
|
267
244
|
return context.calculation
|
|
268
245
|
},
|
|
269
246
|
isSubmittable: (context, event) => {
|
|
270
|
-
const { selectedAmount, userAccountNumber, userAccountName,
|
|
271
|
-
|
|
272
|
-
const defaultCheck = selectedAmount && userAccountNumber && userAccountName && depositTime && receipt
|
|
273
|
-
|
|
274
|
-
if (branchCodeEnable === '1') {
|
|
275
|
-
return defaultCheck && userAccountBranchCode
|
|
276
|
-
} else {
|
|
277
|
-
return defaultCheck
|
|
278
|
-
}
|
|
247
|
+
const { selectedAmount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
248
|
+
return selectedAmount && userAccountNumber && userAccountName && depositTime && receipt
|
|
279
249
|
},
|
|
280
250
|
isProcessing: (context, event) => {
|
|
281
251
|
return context.processing
|
|
@@ -314,19 +284,8 @@ export default function (request, context) {
|
|
|
314
284
|
)
|
|
315
285
|
},
|
|
316
286
|
submitDeposit: async (context, event) => {
|
|
317
|
-
const {
|
|
318
|
-
|
|
319
|
-
selectedAmount,
|
|
320
|
-
selectedHouseBank,
|
|
321
|
-
selectedUserBank,
|
|
322
|
-
userAccountNumber,
|
|
323
|
-
userAccountName,
|
|
324
|
-
userAccountBranchName,
|
|
325
|
-
userAccountBranchCode,
|
|
326
|
-
depositTime,
|
|
327
|
-
receipt,
|
|
328
|
-
promotion,
|
|
329
|
-
} = context
|
|
287
|
+
const { method, selectedAmount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotion } =
|
|
288
|
+
context
|
|
330
289
|
return await request.send(
|
|
331
290
|
payment.submitDepositTransactionBank({
|
|
332
291
|
method,
|
|
@@ -336,8 +295,6 @@ export default function (request, context) {
|
|
|
336
295
|
applyerBankCode: selectedUserBank.bankCode,
|
|
337
296
|
applyerAccountNumber: userAccountNumber,
|
|
338
297
|
applyerHolderName: userAccountName,
|
|
339
|
-
applyerBranchName: userAccountBranchName,
|
|
340
|
-
applyerBranchCode: userAccountBranchCode,
|
|
341
298
|
depositTime,
|
|
342
299
|
receipt,
|
|
343
300
|
promotionsNo: promotion?.promotionsNo,
|
|
@@ -21,8 +21,6 @@ export default function (request) {
|
|
|
21
21
|
selectedUserBank: null,
|
|
22
22
|
userAccountNumber: null,
|
|
23
23
|
userAccountName: null,
|
|
24
|
-
userAccountBranchName: null,
|
|
25
|
-
userAccountBranchCode: null,
|
|
26
24
|
depositTime: null,
|
|
27
25
|
receipt: null,
|
|
28
26
|
|
|
@@ -202,12 +200,6 @@ export default function (request) {
|
|
|
202
200
|
SELECT_USER_BANK: {
|
|
203
201
|
actions: 'setUserBank',
|
|
204
202
|
},
|
|
205
|
-
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
206
|
-
actions: 'setUserAccountBranchName',
|
|
207
|
-
},
|
|
208
|
-
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
209
|
-
actions: 'setUserAccountBranchCode',
|
|
210
|
-
},
|
|
211
203
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
212
204
|
actions: 'setUserAccountNumber',
|
|
213
205
|
},
|
|
@@ -286,8 +278,6 @@ export default function (request) {
|
|
|
286
278
|
selectedUserBank: userBanks[0],
|
|
287
279
|
userAccountNumber: userBanks[0].accountNumber,
|
|
288
280
|
userAccountName: userBanks[0].holderName,
|
|
289
|
-
userAccountBranchName: userBanks[0].branch,
|
|
290
|
-
userAccountBranchCode: userBanks[0].branchCode,
|
|
291
281
|
}
|
|
292
282
|
}),
|
|
293
283
|
setHouseBank: assign((context, event) => {
|
|
@@ -316,23 +306,11 @@ export default function (request) {
|
|
|
316
306
|
}
|
|
317
307
|
}),
|
|
318
308
|
setUserBank: assign((context, event) => {
|
|
319
|
-
const { accountNumber, holderName
|
|
309
|
+
const { accountNumber, holderName } = event.data
|
|
320
310
|
return {
|
|
321
311
|
selectedUserBank: event.data,
|
|
322
312
|
userAccountNumber: accountNumber,
|
|
323
313
|
userAccountName: holderName,
|
|
324
|
-
userAccountBranchName: branch,
|
|
325
|
-
userAccountBranchCode: branchCode,
|
|
326
|
-
}
|
|
327
|
-
}),
|
|
328
|
-
setUserAccountBranchName: assign((context, event) => {
|
|
329
|
-
return {
|
|
330
|
-
userAccountBranchName: event.data,
|
|
331
|
-
}
|
|
332
|
-
}),
|
|
333
|
-
setUserAccountBranchCode: assign((context, event) => {
|
|
334
|
-
return {
|
|
335
|
-
userAccountBranchCode: event.data,
|
|
336
314
|
}
|
|
337
315
|
}),
|
|
338
316
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -381,14 +359,8 @@ export default function (request) {
|
|
|
381
359
|
return context.calculation
|
|
382
360
|
},
|
|
383
361
|
isSubmittable: (context, event) => {
|
|
384
|
-
const { amount, userAccountNumber, userAccountName,
|
|
385
|
-
|
|
386
|
-
const defaultCheck = amount && userAccountNumber && userAccountName && depositTime && receipt
|
|
387
|
-
if (branchCodeEnable === '1') {
|
|
388
|
-
return defaultCheck && userAccountBranchCode
|
|
389
|
-
} else {
|
|
390
|
-
return defaultCheck
|
|
391
|
-
}
|
|
362
|
+
const { amount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
363
|
+
return amount && userAccountNumber && userAccountName && depositTime && receipt
|
|
392
364
|
},
|
|
393
365
|
isProcessing: (context, event) => {
|
|
394
366
|
return context.processing
|
|
@@ -426,19 +398,7 @@ export default function (request) {
|
|
|
426
398
|
)
|
|
427
399
|
},
|
|
428
400
|
submitDeposit: async (context, event) => {
|
|
429
|
-
const {
|
|
430
|
-
method,
|
|
431
|
-
amount,
|
|
432
|
-
selectedHouseBank,
|
|
433
|
-
selectedUserBank,
|
|
434
|
-
userAccountNumber,
|
|
435
|
-
userAccountName,
|
|
436
|
-
userAccountBranchName,
|
|
437
|
-
userAccountBranchCode,
|
|
438
|
-
depositTime,
|
|
439
|
-
receipt,
|
|
440
|
-
promotion,
|
|
441
|
-
} = context
|
|
401
|
+
const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotion } = context
|
|
442
402
|
return await request.send(
|
|
443
403
|
payment.submitDepositTransactionBank({
|
|
444
404
|
method,
|
|
@@ -448,8 +408,6 @@ export default function (request) {
|
|
|
448
408
|
applyerBankCode: selectedUserBank.bankCode,
|
|
449
409
|
applyerAccountNumber: userAccountNumber,
|
|
450
410
|
applyerHolderName: userAccountName,
|
|
451
|
-
applyerBranchName: userAccountBranchName,
|
|
452
|
-
applyerBranchCode: userAccountBranchCode,
|
|
453
411
|
depositTime,
|
|
454
412
|
receipt,
|
|
455
413
|
promotionsNo: promotion?.activityNo,
|