@zeniai/client-epic-state 4.14.93 → 4.14.94
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.
|
@@ -19,7 +19,7 @@ const createBankAccountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
19
19
|
return zeniAPI
|
|
20
20
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bank-accounts`, (0, bankAccountViewPayload_1.toBankAccountPayload)(bankAccountLocalData, paymentMethodType))
|
|
21
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
23
23
|
const bankAccountActions = [];
|
|
24
24
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
25
25
|
bankAccountActions.push((0, bankAccountReducer_1.updateBankAccounts)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.bank_accounts) !== null && _b !== void 0 ? _b : []), (0, bankAccountViewReducer_1.updateStatusForCreateBankAccountFlow)({
|
|
@@ -40,17 +40,27 @@ const createBankAccountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
40
40
|
bankAccountActions.push((0, vendorViewReducer_1.saveVendor)(vendorId));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
if (
|
|
43
|
+
if (bankAccountContext === 'express-pay') {
|
|
44
|
+
// if bank detail is added from express pay page, it has to be selected by default
|
|
45
|
+
bankAccountActions.push((0, expressPayReducer_1.updateExpressPayFormLocalData)({
|
|
46
|
+
localData: Object.assign(Object.assign({}, expressPayState.formLocalData), { amount: (_f = (_e = expressPayState.formLocalData) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : {
|
|
47
|
+
amount: 0,
|
|
48
|
+
currencyCode: 'USD',
|
|
49
|
+
currencySymbol: '$',
|
|
50
|
+
}, paymentDate: (_h = (_g = expressPayState.formLocalData) === null || _g === void 0 ? void 0 : _g.paymentDate) !== null && _h !== void 0 ? _h : (0, zeniDayJS_1.dateNow)(), paymentToAccountId: (_k = (_j = response.data) === null || _j === void 0 ? void 0 : _j.bank_accounts[0].bank_account_id) !== null && _k !== void 0 ? _k : '' }),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
if (((_l = response.data) === null || _l === void 0 ? void 0 : _l.bank_accounts[0].bank_routing_number_ach) !=
|
|
44
54
|
null &&
|
|
45
|
-
((
|
|
55
|
+
((_m = response.data) === null || _m === void 0 ? void 0 : _m.bank_accounts[0].bank_routing_number_ach.length) !== 0) {
|
|
46
56
|
bankAccountActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
47
57
|
messageSection: 'create_bank_account_ach',
|
|
48
58
|
messageText: 'success',
|
|
49
59
|
type: 'success',
|
|
50
60
|
}));
|
|
51
61
|
}
|
|
52
|
-
else if (((
|
|
53
|
-
((
|
|
62
|
+
else if (((_o = response.data) === null || _o === void 0 ? void 0 : _o.bank_accounts[0].bank_routing_number_wire_transfer) != null &&
|
|
63
|
+
((_p = response.data) === null || _p === void 0 ? void 0 : _p.bank_accounts[0].bank_routing_number_wire_transfer.length) !== 0) {
|
|
54
64
|
bankAccountActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
55
65
|
messageSection: 'create_bank_account_wire',
|
|
56
66
|
messageText: 'success',
|
|
@@ -67,7 +77,7 @@ const createBankAccountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
67
77
|
else if (response.status.code === 409) {
|
|
68
78
|
bankAccountActions.push(
|
|
69
79
|
// bank account already exists
|
|
70
|
-
(0, bankAccountReducer_1.updateBankAccounts)((
|
|
80
|
+
(0, bankAccountReducer_1.updateBankAccounts)((_r = (_q = response.data) === null || _q === void 0 ? void 0 : _q.bank_accounts) !== null && _r !== void 0 ? _r : []), (0, bankAccountViewReducer_1.updateStatusForCreateBankAccountFlow)({
|
|
71
81
|
fetchState: 'Error',
|
|
72
82
|
error: response.status,
|
|
73
83
|
isInternationalBankAccount: false,
|
|
@@ -88,7 +98,7 @@ const createBankAccountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
88
98
|
bankAccountContext === 'express-pay') {
|
|
89
99
|
bankAccountActions.push((0, vendorViewReducer_1.updateBankAccountsInVendorView)({
|
|
90
100
|
bankAccountIds: [
|
|
91
|
-
(
|
|
101
|
+
(_t = (_s = response.data) === null || _s === void 0 ? void 0 : _s.bank_accounts[0].bank_account_id) !== null && _t !== void 0 ? _t : '',
|
|
92
102
|
],
|
|
93
103
|
vendorId: vendorId,
|
|
94
104
|
}));
|
|
@@ -99,11 +109,11 @@ const createBankAccountEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
99
109
|
if (bankAccountContext === 'express-pay') {
|
|
100
110
|
// if bank detail is added from express pay page, it has to be selected by default
|
|
101
111
|
bankAccountActions.push((0, expressPayReducer_1.updateExpressPayFormLocalData)({
|
|
102
|
-
localData: Object.assign(Object.assign({}, expressPayState.formLocalData), { amount: (
|
|
112
|
+
localData: Object.assign(Object.assign({}, expressPayState.formLocalData), { amount: (_v = (_u = expressPayState.formLocalData) === null || _u === void 0 ? void 0 : _u.amount) !== null && _v !== void 0 ? _v : {
|
|
103
113
|
amount: 0,
|
|
104
114
|
currencyCode: 'USD',
|
|
105
115
|
currencySymbol: '$',
|
|
106
|
-
}, paymentDate: (
|
|
116
|
+
}, paymentDate: (_x = (_w = expressPayState.formLocalData) === null || _w === void 0 ? void 0 : _w.paymentDate) !== null && _x !== void 0 ? _x : (0, zeniDayJS_1.dateNow)(), paymentToAccountId: (_z = (_y = response.data) === null || _y === void 0 ? void 0 : _y.bank_accounts[0].bank_account_id) !== null && _z !== void 0 ? _z : '' }),
|
|
107
117
|
}));
|
|
108
118
|
}
|
|
109
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.94",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|