@zeniai/client-epic-state 4.8.13 → 4.8.14
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/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +4 -2
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +24 -3
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +11 -3
- package/lib/entity/billPay/billTransaction/billTransactionState.js +12 -1
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -1
- package/lib/entity/reimbursement/reimbursementPayload.js +12 -3
- package/lib/entity/reimbursement/reimbursementState.d.ts +7 -3
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +2 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +2 -3
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +6 -7
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +21 -26
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.d.ts +0 -4
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +3 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +4 -3
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +10 -8
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +38 -38
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +14 -4
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +2 -2
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +8 -48
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +11 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +69 -50
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +2 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +2 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +13 -7
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +6 -9
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +14 -12
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +27 -25
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.d.ts +5 -0
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +41 -30
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferMoneyEpic.js +4 -4
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FetchState } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { DepositAccount } from '../../../../entity/depositAccount/depositAccount';
|
|
4
|
+
import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
3
5
|
import { RootState } from '../../../../reducer';
|
|
4
6
|
import { TransferDetailLocalData, TransferMoneyParty } from './transferDetailState';
|
|
5
7
|
export interface TransferDetailSelectorView extends SelectorView {
|
|
@@ -8,3 +10,6 @@ export interface TransferDetailSelectorView extends SelectorView {
|
|
|
8
10
|
transferMoneyPartiesFetchState: FetchState;
|
|
9
11
|
}
|
|
10
12
|
export declare const getTransferDetail: (state: RootState) => TransferDetailSelectorView;
|
|
13
|
+
export declare const getTransferMoneyParties: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[]) => TransferMoneyParty[];
|
|
14
|
+
export declare const mapDepositAccToTransferMoneyParty: (depositAcc: DepositAccount) => TransferMoneyParty;
|
|
15
|
+
export declare const mapPaymentAccToTransferMoneyParty: (paymentAcc: PaymentAccount) => TransferMoneyParty;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTransferDetail = void 0;
|
|
3
|
+
exports.mapPaymentAccToTransferMoneyParty = exports.mapDepositAccToTransferMoneyParty = exports.getTransferMoneyParties = exports.getTransferDetail = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const depositAccountPayload_1 = require("../../../../entity/depositAccount/depositAccountPayload");
|
|
6
6
|
const depositAccountListSelector_1 = require("../depositAccountList/depositAccountListSelector");
|
|
@@ -17,35 +17,7 @@ const getTransferDetail = (state) => {
|
|
|
17
17
|
]).fetchState;
|
|
18
18
|
if (depositAccountsView.fetchState === 'Completed' &&
|
|
19
19
|
paymentAccountsView.fetchState === 'Completed') {
|
|
20
|
-
transferParties =
|
|
21
|
-
...depositAccountsView.depositAccounts.map((depositAcc) => ({
|
|
22
|
-
id: depositAcc.id,
|
|
23
|
-
accType: 'depositAccount',
|
|
24
|
-
label: depositAcc.accountName,
|
|
25
|
-
maskedAccountNumber: depositAcc.maskedAccountNumber,
|
|
26
|
-
accountBalance: depositAcc.accountBalance,
|
|
27
|
-
logo: undefined,
|
|
28
|
-
})),
|
|
29
|
-
...paymentAccountsView.paymentAccounts
|
|
30
|
-
.filter((paymentAccount) => {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
|
|
33
|
-
((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
|
|
34
|
-
'manually_verified';
|
|
35
|
-
})
|
|
36
|
-
.map((paymentAcc) => {
|
|
37
|
-
var _a;
|
|
38
|
-
return ({
|
|
39
|
-
id: paymentAcc.paymentAccountId,
|
|
40
|
-
accType: 'paymentAccount',
|
|
41
|
-
maskedAccountNumber: paymentAcc.maskedAccountNumber,
|
|
42
|
-
label: Boolean(paymentAcc.institutionDetails.institutionName) === true
|
|
43
|
-
? paymentAcc.institutionDetails.institutionName
|
|
44
|
-
: (0, depositAccountPayload_1.getZeniAccountFallbackName)(paymentAcc.maskedAccountNumber, (_a = paymentAcc.accountSubType) === null || _a === void 0 ? void 0 : _a.name),
|
|
45
|
-
logo: paymentAcc.institutionDetails.logo,
|
|
46
|
-
});
|
|
47
|
-
}),
|
|
48
|
-
];
|
|
20
|
+
transferParties = (0, exports.getTransferMoneyParties)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts);
|
|
49
21
|
}
|
|
50
22
|
return {
|
|
51
23
|
transferDetailLocalData: localData,
|
|
@@ -57,3 +29,42 @@ const getTransferDetail = (state) => {
|
|
|
57
29
|
};
|
|
58
30
|
};
|
|
59
31
|
exports.getTransferDetail = getTransferDetail;
|
|
32
|
+
/* This helper function takes deposit accounts and payment accounts
|
|
33
|
+
and give back TrasferMoneyParty type array
|
|
34
|
+
to support single dropdown with both lists */
|
|
35
|
+
const getTransferMoneyParties = (depositAccounts, paymentAccounts) => {
|
|
36
|
+
return [
|
|
37
|
+
...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToTransferMoneyParty)(depositAcc)),
|
|
38
|
+
...paymentAccounts
|
|
39
|
+
.filter((paymentAccount) => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
|
|
42
|
+
((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
|
|
43
|
+
'manually_verified';
|
|
44
|
+
})
|
|
45
|
+
.map((paymentAcc) => (0, exports.mapPaymentAccToTransferMoneyParty)(paymentAcc)),
|
|
46
|
+
];
|
|
47
|
+
};
|
|
48
|
+
exports.getTransferMoneyParties = getTransferMoneyParties;
|
|
49
|
+
const mapDepositAccToTransferMoneyParty = (depositAcc) => ({
|
|
50
|
+
id: depositAcc.id,
|
|
51
|
+
accType: 'depositAccount',
|
|
52
|
+
label: depositAcc.accountName,
|
|
53
|
+
maskedAccountNumber: depositAcc.maskedAccountNumber,
|
|
54
|
+
accountBalance: depositAcc.accountBalance,
|
|
55
|
+
logo: undefined,
|
|
56
|
+
});
|
|
57
|
+
exports.mapDepositAccToTransferMoneyParty = mapDepositAccToTransferMoneyParty;
|
|
58
|
+
const mapPaymentAccToTransferMoneyParty = (paymentAcc) => {
|
|
59
|
+
var _a;
|
|
60
|
+
return ({
|
|
61
|
+
id: paymentAcc.paymentAccountId,
|
|
62
|
+
accType: 'paymentAccount',
|
|
63
|
+
maskedAccountNumber: paymentAcc.maskedAccountNumber,
|
|
64
|
+
label: Boolean(paymentAcc.institutionDetails.institutionName) === true
|
|
65
|
+
? paymentAcc.institutionDetails.institutionName
|
|
66
|
+
: (0, depositAccountPayload_1.getZeniAccountFallbackName)(paymentAcc.maskedAccountNumber, (_a = paymentAcc.accountSubType) === null || _a === void 0 ? void 0 : _a.name),
|
|
67
|
+
logo: paymentAcc.institutionDetails.logo,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
exports.mapPaymentAccToTransferMoneyParty = mapPaymentAccToTransferMoneyParty;
|
|
@@ -9,18 +9,18 @@ const depositAccountListReducer_1 = require("../depositAccountList/depositAccoun
|
|
|
9
9
|
const depositAccountTransactionListReducer_1 = require("../depositAccountTransactionList/depositAccountTransactionListReducer");
|
|
10
10
|
const helpers_1 = require("../../helpers");
|
|
11
11
|
const transferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transferDetailReducer_1.transferMoney.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
var _a, _b, _c, _d;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
13
|
const state = state$.value;
|
|
14
14
|
const { depositAccountId } = action.payload;
|
|
15
15
|
const localData = state.transferDetailState.localData;
|
|
16
16
|
const payload = {
|
|
17
17
|
from_account: {
|
|
18
18
|
account_id: (_a = localData.transferFrom) === null || _a === void 0 ? void 0 : _a.id,
|
|
19
|
-
account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType),
|
|
19
|
+
account_type: (_c = (0, helpers_1.accountTypeSubConfigCodeToAccType)((_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType)) !== null && _c !== void 0 ? _c : '',
|
|
20
20
|
},
|
|
21
21
|
to_account: {
|
|
22
|
-
account_id: (
|
|
23
|
-
account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((
|
|
22
|
+
account_id: (_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.id,
|
|
23
|
+
account_type: (_f = (0, helpers_1.accountTypeSubConfigCodeToAccType)((_e = localData.transferTo) === null || _e === void 0 ? void 0 : _e.accType)) !== null && _f !== void 0 ? _f : '',
|
|
24
24
|
},
|
|
25
25
|
amount: localData.amount.amount,
|
|
26
26
|
currency_code: localData.amount.currencyCode,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.14",
|
|
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",
|