@zeniai/client-epic-state 4.13.12 → 4.13.13

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 (43) hide show
  1. package/lib/entity/account/accountPayload.d.ts +1 -1
  2. package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
  3. package/lib/entity/tenant/clearAllEpic.js +4 -0
  4. package/lib/entity/vendor/__mocks__/vendorMock.js +0 -2
  5. package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +1 -0
  6. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +73 -4
  7. package/lib/entity/vendor/vendorPayload.d.ts +6 -1
  8. package/lib/entity/vendor/vendorPayload.js +3 -3
  9. package/lib/entity/vendor/vendorState.d.ts +8 -1
  10. package/lib/entity/vendor/vendorType.d.ts +2 -0
  11. package/lib/entity/vendor/vendorType.js +4 -1
  12. package/lib/epic.d.ts +2 -1
  13. package/lib/epic.js +2 -1
  14. package/lib/reducer.d.ts +3 -0
  15. package/lib/reducer.js +3 -0
  16. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.d.ts +11 -0
  17. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4607 -0
  18. package/lib/view/accountMappingView/accountMappingPayload.js +75 -32
  19. package/lib/view/accountMappingView/accountMappingReducer.js +36 -10
  20. package/lib/view/accountMappingView/accountMappingState.d.ts +1 -1
  21. package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +5 -0
  22. package/lib/view/accountMappingView/accountMappingViewSelector.js +11 -1
  23. package/lib/view/accountMappingView/initializeAccountMappingViewEpic.d.ts +2 -1
  24. package/lib/view/accountMappingView/initializeAccountMappingViewEpic.js +2 -0
  25. package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +6 -1
  26. package/lib/view/vendor1099TypeList/vendor1099TypeListEpic.d.ts +7 -0
  27. package/lib/view/vendor1099TypeList/vendor1099TypeListEpic.js +23 -0
  28. package/lib/view/vendor1099TypeList/vendor1099TypeListPayload.d.ts +15 -0
  29. package/lib/view/vendor1099TypeList/vendor1099TypeListPayload.js +2 -0
  30. package/lib/view/vendor1099TypeList/vendor1099TypeListReducer.d.ts +7 -0
  31. package/lib/view/vendor1099TypeList/vendor1099TypeListReducer.js +52 -0
  32. package/lib/view/vendor1099TypeList/vendor1099TypeListState.d.ts +9 -0
  33. package/lib/view/vendor1099TypeList/vendor1099TypeListState.js +2 -0
  34. package/lib/view/vendorFiling1099/__mock__/json/vendorFiling1099ListSuccess.json +4 -1
  35. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListMock.js +12 -3
  36. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListSelectorMock.js +2 -4
  37. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +4 -1
  38. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +2 -2
  39. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +7 -7
  40. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListSelector.js +21 -10
  41. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
  42. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.js +1 -0
  43. package/package.json +1 -1
@@ -9,7 +9,7 @@ const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
9
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
10
10
  const getVendorFiling1099List = (state) => {
11
11
  var _a;
12
- const { vendorFiling1099ListState, vendorState, vendorTypeListState, accountMappingState, } = state;
12
+ const { vendorFiling1099ListState, vendorState, vendor1099TypeListState, accountMappingState, } = state;
13
13
  const targetIds = vendorFiling1099ListState.vendorIds;
14
14
  const allFetchStates = [
15
15
  accountMappingState.accountListFetchState,
@@ -19,24 +19,33 @@ const getVendorFiling1099List = (state) => {
19
19
  error: vendorFiling1099ListState.error,
20
20
  },
21
21
  {
22
- fetchState: vendorTypeListState.fetchState,
23
- error: vendorTypeListState.error,
22
+ fetchState: vendor1099TypeListState.fetchState,
23
+ error: vendor1099TypeListState.error,
24
24
  },
25
25
  ];
26
26
  const fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)(allFetchStates);
27
- const vendorTypeList = vendorTypeListState.vendorTypes;
28
27
  const loweredSearchText = vendorFiling1099ListState.uiState.searchString
29
28
  .trim()
30
29
  .toLowerCase();
31
- let vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, targetIds);
32
- vendors = vendors.filter((vendor) => { var _a; return (_a = vendor.legalName) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(loweredSearchText); });
33
- vendors = (0, exports.sortedVendorFiling1099View)(vendors, vendorFiling1099ListState.uiState.sortKey, vendorFiling1099ListState.uiState.sortOrder);
34
- const vendorFiling1099ViewList = vendors.map((vendor) => {
35
- return Object.assign({}, vendor);
30
+ const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, targetIds);
31
+ let vendorFiling1099ViewList = vendors.flatMap((vendor) => {
32
+ const vendorRows = [];
33
+ if (vendor.isINTType === true) {
34
+ vendorRows.push(Object.assign(Object.assign({}, vendor), { filing1099Type: 'int', filing1099Total: vendor.filing1099INTTotal }));
35
+ }
36
+ if (vendor.isMISCType === true) {
37
+ vendorRows.push(Object.assign(Object.assign({}, vendor), { filing1099Type: 'misc', filing1099Total: vendor.filing1099MISCTotal }));
38
+ }
39
+ if (vendor.isNECType === true) {
40
+ vendorRows.push(Object.assign(Object.assign({}, vendor), { filing1099Type: 'nec', filing1099Total: vendor.filing1099NECTotal }));
41
+ }
42
+ return vendorRows;
36
43
  });
44
+ vendorFiling1099ViewList = vendorFiling1099ViewList.filter((vendor) => { var _a; return (_a = vendor.legalName) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(loweredSearchText); });
45
+ vendorFiling1099ViewList = (0, exports.sortedVendorFiling1099View)(vendorFiling1099ViewList, vendorFiling1099ListState.uiState.sortKey, vendorFiling1099ListState.uiState.sortOrder);
37
46
  return {
38
47
  vendors: vendorFiling1099ViewList,
39
- vendorTypeList: vendorTypeList,
48
+ vendorTypeList: vendor1099TypeListState.vendorTypes,
40
49
  isVendor1099Populated: (_a = vendorFiling1099ListState.isVendor1099Populated) !== null && _a !== void 0 ? _a : true,
41
50
  uiState: vendorFiling1099ListState.uiState,
42
51
  vendorFiling1099DownloadData: vendorFiling1099ListState.vendorFiling1099DownloadData,
@@ -56,6 +65,8 @@ const sortedVendorFiling1099View = (vendorFiling1099List, sortKey, sortOrder) =>
56
65
  return vendor.vendorType;
57
66
  case 'w9':
58
67
  return vendor.filing1099W9Files;
68
+ case 'filing1099type':
69
+ return vendor.filing1099Type;
59
70
  case 'status':
60
71
  return vendor.filing1099Status;
61
72
  default:
@@ -20,7 +20,7 @@ export interface VendorFiling1099ListQuery {
20
20
  sortOrder: SortOrder;
21
21
  sortKey: VendorFiling1099ListViewSortKey;
22
22
  }
23
- declare const toVendorFiling1099ListViewSortKey: (v: string) => "total" | "status" | "w9" | "legal_name" | "tax_classification";
23
+ declare const toVendorFiling1099ListViewSortKey: (v: string) => "total" | "status" | "w9" | "legal_name" | "tax_classification" | "filing1099type";
24
24
  export declare type VendorFiling1099ListViewSortKey = ReturnType<typeof toVendorFiling1099ListViewSortKey>;
25
25
  export declare type Type1099Download = 'nec' | 'misc' | 'int';
26
26
  export {};
@@ -5,6 +5,7 @@ const VENDOR_FILING_1099_LIST_VIEW_SORT_KEYS = [
5
5
  'legal_name',
6
6
  'tax_classification',
7
7
  'w9',
8
+ 'filing1099type',
8
9
  'status',
9
10
  'total',
10
11
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.13.12",
3
+ "version": "4.13.13",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",