@zeniai/client-epic-state 4.11.56 → 4.11.58
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/cardPayment/cardPaymentPayload.d.ts +2 -2
- package/lib/entity/cardPayment/cardPaymentPayload.js +11 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +0 -12
- package/lib/entity/company/companyPayload.js +0 -21
- package/lib/entity/company/companyReducer.d.ts +0 -7
- package/lib/entity/company/companyReducer.js +2 -22
- package/lib/entity/company/companyStateTypes.d.ts +0 -12
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +0 -2
- package/lib/entity/paymentAccount/paymentAccountPayload.js +0 -2
- package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +3 -16
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/index.d.ts +9 -9
- package/lib/index.js +18 -21
- package/lib/view/bankAccountView/epic/createBankAccountEpic.js +3 -5
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +0 -2
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/referralView/referralState.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +41 -45
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +4 -6
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +6 -29
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.d.ts +1 -3
- package/lib/view/settingsView/settingsViewReducer.js +2 -11
- package/lib/view/settingsView/settingsViewSelector.d.ts +1 -1
- package/lib/view/settingsView/settingsViewSelector.js +7 -59
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +2 -10
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
- package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +1 -4
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -16
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +12 -15
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +6 -6
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +1 -4
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -16
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +31 -47
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +5 -4
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +12 -34
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +16 -52
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/getPlaidLinkTokenEpic.js +1 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +27 -21
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +74 -47
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +8 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +19 -6
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +1 -4
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +9 -20
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +6 -6
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +6 -6
- package/package.json +2 -2
|
@@ -69,51 +69,47 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
const sortOrderValue = (0, sortOrderPayload_1.getSortOrder)(sortOrder);
|
|
72
|
-
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, sortKey === 'auditScore'
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return isSecondarySortApplicable === true
|
|
114
|
-
? [primarySortValue, secondarySortValue]
|
|
115
|
-
: primarySortValue;
|
|
116
|
-
}, [sortOrderValue, sortOrderValue]);
|
|
72
|
+
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, (sortKey === 'auditScore') ? ['auditSummary.auditScorePercentage', 'auditSummary.fixesRequired'] : (company) => {
|
|
73
|
+
var _a;
|
|
74
|
+
const warningCount = (0, exports.getAuditWarningsCount)(company);
|
|
75
|
+
let primarySortValue;
|
|
76
|
+
let secondarySortValue;
|
|
77
|
+
let isSecondarySortApplicable;
|
|
78
|
+
switch (sortKey) {
|
|
79
|
+
case 'notes':
|
|
80
|
+
primarySortValue = (_a = company.note) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
81
|
+
break;
|
|
82
|
+
case 'uncategorized':
|
|
83
|
+
isSecondarySortApplicable = true;
|
|
84
|
+
primarySortValue = company.uncategorizedTransactions.income ? 1 : 0;
|
|
85
|
+
secondarySortValue = company.uncategorizedTransactions.expense
|
|
86
|
+
? 1
|
|
87
|
+
: 0;
|
|
88
|
+
break;
|
|
89
|
+
case 'miscategorized':
|
|
90
|
+
isSecondarySortApplicable = true;
|
|
91
|
+
primarySortValue = company.miscategorizedTransactions.income
|
|
92
|
+
? 1
|
|
93
|
+
: 0;
|
|
94
|
+
secondarySortValue = company.miscategorizedTransactions.expense
|
|
95
|
+
? 1
|
|
96
|
+
: 0;
|
|
97
|
+
break;
|
|
98
|
+
case 'warnings':
|
|
99
|
+
primarySortValue = warningCount;
|
|
100
|
+
break;
|
|
101
|
+
case 'reviewVendor':
|
|
102
|
+
primarySortValue = company.isVendorReviewReqiured;
|
|
103
|
+
break;
|
|
104
|
+
case 'companyName':
|
|
105
|
+
default:
|
|
106
|
+
primarySortValue = company.name.toLowerCase();
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
return isSecondarySortApplicable === true
|
|
110
|
+
? [primarySortValue, secondarySortValue]
|
|
111
|
+
: primarySortValue;
|
|
112
|
+
}, [sortOrderValue, sortOrderValue]);
|
|
117
113
|
return {
|
|
118
114
|
companies: [
|
|
119
115
|
...sortedCompaniesWithSortKeyValue,
|
|
@@ -10,7 +10,7 @@ export declare const ALL_SCHEDULES_SUB_TABS: readonly ["all", "new", "ongoing",
|
|
|
10
10
|
export declare const toScheduleSubTabType: (v: string) => "all" | "new" | "completed" | "ongoing";
|
|
11
11
|
export declare type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
12
12
|
export declare const ALL_SCHEDULES_PAY_SORT_KEYS: readonly ["transactionDate", "vendor", "scheduleCategory", "expenseCategory", "accumulatedDepreciationCategory", "class", "amount", "balanceAsOfToday", "memo", "startMonth", "endMonth", "months", "transactionType", "status", "assetId", "user"];
|
|
13
|
-
export declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "amount" | "vendor" | "class" | "memo" | "transactionDate" | "
|
|
13
|
+
export declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "amount" | "vendor" | "class" | "memo" | "transactionDate" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "balanceAsOfToday" | "startMonth" | "endMonth" | "transactionType" | "assetId";
|
|
14
14
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
15
15
|
export interface DownloadJEScheduleTabOptions {
|
|
16
16
|
timezone: string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ActionsObservable
|
|
1
|
+
import { ActionsObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
3
|
import { fetchBankConnectionsView, fetchBankAccountsList } from '../settingsViewReducer';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
export declare const fetchBankConnectionsViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
4
|
+
import { getPaymentAccounts } from '../../spendManagement/plaidAccount/plaidAccountViewReducer';
|
|
5
|
+
export declare type ActionType = ReturnType<typeof fetchBankConnectionsView> | ReturnType<typeof fetchBankAccountsList> | ReturnType<typeof getPaymentAccounts>;
|
|
6
|
+
export declare const fetchBankConnectionsViewEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
|
|
@@ -4,34 +4,11 @@ exports.fetchBankConnectionsViewEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (cacheOverride === true) {
|
|
14
|
-
bankConnectionActions.push((0, settingsViewReducer_1.fetchBankAccountsList)());
|
|
15
|
-
bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
|
|
16
|
-
bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const bankAccountsList = state.settingsViewState.bankConnection;
|
|
20
|
-
if (bankAccountsList.fetchState !== 'Completed' &&
|
|
21
|
-
bankAccountsList.fetchState !== 'In-Progress') {
|
|
22
|
-
bankConnectionActions.push((0, settingsViewReducer_1.fetchBankAccountsList)());
|
|
23
|
-
}
|
|
24
|
-
const paymentAccountList = state.paymentAccountListState;
|
|
25
|
-
if (paymentAccountList.hasValidState() === false &&
|
|
26
|
-
paymentAccountList.fetchState !== 'In-Progress') {
|
|
27
|
-
bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
|
|
28
|
-
}
|
|
29
|
-
const depositAccountList = state.depositAccountListState;
|
|
30
|
-
if (depositAccountList.hasValidState() === false &&
|
|
31
|
-
depositAccountList.fetchState !== 'In-Progress') {
|
|
32
|
-
bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return (0, rxjs_1.concat)((0, rxjs_1.from)(bankConnectionActions));
|
|
7
|
+
const plaidAccountViewReducer_1 = require("../../spendManagement/plaidAccount/plaidAccountViewReducer");
|
|
8
|
+
const fetchBankConnectionsViewEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankConnectionsView.match), (0, operators_1.switchMap)(() => {
|
|
9
|
+
return (0, rxjs_1.from)([
|
|
10
|
+
(0, settingsViewReducer_1.fetchBankAccountsList)(),
|
|
11
|
+
(0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup', false),
|
|
12
|
+
]);
|
|
36
13
|
}));
|
|
37
14
|
exports.fetchBankConnectionsViewEpic = fetchBankConnectionsViewEpic;
|
|
@@ -18,7 +18,7 @@ export declare const saveNotificationSettingsEpic: (actions$: ActionsObservable<
|
|
|
18
18
|
type: string;
|
|
19
19
|
} | {
|
|
20
20
|
payload: {
|
|
21
|
-
messageSection: "
|
|
21
|
+
messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success";
|
|
22
22
|
messageText: "failed" | "success" | "notification";
|
|
23
23
|
type: import("../../..").SnackbarMessageType;
|
|
24
24
|
showStatusIcon?: boolean | undefined;
|
|
@@ -11,9 +11,7 @@ export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreato
|
|
|
11
11
|
companyId: string;
|
|
12
12
|
}, string, never, never>, updateMyProfileOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string], {
|
|
13
13
|
userId: string;
|
|
14
|
-
}, string, never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankConnectionsView: import("@reduxjs/toolkit").
|
|
15
|
-
cacheOverride: any;
|
|
16
|
-
}, string, never, never>, fetchBillingAccountsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
|
+
}, string, never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankConnectionsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchBillingAccountsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
15
|
bankAccountIds: ID[];
|
|
18
16
|
}, string>, updateBankConnectionOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankAccountsList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchNotificationSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateNotificationSettingsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: NotificationSettingsPayload, loggedInUserEmail: string], {
|
|
19
17
|
data: NotificationSettingsPayload;
|
|
@@ -94,17 +94,8 @@ const settings = (0, toolkit_1.createSlice)({
|
|
|
94
94
|
draft.profile.fetchState = 'Error';
|
|
95
95
|
draft.profile.error = action.payload;
|
|
96
96
|
},
|
|
97
|
-
fetchBankConnectionsView
|
|
98
|
-
|
|
99
|
-
// do nothing
|
|
100
|
-
},
|
|
101
|
-
prepare(cacheOverride) {
|
|
102
|
-
return {
|
|
103
|
-
payload: {
|
|
104
|
-
cacheOverride,
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
},
|
|
97
|
+
fetchBankConnectionsView() {
|
|
98
|
+
// Do nothing.
|
|
108
99
|
},
|
|
109
100
|
fetchBillingAccountsView() {
|
|
110
101
|
// Do nothing.
|
|
@@ -3,7 +3,7 @@ import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
|
3
3
|
import { MyBankConnectionsView, BankConnectionsSetupView, MyProfileSelectorView, NotificationSettingsSelectorView, IntegrationsView, BillingView } from './types/settingsViewSelectorTypes';
|
|
4
4
|
import { NotificationSettings } from './settingsViewState';
|
|
5
5
|
export declare function getApprovalRuleViewDetails(state: RootState): FetchStateAndError;
|
|
6
|
-
export declare function getBankConnectionsSetupViewDetails(state: RootState, companyId: ID
|
|
6
|
+
export declare function getBankConnectionsSetupViewDetails(state: RootState, companyId: ID): BankConnectionsSetupView;
|
|
7
7
|
export declare function getBillingAccountsViewDetails(state: RootState, companyId: ID): BillingView;
|
|
8
8
|
export declare function getMyBankConnectionsDetails(state: RootState, userId: ID): MyBankConnectionsView;
|
|
9
9
|
export declare function getIntegrationsView(state: RootState, companyId: ID): IntegrationsView;
|
|
@@ -19,8 +19,6 @@ const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
|
19
19
|
const companyPassportViewSelector_1 = require("../companyView/selector/companyPassportViewSelector");
|
|
20
20
|
const userFinancialAccountSelector_1 = require("../userFinancialAccount/userFinancialAccountSelector");
|
|
21
21
|
const setupViewSelector_1 = require("../../view/spendManagement/commonSetup/setupViewSelector");
|
|
22
|
-
const depositAccountSelector_1 = require("../../entity/depositAccount/depositAccountSelector");
|
|
23
|
-
const getCompanyView_1 = require("../companyView/selectorHelpers/getCompanyView");
|
|
24
22
|
const cardPaymentViewSelector_1 = require("../cardPayment/cardPaymentViewSelector");
|
|
25
23
|
function getApprovalRuleViewDetails(state) {
|
|
26
24
|
const { billPaySetupApproverViewState, remiSetupApproverViewState } = state;
|
|
@@ -33,68 +31,18 @@ function getApprovalRuleViewDetails(state) {
|
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
exports.getApprovalRuleViewDetails = getApprovalRuleViewDetails;
|
|
36
|
-
function getBankConnectionsSetupViewDetails(state, companyId
|
|
37
|
-
|
|
38
|
-
const { accountState, settingsViewState, paymentAccountState, depositAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
34
|
+
function getBankConnectionsSetupViewDetails(state, companyId) {
|
|
35
|
+
const { accountState, plaidAccountViewState, settingsViewState } = state;
|
|
39
36
|
const { bankConnection } = settingsViewState;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
? bankConnection.bankAccountIds
|
|
44
|
-
.map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, 'bill_pay'))
|
|
45
|
-
.filter((account) => account != null)
|
|
46
|
-
: [];
|
|
47
|
-
const paymentAccounts = paymentAccountListState.hasValidState()
|
|
48
|
-
? (_a = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _a !== void 0 ? _a : []
|
|
49
|
-
: [];
|
|
50
|
-
const depositAccounts = depositAccountListState.hasValidState()
|
|
51
|
-
? (_b = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : []
|
|
52
|
-
: [];
|
|
37
|
+
const allBankAccounts = bankConnection.bankAccountIds
|
|
38
|
+
.map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, 'bill_pay'))
|
|
39
|
+
.filter((account) => account != null);
|
|
53
40
|
const fetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
54
41
|
settingsViewState.bankConnection,
|
|
55
|
-
|
|
56
|
-
depositAccountListState,
|
|
42
|
+
plaidAccountViewState['spend_management_setup'].accountDetails.fetchStatus,
|
|
57
43
|
]);
|
|
58
|
-
const allFundingAccounts = fetchState.fetchState === 'Completed'
|
|
59
|
-
? (0, setupViewSelector_1.getAllFundingAccounts)(depositAccounts, paymentAccounts, false)
|
|
60
|
-
: [];
|
|
61
|
-
const primaryAccountsProductWise = [];
|
|
62
|
-
if (isBillPayEnabled) {
|
|
63
|
-
primaryAccountsProductWise.push(Object.assign({ productType: 'bill_pay' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'bill_pay_setup')));
|
|
64
|
-
}
|
|
65
|
-
if (isRemiEnabled) {
|
|
66
|
-
primaryAccountsProductWise.push(Object.assign({ productType: 'reimbursement' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement', 'reimbursement_setup')));
|
|
67
|
-
}
|
|
68
|
-
if (isAccountEnabled) {
|
|
69
|
-
primaryAccountsProductWise.push(Object.assign({ productType: 'zeni_accounts' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'zeni_accounts', 'account_setup')));
|
|
70
|
-
}
|
|
71
|
-
if (isCardEnabled) {
|
|
72
|
-
primaryAccountsProductWise.push(Object.assign({ productType: 'charge_cards' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards', 'charge_card_setup')));
|
|
73
|
-
}
|
|
74
|
-
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
75
|
-
const billPayPrimaryAccount = (_c = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount) === null || _c === void 0 ? void 0 : _c.accountId; //companyBillPayInfo
|
|
76
|
-
const remiPrimaryAccount = (_d = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyReimbursementInfo.primaryFundingAccount) === null || _d === void 0 ? void 0 : _d.accountId;
|
|
77
|
-
const accountsPrimaryAccount = (_e = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyZeniAccountInfo.primaryFundingAccount) === null || _e === void 0 ? void 0 : _e.accountId; //companyZeniAccountInfo
|
|
78
|
-
const chargeCardsPrimaryAccount = (_f = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo.primaryFundingAccount) === null || _f === void 0 ? void 0 : _f.accountId; //companyChargeCardInfo
|
|
79
|
-
const primaryAccounts = [];
|
|
80
|
-
if (billPayPrimaryAccount != null) {
|
|
81
|
-
primaryAccounts.push(billPayPrimaryAccount);
|
|
82
|
-
}
|
|
83
|
-
if (remiPrimaryAccount != null) {
|
|
84
|
-
primaryAccounts.push(remiPrimaryAccount);
|
|
85
|
-
}
|
|
86
|
-
if (accountsPrimaryAccount != null) {
|
|
87
|
-
primaryAccounts.push(accountsPrimaryAccount);
|
|
88
|
-
}
|
|
89
|
-
if (chargeCardsPrimaryAccount != null) {
|
|
90
|
-
primaryAccounts.push(chargeCardsPrimaryAccount);
|
|
91
|
-
}
|
|
92
|
-
const nonPrimaryPaymentAccounts = paymentAccounts.filter((paymentAcc) => !primaryAccounts.includes(paymentAcc.paymentAccountId));
|
|
93
44
|
return {
|
|
94
|
-
|
|
95
|
-
otherPaymentAccounts: nonPrimaryPaymentAccounts,
|
|
96
|
-
allFundingAccounts,
|
|
97
|
-
allBankAccounts,
|
|
45
|
+
setupView: Object.assign(Object.assign({}, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'spend_management_setup')), { allBankAccounts }),
|
|
98
46
|
fetchState: fetchState.fetchState,
|
|
99
47
|
};
|
|
100
48
|
}
|
|
@@ -5,13 +5,11 @@ import { PaymentAccount } from '../../../entity/paymentAccount/paymentAccountSta
|
|
|
5
5
|
import { User } from '../../../entity/user/userState';
|
|
6
6
|
import { UserRole } from '../../../entity/userRole/userRoleState';
|
|
7
7
|
import { Person } from '../../people/peopleSelectorTypes';
|
|
8
|
-
import {
|
|
8
|
+
import { SetupView } from '../../spendManagement/commonSetup/setupViewSelector';
|
|
9
9
|
import { UserFinancialAccountSelectorView } from '../../userFinancialAccount/userFinancialAccountSelector';
|
|
10
10
|
import { IntegrationsSettings, NotificationSettings, SettingsViewUIState } from '../settingsViewState';
|
|
11
11
|
import { TenantExternalConnections } from '../../../entity/tenant/tenantState';
|
|
12
12
|
import { Company } from '../../../entity/company/companyStateTypes';
|
|
13
|
-
import { EntityType as SpendManagementEntityType } from '../../../entity/entityApprovalStatus/entityApprovalStatusState';
|
|
14
|
-
import { AccountBase } from '../../../entity/account/accountState';
|
|
15
13
|
import { CardPaymentSelectorView } from '../../cardPayment/cardPaymentViewSelector';
|
|
16
14
|
export interface MyProfileSelectorView extends SelectorView {
|
|
17
15
|
isZeniUser: boolean;
|
|
@@ -31,19 +29,13 @@ export interface MyBankConnectionsView extends UserFinancialAccountSelectorView
|
|
|
31
29
|
paymentAccounts: PaymentAccount[];
|
|
32
30
|
}
|
|
33
31
|
export interface BankConnectionsSetupView extends FetchStateAndError {
|
|
34
|
-
|
|
35
|
-
otherPaymentAccounts: PaymentAccount[];
|
|
36
|
-
allFundingAccounts: FundingAccount[];
|
|
37
|
-
allBankAccounts: AccountBase[];
|
|
32
|
+
setupView: SetupView;
|
|
38
33
|
}
|
|
39
34
|
export interface BillingView extends FetchStateAndError {
|
|
40
35
|
setupView: SetupView;
|
|
41
36
|
cardPaymentView: CardPaymentSelectorView;
|
|
42
37
|
uiState: SettingsViewUIState;
|
|
43
38
|
}
|
|
44
|
-
export interface ProductWisePrimaryAccount extends SetupView {
|
|
45
|
-
productType: SpendManagementEntityType;
|
|
46
|
-
}
|
|
47
39
|
export interface NotificationSettingsSelectorView extends NotificationSettings {
|
|
48
40
|
allUsers: User[];
|
|
49
41
|
classList: Class[];
|
|
@@ -37,7 +37,7 @@ const getDuplicateBills = (state, billId) => {
|
|
|
37
37
|
exports.getDuplicateBills = getDuplicateBills;
|
|
38
38
|
const getReviewPageBillDetail = (state, billId) => {
|
|
39
39
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
40
|
-
const { accountListState, accountState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, recurringBillState, depositAccountState, depositAccountListState,
|
|
40
|
+
const { accountListState, accountState, plaidAccountViewState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, recurringBillState, depositAccountState, depositAccountListState, } = state;
|
|
41
41
|
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId !== null && billId !== void 0 ? billId : '');
|
|
42
42
|
const sourceBillDetail = billId != null
|
|
43
43
|
? (_a = editBillDetailViewState.editBillStateById) === null || _a === void 0 ? void 0 : _a[key]
|
|
@@ -47,7 +47,8 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
47
47
|
let paymentDetailsSection;
|
|
48
48
|
let file;
|
|
49
49
|
let contactDetails = [];
|
|
50
|
-
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState,
|
|
50
|
+
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, plaidAccountViewState['spend_management_setup'].accountDetails
|
|
51
|
+
.paymentAccountIds);
|
|
51
52
|
const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState).depositAccounts;
|
|
52
53
|
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount);
|
|
53
54
|
let fetchState = 'Not-Started';
|
|
@@ -4,7 +4,7 @@ exports.getBillPayBusinessVerificationDetails = exports.getBillPaySetupViewDetai
|
|
|
4
4
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
5
5
|
const helpers_1 = require("../../helpers");
|
|
6
6
|
function getBillPaySetupViewDetails(state, companyId) {
|
|
7
|
-
const billPaySetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', '
|
|
7
|
+
const billPaySetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'spend_management_setup');
|
|
8
8
|
const businessVerificationDetails = getBillPayBusinessVerificationDetails(state, companyId);
|
|
9
9
|
const selectedCompanyOfficer = (0, helpers_1.getSelectedCompanyOfficer)(businessVerificationDetails);
|
|
10
10
|
const { billPaySetupViewState, setupViewState } = state;
|
|
@@ -13,8 +13,5 @@ import { openSnackbar } from '../../../../../../entity/snackbar/snackbarReducer'
|
|
|
13
13
|
import { updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
|
|
14
14
|
import { fetchBillPaySetupView, fetchBillPaySetupViewSuccess, fetchBillPaySetupViewFailure } from '../../billPaySetupViewReducer';
|
|
15
15
|
import { updatePlaidAccountViewAccountDetails } from '../../../../plaidAccount/plaidAccountViewReducer';
|
|
16
|
-
|
|
17
|
-
import { updateDepositAccounts } from '../../../../../../entity/depositAccount/depositAccountReducer';
|
|
18
|
-
import { updateDepositAccountList } from '../../../../zeniAccounts/depositAccountList/depositAccountListReducer';
|
|
19
|
-
export declare type ActionType = ReturnType<typeof fetchBillPaySetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof updateDepositAccountList> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchBillPaySetupViewSuccess> | ReturnType<typeof fetchBillPaySetupViewFailure>;
|
|
16
|
+
export declare type ActionType = ReturnType<typeof fetchBillPaySetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchBillPaySetupViewSuccess> | ReturnType<typeof fetchBillPaySetupViewFailure>;
|
|
20
17
|
export declare const fetchBillPaySetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -16,9 +16,6 @@ const snackbarReducer_1 = require("../../../../../../entity/snackbar/snackbarRed
|
|
|
16
16
|
const setupViewReducer_1 = require("../../../../commonSetup/setupViewReducer");
|
|
17
17
|
const billPaySetupViewReducer_1 = require("../../billPaySetupViewReducer");
|
|
18
18
|
const plaidAccountViewReducer_1 = require("../../../../plaidAccount/plaidAccountViewReducer");
|
|
19
|
-
const paymentAccountListReducer_1 = require("../../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
20
|
-
const depositAccountReducer_1 = require("../../../../../../entity/depositAccount/depositAccountReducer");
|
|
21
|
-
const depositAccountListReducer_1 = require("../../../../zeniAccounts/depositAccountList/depositAccountListReducer");
|
|
22
19
|
const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupViewReducer_1.fetchBillPaySetupView.match), (0, operators_1.switchMap)((action) => {
|
|
23
20
|
var _a;
|
|
24
21
|
const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
|
|
@@ -32,9 +29,9 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
32
29
|
return zeniAPI
|
|
33
30
|
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"bill_pay_setup"}`)
|
|
34
31
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
35
|
-
var _a, _b, _c;
|
|
36
32
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
37
33
|
const allBankAccountIds = response.data.accounts.map((account) => account.account_id);
|
|
34
|
+
const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
|
|
38
35
|
const actions = [
|
|
39
36
|
(0, userReducer_1.updateAllUsers)({ users: response.data.users }),
|
|
40
37
|
(0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
|
|
@@ -46,19 +43,10 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
46
43
|
(0, fileReducer_1.updateFiles)({ files: response.data.files }),
|
|
47
44
|
(0, accountReducer_1.updateAccounts)(response.data.accounts, 'bill_pay'),
|
|
48
45
|
(0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
|
|
49
|
-
(0, paymentAccountListReducer_1.updatePaymentAccountList)({
|
|
50
|
-
data: response.data.payment_accounts,
|
|
51
|
-
updateType: 'replace',
|
|
52
|
-
}),
|
|
53
|
-
(0, depositAccountReducer_1.updateDepositAccounts)((_a = response.data.deposit_accounts) !== null && _a !== void 0 ? _a : []),
|
|
54
|
-
(0, depositAccountListReducer_1.updateDepositAccountList)({
|
|
55
|
-
data: (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.deposit_accounts) !== null && _c !== void 0 ? _c : [],
|
|
56
|
-
updateType: 'replace',
|
|
57
|
-
}),
|
|
58
46
|
(0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
59
47
|
companyId: response.data.companies[0].company_id,
|
|
60
48
|
}),
|
|
61
|
-
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, '
|
|
49
|
+
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'),
|
|
62
50
|
(0, billPaySetupViewReducer_1.fetchBillPaySetupViewSuccess)(),
|
|
63
51
|
];
|
|
64
52
|
return (0, rxjs_1.from)(actions);
|
|
@@ -74,10 +62,10 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
74
62
|
JSON.stringify(error))))));
|
|
75
63
|
}
|
|
76
64
|
else {
|
|
77
|
-
const { allBankAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
|
|
65
|
+
const { allBankAccountIds, paymentAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
|
|
78
66
|
return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
79
67
|
companyId,
|
|
80
|
-
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, '
|
|
68
|
+
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'), (0, billPaySetupViewReducer_1.fetchBillPaySetupViewSuccess)());
|
|
81
69
|
}
|
|
82
70
|
}));
|
|
83
71
|
exports.fetchBillPaySetupViewEpic = fetchBillPaySetupViewEpic;
|
|
@@ -32,7 +32,7 @@ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depo
|
|
|
32
32
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
33
33
|
const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
|
|
34
34
|
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, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
35
|
-
const { accountListState, accountState, bankAccountState, billDetailViewState,
|
|
35
|
+
const { accountListState, accountState, bankAccountState, billDetailViewState, plaidAccountViewState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, } = state;
|
|
36
36
|
const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
|
|
37
37
|
let recommendations = {};
|
|
38
38
|
if (billId != null) {
|
|
@@ -61,20 +61,17 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
61
61
|
? (_f = (_e = tenantState.tenantsById) === null || _e === void 0 ? void 0 : _e[currentTenantId]) === null || _f === void 0 ? void 0 : _f.companyId
|
|
62
62
|
: undefined;
|
|
63
63
|
const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
|
|
64
|
-
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState,
|
|
65
|
-
|
|
66
|
-
(transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId) != null
|
|
67
|
-
?
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
primaryPaymentAccount.some((account) => account.paymentAccountId === fromPaymentAccount[0].paymentAccountId) === false) {
|
|
76
|
-
primaryPaymentAccount.push(fromPaymentAccount[0]);
|
|
77
|
-
}
|
|
64
|
+
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, (transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountType) ===
|
|
65
|
+
'paymentAccount' &&
|
|
66
|
+
(transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId) != null &&
|
|
67
|
+
(transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId.length) > 0
|
|
68
|
+
? /*
|
|
69
|
+
for extsing transaction since we are not calling payment accounts
|
|
70
|
+
we need to pick payment ids from billPayInfo object
|
|
71
|
+
*/
|
|
72
|
+
[transaction.billPayInfo.fromAccount.billAccountId]
|
|
73
|
+
: plaidAccountViewState['spend_management_setup'].accountDetails
|
|
74
|
+
.paymentAccountIds);
|
|
78
75
|
const fromDepositAccount = (transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountType) === 'depositAccount' &&
|
|
79
76
|
(transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId) != null
|
|
80
77
|
? (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId)
|
package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import { fetchEditBillDetailPage, updateShowAutofill } from '../editBillViewRedu
|
|
|
4
4
|
import { RootState } from '../../../../../reducer';
|
|
5
5
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
6
6
|
import { fetchAccountList } from '../../../../accountList/accountListReducer';
|
|
7
|
+
import { getPaymentAccounts } from '../../../plaidAccount/plaidAccountViewReducer';
|
|
7
8
|
import { fetchBillPaySetupApproverView } from '../../billPaySetupApproverView/billPaySetupApproverViewReducer';
|
|
8
9
|
import { fetchOwnerList } from '../../../../ownerList/ownerListReducer';
|
|
9
10
|
import { fetchVendorTypeList } from '../../../../vendorTypeList/vendorTypeListReducer';
|
|
10
11
|
import { fetchBillPayConfig } from '../../billPayConfig/billPayConfigReducer';
|
|
11
12
|
import { fetchDepositAccountList } from '../../../zeniAccounts/depositAccountList/depositAccountListReducer';
|
|
12
|
-
|
|
13
|
-
export declare type ActionType = ReturnType<typeof fetchEditBillDetailPage> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof fetchBillPayConfig> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof fetchOwnerList>;
|
|
13
|
+
export declare type ActionType = ReturnType<typeof fetchEditBillDetailPage> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof getPaymentAccounts> | ReturnType<typeof fetchDepositAccountList> | ReturnType<typeof fetchBillPayConfig> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof fetchOwnerList>;
|
|
14
14
|
export declare const fetchEditBillDetailPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -6,13 +6,13 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
7
7
|
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
8
8
|
const accountListReducer_1 = require("../../../../accountList/accountListReducer");
|
|
9
|
+
const plaidAccountViewReducer_1 = require("../../../plaidAccount/plaidAccountViewReducer");
|
|
9
10
|
const billPaySetupApproverViewReducer_1 = require("../../billPaySetupApproverView/billPaySetupApproverViewReducer");
|
|
10
11
|
const ownerListReducer_1 = require("../../../../ownerList/ownerListReducer");
|
|
11
12
|
const vendorTypeListReducer_1 = require("../../../../vendorTypeList/vendorTypeListReducer");
|
|
12
13
|
const billPayConfigReducer_1 = require("../../billPayConfig/billPayConfigReducer");
|
|
13
14
|
const depositAccountListReducer_1 = require("../../../zeniAccounts/depositAccountList/depositAccountListReducer");
|
|
14
15
|
const companySelector_1 = require("../../../../../entity/company/companySelector");
|
|
15
|
-
const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
16
16
|
const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchEditBillDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
17
17
|
var _a, _b, _c;
|
|
18
18
|
const { cacheOverride, billId, isShowDeletedBillsEnabled } = action.payload;
|
|
@@ -34,7 +34,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
34
34
|
if (isCompanyZeniAccountsSetUpDone) {
|
|
35
35
|
billDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
36
36
|
}
|
|
37
|
-
billDetailActions.push((0,
|
|
37
|
+
billDetailActions.push((0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup'));
|
|
38
38
|
if (billId != null) {
|
|
39
39
|
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true, isShowDeletedBillsEnabled));
|
|
40
40
|
}
|
|
@@ -73,10 +73,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
73
73
|
depositAccounts.fetchState !== 'Completed') {
|
|
74
74
|
billDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
billDetailActions.push((0,
|
|
76
|
+
const paymentAccount = state.plaidAccountViewState['spend_management_setup'].accountDetails;
|
|
77
|
+
if (paymentAccount.fetchStatus.fetchState !== 'In-Progress' &&
|
|
78
|
+
paymentAccount.fetchStatus.fetchState !== 'Completed') {
|
|
79
|
+
billDetailActions.push((0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup'));
|
|
80
80
|
}
|
|
81
81
|
if (billId != null) {
|
|
82
82
|
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled));
|
package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts
CHANGED
|
@@ -3,12 +3,13 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { convertAmountToHomeCurrency, initializeBillToLocalStore, saveBillUpdatesToLocalStore, updateEditBillFetchStateCompleted } from '../editBillViewReducer';
|
|
4
4
|
import { RootState } from '../../../../../reducer';
|
|
5
5
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
6
|
+
import { getPaymentAccounts } from '../../../plaidAccount/plaidAccountViewReducer';
|
|
6
7
|
import { LineItemRecommendationsLocalData } from '../editBillViewSelector';
|
|
7
8
|
import { RecommendationByLineId } from '../../../../../entity/transaction/stateTypes/transaction';
|
|
8
9
|
import { Vendor } from '../../../../../entity/vendor/vendorState';
|
|
9
10
|
import { AccountListSelectorView } from '../../../../accountList/accountListSelector';
|
|
10
11
|
import { ClassListSelectorView } from '../../../../classList/classListSelector';
|
|
11
12
|
import Line from '../../../../../entity/transaction/stateTypes/transactionLine';
|
|
12
|
-
export declare type ActionType = ReturnType<typeof initializeBillToLocalStore> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchClassList> | ReturnType<typeof updateEditBillFetchStateCompleted> | ReturnType<typeof convertAmountToHomeCurrency>;
|
|
13
|
+
export declare type ActionType = ReturnType<typeof initializeBillToLocalStore> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchClassList> | ReturnType<typeof updateEditBillFetchStateCompleted> | ReturnType<typeof getPaymentAccounts> | ReturnType<typeof convertAmountToHomeCurrency>;
|
|
13
14
|
export declare const getLineRecommendationsLocalData: (lineId: string, line: Line, recommendations: RecommendationByLineId | undefined, accountList: AccountListSelectorView, classList: ClassListSelectorView, vendorDetails?: Vendor | undefined) => LineItemRecommendationsLocalData;
|
|
14
15
|
export declare const initializeBillToLocalStoreEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,7 +5,7 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
|
|
|
5
5
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
6
|
const helpers_1 = require("../../helpers");
|
|
7
7
|
function getChargeCardSetupViewDetails(state, companyId) {
|
|
8
|
-
const chargeCardSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards', '
|
|
8
|
+
const chargeCardSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards', 'spend_management_setup');
|
|
9
9
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
10
10
|
const companyChargeCardInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo;
|
|
11
11
|
const { chargeCardSetupViewState, setupViewState } = state;
|