@zeniai/client-epic-state 4.12.61 → 4.12.63

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.
Files changed (72) hide show
  1. package/lib/entity/tenant/clearAllEpic.d.ts +1 -1
  2. package/lib/entity/tenant/clearAllEpic.js +1 -1
  3. package/lib/entity/vendor/__mocks__/vendorMock.d.ts +7 -0
  4. package/lib/entity/vendor/__mocks__/vendorMock.js +339 -0
  5. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +6 -1
  6. package/lib/entity/vendor/vendorPayload.d.ts +2 -1
  7. package/lib/entity/vendor/vendorPayload.js +6 -4
  8. package/lib/entity/vendor/vendorState.d.ts +1 -0
  9. package/lib/entity/vendor/vendorType.d.ts +2 -1
  10. package/lib/epic.d.ts +4 -2
  11. package/lib/epic.js +4 -2
  12. package/lib/index.d.ts +15 -8
  13. package/lib/index.js +31 -16
  14. package/lib/reducer.d.ts +4 -1
  15. package/lib/reducer.js +4 -1
  16. package/lib/view/addressView/__mocks__/addressViewMocks.d.ts +34 -0
  17. package/lib/view/addressView/__mocks__/addressViewMocks.js +223 -0
  18. package/lib/view/addressView/__mocks__/json/createAddressResponse.json +23 -0
  19. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +218 -0
  20. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +345 -0
  21. package/lib/view/addressView/__mocks__/json/fetchAddressResponse.json +24 -0
  22. package/lib/view/addressView/__mocks__/json/updateAddressResponse.json +24 -0
  23. package/lib/view/commonVendorView/vendorView/epics/fetchVendorDetailsEpic.js +2 -2
  24. package/lib/view/commonVendorView/vendorView/vendorViewPayload.d.ts +6 -0
  25. package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.d.ts +2 -1
  26. package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorDetailPageViewEpic.js +6 -1
  27. package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.d.ts +3 -2
  28. package/lib/view/commonVendorView/vendorsTabVendorView/epics/fetchVendorsTabVendorEpic.js +4 -2
  29. package/lib/view/commonVendorView/vendorsTabVendorView/epics/resetVendorsTabVendorDetailLocalDataEpic.js +1 -1
  30. package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.d.ts +3 -1
  31. package/lib/view/commonVendorView/vendorsTabVendorView/epics/vendorsTabVendorDetailLocalDataHelpers.js +14 -3
  32. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.d.ts +5 -0
  33. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewPayload.js +35 -1
  34. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +7 -2
  35. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +23 -3
  36. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +16 -1
  37. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +24 -7
  38. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +16 -0
  39. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.js +3 -0
  40. package/lib/view/twoFactorAuthentication/sendOtpEpic.js +9 -6
  41. package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/json/vendorFiling1099ListSuccess.json +1 -1
  42. package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.d.ts +3 -3
  43. package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListMock.js +17 -3
  44. package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.d.ts +1 -1
  45. package/lib/view/{vendorFiling1099List → vendorFiling1099}/__mock__/vendorFiling1099ListSelectorMock.js +10 -1
  46. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +132 -0
  47. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.js +146 -0
  48. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +8 -0
  49. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +30 -0
  50. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.d.ts +5 -5
  51. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/fetchVendorsFiling1099ListEpic.js +6 -6
  52. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.d.ts +3 -3
  53. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.d.ts +8 -4
  54. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListReducer.js +18 -5
  55. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.d.ts +6 -6
  56. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListSelector.js +8 -3
  57. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListState.d.ts +3 -3
  58. package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListState.js +1 -1
  59. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.d.ts +20 -0
  60. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsPayload.js +48 -0
  61. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +25 -0
  62. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +180 -0
  63. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.d.ts +11 -0
  64. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSaveEpic.js +58 -0
  65. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.d.ts +14 -0
  66. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsSelector.js +17 -0
  67. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.d.ts +26 -0
  68. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState.js +2 -0
  69. package/lib/view/vendorTabView/fetchVendorTabViewEpic.d.ts +1 -1
  70. package/lib/view/vendorTabView/fetchVendorTabViewEpic.js +2 -2
  71. package/package.json +2 -1
  72. /package/lib/view/{vendorFiling1099List → vendorFiling1099/vendorFiling1099List}/vendorFiling1099ListPayload.js +0 -0
@@ -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>, clearVendorsTabVendorView: 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
- draft.vendorStateById[vendorId].vendorDetailLocalData = Object.assign(Object.assign({}, exports.initialVendorDetailLocalData), localData);
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
- vendorDetailLocalData: (_c = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _c === void 0 ? void 0 : _c.vendorDetailLocalData,
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
- (_e = (_d = vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]) === null || _d === void 0 ? void 0 : _d.fetchStatus) !== null && _e !== void 0 ? _e : {
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);
@@ -11,23 +11,26 @@ 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, _b;
14
+ var _a;
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
- ? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.productSettings
20
+ ? (_a = tenantState.tenantsById[currentTenantId]) === null || _a === void 0 ? void 0 : _a.productSettings
21
21
  : undefined;
22
- const isCardsEnabled = productSettings != null ? productSettings.isBookkeepingEnabled || productSettings.isCardsEnabled : false;
22
+ const isCardsEnabled = productSettings != null
23
+ ? productSettings.isBookkeepingEnabled ||
24
+ productSettings.isCardsEnabled
25
+ : false;
23
26
  const queryPayload = {
24
27
  channel_type: 'phone',
25
28
  channel_info: {
26
29
  phone_number: phoneNumber,
27
30
  },
28
- is_for_charge_cards: (twoFASource === 'ChargeCard'
29
- || twoFASource === "CardUserOnboarding"
30
- || (twoFASource === "MyProfile" && isCardsEnabled)),
31
+ is_for_charge_cards: twoFASource === 'ChargeCard' ||
32
+ twoFASource === 'CardUserOnboarding' ||
33
+ (twoFASource === 'MyProfile' && isCardsEnabled),
31
34
  };
32
35
  switch (twoFASource) {
33
36
  case 'SpendManagementSetup':
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "vendor_1099_status": "incomplete",
79
79
  "vendor_1099_ytd_total": -2287.0,
80
- "w9_document": []
80
+ "w9_documents": []
81
81
  }
82
82
  ],
83
83
  "version": "2.0"
@@ -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 rootStateWithVendorList: RootState;
11
+ export declare const rootStateWithVendorFiling1099List: RootState;
@@ -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.rootStateWithVendorList = exports.vendorFiling1099ListFailureState = exports.vendorFiling1099ListSuccessState = exports.vendorFiling1099ListInProgressInitialState = exports.vendorFiling1099ListInProgressState = exports.vendorFiling1099ListFailureResponse = exports.vendorFiling1099ListSuccessResponse = exports.vendorFiling1099ListSelectorMock = void 0;
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.rootStateWithVendorList = Object.assign({}, reducer_1.initialRootState, {
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,132 @@
1
+ import { RootState } from '../../../reducer';
2
+ import { VendorFiling1099UploadDetailsState } from '../vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsState';
3
+ export declare const vendorFiling1099UploadDetailsSuccessResponse: {
4
+ data: {
5
+ filter: null;
6
+ query: {
7
+ end_date: string;
8
+ group_by: string;
9
+ sort_order: string;
10
+ source_account_type: string;
11
+ start_date: string;
12
+ };
13
+ query_definitions: {};
14
+ report: {
15
+ currency: {
16
+ currency_code: null;
17
+ currency_symbol: null;
18
+ };
19
+ is_vendor_1099_populated: boolean;
20
+ report_id: string;
21
+ report_title: string;
22
+ status: {
23
+ code: number;
24
+ description: string;
25
+ is_filtered_report: boolean;
26
+ last_refresh_attempt_time: string;
27
+ last_refresh_success_time: string;
28
+ message: string;
29
+ };
30
+ vendors: {
31
+ vendor_id: string;
32
+ qbo_id: string;
33
+ vendor_name: string;
34
+ title: string;
35
+ suffix: string;
36
+ first_name: string;
37
+ middle_name: string;
38
+ last_name: string;
39
+ vendor_type: string;
40
+ logo: {
41
+ url: string;
42
+ base64: string;
43
+ };
44
+ owner: null;
45
+ balance: number;
46
+ is_deleted: boolean;
47
+ qbo_create_time: string;
48
+ qbo_update_time: string;
49
+ create_time: string;
50
+ update_time: string;
51
+ email: string;
52
+ phone: string;
53
+ website_url: string;
54
+ currency_code: string;
55
+ currency_symbol: string;
56
+ country_code: string;
57
+ billing_address_id: string;
58
+ billing_address: {
59
+ address_id: string;
60
+ city: string;
61
+ country: string;
62
+ country_code: null;
63
+ create_time: string;
64
+ hash_value: string;
65
+ latitude: null;
66
+ longitude: null;
67
+ postal_code: string;
68
+ state: string;
69
+ street: string[];
70
+ update_time: string;
71
+ };
72
+ documents: never[];
73
+ vendor_currency_code: string;
74
+ vendor_currency_symbol: string;
75
+ tin: {
76
+ type: string;
77
+ value: string;
78
+ };
79
+ vendor_1099_status: string;
80
+ vendor_1099_ytd_total: number;
81
+ w9_documents: never[];
82
+ }[];
83
+ version: string;
84
+ };
85
+ };
86
+ status: {
87
+ code: number;
88
+ message: string;
89
+ };
90
+ };
91
+ export declare const vendorFiling1099UploadDetailsFailureResponse: {
92
+ status: {
93
+ message: string;
94
+ code: number;
95
+ };
96
+ };
97
+ export declare const vendorFiling1099UploadDetailsInProgressState: VendorFiling1099UploadDetailsState;
98
+ export declare const vendorFiling1099UploadDetailsInProgressInitialState: VendorFiling1099UploadDetailsState;
99
+ export declare const vendorFiling1099UploadDetailsSuccessState: VendorFiling1099UploadDetailsState;
100
+ export declare const w9FormFile: {
101
+ checksum: string;
102
+ company_id: string;
103
+ content_type: string;
104
+ create_time: string;
105
+ create_userid: string;
106
+ document_side: string;
107
+ document_type: string;
108
+ extension: string;
109
+ file_id: string;
110
+ file_location: string;
111
+ file_name: string;
112
+ file_size: number;
113
+ file_size_unit: string;
114
+ image_file_ids: string[];
115
+ image_files: {
116
+ create_time: string;
117
+ file_location: string;
118
+ height: number;
119
+ image_format: string;
120
+ image_size_type: string;
121
+ signed_url: string;
122
+ update_time: string;
123
+ width: number;
124
+ }[];
125
+ index: string;
126
+ purpose_id: string;
127
+ signed_url: string;
128
+ update_time: string;
129
+ update_userid: string;
130
+ user_id: string;
131
+ };
132
+ export declare const rootStateWithVendorFiling1099UploadDetails: RootState;