@zeniai/client-epic-state 4.13.5 → 4.13.9

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 (90) hide show
  1. package/lib/entity/account/accountPayload.d.ts +1 -1
  2. package/lib/entity/chargeCard/chargeCard.d.ts +16 -2
  3. package/lib/entity/chargeCard/chargeCard.js +18 -1
  4. package/lib/entity/chargeCard/chargeCardPayload.d.ts +14 -5
  5. package/lib/entity/chargeCard/chargeCardPayload.js +24 -7
  6. package/lib/entity/tenant/clearAllEpic.d.ts +4 -1
  7. package/lib/entity/tenant/clearAllEpic.js +6 -0
  8. package/lib/entity/vendor/__mocks__/vendorMock.js +0 -2
  9. package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +1 -0
  10. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +73 -4
  11. package/lib/entity/vendor/vendorPayload.d.ts +6 -1
  12. package/lib/entity/vendor/vendorPayload.js +3 -3
  13. package/lib/entity/vendor/vendorState.d.ts +8 -1
  14. package/lib/entity/vendor/vendorType.d.ts +2 -0
  15. package/lib/entity/vendor/vendorType.js +4 -1
  16. package/lib/epic.d.ts +5 -2
  17. package/lib/epic.js +5 -2
  18. package/lib/index.d.ts +15 -10
  19. package/lib/index.js +36 -20
  20. package/lib/reducer.d.ts +6 -0
  21. package/lib/reducer.js +6 -0
  22. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.d.ts +11 -0
  23. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +4607 -0
  24. package/lib/view/accountMappingView/accountMappingPayload.js +75 -32
  25. package/lib/view/accountMappingView/accountMappingReducer.js +36 -10
  26. package/lib/view/accountMappingView/accountMappingState.d.ts +1 -1
  27. package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +5 -0
  28. package/lib/view/accountMappingView/accountMappingViewSelector.js +11 -1
  29. package/lib/view/accountMappingView/initializeAccountMappingViewEpic.d.ts +2 -1
  30. package/lib/view/accountMappingView/initializeAccountMappingViewEpic.js +2 -0
  31. package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +6 -1
  32. package/lib/view/addressView/addressViewState.d.ts +1 -1
  33. package/lib/view/addressView/toAddressViewLocalData.d.ts +2 -0
  34. package/lib/view/addressView/toAddressViewLocalData.js +5 -4
  35. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -1
  36. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +1 -2
  37. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +2 -5
  38. package/lib/view/settingsView/epic/updateMyProfileEpic.js +6 -4
  39. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.d.ts +3 -1
  40. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.js +6 -2
  41. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.d.ts +2 -3
  42. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -3
  43. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts +1 -3
  44. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.d.ts +1 -2
  45. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +1 -21
  46. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.js +1 -3
  47. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
  48. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
  49. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +8 -1
  50. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
  51. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -0
  52. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +8 -4
  53. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -1
  54. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.d.ts +11 -0
  55. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.js +42 -0
  56. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -14
  57. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +2 -13
  58. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -6
  59. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -17
  60. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +8 -2
  61. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +55 -15
  62. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +9 -0
  63. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +44 -0
  64. package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.d.ts +3 -2
  65. package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.js +35 -18
  66. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +15 -0
  67. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +65 -0
  68. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +22 -0
  69. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +76 -0
  70. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +28 -0
  71. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +23 -0
  72. package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -1
  73. package/lib/view/vendor1099TypeList/vendor1099TypeListEpic.d.ts +7 -0
  74. package/lib/view/vendor1099TypeList/vendor1099TypeListEpic.js +23 -0
  75. package/lib/view/vendor1099TypeList/vendor1099TypeListPayload.d.ts +15 -0
  76. package/lib/view/vendor1099TypeList/vendor1099TypeListPayload.js +2 -0
  77. package/lib/view/vendor1099TypeList/vendor1099TypeListReducer.d.ts +7 -0
  78. package/lib/view/vendor1099TypeList/vendor1099TypeListReducer.js +52 -0
  79. package/lib/view/vendor1099TypeList/vendor1099TypeListState.d.ts +9 -0
  80. package/lib/view/vendor1099TypeList/vendor1099TypeListState.js +2 -0
  81. package/lib/view/vendorFiling1099/__mock__/json/vendorFiling1099ListSuccess.json +4 -1
  82. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListMock.js +12 -3
  83. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListSelectorMock.js +2 -4
  84. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099UploadDetailsMock.d.ts +4 -1
  85. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.d.ts +2 -2
  86. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099AllEpic.js +7 -7
  87. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListSelector.js +21 -10
  88. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
  89. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.js +1 -0
  90. 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.5",
3
+ "version": "4.13.9",
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",