@zeniai/client-epic-state 4.12.62 → 4.12.64
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 +1 -2
- package/lib/epic.d.ts +2 -3
- package/lib/epic.js +2 -3
- package/lib/index.d.ts +8 -10
- package/lib/index.js +16 -21
- package/lib/reducer.d.ts +1 -1
- package/lib/reducer.js +1 -1
- 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/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +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 -1
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +0 -8
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +0 -30
- /package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/json/vendorFiling1099ListSuccess.json +0 -0
- /package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
|
@@ -11,6 +11,5 @@ 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
|
|
16
|
-
export declare const fetchVendorsTabVendorEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
14
|
+
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>;
|
|
15
|
+
export declare const fetchVendorsTabVendorEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -15,8 +15,7 @@ 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
|
|
19
|
-
const fetchVendorsTabVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorsTabVendorViewReducer_1.fetchVendorsTabVendor.match), (0, operators_1.switchMap)((action) => {
|
|
18
|
+
const fetchVendorsTabVendorEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorsTabVendorViewReducer_1.fetchVendorsTabVendor.match), (0, operators_1.switchMap)((action) => {
|
|
20
19
|
return zeniAPI
|
|
21
20
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/vendors/${action.payload.vendorId}`)
|
|
22
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -44,12 +43,11 @@ const fetchVendorsTabVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
44
43
|
(0, vendorsTabVendorViewReducer_1.updateVendorsTabVendorSaveStatus)({
|
|
45
44
|
vendorId: action.payload.vendorId,
|
|
46
45
|
}),
|
|
47
|
-
(0, vendorViewReducer_1.initializeVendorAddress)(action.payload.vendorId),
|
|
48
46
|
];
|
|
49
47
|
if (vendorInResponse != null) {
|
|
50
48
|
actions.push((0, vendorsTabVendorViewReducer_1.vendorsTabUpdateVendorDetailLocalData)({
|
|
51
49
|
vendorId: action.payload.vendorId,
|
|
52
|
-
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.
|
|
50
|
+
localData: (0, vendorsTabVendorDetailLocalDataHelpers_1.getInitializedVendorDetailLocalData)((0, vendorPayload_1.mapVendorPayloadToVendor)(vendorInResponse)),
|
|
53
51
|
}));
|
|
54
52
|
}
|
|
55
53
|
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.getInitializedVendorDetailLocalData)(vendorStateData),
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
return (0, rxjs_1.from)(actions);
|
|
@@ -2,9 +2,7 @@ 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
|
-
|
|
6
|
-
import { VendorPayload } from '../../../../entity/vendor/vendorPayload';
|
|
7
|
-
export declare const getInitializedVendorTabDetailLocalData: (vendorData: Vendor, state: RootState, vendorPayload?: VendorPayload | undefined) => VendorsTabVendorDetailLocalData;
|
|
5
|
+
export declare const getInitializedVendorDetailLocalData: (vendorData: Vendor) => VendorsTabVendorDetailLocalData;
|
|
8
6
|
export declare const getAnalyticsDataOnVendorSave: (vendorViewDetails: VendorsTabVendorViewSelectorView, ownerList: User[]) => {
|
|
9
7
|
vendorId: string | undefined;
|
|
10
8
|
vendorName: string | undefined;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAnalyticsDataOnVendorSave = exports.
|
|
3
|
+
exports.getAnalyticsDataOnVendorSave = exports.getInitializedVendorDetailLocalData = void 0;
|
|
4
4
|
const commonVendorViewHelper_1 = require("../../commonVendorViewHelper");
|
|
5
|
-
const
|
|
6
|
-
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
7
|
-
const getInitializedVendorTabDetailLocalData = (vendorData, state, vendorPayload) => {
|
|
8
|
-
var _a;
|
|
9
|
-
const { contactState } = state;
|
|
5
|
+
const getInitializedVendorDetailLocalData = (vendorData) => {
|
|
10
6
|
const { recommendedAccount, recommendedClass } = (0, commonVendorViewHelper_1.getRecommendedCategoryClass)(vendorData.recommendations, vendorData.accountId, vendorData.classId);
|
|
11
7
|
return {
|
|
12
8
|
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 : []),
|
|
20
9
|
vendorCategory: vendorData.accountId,
|
|
21
10
|
vendorClass: vendorData.classId,
|
|
22
11
|
vendorOwner: vendorData.ownerId,
|
|
@@ -28,7 +17,7 @@ const getInitializedVendorTabDetailLocalData = (vendorData, state, vendorPayload
|
|
|
28
17
|
isClassUpdateSelected: false,
|
|
29
18
|
};
|
|
30
19
|
};
|
|
31
|
-
exports.
|
|
20
|
+
exports.getInitializedVendorDetailLocalData = getInitializedVendorDetailLocalData;
|
|
32
21
|
const getAnalyticsDataOnVendorSave = (vendorViewDetails, ownerList) => {
|
|
33
22
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
34
23
|
const vendorBasic = (_a = vendorViewDetails === null || vendorViewDetails === void 0 ? void 0 : vendorViewDetails.vendorView) === null || _a === void 0 ? void 0 : _a.vendorBasic;
|
|
@@ -7,14 +7,10 @@ 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';
|
|
11
10
|
export declare type VendorCreationResponse = ZeniAPIResponse<FetchAllVendorsPayload>;
|
|
12
11
|
export interface VendorUpdatePayload {
|
|
13
12
|
qbo_id: string;
|
|
14
13
|
vendor_name: string;
|
|
15
|
-
email: string;
|
|
16
|
-
phone: string;
|
|
17
|
-
tin: Filing1099TinType | null;
|
|
18
14
|
vendor_type: string;
|
|
19
15
|
account: AccountBasePayload | null;
|
|
20
16
|
accounting_class: ClassBasePayload | null;
|
|
@@ -25,7 +21,6 @@ export interface VendorUpdatePayload {
|
|
|
25
21
|
vendor_currency_symbol: string;
|
|
26
22
|
sync_token: string;
|
|
27
23
|
address?: AddressUpdatableInfoPayload;
|
|
28
|
-
billing_address?: AddressUpdatableInfoPayload;
|
|
29
24
|
is_vendor_1099?: boolean;
|
|
30
25
|
document_ids: ID[] | null;
|
|
31
26
|
owner_id: ID | null;
|
|
@@ -5,11 +5,8 @@ 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");
|
|
10
8
|
const prepareEditVendorPayload = (state, vendorDetailLocalData, vendorId) => {
|
|
11
|
-
|
|
12
|
-
const { accountState, classState, addressViewState, vendorState } = state;
|
|
9
|
+
const { accountState, classState, vendorState } = state;
|
|
13
10
|
const payload = {};
|
|
14
11
|
if (vendorDetailLocalData != null) {
|
|
15
12
|
payload.vendor_name = vendorDetailLocalData.vendorName;
|
|
@@ -40,37 +37,6 @@ const prepareEditVendorPayload = (state, vendorDetailLocalData, vendorId) => {
|
|
|
40
37
|
else {
|
|
41
38
|
payload.owner_id = null;
|
|
42
39
|
}
|
|
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;
|
|
74
40
|
}
|
|
75
41
|
if (vendorId != null) {
|
|
76
42
|
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 {
|
|
4
|
+
import { 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,11 +38,6 @@ 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>,
|
|
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>;
|
|
41
|
+
}, string, never, never>, resetVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearVendorsTabVendorView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
47
42
|
declare const _default: import("@reduxjs/toolkit").Reducer<VendorsTabVendorViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
48
43
|
export default _default;
|
|
@@ -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);
|
|
@@ -36,7 +36,7 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
36
36
|
cardHolderUser == null ||
|
|
37
37
|
cardHolderUserRole == null ||
|
|
38
38
|
billingAddress == null) {
|
|
39
|
-
console.error(`Cannot find details for card ${chargeCard.id}
|
|
39
|
+
console.error(`Cannot find details for card ${chargeCard.cardName} id ${chargeCard.id} - Created by ${cardCreatedByUser === null || cardCreatedByUser === void 0 ? void 0 : cardCreatedByUser.firstName}, for ${cardHolderUser === null || cardHolderUser === void 0 ? void 0 : cardHolderUser.firstName} with role ${cardHolderUserRole} and billing address in ${billingAddress === null || billingAddress === void 0 ? void 0 : billingAddress.country}.`);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
chargeCardsWithUser.push(Object.assign(Object.assign({}, chargeCard), { cardHolderUser,
|
package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListMock.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VendorFiling1099ListResponse } from '../
|
|
2
|
-
import { VendorFiling1099ListState } from '../
|
|
1
|
+
import { VendorFiling1099ListResponse } from '../vendorFiling1099ListPayload';
|
|
2
|
+
import { VendorFiling1099ListState } from '../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 rootStateWithVendorList: RootState;
|
package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__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.rootStateWithVendorList = 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("../
|
|
9
|
+
const vendorFiling1099ListReducer_1 = require("../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.rootStateWithVendorList = Object.assign({}, reducer_1.initialRootState, {
|
|
81
81
|
vendorState: {
|
|
82
82
|
vendorByID: {
|
|
83
83
|
'vendor_j12jh1g2g12jg3jh12:12': vendorStateMocks_1.vendorStateMock1,
|
|
@@ -98,18 +98,4 @@ exports.rootStateWithVendorFiling1099List = Object.assign({}, reducer_1.initialR
|
|
|
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
|
-
},
|
|
115
101
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VendorFiling1099ListSelectorView } from '../
|
|
1
|
+
import { VendorFiling1099ListSelectorView } from '../vendorFiling1099ListSelector';
|
|
2
2
|
export declare const vendorFiling1099ListSelectorMock: VendorFiling1099ListSelectorView;
|
|
@@ -18,14 +18,5 @@ exports.vendorFiling1099ListSelectorMock = {
|
|
|
18
18
|
searchString: '',
|
|
19
19
|
},
|
|
20
20
|
isVendor1099Populated: true,
|
|
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
|
-
],
|
|
21
|
+
vendorTypeList: [],
|
|
31
22
|
};
|
|
@@ -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>;
|
|
@@ -3,19 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchVendorsFiling1099ListEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("
|
|
6
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
7
7
|
const vendorFiling1099ListReducer_1 = require("./vendorFiling1099ListReducer");
|
|
8
|
-
const vendorReducer_1 = require("
|
|
9
|
-
const addressReducer_1 = require("
|
|
10
|
-
const commonVendorViewHelper_1 = require("
|
|
11
|
-
const vendorTypeListReducer_1 = require("
|
|
8
|
+
const vendorReducer_1 = require("../../entity/vendor/vendorReducer");
|
|
9
|
+
const addressReducer_1 = require("../../entity/address/addressReducer");
|
|
10
|
+
const commonVendorViewHelper_1 = require("../commonVendorView/commonVendorViewHelper");
|
|
11
|
+
const vendorTypeListReducer_1 = require("../vendorTypeList/vendorTypeListReducer");
|
|
12
12
|
const fetchVendorsFiling1099ListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFiling1099ListReducer_1.fetchVendorsFiling1099List.match), (0, operators_1.switchMap)(() => {
|
|
13
13
|
const apiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/vendor_1099`;
|
|
14
14
|
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
|
|
15
15
|
var _a;
|
|
16
16
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
17
|
const actions = [];
|
|
18
|
-
actions.push(...updateAllVendorRelatedEntities((_a = response.data
|
|
18
|
+
actions.push(...updateAllVendorRelatedEntities((_a = response.data) === null || _a === void 0 ? void 0 : _a.report.vendors), (0, vendorFiling1099ListReducer_1.updateVendorsFiling1099List)({
|
|
19
19
|
response,
|
|
20
20
|
}));
|
|
21
21
|
actions.push((0, vendorTypeListReducer_1.fetchVendorTypeList)());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReportPayload } from '
|
|
2
|
-
import { VendorPayload } from '
|
|
3
|
-
import { ZeniAPIResponse } from '
|
|
1
|
+
import { ReportPayload } from '../../commonPayloadTypes/viewAndReportPayload';
|
|
2
|
+
import { VendorPayload } from '../../entity/vendor/vendorPayload';
|
|
3
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
4
|
export interface FetchVendorFiling1099Payload {
|
|
5
5
|
report: ReportVendorFiling1099Payload;
|
|
6
6
|
query: Record<string, unknown>;
|