@zeniai/client-epic-state 4.12.66 → 4.12.68
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/paymentAccount/paymentAccountPayload.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountPayload.js +7 -7
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.js +1 -1
- package/lib/entity/vendor/__mocks__/vendorStateMocks.js +1 -6
- package/lib/entity/vendor/vendorPayload.d.ts +1 -2
- package/lib/entity/vendor/vendorPayload.js +4 -6
- package/lib/entity/vendor/vendorState.d.ts +0 -1
- package/lib/entity/vendor/vendorType.d.ts +1 -2
- package/lib/epic.d.ts +2 -5
- package/lib/epic.js +2 -5
- package/lib/index.d.ts +8 -15
- package/lib/index.js +16 -31
- package/lib/reducer.d.ts +1 -4
- package/lib/reducer.js +1 -4
- package/lib/view/commonVendorView/vendorView/epics/fetchVendorDetailsEpic.js +2 -2
- package/lib/view/commonVendorView/vendorView/vendorViewPayload.d.ts +0 -6
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.d.ts +1 -2
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.js +1 -6
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.d.ts +2 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.js +2 -4
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/resetVendorsTabVendorDetailLocalDataEpic.js +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.d.ts +1 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.js +3 -14
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.d.ts +0 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.js +1 -35
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -7
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +3 -23
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -16
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +7 -24
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +0 -16
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.js +0 -3
- package/lib/view/settingsView/settingsViewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +2 -2
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +5 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.js +5 -8
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -11
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +7 -16
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountListEpic.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountListEpic.js +6 -12
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountList.d.ts +0 -1
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer.d.ts +0 -6
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer.js +2 -25
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListSelector.d.ts +0 -1
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListSelector.js +0 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +0 -8
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +6 -9
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/json/vendorFiling1099ListSuccess.json +1 -1
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListMock.d.ts +3 -3
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListMock.js +3 -17
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListSelectorMock.d.ts +1 -1
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListSelectorMock.js +1 -10
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/fetchVendorsFiling1099ListEpic.d.ts +5 -5
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/fetchVendorsFiling1099ListEpic.js +6 -6
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListPayload.d.ts +3 -3
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListReducer.d.ts +4 -8
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListReducer.js +5 -18
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListSelector.d.ts +6 -6
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListSelector.js +3 -8
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListState.d.ts +3 -3
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListState.js +1 -1
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +1 -1
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +2 -2
- package/package.json +1 -2
- package/lib/entity/vendor/__mocks__/vendorMock.d.ts +0 -7
- package/lib/entity/vendor/__mocks__/vendorMock.js +0 -339
- package/lib/view/addressView/__mocks__/addressViewMocks.d.ts +0 -34
- package/lib/view/addressView/__mocks__/addressViewMocks.js +0 -223
- package/lib/view/addressView/__mocks__/json/createAddressResponse.json +0 -23
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -218
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -345
- package/lib/view/addressView/__mocks__/json/fetchAddressResponse.json +0 -24
- package/lib/view/addressView/__mocks__/json/updateAddressResponse.json +0 -24
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountBalanceEpic.d.ts +0 -9
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountBalanceEpic.js +0 -48
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +0 -132
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.js +0 -146
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +0 -8
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +0 -30
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.d.ts +0 -20
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.js +0 -48
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +0 -25
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +0 -180
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.d.ts +0 -11
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.js +0 -58
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.d.ts +0 -14
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.js +0 -17
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.d.ts +0 -26
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.js +0 -2
- /package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearVendorsTabVendorView = exports.
|
|
4
|
+
exports.clearVendorsTabVendorView = exports.resetVendorsTabVendorAllTransactionsTabData = exports.updateVendorSpendTrendFilterTabValue = exports.updateSelectedTabType = exports.resetSelectedTabType = exports.updateVendorsTabVendorAllTransactionsTabData = exports.fetchVendorsTabVendorDetailPageView = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.updateVendorsTabVendorSaveStatus = exports.updateVendorsTabVendorFetchStatus = exports.fetchVendorsTabVendor = exports.fetchVendorsTabVendorDetails = exports.initialState = exports.initialVendorDetailLocalData = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialVendorDetailLocalData = {
|
|
7
|
-
contacts: [],
|
|
8
7
|
vendorId: undefined,
|
|
9
8
|
isCategoryUpdateSelected: false,
|
|
10
9
|
isClassUpdateSelected: false,
|
|
@@ -15,9 +14,6 @@ exports.initialState = {
|
|
|
15
14
|
vendorStateById: {},
|
|
16
15
|
selectedTabType: 'spend_transactions',
|
|
17
16
|
vendorSpendTrendFilterTabValue: 'YTD_spend',
|
|
18
|
-
uiState: {
|
|
19
|
-
collapsableStatus: 'expand',
|
|
20
|
-
},
|
|
21
17
|
};
|
|
22
18
|
const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
23
19
|
name: 'vendorsTabVendorView',
|
|
@@ -119,14 +115,12 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
119
115
|
},
|
|
120
116
|
},
|
|
121
117
|
vendorsTabUpdateVendorDetailLocalData(draft, action) {
|
|
122
|
-
var _a;
|
|
123
118
|
const { vendorId, localData } = action.payload;
|
|
124
119
|
if (localData == null) {
|
|
125
120
|
delete draft.vendorStateById[vendorId].vendorDetailLocalData;
|
|
126
121
|
}
|
|
127
122
|
else if (draft.vendorStateById[vendorId] != null) {
|
|
128
|
-
|
|
129
|
-
draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData), { contacts: contacts.map((contact) => (Object.assign({}, contact))) });
|
|
123
|
+
draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData);
|
|
130
124
|
}
|
|
131
125
|
},
|
|
132
126
|
vendorsTabResetVendorDetailLocalData: {
|
|
@@ -191,24 +185,10 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
191
185
|
resetSelectedTabType(draft) {
|
|
192
186
|
draft.selectedTabType = 'spend_transactions';
|
|
193
187
|
},
|
|
194
|
-
updateContactsInVendorTabDetailLocalData(draft, action) {
|
|
195
|
-
var _a;
|
|
196
|
-
const { vendorId, localData } = action.payload;
|
|
197
|
-
if (localData === null || localData === void 0 ? void 0 : localData.contacts) {
|
|
198
|
-
const contacts = localData.contacts;
|
|
199
|
-
if (vendorId != null) {
|
|
200
|
-
draft.vendorStateById[vendorId] = Object.assign(Object.assign({}, draft.vendorStateById[vendorId]), { vendorDetailLocalData: Object.assign(Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), (_a = draft.vendorStateById[vendorId]) === null || _a === void 0 ? void 0 : _a.vendorDetailLocalData), { contacts: contacts.map((contact) => (Object.assign({}, contact))) }) });
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
updateVendorTabDetailUIState(draft, action) {
|
|
205
|
-
const { collapsableStatus } = action.payload;
|
|
206
|
-
draft.uiState.collapsableStatus = collapsableStatus;
|
|
207
|
-
},
|
|
208
188
|
clearVendorsTabVendorView(draft) {
|
|
209
189
|
Object.assign(draft, exports.initialState);
|
|
210
190
|
},
|
|
211
191
|
},
|
|
212
192
|
});
|
|
213
|
-
_a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.updateVendorsTabVendorAllTransactionsTabData = _a.updateVendorsTabVendorAllTransactionsTabData, exports.resetSelectedTabType = _a.resetSelectedTabType, exports.updateSelectedTabType = _a.updateSelectedTabType, exports.updateVendorSpendTrendFilterTabValue = _a.updateVendorSpendTrendFilterTabValue, exports.resetVendorsTabVendorAllTransactionsTabData = _a.resetVendorsTabVendorAllTransactionsTabData, exports.
|
|
193
|
+
_a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.updateVendorsTabVendorAllTransactionsTabData = _a.updateVendorsTabVendorAllTransactionsTabData, exports.resetSelectedTabType = _a.resetSelectedTabType, exports.updateSelectedTabType = _a.updateSelectedTabType, exports.updateVendorSpendTrendFilterTabValue = _a.updateVendorSpendTrendFilterTabValue, exports.resetVendorsTabVendorAllTransactionsTabData = _a.resetVendorsTabVendorAllTransactionsTabData, exports.clearVendorsTabVendorView = _a.clearVendorsTabVendorView;
|
|
214
194
|
exports.default = vendorsTabVendorView.reducer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
|
-
import { VendorsTabVendorDetailLocalData
|
|
4
|
+
import { VendorsTabVendorDetailLocalData } from './vendorsTabVendorViewState';
|
|
5
5
|
import { AccountListSelectorView } from '../../accountList/accountListSelector';
|
|
6
6
|
import { ClassListSelectorView } from '../../classList/classListSelector';
|
|
7
7
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
@@ -17,37 +17,23 @@ import { TransactionListByEntityView } from '../../transactionList/transactionLi
|
|
|
17
17
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
18
18
|
import { Month } from '../../../commonStateTypes/timePeriod';
|
|
19
19
|
import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
|
|
20
|
-
import { Address } from '../../../entity/address/addressState';
|
|
21
|
-
import { Contact } from '../../../entity/billPay/contact/contact';
|
|
22
|
-
import { VendorType } from '../../vendorTypeList/vendorTypeListPayload';
|
|
23
|
-
import { Filing1099TinType } from '../../../entity/vendor/vendorType';
|
|
24
|
-
import { NewAddressData } from '../../addressView/addressViewState';
|
|
25
20
|
export declare const toVendorDetailTabsType: (v: string) => "spend_transactions" | "all_transactions";
|
|
26
21
|
export declare type VendorDetailTabsType = ReturnType<typeof toVendorDetailTabsType>;
|
|
27
22
|
export interface VendorsTabVendorDetails {
|
|
28
23
|
vendorBasic: VendorsTabVendorBasic;
|
|
29
|
-
vendorNewAddressStatus?: NewAddressData;
|
|
30
|
-
vendorAddress?: Address;
|
|
31
24
|
saveStatus: FetchStateAndError;
|
|
32
25
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
33
26
|
}
|
|
34
27
|
export interface VendorsTabVendorBasic {
|
|
35
28
|
id: ID;
|
|
36
29
|
name: string;
|
|
37
|
-
email?: string;
|
|
38
|
-
phone?: string;
|
|
39
30
|
account?: AccountBase;
|
|
40
31
|
class?: ClassBase;
|
|
41
32
|
owner?: User;
|
|
42
|
-
vendorType?: VendorType;
|
|
43
|
-
vendorTin?: Filing1099TinType;
|
|
44
|
-
contacts?: Contact[];
|
|
45
|
-
vendorDocuments?: File[];
|
|
46
33
|
}
|
|
47
34
|
export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
48
35
|
accountList: AccountListSelectorView;
|
|
49
36
|
classList: ClassListSelectorView;
|
|
50
|
-
vendorTypeList: VendorType[];
|
|
51
37
|
accountsHierarchyList: NestedAccountHierarchyForReport[];
|
|
52
38
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
53
39
|
ownerList: User[];
|
|
@@ -55,7 +41,6 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
|
55
41
|
}
|
|
56
42
|
export interface VendorsTabVendorDetailPageView extends SelectorView {
|
|
57
43
|
vendorViewDetails: VendorsTabVendorViewSelectorView;
|
|
58
|
-
uiState: VendorsTabVendorViewUIState;
|
|
59
44
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
60
45
|
trendWithTransactions: TrendWithTransactionsView;
|
|
61
46
|
vendorSpend: VendorSpend;
|
|
@@ -14,8 +14,6 @@ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
|
14
14
|
const addSubtractPeriod_1 = require("../../../commonStateTypes/fiscalYearHelpers/addSubtractPeriod");
|
|
15
15
|
const getStartOfAndEndOfTimeframeFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/getStartOfAndEndOfTimeframeFY");
|
|
16
16
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
17
|
-
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
18
|
-
const contactSelector_1 = require("../../../entity/billPay/contact/contactSelector");
|
|
19
17
|
const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
20
18
|
'spend_transactions',
|
|
21
19
|
'all_transactions',
|
|
@@ -23,12 +21,11 @@ const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
|
23
21
|
const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_VENDOR_DETAIL_TABS_TYPES);
|
|
24
22
|
exports.toVendorDetailTabsType = toVendorDetailTabsType;
|
|
25
23
|
const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
26
|
-
var _a, _b, _c, _d, _e
|
|
27
|
-
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState,
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
|
+
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, } = state;
|
|
28
26
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
29
27
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
30
28
|
const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
|
|
31
|
-
const vendorTypeList = vendorTypeListState.vendorTypes;
|
|
32
29
|
let vendorDetailState;
|
|
33
30
|
let fetchState = {
|
|
34
31
|
fetchState: 'Not-Started',
|
|
@@ -36,27 +33,22 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
36
33
|
};
|
|
37
34
|
const selectedVendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorIdFromUrl);
|
|
38
35
|
const basicVendorDetails = selectedVendor != null
|
|
39
|
-
? getBasicVendorDetails(accountState, classState, userState, selectedVendor
|
|
36
|
+
? getBasicVendorDetails(accountState, classState, userState, selectedVendor)
|
|
40
37
|
: undefined;
|
|
41
|
-
if (basicVendorDetails
|
|
38
|
+
if (basicVendorDetails) {
|
|
42
39
|
vendorDetailState = {
|
|
43
40
|
vendorBasic: basicVendorDetails,
|
|
44
41
|
saveStatus: (_b = (_a = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _a === void 0 ? void 0 : _a.saveStatus) !== null && _b !== void 0 ? _b : {
|
|
45
42
|
fetchState: 'Not-Started',
|
|
46
43
|
error: undefined,
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
vendorAddress: (selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.addressId) != null
|
|
50
|
-
? (0, addressSelector_1.getAddressByAddressId)(addressState, selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.addressId)
|
|
51
|
-
: undefined,
|
|
52
|
-
vendorDetailLocalData: (_d = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _d === void 0 ? void 0 : _d.vendorDetailLocalData,
|
|
45
|
+
vendorDetailLocalData: (_c = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _c === void 0 ? void 0 : _c.vendorDetailLocalData,
|
|
53
46
|
};
|
|
54
47
|
}
|
|
55
48
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
56
49
|
accountList,
|
|
57
50
|
classList,
|
|
58
|
-
|
|
59
|
-
(_f = (_e = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _e === void 0 ? void 0 : _e.fetchStatus) !== null && _f !== void 0 ? _f : {
|
|
51
|
+
(_e = (_d = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _d === void 0 ? void 0 : _d.fetchStatus) !== null && _e !== void 0 ? _e : {
|
|
60
52
|
fetchState: 'Not-Started',
|
|
61
53
|
},
|
|
62
54
|
]);
|
|
@@ -65,7 +57,6 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
65
57
|
return {
|
|
66
58
|
accountList: accountList,
|
|
67
59
|
classList: classList,
|
|
68
|
-
vendorTypeList: vendorTypeList,
|
|
69
60
|
accountsHierarchyList,
|
|
70
61
|
classHierarchyList,
|
|
71
62
|
ownerList: ownerList,
|
|
@@ -76,10 +67,8 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
76
67
|
};
|
|
77
68
|
};
|
|
78
69
|
exports.getVendorsTabVendorView = getVendorsTabVendorView;
|
|
79
|
-
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor
|
|
70
|
+
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor) => ({
|
|
80
71
|
name: selectedVendor.name,
|
|
81
|
-
email: selectedVendor.email,
|
|
82
|
-
phone: selectedVendor.phone,
|
|
83
72
|
account: selectedVendor.accountId != null
|
|
84
73
|
? (0, accountSelector_1.getAccountBase)(accountState, selectedVendor.accountId, 'account_list')
|
|
85
74
|
: undefined,
|
|
@@ -92,15 +81,11 @@ const getBasicVendorDetails = (accountState, classState, userState, selectedVend
|
|
|
92
81
|
owner: selectedVendor.ownerId != null
|
|
93
82
|
? (0, userSelector_1.getUserByUserId)(userState, selectedVendor.ownerId)
|
|
94
83
|
: undefined,
|
|
95
|
-
vendorType: vendorTypeListState.vendorTypes.filter((type) => type.code === selectedVendor.vendorType)[0],
|
|
96
|
-
vendorTin: selectedVendor.filing1099Tin,
|
|
97
|
-
contacts: (0, contactSelector_1.getContactsByIds)(contactState, selectedVendor.contactIds),
|
|
98
84
|
id: selectedVendor.id,
|
|
99
85
|
});
|
|
100
86
|
const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
101
87
|
var _a, _b, _c;
|
|
102
88
|
const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
|
|
103
|
-
const uiState = state.vendorsTabVendorViewState.uiState;
|
|
104
89
|
const vendorViewDetails = (0, exports.getVendorsTabVendorView)(state, vendorId);
|
|
105
90
|
const allVendorTransactions = ((_a = state.vendorsTabVendorViewState.allTransactionsTabData) === null || _a === void 0 ? void 0 : _a.timePeriod) != null
|
|
106
91
|
? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
|
|
@@ -110,7 +95,6 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
110
95
|
state.accountListState.byReportId.accountList,
|
|
111
96
|
state.classListState,
|
|
112
97
|
state.ownerListState,
|
|
113
|
-
state.vendorTypeListState,
|
|
114
98
|
(_c = (_b = state.vendorsTabVendorViewState.vendorStateById[vendorId]) === null || _b === void 0 ? void 0 : _b.fetchStatus) !== null && _c !== void 0 ? _c : {
|
|
115
99
|
fetchState: 'Not-Started',
|
|
116
100
|
},
|
|
@@ -118,7 +102,6 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
118
102
|
]);
|
|
119
103
|
return {
|
|
120
104
|
vendorViewDetails,
|
|
121
|
-
uiState,
|
|
122
105
|
trendWithTransactions,
|
|
123
106
|
allVendorTransactionsView: allVendorTransactions,
|
|
124
107
|
allTransactionsTabData: state.vendorsTabVendorViewState.allTransactionsTabData,
|
|
@@ -3,14 +3,10 @@ import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
|
3
3
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { RecommendedAccountBase } from '../../../entity/account/accountState';
|
|
5
5
|
import { RecommendedClassBase } from '../../../entity/class/classState';
|
|
6
|
-
import { Filing1099TinType } from '../../../entity/vendor/vendorType';
|
|
7
6
|
import { VendorSpendTrendFilterTabType } from '../../../entity/vendorExpense/vendorExpenseSelector';
|
|
8
|
-
import { AddressUpdatableInfo } from '../../addressView/addressViewState';
|
|
9
|
-
import { VendorContactInfo } from '../vendorView/vendorViewState';
|
|
10
7
|
import { VendorDetailTabsType } from './vendorsTabVendorViewSelector';
|
|
11
8
|
export interface VendorsTabVendorViewState {
|
|
12
9
|
vendorStateById: Record<ID, VendorsTabVendorDetailState>;
|
|
13
|
-
uiState: VendorsTabVendorViewUIState;
|
|
14
10
|
selectedTabType: VendorDetailTabsType;
|
|
15
11
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
16
12
|
allTransactionsTabData?: {
|
|
@@ -20,12 +16,6 @@ export interface VendorsTabVendorViewState {
|
|
|
20
16
|
}
|
|
21
17
|
export interface VendorsTabVendorDetailLocalData {
|
|
22
18
|
vendorName?: string;
|
|
23
|
-
vendorEmail?: string;
|
|
24
|
-
vendorPhone?: string;
|
|
25
|
-
vendorType?: string;
|
|
26
|
-
tin?: Filing1099TinType;
|
|
27
|
-
address?: AddressUpdatableInfo;
|
|
28
|
-
contacts: VendorContactInfo[];
|
|
29
19
|
vendorCategory?: string;
|
|
30
20
|
vendorClass?: string;
|
|
31
21
|
vendorId?: ID;
|
|
@@ -41,9 +31,3 @@ export interface VendorsTabVendorDetailState {
|
|
|
41
31
|
saveStatus: FetchStateAndError;
|
|
42
32
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
43
33
|
}
|
|
44
|
-
declare const toCollapsableStatusKey: (v: string) => "expand" | "collapse";
|
|
45
|
-
export declare type CollapsableStatusKey = ReturnType<typeof toCollapsableStatusKey>;
|
|
46
|
-
export interface VendorsTabVendorViewUIState {
|
|
47
|
-
collapsableStatus: CollapsableStatusKey;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
4
|
-
const COLLAPSABLESTATUS = ['expand', 'collapse'];
|
|
5
|
-
const toCollapsableStatusKey = (v) => (0, stringToUnion_1.stringToUnion)(v, COLLAPSABLESTATUS);
|
|
@@ -65,7 +65,7 @@ function getBankConnectionsSetupViewDetails(state, companyId, isBillPayEnabled,
|
|
|
65
65
|
paymentAccountListState,
|
|
66
66
|
]);
|
|
67
67
|
const allFundingAccounts = fetchState.fetchState === 'Completed'
|
|
68
|
-
? (0, setupViewSelector_1.getAllFundingAccounts)(depositAccounts, paymentAccounts,
|
|
68
|
+
? (0, setupViewSelector_1.getAllFundingAccounts)(depositAccounts, paymentAccounts, false)
|
|
69
69
|
: [];
|
|
70
70
|
const primaryAccountsProductWise = [];
|
|
71
71
|
if (isBillPayEnabled) {
|
|
@@ -85,7 +85,7 @@ const getBillActivities = (state, billId, billStageCode) => {
|
|
|
85
85
|
exports.getBillActivities = getBillActivities;
|
|
86
86
|
const getBillDetailView = (state, billId) => {
|
|
87
87
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
88
|
-
const { bankAccountState, paymentInstrumentState, billDetailViewState, billTransactionState, paymentAccountState, userState, billPayConfigState, userRoleState, classListState, classState, commonHistoryState, realTimeApprovalState, entityApprovalStatusState, billPaySetupApproverViewState, vendorState, recurringBillState, depositAccountState,
|
|
88
|
+
const { bankAccountState, paymentInstrumentState, billDetailViewState, billTransactionState, paymentAccountState, userState, billPayConfigState, userRoleState, classListState, classState, commonHistoryState, realTimeApprovalState, entityApprovalStatusState, billPaySetupApproverViewState, vendorState, recurringBillState, depositAccountState, } = state;
|
|
89
89
|
const { approverListState } = billPaySetupApproverViewState;
|
|
90
90
|
const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId !== null && billId !== void 0 ? billId : '');
|
|
91
91
|
const billTransactionDetails = (0, get_1.default)(billDetailViewState.billDetailById, detailKey, undefined);
|
|
@@ -98,7 +98,7 @@ const getBillDetailView = (state, billId) => {
|
|
|
98
98
|
const paymentInstrument = (0, paymentInstrumentSelector_1.getPaymentInstrumentById)(paymentInstrumentState, (_c = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.toAccount.billAccountId) !== null && _c !== void 0 ? _c : '');
|
|
99
99
|
const paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, (_d = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId) !== null && _d !== void 0 ? _d : '');
|
|
100
100
|
const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, (_e = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.fromAccount.billAccountId) !== null && _e !== void 0 ? _e : '');
|
|
101
|
-
const withdrawFrom = (0, setupViewSelector_1.getAllFundingAccounts)((_f = (depositAccount && [depositAccount])) !== null && _f !== void 0 ? _f : [], (_g = (paymentAccount && [paymentAccount])) !== null && _g !== void 0 ? _g : []
|
|
101
|
+
const withdrawFrom = (0, setupViewSelector_1.getAllFundingAccounts)((_f = (depositAccount && [depositAccount])) !== null && _f !== void 0 ? _f : [], (_g = (paymentAccount && [paymentAccount])) !== null && _g !== void 0 ? _g : [])[0];
|
|
102
102
|
let previousBills = {
|
|
103
103
|
bills: [],
|
|
104
104
|
fetchState: 'Not-Started',
|
|
@@ -49,7 +49,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
49
49
|
let contactDetails = [];
|
|
50
50
|
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountListState.paymentAccountIds);
|
|
51
51
|
const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState).depositAccounts;
|
|
52
|
-
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount
|
|
52
|
+
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount);
|
|
53
53
|
let fetchState = 'Not-Started';
|
|
54
54
|
let sourceBillDetailFetchState = 'Not-Started';
|
|
55
55
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'billPayAccountList');
|
|
@@ -88,7 +88,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
88
88
|
if (allDepositAccounts.length === 0 && fromDepositAccount != null) {
|
|
89
89
|
allDepositAccounts.push(fromDepositAccount);
|
|
90
90
|
}
|
|
91
|
-
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount
|
|
91
|
+
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount);
|
|
92
92
|
let previousBills = {
|
|
93
93
|
bills: [],
|
|
94
94
|
fetchState: 'Not-Started',
|
|
@@ -596,7 +596,7 @@ const getDueDate = (billStageCode, dueDate, invoiceDate, bookCloseDate) => {
|
|
|
596
596
|
};
|
|
597
597
|
exports.getDueDate = getDueDate;
|
|
598
598
|
const getWithdrawFrom = (state, fromAccountId, fromAccountType, companyId, lastSelectedFromAccount) => {
|
|
599
|
-
const { paymentAccountState, depositAccountState, depositAccountListState
|
|
599
|
+
const { paymentAccountState, depositAccountState, depositAccountListState } = state;
|
|
600
600
|
if (fromAccountId != null) {
|
|
601
601
|
const withdrawFromAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, fromAccountId);
|
|
602
602
|
const withdrawFromAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, fromAccountId);
|
|
@@ -606,7 +606,7 @@ const getWithdrawFrom = (state, fromAccountId, fromAccountType, companyId, lastS
|
|
|
606
606
|
}
|
|
607
607
|
if (fromAccountType === 'paymentAccount' &&
|
|
608
608
|
withdrawFromAsPaymentAcc != null) {
|
|
609
|
-
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(withdrawFromAsPaymentAcc
|
|
609
|
+
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(withdrawFromAsPaymentAcc);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
else {
|
|
@@ -616,7 +616,7 @@ const getWithdrawFrom = (state, fromAccountId, fromAccountType, companyId, lastS
|
|
|
616
616
|
};
|
|
617
617
|
exports.getWithdrawFrom = getWithdrawFrom;
|
|
618
618
|
const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSelectedFromAccount) => {
|
|
619
|
-
const { depositAccountState, paymentAccountState
|
|
619
|
+
const { depositAccountState, paymentAccountState } = state;
|
|
620
620
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
621
621
|
const primaryAccount = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount;
|
|
622
622
|
let defaultAccount = undefined;
|
|
@@ -655,7 +655,7 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
|
|
|
655
655
|
}
|
|
656
656
|
if (defaultAccount.accountType === 'paymentAccount' &&
|
|
657
657
|
defaultAccAsPaymentAcc != null) {
|
|
658
|
-
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(defaultAccAsPaymentAcc
|
|
658
|
+
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(defaultAccAsPaymentAcc);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
return undefined;
|
|
@@ -27,20 +27,17 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
27
27
|
return zeniAPI
|
|
28
28
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
|
|
29
29
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
30
|
-
var _a, _b, _c;
|
|
31
30
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
32
31
|
const actions = [];
|
|
33
32
|
actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({
|
|
34
33
|
chargeCardListPayload: response.data,
|
|
35
34
|
keepExistingListItems: true,
|
|
36
35
|
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
37
|
-
|
|
38
|
-
const names = response.data.users
|
|
39
|
-
|
|
40
|
-
:
|
|
41
|
-
|
|
42
|
-
.map((user) => { var _a, _b, _c; return (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim(); })
|
|
43
|
-
.join(', ');
|
|
36
|
+
const cardHolderIds = response.data.cards.map((card) => card.holder_user_id);
|
|
37
|
+
const names = response.data.users
|
|
38
|
+
.filter((user) => cardHolderIds.includes(user.user_id))
|
|
39
|
+
.map((user) => { var _a, _b, _c; return (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim(); })
|
|
40
|
+
.join(', ');
|
|
44
41
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
45
42
|
messageSection: 'issue_charge_card',
|
|
46
43
|
messageText: 'success',
|
|
@@ -12,10 +12,9 @@ import { NewAddressData } from '../../addressView/addressViewState';
|
|
|
12
12
|
import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewType } from './setupViewState';
|
|
13
13
|
import { PlaidAccountKeyType, PlaidConnectionDetails } from '../plaidAccount/plaidAccountViewState';
|
|
14
14
|
import { AccountTypeSubConfigCodeKeyType } from '../billPay/billPayConfig/billPayConfigState';
|
|
15
|
+
import { Balance } from '../../../commonStateTypes/balance';
|
|
15
16
|
import { DepositAccount } from '../../../entity/depositAccount/depositAccount';
|
|
16
17
|
import { AllowedValueWithCode } from '../../../commonStateTypes/allowedValue';
|
|
17
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
18
|
-
import { BalanceChange } from '../../../commonStateTypes/balance';
|
|
19
18
|
export interface SetupView {
|
|
20
19
|
allFundingAccounts: FundingAccount[];
|
|
21
20
|
allBankAccounts: AccountBase[];
|
|
@@ -32,14 +31,8 @@ export interface FundingAccount {
|
|
|
32
31
|
accType: AccountTypeSubConfigCodeKeyType;
|
|
33
32
|
label: string;
|
|
34
33
|
maskedAccountNumber: string;
|
|
35
|
-
balanceFetchStatus: FetchStateAndError;
|
|
36
34
|
zeniAccountId?: ID;
|
|
37
|
-
accountBalance?:
|
|
38
|
-
available?: Amount;
|
|
39
|
-
current?: Amount;
|
|
40
|
-
lastRefreshTime?: ZeniDate;
|
|
41
|
-
change?: BalanceChange;
|
|
42
|
-
};
|
|
35
|
+
accountBalance?: Balance;
|
|
43
36
|
logo?: Logo;
|
|
44
37
|
providerAccountId?: ID;
|
|
45
38
|
institutionDetails?: InstitutionDetails;
|
|
@@ -86,7 +79,7 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
|
|
|
86
79
|
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
|
|
87
80
|
export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
|
|
88
81
|
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
|
|
89
|
-
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[],
|
|
82
|
+
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[], includeOnlyVerifiedAccounts?: boolean) => FundingAccount[];
|
|
90
83
|
export declare const mapDepositAccToFundingAccount: (depositAcc: DepositAccount) => FundingAccount;
|
|
91
|
-
export declare const mapPaymentAccToFundingAccount: (paymentAcc: PaymentAccount
|
|
84
|
+
export declare const mapPaymentAccToFundingAccount: (paymentAcc: PaymentAccount) => FundingAccount;
|
|
92
85
|
export {};
|
|
@@ -15,13 +15,13 @@ function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccount
|
|
|
15
15
|
const { updateStatus } = setupViewState;
|
|
16
16
|
const { accountDetails, plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountDetails)(plaidAccountViewState, plaidAccountKeyType);
|
|
17
17
|
const { allBankAccountIds } = accountDetails;
|
|
18
|
-
const { paymentAccountIds
|
|
18
|
+
const { paymentAccountIds } = paymentAccountListState;
|
|
19
19
|
const { accountIds: depositAccountIds } = depositAccountListState;
|
|
20
20
|
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 : [];
|
|
21
21
|
const paymentAccounts = (_b = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : [];
|
|
22
22
|
const depositAccounts = (_c = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _c !== void 0 ? _c : [];
|
|
23
23
|
const allFundingAccounts = (0, exports.getAllFundingAccounts)(setupViewType === 'zeni_accounts' ? [] : depositAccounts, // only external acct can be made primary for accounts setup
|
|
24
|
-
paymentAccounts,
|
|
24
|
+
paymentAccounts, false);
|
|
25
25
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
26
26
|
const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
|
|
27
27
|
const primaryAccount = getPrimaryAccountForTheProduct(state, companyId, setupViewType);
|
|
@@ -35,7 +35,7 @@ function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccount
|
|
|
35
35
|
else if ((primaryAccount === null || primaryAccount === void 0 ? void 0 : primaryAccount.accountType) === 'paymentAccount') {
|
|
36
36
|
const paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, primaryAccount.accountId);
|
|
37
37
|
if (paymentAccount != null) {
|
|
38
|
-
primaryFundingAccount = (0, exports.mapPaymentAccToFundingAccount)(paymentAccount
|
|
38
|
+
primaryFundingAccount = (0, exports.mapPaymentAccToFundingAccount)(paymentAccount);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
let paymentAccountForBilling;
|
|
@@ -184,7 +184,7 @@ exports.getCompanyAndIdentityDetails = getCompanyAndIdentityDetails;
|
|
|
184
184
|
/* This helper function takes deposit accounts and payment accounts
|
|
185
185
|
and give back FundingAccount type array
|
|
186
186
|
to support single dropdown with both lists */
|
|
187
|
-
const getAllFundingAccounts = (depositAccounts, paymentAccounts,
|
|
187
|
+
const getAllFundingAccounts = (depositAccounts, paymentAccounts, includeOnlyVerifiedAccounts = true) => {
|
|
188
188
|
return [
|
|
189
189
|
...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToFundingAccount)(depositAcc)),
|
|
190
190
|
...(includeOnlyVerifiedAccounts
|
|
@@ -196,7 +196,7 @@ const getAllFundingAccounts = (depositAccounts, paymentAccounts, paymentAccountB
|
|
|
196
196
|
((_c = paymentAccount.providerVerificationStatus) === null || _c === void 0 ? void 0 : _c.code) ===
|
|
197
197
|
'automatically_verified';
|
|
198
198
|
})
|
|
199
|
-
: paymentAccounts).map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc
|
|
199
|
+
: paymentAccounts).map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc)),
|
|
200
200
|
];
|
|
201
201
|
};
|
|
202
202
|
exports.getAllFundingAccounts = getAllFundingAccounts;
|
|
@@ -208,14 +208,10 @@ const mapDepositAccToFundingAccount = (depositAcc) => ({
|
|
|
208
208
|
accountBalance: depositAcc.accountBalance,
|
|
209
209
|
logo: undefined,
|
|
210
210
|
zeniAccountId: depositAcc.zeniAccountId,
|
|
211
|
-
balanceFetchStatus: {
|
|
212
|
-
fetchState: 'Completed',
|
|
213
|
-
error: undefined,
|
|
214
|
-
},
|
|
215
211
|
});
|
|
216
212
|
exports.mapDepositAccToFundingAccount = mapDepositAccToFundingAccount;
|
|
217
|
-
const mapPaymentAccToFundingAccount = (paymentAcc
|
|
218
|
-
var _a
|
|
213
|
+
const mapPaymentAccToFundingAccount = (paymentAcc) => {
|
|
214
|
+
var _a;
|
|
219
215
|
return ({
|
|
220
216
|
id: paymentAcc.paymentAccountId,
|
|
221
217
|
accType: 'paymentAccount',
|
|
@@ -226,15 +222,10 @@ const mapPaymentAccToFundingAccount = (paymentAcc, paymentAccountBalanceFetchSta
|
|
|
226
222
|
isLoginRequired: paymentAcc.isLoginRequired,
|
|
227
223
|
providerAccountId: paymentAcc.providerAccountId,
|
|
228
224
|
providerVerificationStatus: paymentAcc.providerVerificationStatus,
|
|
229
|
-
accountBalance: paymentAcc.balances,
|
|
230
225
|
label: Boolean(paymentAcc.institutionDetails.institutionName) === true
|
|
231
226
|
? paymentAcc.institutionDetails.institutionName
|
|
232
227
|
: (0, depositAccountPayload_1.getZeniAccountFallbackName)(paymentAcc.maskedAccountNumber, (_a = paymentAcc.accountSubType) === null || _a === void 0 ? void 0 : _a.name),
|
|
233
228
|
logo: paymentAcc.institutionDetails.logo,
|
|
234
|
-
balanceFetchStatus: (_b = paymentAccountBalanceFetchStatus[paymentAcc.paymentAccountId]) !== null && _b !== void 0 ? _b : {
|
|
235
|
-
fetchState: 'Not-Started',
|
|
236
|
-
error: undefined,
|
|
237
|
-
},
|
|
238
229
|
});
|
|
239
230
|
};
|
|
240
231
|
exports.mapPaymentAccToFundingAccount = mapPaymentAccToFundingAccount;
|
package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountListEpic.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchPaymentAccountList, updatePaymentAccountList, updatePaymentAccountListFetchStatus
|
|
5
|
+
import { fetchPaymentAccountList, updatePaymentAccountList, updatePaymentAccountListFetchStatus } from './paymentAccountListReducer';
|
|
6
6
|
import { updateAccounts } from '../../../../entity/account/accountReducer';
|
|
7
7
|
import { updatePaymentAccounts } from '../../../../entity/paymentAccount/paymentAccountReducer';
|
|
8
|
-
export declare type ActionType = ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof updatePaymentAccountListFetchStatus> | ReturnType<typeof
|
|
8
|
+
export declare type ActionType = ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof updatePaymentAccountListFetchStatus> | ReturnType<typeof updateAccounts> | ReturnType<typeof updatePaymentAccounts>;
|
|
9
9
|
export declare const fetchPaymentAccountListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/zeniAccounts/paymentAccountList/fetchPaymentAccountListEpic.js
CHANGED
|
@@ -11,18 +11,12 @@ const fetchPaymentAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pip
|
|
|
11
11
|
return zeniAPI
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/payment-accounts`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(0
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
data: payment_accounts,
|
|
21
|
-
updateType: 'replace',
|
|
22
|
-
}),
|
|
23
|
-
];
|
|
24
|
-
paymentAccountListAction = paymentAccountListAction.concat(payment_accounts.map((paymentAcc) => (0, paymentAccountListReducer_1.fetchPaymentAccountBalance)(paymentAcc.payment_account_id)));
|
|
25
|
-
return (0, rxjs_1.concat)((0, rxjs_1.from)(paymentAccountListAction));
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
16
|
+
return (0, rxjs_1.of)((0, accountReducer_1.updateAccounts)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.accounts) !== null && _b !== void 0 ? _b : [], 'zeni_accounts'), (0, paymentAccountReducer_1.updatePaymentAccounts)((_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.payment_accounts) !== null && _d !== void 0 ? _d : []), (0, paymentAccountListReducer_1.updatePaymentAccountList)({
|
|
17
|
+
data: (_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.payment_accounts) !== null && _f !== void 0 ? _f : [],
|
|
18
|
+
updateType: 'replace',
|
|
19
|
+
}));
|
|
26
20
|
}
|
|
27
21
|
else {
|
|
28
22
|
return (0, rxjs_1.of)((0, paymentAccountListReducer_1.updatePaymentAccountListFetchStatus)({
|
|
@@ -2,5 +2,4 @@ import { FetchedState, FetchStateAndError, ID } from '../../../../commonStateTyp
|
|
|
2
2
|
export interface PaymentAccountListState extends FetchedState {
|
|
3
3
|
paymentAccountIds: ID[];
|
|
4
4
|
unlinkingAccountStatus: Record<ID, FetchStateAndError>;
|
|
5
|
-
paymentAccountBalanceFetchStatus: Record<ID, FetchStateAndError>;
|
|
6
5
|
}
|
package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer.d.ts
CHANGED
|
@@ -17,12 +17,6 @@ export declare const fetchPaymentAccountList: import("@reduxjs/toolkit").ActionC
|
|
|
17
17
|
accountId: ID;
|
|
18
18
|
fetchState: FetchState;
|
|
19
19
|
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
20
|
-
}, string>, fetchPaymentAccountBalance: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountId: string], {
|
|
21
|
-
paymentAccountId: string;
|
|
22
|
-
}, string, never, never>, updatePaymentAccountBalanceStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
23
|
-
paymentAccountId: ID;
|
|
24
|
-
fetchState: FetchState;
|
|
25
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
26
20
|
}, string>;
|
|
27
21
|
declare const _default: import("@reduxjs/toolkit").Reducer<PaymentAccountListState, import("@reduxjs/toolkit").AnyAction>;
|
|
28
22
|
export default _default;
|
package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.unlinkPaymentAccountStatus = exports.unlinkPaymentAccount = exports.removePaymentAccountById = exports.clearPaymentAccountList = exports.updatePaymentAccountListFetchStatus = exports.updatePaymentAccountList = exports.fetchPaymentAccountList = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialState = {
|
|
7
7
|
paymentAccountIds: [],
|
|
8
8
|
fetchState: 'Not-Started',
|
|
9
9
|
unlinkingAccountStatus: {},
|
|
10
|
-
paymentAccountBalanceFetchStatus: {},
|
|
11
10
|
error: undefined,
|
|
12
11
|
hasValidState() {
|
|
13
12
|
return this.fetchState == 'Completed';
|
|
@@ -65,32 +64,10 @@ const paymentAccountList = (0, toolkit_1.createSlice)({
|
|
|
65
64
|
draft.fetchState = action.payload.fetchState;
|
|
66
65
|
draft.error = action.payload.error;
|
|
67
66
|
},
|
|
68
|
-
fetchPaymentAccountBalance: {
|
|
69
|
-
reducer(draft, action) {
|
|
70
|
-
const { paymentAccountId } = action.payload;
|
|
71
|
-
draft.paymentAccountBalanceFetchStatus[paymentAccountId] = {
|
|
72
|
-
fetchState: 'In-Progress',
|
|
73
|
-
error: undefined,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
prepare(paymentAccountId) {
|
|
77
|
-
return {
|
|
78
|
-
payload: {
|
|
79
|
-
paymentAccountId,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
updatePaymentAccountBalanceStatus(draft, action) {
|
|
85
|
-
const { paymentAccountId, fetchState, error } = action.payload;
|
|
86
|
-
draft.paymentAccountBalanceFetchStatus[paymentAccountId].fetchState =
|
|
87
|
-
fetchState;
|
|
88
|
-
draft.paymentAccountBalanceFetchStatus[paymentAccountId].error = error;
|
|
89
|
-
},
|
|
90
67
|
clearPaymentAccountList(draft) {
|
|
91
68
|
Object.assign(draft, exports.initialState);
|
|
92
69
|
},
|
|
93
70
|
},
|
|
94
71
|
});
|
|
95
|
-
_a = paymentAccountList.actions, exports.fetchPaymentAccountList = _a.fetchPaymentAccountList, exports.updatePaymentAccountList = _a.updatePaymentAccountList, exports.updatePaymentAccountListFetchStatus = _a.updatePaymentAccountListFetchStatus, exports.clearPaymentAccountList = _a.clearPaymentAccountList, exports.removePaymentAccountById = _a.removePaymentAccountById, exports.unlinkPaymentAccount = _a.unlinkPaymentAccount, exports.unlinkPaymentAccountStatus = _a.unlinkPaymentAccountStatus
|
|
72
|
+
_a = paymentAccountList.actions, exports.fetchPaymentAccountList = _a.fetchPaymentAccountList, exports.updatePaymentAccountList = _a.updatePaymentAccountList, exports.updatePaymentAccountListFetchStatus = _a.updatePaymentAccountListFetchStatus, exports.clearPaymentAccountList = _a.clearPaymentAccountList, exports.removePaymentAccountById = _a.removePaymentAccountById, exports.unlinkPaymentAccount = _a.unlinkPaymentAccount, exports.unlinkPaymentAccountStatus = _a.unlinkPaymentAccountStatus;
|
|
96
73
|
exports.default = paymentAccountList.reducer;
|