@zeniai/client-epic-state 4.12.60 → 4.12.62
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/tenant/clearAllEpic.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.js +1 -1
- package/lib/entity/vendor/vendorType.d.ts +2 -1
- package/lib/epic.d.ts +3 -2
- package/lib/epic.js +3 -2
- package/lib/index.d.ts +10 -8
- package/lib/index.js +21 -16
- package/lib/reducer.d.ts +1 -1
- package/lib/reducer.js +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.d.ts +2 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.js +6 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.d.ts +3 -2
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.js +4 -2
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/resetVendorsTabVendorDetailLocalDataEpic.js +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.d.ts +3 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.js +14 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.d.ts +5 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.js +35 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +7 -2
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +23 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +16 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +24 -7
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +16 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.js +3 -0
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.d.ts +3 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.js +17 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.d.ts +1 -1
- package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.js +10 -1
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +8 -0
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +30 -0
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.d.ts +5 -5
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.js +6 -6
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.d.ts +3 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.d.ts +8 -4
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.js +18 -5
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.d.ts +6 -6
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.js +8 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListState.d.ts +3 -3
- package/lib/view/{vendorFiling1099List → vendorFiling1099/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 -1
- /package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/json/vendorFiling1099ListSuccess.json +0 -0
- /package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
|
@@ -11,5 +11,6 @@ import { updateClasses } from '../../../../entity/class/classReducer';
|
|
|
11
11
|
import { updateBankAccounts } from '../../../../entity/bankAccount/bankAccountReducer';
|
|
12
12
|
import { updateFiles } from '../../../../entity/file/fileReducer';
|
|
13
13
|
import { updateAccounts } from '../../../../entity/account/accountReducer';
|
|
14
|
-
|
|
15
|
-
export declare
|
|
14
|
+
import { initializeVendorAddress } from '../../vendorView/vendorViewReducer';
|
|
15
|
+
export declare type ActionType = ReturnType<typeof fetchVendorsTabVendor> | ReturnType<typeof fetchClassList> | ReturnType<typeof updateVendorsTabVendorFetchStatus> | ReturnType<typeof updateVendors> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateClasses> | ReturnType<typeof updateContacts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateVendorsTabVendorSaveStatus> | ReturnType<typeof updateFiles> | ReturnType<typeof initializeVendorAddress>;
|
|
16
|
+
export declare const fetchVendorsTabVendorEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -15,7 +15,8 @@ const bankAccountReducer_1 = require("../../../../entity/bankAccount/bankAccount
|
|
|
15
15
|
const fileReducer_1 = require("../../../../entity/file/fileReducer");
|
|
16
16
|
const commonVendorViewHelper_1 = require("../../commonVendorViewHelper");
|
|
17
17
|
const accountReducer_1 = require("../../../../entity/account/accountReducer");
|
|
18
|
-
const
|
|
18
|
+
const vendorViewReducer_1 = require("../../vendorView/vendorViewReducer");
|
|
19
|
+
const fetchVendorsTabVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorsTabVendorViewReducer_1.fetchVendorsTabVendor.match), (0, operators_1.switchMap)((action) => {
|
|
19
20
|
return zeniAPI
|
|
20
21
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/vendors/${action.payload.vendorId}`)
|
|
21
22
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -43,11 +44,12 @@ const fetchVendorsTabVendorEpic = (actions$, _state$, zeniAPI) => actions$.pipe(
|
|
|
43
44
|
(0, vendorsTabVendorViewReducer_1.updateVendorsTabVendorSaveStatus)({
|
|
44
45
|
vendorId: action.payload.vendorId,
|
|
45
46
|
}),
|
|
47
|
+
(0, vendorViewReducer_1.initializeVendorAddress)(action.payload.vendorId),
|
|
46
48
|
];
|
|
47
49
|
if (vendorInResponse != null) {
|
|
48
50
|
actions.push((0, vendorsTabVendorViewReducer_1.vendorsTabUpdateVendorDetailLocalData)({
|
|
49
51
|
vendorId: action.payload.vendorId,
|
|
50
|
-
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.
|
|
52
|
+
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.getInitializedVendorTabDetailLocalData)((0, vendorPayload_1.mapVendorPayloadToVendor)(vendorInResponse), state$.value, vendorInResponse),
|
|
51
53
|
}));
|
|
52
54
|
}
|
|
53
55
|
return (0, rxjs_1.from)(actions);
|
|
@@ -14,7 +14,7 @@ _zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorsTabVendorViewReducer_1
|
|
|
14
14
|
if (vendorStateData != null) {
|
|
15
15
|
actions.push((0, vendorsTabVendorViewReducer_1.vendorsTabUpdateVendorDetailLocalData)({
|
|
16
16
|
vendorId: action.payload.vendorId,
|
|
17
|
-
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.
|
|
17
|
+
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.getInitializedVendorTabDetailLocalData)(vendorStateData, state$.value),
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
return (0, rxjs_1.from)(actions);
|
|
@@ -2,7 +2,9 @@ import { User } from '../../../../entity/user/userState';
|
|
|
2
2
|
import { Vendor } from '../../../../entity/vendor/vendorState';
|
|
3
3
|
import { VendorsTabVendorDetailLocalData } from '../vendorsTabVendorViewState';
|
|
4
4
|
import { VendorsTabVendorViewSelectorView } from '../vendorsTabVendorViewSelector';
|
|
5
|
-
|
|
5
|
+
import { RootState } from '../../../../reducer';
|
|
6
|
+
import { VendorPayload } from '../../../../entity/vendor/vendorPayload';
|
|
7
|
+
export declare const getInitializedVendorTabDetailLocalData: (vendorData: Vendor, state: RootState, vendorPayload?: VendorPayload | undefined) => VendorsTabVendorDetailLocalData;
|
|
6
8
|
export declare const getAnalyticsDataOnVendorSave: (vendorViewDetails: VendorsTabVendorViewSelectorView, ownerList: User[]) => {
|
|
7
9
|
vendorId: string | undefined;
|
|
8
10
|
vendorName: string | undefined;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAnalyticsDataOnVendorSave = exports.
|
|
3
|
+
exports.getAnalyticsDataOnVendorSave = exports.getInitializedVendorTabDetailLocalData = void 0;
|
|
4
4
|
const commonVendorViewHelper_1 = require("../../commonVendorViewHelper");
|
|
5
|
-
const
|
|
5
|
+
const contactPayload_1 = require("../../../../entity/billPay/contact/contactPayload");
|
|
6
|
+
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
7
|
+
const getInitializedVendorTabDetailLocalData = (vendorData, state, vendorPayload) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const { contactState } = state;
|
|
6
10
|
const { recommendedAccount, recommendedClass } = (0, commonVendorViewHelper_1.getRecommendedCategoryClass)(vendorData.recommendations, vendorData.accountId, vendorData.classId);
|
|
7
11
|
return {
|
|
8
12
|
vendorName: vendorData.name,
|
|
13
|
+
vendorEmail: vendorData.email,
|
|
14
|
+
vendorPhone: vendorData.phone,
|
|
15
|
+
vendorType: vendorData.vendorType,
|
|
16
|
+
tin: vendorData.filing1099Tin,
|
|
17
|
+
contacts: (vendorPayload === null || vendorPayload === void 0 ? void 0 : vendorPayload.contacts) != null
|
|
18
|
+
? vendorPayload.contacts.map((contact) => (0, contactPayload_1.toContact)(contact))
|
|
19
|
+
: (0, contactSelector_1.getContactsByIds)(contactState, (_a = vendorData.contactIds) !== null && _a !== void 0 ? _a : []),
|
|
9
20
|
vendorCategory: vendorData.accountId,
|
|
10
21
|
vendorClass: vendorData.classId,
|
|
11
22
|
vendorOwner: vendorData.ownerId,
|
|
@@ -17,7 +28,7 @@ const getInitializedVendorDetailLocalData = (vendorData) => {
|
|
|
17
28
|
isClassUpdateSelected: false,
|
|
18
29
|
};
|
|
19
30
|
};
|
|
20
|
-
exports.
|
|
31
|
+
exports.getInitializedVendorTabDetailLocalData = getInitializedVendorTabDetailLocalData;
|
|
21
32
|
const getAnalyticsDataOnVendorSave = (vendorViewDetails, ownerList) => {
|
|
22
33
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
23
34
|
const vendorBasic = (_a = vendorViewDetails === null || vendorViewDetails === void 0 ? void 0 : vendorViewDetails.vendorView) === null || _a === void 0 ? void 0 : _a.vendorBasic;
|
|
@@ -7,10 +7,14 @@ import { ZeniAPIResponse } from '../../../responsePayload';
|
|
|
7
7
|
import { VendorsTabVendorDetailLocalData } from './vendorsTabVendorViewState';
|
|
8
8
|
import { AddressUpdatableInfoPayload } from '../../addressView/addressViewPayload';
|
|
9
9
|
import { FetchAllVendorsPayload } from '../../vendorList/vendorListPayload';
|
|
10
|
+
import { Filing1099TinType } from '../../../entity/vendor/vendorType';
|
|
10
11
|
export declare type VendorCreationResponse = ZeniAPIResponse<FetchAllVendorsPayload>;
|
|
11
12
|
export interface VendorUpdatePayload {
|
|
12
13
|
qbo_id: string;
|
|
13
14
|
vendor_name: string;
|
|
15
|
+
email: string;
|
|
16
|
+
phone: string;
|
|
17
|
+
tin: Filing1099TinType | null;
|
|
14
18
|
vendor_type: string;
|
|
15
19
|
account: AccountBasePayload | null;
|
|
16
20
|
accounting_class: ClassBasePayload | null;
|
|
@@ -21,6 +25,7 @@ export interface VendorUpdatePayload {
|
|
|
21
25
|
vendor_currency_symbol: string;
|
|
22
26
|
sync_token: string;
|
|
23
27
|
address?: AddressUpdatableInfoPayload;
|
|
28
|
+
billing_address?: AddressUpdatableInfoPayload;
|
|
24
29
|
is_vendor_1099?: boolean;
|
|
25
30
|
document_ids: ID[] | null;
|
|
26
31
|
owner_id: ID | null;
|
|
@@ -5,8 +5,11 @@ const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
|
5
5
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
6
6
|
const classPayload_1 = require("../../../entity/class/classPayload");
|
|
7
7
|
const classSelector_1 = require("../../../entity/class/classSelector");
|
|
8
|
+
const contactPayload_1 = require("../../../entity/billPay/contact/contactPayload");
|
|
9
|
+
const addressViewPayload_1 = require("../../addressView/addressViewPayload");
|
|
8
10
|
const prepareEditVendorPayload = (state, vendorDetailLocalData, vendorId) => {
|
|
9
|
-
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const { accountState, classState, addressViewState, vendorState } = state;
|
|
10
13
|
const payload = {};
|
|
11
14
|
if (vendorDetailLocalData != null) {
|
|
12
15
|
payload.vendor_name = vendorDetailLocalData.vendorName;
|
|
@@ -37,6 +40,37 @@ const prepareEditVendorPayload = (state, vendorDetailLocalData, vendorId) => {
|
|
|
37
40
|
else {
|
|
38
41
|
payload.owner_id = null;
|
|
39
42
|
}
|
|
43
|
+
if (vendorDetailLocalData.vendorEmail != null) {
|
|
44
|
+
payload.email = vendorDetailLocalData.vendorEmail;
|
|
45
|
+
}
|
|
46
|
+
if (vendorDetailLocalData.vendorPhone != null) {
|
|
47
|
+
payload.phone = vendorDetailLocalData.vendorPhone;
|
|
48
|
+
}
|
|
49
|
+
if (vendorDetailLocalData.vendorType != null) {
|
|
50
|
+
payload.vendor_type = vendorDetailLocalData.vendorType;
|
|
51
|
+
}
|
|
52
|
+
if (vendorDetailLocalData.tin != null) {
|
|
53
|
+
payload.tin = {
|
|
54
|
+
type: vendorDetailLocalData.tin.type,
|
|
55
|
+
value: vendorDetailLocalData.tin.value,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
payload.tin = null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const contacts = (_a = vendorDetailLocalData.contacts) !== null && _a !== void 0 ? _a : [];
|
|
63
|
+
payload.contacts = contacts
|
|
64
|
+
.filter((contact) => contact.email.length > 0 || contact.fullName.length > 0)
|
|
65
|
+
.map((contact) => {
|
|
66
|
+
return (0, contactPayload_1.toContactPayload)(contact);
|
|
67
|
+
});
|
|
68
|
+
const vendorAddressToCreate = (_b = addressViewState.newAddressState) === null || _b === void 0 ? void 0 : _b['vendor_address'].addressToCreate;
|
|
69
|
+
const vendorAddressPayload = vendorAddressToCreate != null
|
|
70
|
+
? (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(vendorAddressToCreate)
|
|
71
|
+
: undefined;
|
|
72
|
+
if (vendorAddressPayload != null) {
|
|
73
|
+
payload['address'] = vendorAddressPayload;
|
|
40
74
|
}
|
|
41
75
|
if (vendorId != null) {
|
|
42
76
|
const syncToken = vendorState.vendorByID[vendorId].syncToken;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { Entity } from '../../../entity/genericEntity/entity';
|
|
3
3
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
|
-
import { VendorsTabVendorDetailLocalData, VendorsTabVendorViewState } from './vendorsTabVendorViewState';
|
|
4
|
+
import { CollapsableStatusKey, VendorsTabVendorDetailLocalData, VendorsTabVendorViewState } from './vendorsTabVendorViewState';
|
|
5
5
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
6
6
|
export declare const initialVendorDetailLocalData: VendorsTabVendorDetailLocalData;
|
|
7
7
|
export declare const initialState: VendorsTabVendorViewState;
|
|
@@ -38,6 +38,11 @@ export declare const fetchVendorsTabVendorDetails: import("@reduxjs/toolkit").Ac
|
|
|
38
38
|
numberOfQuartersFetched: number;
|
|
39
39
|
}, string>, resetSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", string>, updateVendorSpendTrendFilterTabValue: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year"], {
|
|
40
40
|
vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year";
|
|
41
|
-
}, string, never, never>, resetVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>,
|
|
41
|
+
}, string, never, never>, resetVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateContactsInVendorTabDetailLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
42
|
+
vendorId: ID;
|
|
43
|
+
localData?: Partial<VendorsTabVendorDetailLocalData> | undefined;
|
|
44
|
+
}, string>, updateVendorTabDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
45
|
+
collapsableStatus: CollapsableStatusKey;
|
|
46
|
+
}, string>, clearVendorsTabVendorView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
42
47
|
declare const _default: import("@reduxjs/toolkit").Reducer<VendorsTabVendorViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
43
48
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
4
|
+
exports.clearVendorsTabVendorView = exports.updateVendorTabDetailUIState = exports.updateContactsInVendorTabDetailLocalData = 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: [],
|
|
7
8
|
vendorId: undefined,
|
|
8
9
|
isCategoryUpdateSelected: false,
|
|
9
10
|
isClassUpdateSelected: false,
|
|
@@ -14,6 +15,9 @@ exports.initialState = {
|
|
|
14
15
|
vendorStateById: {},
|
|
15
16
|
selectedTabType: 'spend_transactions',
|
|
16
17
|
vendorSpendTrendFilterTabValue: 'YTD_spend',
|
|
18
|
+
uiState: {
|
|
19
|
+
collapsableStatus: 'expand',
|
|
20
|
+
},
|
|
17
21
|
};
|
|
18
22
|
const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
19
23
|
name: 'vendorsTabVendorView',
|
|
@@ -115,12 +119,14 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
115
119
|
},
|
|
116
120
|
},
|
|
117
121
|
vendorsTabUpdateVendorDetailLocalData(draft, action) {
|
|
122
|
+
var _a;
|
|
118
123
|
const { vendorId, localData } = action.payload;
|
|
119
124
|
if (localData == null) {
|
|
120
125
|
delete draft.vendorStateById[vendorId].vendorDetailLocalData;
|
|
121
126
|
}
|
|
122
127
|
else if (draft.vendorStateById[vendorId] != null) {
|
|
123
|
-
|
|
128
|
+
const contacts = (_a = localData.contacts) !== null && _a !== void 0 ? _a : [];
|
|
129
|
+
draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData), { contacts: contacts.map((contact) => (Object.assign({}, contact))) });
|
|
124
130
|
}
|
|
125
131
|
},
|
|
126
132
|
vendorsTabResetVendorDetailLocalData: {
|
|
@@ -185,10 +191,24 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
185
191
|
resetSelectedTabType(draft) {
|
|
186
192
|
draft.selectedTabType = 'spend_transactions';
|
|
187
193
|
},
|
|
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
|
+
},
|
|
188
208
|
clearVendorsTabVendorView(draft) {
|
|
189
209
|
Object.assign(draft, exports.initialState);
|
|
190
210
|
},
|
|
191
211
|
},
|
|
192
212
|
});
|
|
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;
|
|
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.updateContactsInVendorTabDetailLocalData = _a.updateContactsInVendorTabDetailLocalData, exports.updateVendorTabDetailUIState = _a.updateVendorTabDetailUIState, exports.clearVendorsTabVendorView = _a.clearVendorsTabVendorView;
|
|
194
214
|
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 } from './vendorsTabVendorViewState';
|
|
4
|
+
import { VendorsTabVendorDetailLocalData, VendorsTabVendorViewUIState } 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,23 +17,37 @@ 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';
|
|
20
25
|
export declare const toVendorDetailTabsType: (v: string) => "spend_transactions" | "all_transactions";
|
|
21
26
|
export declare type VendorDetailTabsType = ReturnType<typeof toVendorDetailTabsType>;
|
|
22
27
|
export interface VendorsTabVendorDetails {
|
|
23
28
|
vendorBasic: VendorsTabVendorBasic;
|
|
29
|
+
vendorNewAddressStatus?: NewAddressData;
|
|
30
|
+
vendorAddress?: Address;
|
|
24
31
|
saveStatus: FetchStateAndError;
|
|
25
32
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
26
33
|
}
|
|
27
34
|
export interface VendorsTabVendorBasic {
|
|
28
35
|
id: ID;
|
|
29
36
|
name: string;
|
|
37
|
+
email?: string;
|
|
38
|
+
phone?: string;
|
|
30
39
|
account?: AccountBase;
|
|
31
40
|
class?: ClassBase;
|
|
32
41
|
owner?: User;
|
|
42
|
+
vendorType?: VendorType;
|
|
43
|
+
vendorTin?: Filing1099TinType;
|
|
44
|
+
contacts?: Contact[];
|
|
45
|
+
vendorDocuments?: File[];
|
|
33
46
|
}
|
|
34
47
|
export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
35
48
|
accountList: AccountListSelectorView;
|
|
36
49
|
classList: ClassListSelectorView;
|
|
50
|
+
vendorTypeList: VendorType[];
|
|
37
51
|
accountsHierarchyList: NestedAccountHierarchyForReport[];
|
|
38
52
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
39
53
|
ownerList: User[];
|
|
@@ -41,6 +55,7 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
|
41
55
|
}
|
|
42
56
|
export interface VendorsTabVendorDetailPageView extends SelectorView {
|
|
43
57
|
vendorViewDetails: VendorsTabVendorViewSelectorView;
|
|
58
|
+
uiState: VendorsTabVendorViewUIState;
|
|
44
59
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
45
60
|
trendWithTransactions: TrendWithTransactionsView;
|
|
46
61
|
vendorSpend: VendorSpend;
|
|
@@ -14,6 +14,8 @@ 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");
|
|
17
19
|
const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
18
20
|
'spend_transactions',
|
|
19
21
|
'all_transactions',
|
|
@@ -21,11 +23,12 @@ const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
|
21
23
|
const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_VENDOR_DETAIL_TABS_TYPES);
|
|
22
24
|
exports.toVendorDetailTabsType = toVendorDetailTabsType;
|
|
23
25
|
const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
24
|
-
var _a, _b, _c, _d, _e;
|
|
25
|
-
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, } = state;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27
|
+
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
|
|
26
28
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
27
29
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
28
30
|
const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
|
|
31
|
+
const vendorTypeList = vendorTypeListState.vendorTypes;
|
|
29
32
|
let vendorDetailState;
|
|
30
33
|
let fetchState = {
|
|
31
34
|
fetchState: 'Not-Started',
|
|
@@ -33,22 +36,27 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
33
36
|
};
|
|
34
37
|
const selectedVendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorIdFromUrl);
|
|
35
38
|
const basicVendorDetails = selectedVendor != null
|
|
36
|
-
? getBasicVendorDetails(accountState, classState, userState, selectedVendor)
|
|
39
|
+
? getBasicVendorDetails(accountState, classState, userState, selectedVendor, vendorTypeListState, contactState)
|
|
37
40
|
: undefined;
|
|
38
|
-
if (basicVendorDetails) {
|
|
41
|
+
if (basicVendorDetails != null) {
|
|
39
42
|
vendorDetailState = {
|
|
40
43
|
vendorBasic: basicVendorDetails,
|
|
41
44
|
saveStatus: (_b = (_a = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _a === void 0 ? void 0 : _a.saveStatus) !== null && _b !== void 0 ? _b : {
|
|
42
45
|
fetchState: 'Not-Started',
|
|
43
46
|
error: undefined,
|
|
44
47
|
},
|
|
45
|
-
|
|
48
|
+
vendorNewAddressStatus: (_c = addressViewState.newAddressState) === null || _c === void 0 ? void 0 : _c.vendor_address,
|
|
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,
|
|
46
53
|
};
|
|
47
54
|
}
|
|
48
55
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
49
56
|
accountList,
|
|
50
57
|
classList,
|
|
51
|
-
|
|
58
|
+
vendorTypeListState,
|
|
59
|
+
(_f = (_e = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _e === void 0 ? void 0 : _e.fetchStatus) !== null && _f !== void 0 ? _f : {
|
|
52
60
|
fetchState: 'Not-Started',
|
|
53
61
|
},
|
|
54
62
|
]);
|
|
@@ -57,6 +65,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
57
65
|
return {
|
|
58
66
|
accountList: accountList,
|
|
59
67
|
classList: classList,
|
|
68
|
+
vendorTypeList: vendorTypeList,
|
|
60
69
|
accountsHierarchyList,
|
|
61
70
|
classHierarchyList,
|
|
62
71
|
ownerList: ownerList,
|
|
@@ -67,8 +76,10 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
67
76
|
};
|
|
68
77
|
};
|
|
69
78
|
exports.getVendorsTabVendorView = getVendorsTabVendorView;
|
|
70
|
-
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor) => ({
|
|
79
|
+
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor, vendorTypeListState, contactState) => ({
|
|
71
80
|
name: selectedVendor.name,
|
|
81
|
+
email: selectedVendor.email,
|
|
82
|
+
phone: selectedVendor.phone,
|
|
72
83
|
account: selectedVendor.accountId != null
|
|
73
84
|
? (0, accountSelector_1.getAccountBase)(accountState, selectedVendor.accountId, 'account_list')
|
|
74
85
|
: undefined,
|
|
@@ -81,11 +92,15 @@ const getBasicVendorDetails = (accountState, classState, userState, selectedVend
|
|
|
81
92
|
owner: selectedVendor.ownerId != null
|
|
82
93
|
? (0, userSelector_1.getUserByUserId)(userState, selectedVendor.ownerId)
|
|
83
94
|
: 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),
|
|
84
98
|
id: selectedVendor.id,
|
|
85
99
|
});
|
|
86
100
|
const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
87
101
|
var _a, _b, _c;
|
|
88
102
|
const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
|
|
103
|
+
const uiState = state.vendorsTabVendorViewState.uiState;
|
|
89
104
|
const vendorViewDetails = (0, exports.getVendorsTabVendorView)(state, vendorId);
|
|
90
105
|
const allVendorTransactions = ((_a = state.vendorsTabVendorViewState.allTransactionsTabData) === null || _a === void 0 ? void 0 : _a.timePeriod) != null
|
|
91
106
|
? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
|
|
@@ -95,6 +110,7 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
95
110
|
state.accountListState.byReportId.accountList,
|
|
96
111
|
state.classListState,
|
|
97
112
|
state.ownerListState,
|
|
113
|
+
state.vendorTypeListState,
|
|
98
114
|
(_c = (_b = state.vendorsTabVendorViewState.vendorStateById[vendorId]) === null || _b === void 0 ? void 0 : _b.fetchStatus) !== null && _c !== void 0 ? _c : {
|
|
99
115
|
fetchState: 'Not-Started',
|
|
100
116
|
},
|
|
@@ -102,6 +118,7 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
102
118
|
]);
|
|
103
119
|
return {
|
|
104
120
|
vendorViewDetails,
|
|
121
|
+
uiState,
|
|
105
122
|
trendWithTransactions,
|
|
106
123
|
allVendorTransactionsView: allVendorTransactions,
|
|
107
124
|
allTransactionsTabData: state.vendorsTabVendorViewState.allTransactionsTabData,
|
|
@@ -3,10 +3,14 @@ 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';
|
|
6
7
|
import { VendorSpendTrendFilterTabType } from '../../../entity/vendorExpense/vendorExpenseSelector';
|
|
8
|
+
import { AddressUpdatableInfo } from '../../addressView/addressViewState';
|
|
9
|
+
import { VendorContactInfo } from '../vendorView/vendorViewState';
|
|
7
10
|
import { VendorDetailTabsType } from './vendorsTabVendorViewSelector';
|
|
8
11
|
export interface VendorsTabVendorViewState {
|
|
9
12
|
vendorStateById: Record<ID, VendorsTabVendorDetailState>;
|
|
13
|
+
uiState: VendorsTabVendorViewUIState;
|
|
10
14
|
selectedTabType: VendorDetailTabsType;
|
|
11
15
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
12
16
|
allTransactionsTabData?: {
|
|
@@ -16,6 +20,12 @@ export interface VendorsTabVendorViewState {
|
|
|
16
20
|
}
|
|
17
21
|
export interface VendorsTabVendorDetailLocalData {
|
|
18
22
|
vendorName?: string;
|
|
23
|
+
vendorEmail?: string;
|
|
24
|
+
vendorPhone?: string;
|
|
25
|
+
vendorType?: string;
|
|
26
|
+
tin?: Filing1099TinType;
|
|
27
|
+
address?: AddressUpdatableInfo;
|
|
28
|
+
contacts: VendorContactInfo[];
|
|
19
29
|
vendorCategory?: string;
|
|
20
30
|
vendorClass?: string;
|
|
21
31
|
vendorId?: ID;
|
|
@@ -31,3 +41,9 @@ export interface VendorsTabVendorDetailState {
|
|
|
31
41
|
saveStatus: FetchStateAndError;
|
|
32
42
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
33
43
|
}
|
|
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,2 +1,5 @@
|
|
|
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);
|
package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VendorFiling1099ListResponse } from '../vendorFiling1099ListPayload';
|
|
2
|
-
import { VendorFiling1099ListState } from '../vendorFiling1099ListState';
|
|
1
|
+
import { VendorFiling1099ListResponse } from '../vendorFiling1099List/vendorFiling1099ListPayload';
|
|
2
|
+
import { VendorFiling1099ListState } from '../vendorFiling1099List/vendorFiling1099ListState';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
4
|
export { vendorFiling1099ListSelectorMock } from './vendorFiling1099ListSelectorMock';
|
|
5
5
|
export declare const vendorFiling1099ListSuccessResponse: VendorFiling1099ListResponse;
|
|
@@ -8,4 +8,4 @@ export declare const vendorFiling1099ListInProgressState: VendorFiling1099ListSt
|
|
|
8
8
|
export declare const vendorFiling1099ListInProgressInitialState: VendorFiling1099ListState;
|
|
9
9
|
export declare const vendorFiling1099ListSuccessState: VendorFiling1099ListState;
|
|
10
10
|
export declare const vendorFiling1099ListFailureState: VendorFiling1099ListState;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const rootStateWithVendorFiling1099List: RootState;
|
package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.js
RENAMED
|
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.rootStateWithVendorFiling1099List = exports.vendorFiling1099ListFailureState = exports.vendorFiling1099ListSuccessState = exports.vendorFiling1099ListInProgressInitialState = exports.vendorFiling1099ListInProgressState = exports.vendorFiling1099ListFailureResponse = exports.vendorFiling1099ListSuccessResponse = exports.vendorFiling1099ListSelectorMock = void 0;
|
|
7
7
|
const vendorFiling1099ListSuccess_json_1 = __importDefault(require("./json/vendorFiling1099ListSuccess.json"));
|
|
8
8
|
const apiFailure_json_1 = __importDefault(require("../../../__testHelpers__/apiFailure.json"));
|
|
9
|
-
const vendorFiling1099ListReducer_1 = require("../vendorFiling1099ListReducer");
|
|
9
|
+
const vendorFiling1099ListReducer_1 = require("../vendorFiling1099List/vendorFiling1099ListReducer");
|
|
10
10
|
const vendorStateMocks_1 = require("../../../entity/vendor/__mocks__/vendorStateMocks");
|
|
11
11
|
const reducer_1 = require("../../../reducer");
|
|
12
12
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
@@ -77,7 +77,7 @@ exports.vendorFiling1099ListFailureState = {
|
|
|
77
77
|
hasValidState: vendorFiling1099ListReducer_1.initialState.hasValidState,
|
|
78
78
|
isVendor1099Populated: false,
|
|
79
79
|
};
|
|
80
|
-
exports.
|
|
80
|
+
exports.rootStateWithVendorFiling1099List = Object.assign({}, reducer_1.initialRootState, {
|
|
81
81
|
vendorState: {
|
|
82
82
|
vendorByID: {
|
|
83
83
|
'vendor_j12jh1g2g12jg3jh12:12': vendorStateMocks_1.vendorStateMock1,
|
|
@@ -98,4 +98,18 @@ exports.rootStateWithVendorList = Object.assign({}, reducer_1.initialRootState,
|
|
|
98
98
|
hasValidState: vendorFiling1099ListReducer_1.initialState.hasValidState,
|
|
99
99
|
isVendor1099Populated: true,
|
|
100
100
|
},
|
|
101
|
+
vendorTypeListState: {
|
|
102
|
+
fetchState: 'Completed',
|
|
103
|
+
error: undefined,
|
|
104
|
+
vendorTypes: [
|
|
105
|
+
{
|
|
106
|
+
code: 'international_business',
|
|
107
|
+
name: 'International - Business',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
code: 'individual',
|
|
111
|
+
name: 'Individual / Sole-Proprietor or Single-Member LLC',
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
101
115
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VendorFiling1099ListSelectorView } from '../vendorFiling1099ListSelector';
|
|
1
|
+
import { VendorFiling1099ListSelectorView } from '../vendorFiling1099List/vendorFiling1099ListSelector';
|
|
2
2
|
export declare const vendorFiling1099ListSelectorMock: VendorFiling1099ListSelectorView;
|
|
@@ -18,5 +18,14 @@ exports.vendorFiling1099ListSelectorMock = {
|
|
|
18
18
|
searchString: '',
|
|
19
19
|
},
|
|
20
20
|
isVendor1099Populated: true,
|
|
21
|
-
vendorTypeList: [
|
|
21
|
+
vendorTypeList: [
|
|
22
|
+
{
|
|
23
|
+
code: 'international_business',
|
|
24
|
+
name: 'International - Business',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: 'individual',
|
|
28
|
+
name: 'Individual / Sole-Proprietor or Single-Member LLC',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
22
31
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { fetchVendorsFiling1099List } from './vendorFiling1099ListReducer';
|
|
5
|
+
import { fetchVendorTypeList } from '../../vendorTypeList/vendorTypeListReducer';
|
|
6
|
+
import { initializeAccountMappingView } from '../../accountMappingView/accountMappingReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof fetchVendorsFiling1099List> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof initializeAccountMappingView>;
|
|
8
|
+
export declare const fetchVendorsFiling1099AllEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchVendorsFiling1099AllEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const vendorFiling1099ListReducer_1 = require("./vendorFiling1099ListReducer");
|
|
7
|
+
const vendorTypeListReducer_1 = require("../../vendorTypeList/vendorTypeListReducer");
|
|
8
|
+
const accountMappingReducer_1 = require("../../accountMappingView/accountMappingReducer");
|
|
9
|
+
const fetchVendorsFiling1099AllEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(vendorFiling1099ListReducer_1.fetchVendorsFiling1099All.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const vendorActions = [];
|
|
12
|
+
if (action.payload.cacheOverride === true) {
|
|
13
|
+
if (state.vendorTypeListState.hasValidState() === false &&
|
|
14
|
+
state.vendorTypeListState.fetchState !== 'In-Progress') {
|
|
15
|
+
vendorActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
16
|
+
}
|
|
17
|
+
vendorActions.push((0, accountMappingReducer_1.initializeAccountMappingView)());
|
|
18
|
+
vendorActions.push((0, vendorFiling1099ListReducer_1.fetchVendorsFiling1099List)());
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (state.vendorTypeListState.hasValidState() === false &&
|
|
22
|
+
state.vendorTypeListState.fetchState !== 'In-Progress') {
|
|
23
|
+
vendorActions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
24
|
+
}
|
|
25
|
+
vendorActions.push((0, accountMappingReducer_1.initializeAccountMappingView)());
|
|
26
|
+
vendorActions.push((0, vendorFiling1099ListReducer_1.fetchVendorsFiling1099List)());
|
|
27
|
+
}
|
|
28
|
+
return (0, rxjs_1.concat)((0, rxjs_1.from)(vendorActions));
|
|
29
|
+
}));
|
|
30
|
+
exports.fetchVendorsFiling1099AllEpic = fetchVendorsFiling1099AllEpic;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ZeniAPI } from '
|
|
4
|
-
import { RootState } from '
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
5
|
import { updateVendorsFiling1099List, updateVendorFiling1099ListFailure, fetchVendorsFiling1099List } from './vendorFiling1099ListReducer';
|
|
6
|
-
import { updateVendors } from '
|
|
7
|
-
import { updateAddresses } from '
|
|
8
|
-
import { fetchVendorTypeList } from '
|
|
6
|
+
import { updateVendors } from '../../../entity/vendor/vendorReducer';
|
|
7
|
+
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
8
|
+
import { fetchVendorTypeList } from '../../vendorTypeList/vendorTypeListReducer';
|
|
9
9
|
export declare type ActionType = ReturnType<typeof fetchVendorsFiling1099List> | ReturnType<typeof updateVendorFiling1099ListFailure> | ReturnType<typeof updateVendors> | ReturnType<typeof updateVendorsFiling1099List> | ReturnType<typeof fetchVendorTypeList> | ReturnType<typeof updateAddresses>;
|
|
10
10
|
export declare const fetchVendorsFiling1099ListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|