@zeniai/client-epic-state 4.10.75 → 4.10.76
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/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +12 -12
- package/lib/view/spendManagement/helpers.js +8 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +6 -3
- package/package.json +1 -1
|
@@ -79,6 +79,6 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
|
|
|
79
79
|
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
|
|
80
80
|
export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
|
|
81
81
|
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
|
|
82
|
-
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[]) => FundingAccount[];
|
|
82
|
+
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[], includeOnlyVerifiedAccounts?: boolean) => FundingAccount[];
|
|
83
83
|
export declare const mapDepositAccToFundingAccount: (depositAcc: DepositAccount) => FundingAccount;
|
|
84
84
|
export declare const mapPaymentAccToFundingAccount: (paymentAcc: PaymentAccount) => FundingAccount;
|
|
@@ -18,7 +18,7 @@ function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccount
|
|
|
18
18
|
const allBankAccounts = (_a = allBankAccountIds === null || allBankAccountIds === void 0 ? void 0 : allBankAccountIds.map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, setupViewType)).filter((account) => account != null)) !== null && _a !== void 0 ? _a : [];
|
|
19
19
|
const paymentAccounts = (_b = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : [];
|
|
20
20
|
const depositAccounts = (_c = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _c !== void 0 ? _c : [];
|
|
21
|
-
const allFundingAccounts = (0, exports.getAllFundingAccounts)(depositAccounts, paymentAccounts);
|
|
21
|
+
const allFundingAccounts = (0, exports.getAllFundingAccounts)(depositAccounts, paymentAccounts, false);
|
|
22
22
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
23
23
|
const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
|
|
24
24
|
let paymentAccount;
|
|
@@ -166,19 +166,19 @@ exports.getCompanyAndIdentityDetails = getCompanyAndIdentityDetails;
|
|
|
166
166
|
/* This helper function takes deposit accounts and payment accounts
|
|
167
167
|
and give back FundingAccount type array
|
|
168
168
|
to support single dropdown with both lists */
|
|
169
|
-
const getAllFundingAccounts = (depositAccounts, paymentAccounts) => {
|
|
169
|
+
const getAllFundingAccounts = (depositAccounts, paymentAccounts, includeOnlyVerifiedAccounts = true) => {
|
|
170
170
|
return [
|
|
171
171
|
...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToFundingAccount)(depositAcc)),
|
|
172
|
-
...
|
|
173
|
-
.filter((paymentAccount) => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc)),
|
|
172
|
+
...(includeOnlyVerifiedAccounts
|
|
173
|
+
? paymentAccounts.filter((paymentAccount) => {
|
|
174
|
+
var _a, _b, _c;
|
|
175
|
+
return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
|
|
176
|
+
((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
|
|
177
|
+
'manually_verified' ||
|
|
178
|
+
((_c = paymentAccount.providerVerificationStatus) === null || _c === void 0 ? void 0 : _c.code) ===
|
|
179
|
+
'automatically_verified';
|
|
180
|
+
})
|
|
181
|
+
: paymentAccounts).map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc)),
|
|
182
182
|
];
|
|
183
183
|
};
|
|
184
184
|
exports.getAllFundingAccounts = getAllFundingAccounts;
|
|
@@ -262,6 +262,13 @@ const getActualPaymentDate = (billPayInfo) => {
|
|
|
262
262
|
};
|
|
263
263
|
exports.getActualPaymentDate = getActualPaymentDate;
|
|
264
264
|
function isVerifiedStatusCode(statusCode) {
|
|
265
|
-
return [
|
|
265
|
+
return [
|
|
266
|
+
'verified',
|
|
267
|
+
'automatically_verified',
|
|
268
|
+
'manually_verified',
|
|
269
|
+
'pending_automatic_verification',
|
|
270
|
+
'pending_manual_verification',
|
|
271
|
+
'pending_verification',
|
|
272
|
+
].includes(statusCode);
|
|
266
273
|
}
|
|
267
274
|
exports.isVerifiedStatusCode = isVerifiedStatusCode;
|
|
@@ -131,8 +131,10 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
131
131
|
fetchState: 'Completed',
|
|
132
132
|
error: undefined,
|
|
133
133
|
} });
|
|
134
|
-
|
|
135
|
-
paymentAccountIds
|
|
134
|
+
if (plaidAccountKeyType !== 'reimbursement_setup') {
|
|
135
|
+
draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
|
|
136
|
+
paymentAccountIds;
|
|
137
|
+
}
|
|
136
138
|
},
|
|
137
139
|
prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
|
|
138
140
|
return {
|
|
@@ -211,7 +213,8 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
211
213
|
fetchState: 'In-Progress',
|
|
212
214
|
error: undefined,
|
|
213
215
|
} });
|
|
214
|
-
if (paymentAccountId != null
|
|
216
|
+
if (paymentAccountId != null &&
|
|
217
|
+
plaidAccountKeyType !== 'reimbursement_setup') {
|
|
215
218
|
draft[plaidAccountKeyType].accountDetails.paymentAccountIds = [
|
|
216
219
|
paymentAccountId,
|
|
217
220
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.76",
|
|
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",
|