@zeniai/client-epic-state 4.12.63 → 4.12.65
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/__mocks__/vendorStateMocks.js +1 -6
- package/lib/entity/vendor/vendorPayload.d.ts +1 -2
- package/lib/entity/vendor/vendorPayload.js +4 -6
- package/lib/entity/vendor/vendorState.d.ts +0 -1
- package/lib/entity/vendor/vendorType.d.ts +1 -2
- package/lib/epic.d.ts +2 -4
- package/lib/epic.js +2 -4
- package/lib/index.d.ts +8 -15
- package/lib/index.js +16 -31
- package/lib/reducer.d.ts +1 -4
- package/lib/reducer.js +1 -4
- package/lib/view/commonVendorView/vendorView/epics/fetchVendorDetailsEpic.js +2 -2
- package/lib/view/commonVendorView/vendorView/vendorViewPayload.d.ts +0 -6
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.d.ts +1 -2
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.js +1 -6
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.d.ts +2 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.js +2 -4
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/resetVendorsTabVendorDetailLocalDataEpic.js +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.d.ts +1 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.js +3 -14
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.d.ts +0 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.js +1 -35
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -7
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +3 -23
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -16
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +7 -24
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +0 -16
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.js +0 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.js +9 -4
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +6 -9
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/json/vendorFiling1099ListSuccess.json +1 -1
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListMock.d.ts +3 -3
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListMock.js +3 -17
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListSelectorMock.d.ts +1 -1
- package/lib/view/{vendorFiling1099 → vendorFiling1099List}/__mock__/vendorFiling1099ListSelectorMock.js +1 -10
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/fetchVendorsFiling1099ListEpic.d.ts +5 -5
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/fetchVendorsFiling1099ListEpic.js +6 -6
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListPayload.d.ts +3 -3
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListReducer.d.ts +4 -8
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListReducer.js +5 -18
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListSelector.d.ts +6 -6
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListSelector.js +3 -8
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListState.d.ts +3 -3
- package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListState.js +1 -1
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +1 -1
- package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +2 -2
- package/package.json +1 -2
- package/lib/entity/vendor/__mocks__/vendorMock.d.ts +0 -7
- package/lib/entity/vendor/__mocks__/vendorMock.js +0 -339
- package/lib/view/addressView/__mocks__/addressViewMocks.d.ts +0 -34
- package/lib/view/addressView/__mocks__/addressViewMocks.js +0 -223
- package/lib/view/addressView/__mocks__/json/createAddressResponse.json +0 -23
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -218
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -345
- package/lib/view/addressView/__mocks__/json/fetchAddressResponse.json +0 -24
- package/lib/view/addressView/__mocks__/json/updateAddressResponse.json +0 -24
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +0 -132
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.js +0 -146
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +0 -8
- package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +0 -30
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.d.ts +0 -20
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.js +0 -48
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +0 -25
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +0 -180
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.d.ts +0 -11
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.js +0 -58
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.d.ts +0 -14
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.js +0 -17
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.d.ts +0 -26
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.js +0 -2
- /package/lib/view/{vendorFiling1099/vendorFiling1099List → vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearVendorsTabVendorView = exports.
|
|
4
|
+
exports.clearVendorsTabVendorView = exports.resetVendorsTabVendorAllTransactionsTabData = exports.updateVendorSpendTrendFilterTabValue = exports.updateSelectedTabType = exports.resetSelectedTabType = exports.updateVendorsTabVendorAllTransactionsTabData = exports.fetchVendorsTabVendorDetailPageView = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.updateVendorsTabVendorSaveStatus = exports.updateVendorsTabVendorFetchStatus = exports.fetchVendorsTabVendor = exports.fetchVendorsTabVendorDetails = exports.initialState = exports.initialVendorDetailLocalData = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialVendorDetailLocalData = {
|
|
7
|
-
contacts: [],
|
|
8
7
|
vendorId: undefined,
|
|
9
8
|
isCategoryUpdateSelected: false,
|
|
10
9
|
isClassUpdateSelected: false,
|
|
@@ -15,9 +14,6 @@ exports.initialState = {
|
|
|
15
14
|
vendorStateById: {},
|
|
16
15
|
selectedTabType: 'spend_transactions',
|
|
17
16
|
vendorSpendTrendFilterTabValue: 'YTD_spend',
|
|
18
|
-
uiState: {
|
|
19
|
-
collapsableStatus: 'expand',
|
|
20
|
-
},
|
|
21
17
|
};
|
|
22
18
|
const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
23
19
|
name: 'vendorsTabVendorView',
|
|
@@ -119,14 +115,12 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
119
115
|
},
|
|
120
116
|
},
|
|
121
117
|
vendorsTabUpdateVendorDetailLocalData(draft, action) {
|
|
122
|
-
var _a;
|
|
123
118
|
const { vendorId, localData } = action.payload;
|
|
124
119
|
if (localData == null) {
|
|
125
120
|
delete draft.vendorStateById[vendorId].vendorDetailLocalData;
|
|
126
121
|
}
|
|
127
122
|
else if (draft.vendorStateById[vendorId] != null) {
|
|
128
|
-
|
|
129
|
-
draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData), { contacts: contacts.map((contact) => (Object.assign({}, contact))) });
|
|
123
|
+
draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData);
|
|
130
124
|
}
|
|
131
125
|
},
|
|
132
126
|
vendorsTabResetVendorDetailLocalData: {
|
|
@@ -191,24 +185,10 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
191
185
|
resetSelectedTabType(draft) {
|
|
192
186
|
draft.selectedTabType = 'spend_transactions';
|
|
193
187
|
},
|
|
194
|
-
updateContactsInVendorTabDetailLocalData(draft, action) {
|
|
195
|
-
var _a;
|
|
196
|
-
const { vendorId, localData } = action.payload;
|
|
197
|
-
if (localData === null || localData === void 0 ? void 0 : localData.contacts) {
|
|
198
|
-
const contacts = localData.contacts;
|
|
199
|
-
if (vendorId != null) {
|
|
200
|
-
draft.vendorStateById[vendorId] = Object.assign(Object.assign({}, draft.vendorStateById[vendorId]), { vendorDetailLocalData: Object.assign(Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), (_a = draft.vendorStateById[vendorId]) === null || _a === void 0 ? void 0 : _a.vendorDetailLocalData), { contacts: contacts.map((contact) => (Object.assign({}, contact))) }) });
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
updateVendorTabDetailUIState(draft, action) {
|
|
205
|
-
const { collapsableStatus } = action.payload;
|
|
206
|
-
draft.uiState.collapsableStatus = collapsableStatus;
|
|
207
|
-
},
|
|
208
188
|
clearVendorsTabVendorView(draft) {
|
|
209
189
|
Object.assign(draft, exports.initialState);
|
|
210
190
|
},
|
|
211
191
|
},
|
|
212
192
|
});
|
|
213
|
-
_a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.updateVendorsTabVendorAllTransactionsTabData = _a.updateVendorsTabVendorAllTransactionsTabData, exports.resetSelectedTabType = _a.resetSelectedTabType, exports.updateSelectedTabType = _a.updateSelectedTabType, exports.updateVendorSpendTrendFilterTabValue = _a.updateVendorSpendTrendFilterTabValue, exports.resetVendorsTabVendorAllTransactionsTabData = _a.resetVendorsTabVendorAllTransactionsTabData, exports.
|
|
193
|
+
_a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.updateVendorsTabVendorAllTransactionsTabData = _a.updateVendorsTabVendorAllTransactionsTabData, exports.resetSelectedTabType = _a.resetSelectedTabType, exports.updateSelectedTabType = _a.updateSelectedTabType, exports.updateVendorSpendTrendFilterTabValue = _a.updateVendorSpendTrendFilterTabValue, exports.resetVendorsTabVendorAllTransactionsTabData = _a.resetVendorsTabVendorAllTransactionsTabData, exports.clearVendorsTabVendorView = _a.clearVendorsTabVendorView;
|
|
214
194
|
exports.default = vendorsTabVendorView.reducer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
|
-
import { VendorsTabVendorDetailLocalData
|
|
4
|
+
import { VendorsTabVendorDetailLocalData } from './vendorsTabVendorViewState';
|
|
5
5
|
import { AccountListSelectorView } from '../../accountList/accountListSelector';
|
|
6
6
|
import { ClassListSelectorView } from '../../classList/classListSelector';
|
|
7
7
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
@@ -17,37 +17,23 @@ import { TransactionListByEntityView } from '../../transactionList/transactionLi
|
|
|
17
17
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
18
18
|
import { Month } from '../../../commonStateTypes/timePeriod';
|
|
19
19
|
import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
|
|
20
|
-
import { Address } from '../../../entity/address/addressState';
|
|
21
|
-
import { Contact } from '../../../entity/billPay/contact/contact';
|
|
22
|
-
import { VendorType } from '../../vendorTypeList/vendorTypeListPayload';
|
|
23
|
-
import { Filing1099TinType } from '../../../entity/vendor/vendorType';
|
|
24
|
-
import { NewAddressData } from '../../addressView/addressViewState';
|
|
25
20
|
export declare const toVendorDetailTabsType: (v: string) => "spend_transactions" | "all_transactions";
|
|
26
21
|
export declare type VendorDetailTabsType = ReturnType<typeof toVendorDetailTabsType>;
|
|
27
22
|
export interface VendorsTabVendorDetails {
|
|
28
23
|
vendorBasic: VendorsTabVendorBasic;
|
|
29
|
-
vendorNewAddressStatus?: NewAddressData;
|
|
30
|
-
vendorAddress?: Address;
|
|
31
24
|
saveStatus: FetchStateAndError;
|
|
32
25
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
33
26
|
}
|
|
34
27
|
export interface VendorsTabVendorBasic {
|
|
35
28
|
id: ID;
|
|
36
29
|
name: string;
|
|
37
|
-
email?: string;
|
|
38
|
-
phone?: string;
|
|
39
30
|
account?: AccountBase;
|
|
40
31
|
class?: ClassBase;
|
|
41
32
|
owner?: User;
|
|
42
|
-
vendorType?: VendorType;
|
|
43
|
-
vendorTin?: Filing1099TinType;
|
|
44
|
-
contacts?: Contact[];
|
|
45
|
-
vendorDocuments?: File[];
|
|
46
33
|
}
|
|
47
34
|
export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
48
35
|
accountList: AccountListSelectorView;
|
|
49
36
|
classList: ClassListSelectorView;
|
|
50
|
-
vendorTypeList: VendorType[];
|
|
51
37
|
accountsHierarchyList: NestedAccountHierarchyForReport[];
|
|
52
38
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
53
39
|
ownerList: User[];
|
|
@@ -55,7 +41,6 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
|
55
41
|
}
|
|
56
42
|
export interface VendorsTabVendorDetailPageView extends SelectorView {
|
|
57
43
|
vendorViewDetails: VendorsTabVendorViewSelectorView;
|
|
58
|
-
uiState: VendorsTabVendorViewUIState;
|
|
59
44
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
60
45
|
trendWithTransactions: TrendWithTransactionsView;
|
|
61
46
|
vendorSpend: VendorSpend;
|
|
@@ -14,8 +14,6 @@ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
|
14
14
|
const addSubtractPeriod_1 = require("../../../commonStateTypes/fiscalYearHelpers/addSubtractPeriod");
|
|
15
15
|
const getStartOfAndEndOfTimeframeFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/getStartOfAndEndOfTimeframeFY");
|
|
16
16
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
17
|
-
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
18
|
-
const contactSelector_1 = require("../../../entity/billPay/contact/contactSelector");
|
|
19
17
|
const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
20
18
|
'spend_transactions',
|
|
21
19
|
'all_transactions',
|
|
@@ -23,12 +21,11 @@ const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
|
23
21
|
const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_VENDOR_DETAIL_TABS_TYPES);
|
|
24
22
|
exports.toVendorDetailTabsType = toVendorDetailTabsType;
|
|
25
23
|
const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
26
|
-
var _a, _b, _c, _d, _e
|
|
27
|
-
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState,
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
|
+
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, } = state;
|
|
28
26
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
29
27
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
30
28
|
const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
|
|
31
|
-
const vendorTypeList = vendorTypeListState.vendorTypes;
|
|
32
29
|
let vendorDetailState;
|
|
33
30
|
let fetchState = {
|
|
34
31
|
fetchState: 'Not-Started',
|
|
@@ -36,27 +33,22 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
36
33
|
};
|
|
37
34
|
const selectedVendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorIdFromUrl);
|
|
38
35
|
const basicVendorDetails = selectedVendor != null
|
|
39
|
-
? getBasicVendorDetails(accountState, classState, userState, selectedVendor
|
|
36
|
+
? getBasicVendorDetails(accountState, classState, userState, selectedVendor)
|
|
40
37
|
: undefined;
|
|
41
|
-
if (basicVendorDetails
|
|
38
|
+
if (basicVendorDetails) {
|
|
42
39
|
vendorDetailState = {
|
|
43
40
|
vendorBasic: basicVendorDetails,
|
|
44
41
|
saveStatus: (_b = (_a = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _a === void 0 ? void 0 : _a.saveStatus) !== null && _b !== void 0 ? _b : {
|
|
45
42
|
fetchState: 'Not-Started',
|
|
46
43
|
error: undefined,
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
vendorAddress: (selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.addressId) != null
|
|
50
|
-
? (0, addressSelector_1.getAddressByAddressId)(addressState, selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.addressId)
|
|
51
|
-
: undefined,
|
|
52
|
-
vendorDetailLocalData: (_d = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _d === void 0 ? void 0 : _d.vendorDetailLocalData,
|
|
45
|
+
vendorDetailLocalData: (_c = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _c === void 0 ? void 0 : _c.vendorDetailLocalData,
|
|
53
46
|
};
|
|
54
47
|
}
|
|
55
48
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
56
49
|
accountList,
|
|
57
50
|
classList,
|
|
58
|
-
|
|
59
|
-
(_f = (_e = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _e === void 0 ? void 0 : _e.fetchStatus) !== null && _f !== void 0 ? _f : {
|
|
51
|
+
(_e = (_d = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _d === void 0 ? void 0 : _d.fetchStatus) !== null && _e !== void 0 ? _e : {
|
|
60
52
|
fetchState: 'Not-Started',
|
|
61
53
|
},
|
|
62
54
|
]);
|
|
@@ -65,7 +57,6 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
65
57
|
return {
|
|
66
58
|
accountList: accountList,
|
|
67
59
|
classList: classList,
|
|
68
|
-
vendorTypeList: vendorTypeList,
|
|
69
60
|
accountsHierarchyList,
|
|
70
61
|
classHierarchyList,
|
|
71
62
|
ownerList: ownerList,
|
|
@@ -76,10 +67,8 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
76
67
|
};
|
|
77
68
|
};
|
|
78
69
|
exports.getVendorsTabVendorView = getVendorsTabVendorView;
|
|
79
|
-
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor
|
|
70
|
+
const getBasicVendorDetails = (accountState, classState, userState, selectedVendor) => ({
|
|
80
71
|
name: selectedVendor.name,
|
|
81
|
-
email: selectedVendor.email,
|
|
82
|
-
phone: selectedVendor.phone,
|
|
83
72
|
account: selectedVendor.accountId != null
|
|
84
73
|
? (0, accountSelector_1.getAccountBase)(accountState, selectedVendor.accountId, 'account_list')
|
|
85
74
|
: undefined,
|
|
@@ -92,15 +81,11 @@ const getBasicVendorDetails = (accountState, classState, userState, selectedVend
|
|
|
92
81
|
owner: selectedVendor.ownerId != null
|
|
93
82
|
? (0, userSelector_1.getUserByUserId)(userState, selectedVendor.ownerId)
|
|
94
83
|
: undefined,
|
|
95
|
-
vendorType: vendorTypeListState.vendorTypes.filter((type) => type.code === selectedVendor.vendorType)[0],
|
|
96
|
-
vendorTin: selectedVendor.filing1099Tin,
|
|
97
|
-
contacts: (0, contactSelector_1.getContactsByIds)(contactState, selectedVendor.contactIds),
|
|
98
84
|
id: selectedVendor.id,
|
|
99
85
|
});
|
|
100
86
|
const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
101
87
|
var _a, _b, _c;
|
|
102
88
|
const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
|
|
103
|
-
const uiState = state.vendorsTabVendorViewState.uiState;
|
|
104
89
|
const vendorViewDetails = (0, exports.getVendorsTabVendorView)(state, vendorId);
|
|
105
90
|
const allVendorTransactions = ((_a = state.vendorsTabVendorViewState.allTransactionsTabData) === null || _a === void 0 ? void 0 : _a.timePeriod) != null
|
|
106
91
|
? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
|
|
@@ -110,7 +95,6 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
110
95
|
state.accountListState.byReportId.accountList,
|
|
111
96
|
state.classListState,
|
|
112
97
|
state.ownerListState,
|
|
113
|
-
state.vendorTypeListState,
|
|
114
98
|
(_c = (_b = state.vendorsTabVendorViewState.vendorStateById[vendorId]) === null || _b === void 0 ? void 0 : _b.fetchStatus) !== null && _c !== void 0 ? _c : {
|
|
115
99
|
fetchState: 'Not-Started',
|
|
116
100
|
},
|
|
@@ -118,7 +102,6 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
118
102
|
]);
|
|
119
103
|
return {
|
|
120
104
|
vendorViewDetails,
|
|
121
|
-
uiState,
|
|
122
105
|
trendWithTransactions,
|
|
123
106
|
allVendorTransactionsView: allVendorTransactions,
|
|
124
107
|
allTransactionsTabData: state.vendorsTabVendorViewState.allTransactionsTabData,
|
|
@@ -3,14 +3,10 @@ import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
|
3
3
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { RecommendedAccountBase } from '../../../entity/account/accountState';
|
|
5
5
|
import { RecommendedClassBase } from '../../../entity/class/classState';
|
|
6
|
-
import { Filing1099TinType } from '../../../entity/vendor/vendorType';
|
|
7
6
|
import { VendorSpendTrendFilterTabType } from '../../../entity/vendorExpense/vendorExpenseSelector';
|
|
8
|
-
import { AddressUpdatableInfo } from '../../addressView/addressViewState';
|
|
9
|
-
import { VendorContactInfo } from '../vendorView/vendorViewState';
|
|
10
7
|
import { VendorDetailTabsType } from './vendorsTabVendorViewSelector';
|
|
11
8
|
export interface VendorsTabVendorViewState {
|
|
12
9
|
vendorStateById: Record<ID, VendorsTabVendorDetailState>;
|
|
13
|
-
uiState: VendorsTabVendorViewUIState;
|
|
14
10
|
selectedTabType: VendorDetailTabsType;
|
|
15
11
|
vendorSpendTrendFilterTabValue: VendorSpendTrendFilterTabType;
|
|
16
12
|
allTransactionsTabData?: {
|
|
@@ -20,12 +16,6 @@ export interface VendorsTabVendorViewState {
|
|
|
20
16
|
}
|
|
21
17
|
export interface VendorsTabVendorDetailLocalData {
|
|
22
18
|
vendorName?: string;
|
|
23
|
-
vendorEmail?: string;
|
|
24
|
-
vendorPhone?: string;
|
|
25
|
-
vendorType?: string;
|
|
26
|
-
tin?: Filing1099TinType;
|
|
27
|
-
address?: AddressUpdatableInfo;
|
|
28
|
-
contacts: VendorContactInfo[];
|
|
29
19
|
vendorCategory?: string;
|
|
30
20
|
vendorClass?: string;
|
|
31
21
|
vendorId?: ID;
|
|
@@ -41,9 +31,3 @@ export interface VendorsTabVendorDetailState {
|
|
|
41
31
|
saveStatus: FetchStateAndError;
|
|
42
32
|
vendorDetailLocalData?: VendorsTabVendorDetailLocalData;
|
|
43
33
|
}
|
|
44
|
-
declare const toCollapsableStatusKey: (v: string) => "expand" | "collapse";
|
|
45
|
-
export declare type CollapsableStatusKey = ReturnType<typeof toCollapsableStatusKey>;
|
|
46
|
-
export interface VendorsTabVendorViewUIState {
|
|
47
|
-
collapsableStatus: CollapsableStatusKey;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
4
|
-
const COLLAPSABLESTATUS = ['expand', 'collapse'];
|
|
5
|
-
const toCollapsableStatusKey = (v) => (0, stringToUnion_1.stringToUnion)(v, COLLAPSABLESTATUS);
|
|
@@ -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,
|
|
@@ -27,15 +27,20 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
27
27
|
return zeniAPI
|
|
28
28
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
|
|
29
29
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
30
|
+
var _a, _b, _c;
|
|
30
31
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
31
32
|
const actions = [];
|
|
32
33
|
actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({
|
|
33
34
|
chargeCardListPayload: response.data,
|
|
34
35
|
keepExistingListItems: true,
|
|
35
36
|
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.
|
|
37
|
+
//removing the last user, because it belongs to created_by user
|
|
38
|
+
const names = response.data.users.length === 1
|
|
39
|
+
? (_b = (_a = response.data.users[0].first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = response.data.users[0].last_name) === null || _c === void 0 ? void 0 : _c.trim()
|
|
40
|
+
: response.data.users
|
|
41
|
+
.slice(0, -1)
|
|
42
|
+
.map((user) => { var _a, _b, _c; return (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim(); })
|
|
43
|
+
.join(', ');
|
|
39
44
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
40
45
|
messageSection: 'issue_charge_card',
|
|
41
46
|
messageText: 'success',
|
|
@@ -43,7 +48,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
43
48
|
variables: [
|
|
44
49
|
{
|
|
45
50
|
variableName: '_user-name_',
|
|
46
|
-
variableValue: names,
|
|
51
|
+
variableValue: names !== null && names !== void 0 ? names : '',
|
|
47
52
|
},
|
|
48
53
|
],
|
|
49
54
|
}));
|
|
@@ -11,26 +11,23 @@ const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/
|
|
|
11
11
|
const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
|
|
12
12
|
const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
|
|
13
13
|
const sendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.sendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
-
var _a;
|
|
14
|
+
var _a, _b;
|
|
15
15
|
const sendOtpActions = [];
|
|
16
16
|
const { phoneNumber, twoFASource } = action.payload;
|
|
17
17
|
const tenantState = state$.value.tenantState;
|
|
18
18
|
const { currentTenantId } = tenantState;
|
|
19
19
|
const productSettings = currentTenantId != null
|
|
20
|
-
? (_a = tenantState.tenantsById[currentTenantId]) === null ||
|
|
20
|
+
? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.productSettings
|
|
21
21
|
: undefined;
|
|
22
|
-
const isCardsEnabled = productSettings != null
|
|
23
|
-
? productSettings.isBookkeepingEnabled ||
|
|
24
|
-
productSettings.isCardsEnabled
|
|
25
|
-
: false;
|
|
22
|
+
const isCardsEnabled = productSettings != null ? productSettings.isBookkeepingEnabled || productSettings.isCardsEnabled : false;
|
|
26
23
|
const queryPayload = {
|
|
27
24
|
channel_type: 'phone',
|
|
28
25
|
channel_info: {
|
|
29
26
|
phone_number: phoneNumber,
|
|
30
27
|
},
|
|
31
|
-
is_for_charge_cards: twoFASource === 'ChargeCard'
|
|
32
|
-
twoFASource ===
|
|
33
|
-
(twoFASource ===
|
|
28
|
+
is_for_charge_cards: (twoFASource === 'ChargeCard'
|
|
29
|
+
|| twoFASource === "CardUserOnboarding"
|
|
30
|
+
|| (twoFASource === "MyProfile" && isCardsEnabled)),
|
|
34
31
|
};
|
|
35
32
|
switch (twoFASource) {
|
|
36
33
|
case 'SpendManagementSetup':
|
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>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { SortOrder } from '
|
|
2
|
-
import { ZeniAPIStatus } from '
|
|
1
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
2
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
3
|
import { VendorFiling1099ListResponse } from './vendorFiling1099ListPayload';
|
|
4
4
|
import { VendorFiling1099ListState, VendorFiling1099ListViewSortKey } from './vendorFiling1099ListState';
|
|
5
5
|
export declare const initialState: VendorFiling1099ListState;
|
|
6
|
-
export declare const
|
|
7
|
-
cacheOverride: boolean;
|
|
8
|
-
}, string, never, never>, fetchVendorsFiling1099List: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], {
|
|
6
|
+
export declare const fetchVendorsFiling1099List: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], {
|
|
9
7
|
view: undefined;
|
|
10
8
|
}, string, never, never>, updateVendorsFiling1099List: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
9
|
response: VendorFiling1099ListResponse;
|
|
@@ -13,11 +11,9 @@ export declare const fetchVendorsFiling1099All: import("@reduxjs/toolkit").Actio
|
|
|
13
11
|
status: ZeniAPIStatus;
|
|
14
12
|
}, string>, clearVendorsFiling1099List: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateFiling1099ScrollYOffset: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
13
|
scrollYOffset: number;
|
|
16
|
-
}, string>,
|
|
14
|
+
}, string>, updateFiling1099SortUiState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
15
|
sortOrder: SortOrder;
|
|
18
16
|
sortKey: VendorFiling1099ListViewSortKey;
|
|
19
|
-
}, string>, updateFiling1099SearchUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
-
searchString: string;
|
|
21
17
|
}, string>;
|
|
22
18
|
declare const _default: import("@reduxjs/toolkit").Reducer<VendorFiling1099ListState, import("@reduxjs/toolkit").AnyAction>;
|
|
23
19
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.updateFiling1099SortUiState = exports.updateFiling1099ScrollYOffset = exports.clearVendorsFiling1099List = exports.updateVendorFiling1099ListFailure = exports.updateVendorsFiling1099List = exports.fetchVendorsFiling1099List = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const zeniDayJS_1 = require("
|
|
6
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
7
|
exports.initialState = {
|
|
8
8
|
fetchState: 'Not-Started',
|
|
9
9
|
error: undefined,
|
|
@@ -25,21 +25,11 @@ const vendorFiling1099List = (0, toolkit_1.createSlice)({
|
|
|
25
25
|
name: 'vendorFiling1099List',
|
|
26
26
|
initialState: exports.initialState,
|
|
27
27
|
reducers: {
|
|
28
|
-
fetchVendorsFiling1099All: {
|
|
29
|
-
prepare(cacheOverride) {
|
|
30
|
-
return {
|
|
31
|
-
payload: { cacheOverride },
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
reducer() {
|
|
35
|
-
// Do nothing
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
28
|
fetchVendorsFiling1099List: {
|
|
39
29
|
reducer(draft) {
|
|
40
30
|
draft.fetchState = 'In-Progress';
|
|
41
31
|
// Note: Need to reset scroll position whenever a new fetch happens, except when fetching through scroll
|
|
42
|
-
draft.uiState =
|
|
32
|
+
draft.uiState.scrollYOffset = 0;
|
|
43
33
|
draft.error = undefined;
|
|
44
34
|
},
|
|
45
35
|
prepare() {
|
|
@@ -48,12 +38,9 @@ const vendorFiling1099List = (0, toolkit_1.createSlice)({
|
|
|
48
38
|
};
|
|
49
39
|
},
|
|
50
40
|
},
|
|
51
|
-
|
|
41
|
+
updateFiling1099SortUiState(draft, action) {
|
|
52
42
|
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { sortKey: action.payload.sortKey, sortOrder: action.payload.sortOrder });
|
|
53
43
|
},
|
|
54
|
-
updateFiling1099SearchUIState(draft, action) {
|
|
55
|
-
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { searchString: action.payload.searchString });
|
|
56
|
-
},
|
|
57
44
|
updateVendorsFiling1099List(draft, action) {
|
|
58
45
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
59
46
|
const { response } = action.payload;
|
|
@@ -80,5 +67,5 @@ const vendorFiling1099List = (0, toolkit_1.createSlice)({
|
|
|
80
67
|
},
|
|
81
68
|
},
|
|
82
69
|
});
|
|
83
|
-
_a = vendorFiling1099List.actions, exports.
|
|
70
|
+
_a = vendorFiling1099List.actions, exports.fetchVendorsFiling1099List = _a.fetchVendorsFiling1099List, exports.updateVendorsFiling1099List = _a.updateVendorsFiling1099List, exports.updateVendorFiling1099ListFailure = _a.updateVendorFiling1099ListFailure, exports.clearVendorsFiling1099List = _a.clearVendorsFiling1099List, exports.updateFiling1099ScrollYOffset = _a.updateFiling1099ScrollYOffset, exports.updateFiling1099SortUiState = _a.updateFiling1099SortUiState;
|
|
84
71
|
exports.default = vendorFiling1099List.reducer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SelectorView } from '
|
|
2
|
-
import { Vendor } from '
|
|
3
|
-
import { RootState } from '
|
|
4
|
-
import { ZeniDate } from '
|
|
1
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
+
import { Vendor } from '../../entity/vendor/vendorState';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { VendorFiling1099ListViewSortKey, VendorFiling1099ViewUIState } from './vendorFiling1099ListState';
|
|
6
|
-
import { SortOrder } from '
|
|
7
|
-
import { VendorType } from '
|
|
6
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
7
|
+
import { VendorType } from '../vendorTypeList/vendorTypeListPayload';
|
|
8
8
|
export interface VendorFiling1099ListSelectorView extends SelectorView {
|
|
9
9
|
vendors: Vendor[];
|
|
10
10
|
vendorTypeList: VendorType[];
|