@zeniai/client-epic-state 5.0.81-betaJK7 → 5.0.81-betaML1

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 (96) hide show
  1. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  2. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  3. package/lib/entity/account/accountSelector.d.ts +9 -0
  4. package/lib/entity/account/accountSelector.js +14 -1
  5. package/lib/entity/account/accountState.d.ts +1 -1
  6. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  7. package/lib/entity/class/classReducer.d.ts +4 -4
  8. package/lib/entity/class/classState.d.ts +1 -1
  9. package/lib/entity/forecast/forecastState.d.ts +1 -1
  10. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  11. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  12. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  13. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  14. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  15. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  16. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  17. package/lib/entity/task/taskPayload.d.ts +1 -3
  18. package/lib/entity/task/taskPayload.js +0 -2
  19. package/lib/entity/task/taskState.d.ts +0 -2
  20. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  21. package/lib/entity/tenant/clearAllEpic.js +2 -0
  22. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
  23. package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  24. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  25. package/lib/epic.d.ts +3 -2
  26. package/lib/epic.js +3 -2
  27. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  28. package/lib/esm/entity/account/accountSelector.js +11 -0
  29. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  30. package/lib/esm/entity/task/taskPayload.js +0 -2
  31. package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
  32. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  33. package/lib/esm/epic.js +3 -2
  34. package/lib/esm/index.js +8 -7
  35. package/lib/esm/reducer.js +3 -0
  36. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +11 -26
  37. package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
  38. package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  39. package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +72 -0
  40. package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
  41. package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
  42. package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +130 -0
  43. package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
  44. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +13 -1
  45. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
  46. package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +1 -1
  47. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
  48. package/lib/index.d.ts +9 -8
  49. package/lib/index.js +46 -37
  50. package/lib/reducer.d.ts +3 -0
  51. package/lib/reducer.js +3 -0
  52. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  53. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  54. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  55. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  56. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  57. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  58. package/lib/view/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +15 -13
  59. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +4 -5
  60. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +12 -27
  61. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +3 -3
  62. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +3 -1
  63. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
  64. package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  65. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -2
  66. package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
  67. package/lib/view/createTransferEntry/createTransferEntryReducer.js +76 -0
  68. package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
  69. package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
  70. package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
  71. package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
  72. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
  73. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +134 -0
  74. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
  75. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
  76. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  77. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  78. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -1
  79. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -2
  80. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -1
  81. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -0
  82. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -2
  83. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  84. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  85. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  86. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  87. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  88. package/lib/view/topEx/topExSelector.d.ts +1 -1
  89. package/lib/view/transactionDetail/epics/transactionDetailEpic.js +1 -1
  90. package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
  91. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
  92. package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
  93. package/package.json +1 -1
  94. package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +0 -16
  95. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.d.ts +0 -6
  96. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +0 -20
@@ -1,7 +1,8 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { NestedClassHierarchyForReport } from '../../commonStateTypes/classesView/nestedClassID';
3
- import { FetchStateAndError } from '../../commonStateTypes/common';
3
+ import { FetchState, FetchStateAndError } from '../../commonStateTypes/common';
4
4
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
5
+ import { AccountBase } from '../../entity/account/accountState';
5
6
  import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
6
7
  import { SupportedTransactionWithCOT } from '../../entity/transaction/transactionState';
7
8
  import { Vendor } from '../../entity/vendor/vendorState';
@@ -17,6 +18,9 @@ export interface TransactionDetailReport extends SelectorView {
17
18
  allVendors: Vendor[];
18
19
  classHierarchyList: NestedClassHierarchyForReport[];
19
20
  classList: ClassListSelectorView;
21
+ createTransferEntryStatus: FetchState;
22
+ /** Resolved credit-card pool for credit_card_payment transfer drawer. */
23
+ creditCardTransferAccountsList: AccountBase[];
20
24
  deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
21
25
  hasInFlightCategoryClassRecommendations: boolean;
22
26
  isAccountingClassesEnabled: boolean;
@@ -25,6 +29,7 @@ export interface TransactionDetailReport extends SelectorView {
25
29
  projectList: ProjectListSelectorView;
26
30
  transactionDetailLocalData: TransactionDetailLocalData;
27
31
  transactionDetailUpdateStatus: FetchStateAndError;
32
+ transferAccounts: AccountBase[];
28
33
  isUpdateNotAllowed?: boolean;
29
34
  transaction?: SupportedTransactionWithCOT;
30
35
  }
@@ -15,6 +15,7 @@ const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
15
15
  const zeniDayJS_1 = require("../../zeniDayJS");
16
16
  const accountListSelector_1 = require("../accountList/accountListSelector");
17
17
  const classListSelector_1 = require("../classList/classListSelector");
18
+ const createTransferEntrySelector_1 = require("../createTransferEntry/createTransferEntrySelector");
18
19
  const projectListSelector_1 = require("../projectList/projectListSelector");
19
20
  const transactionDetailState_1 = require("./transactionDetailState");
20
21
  // "Any line on this transaction is fetching category/class recommendations?"
@@ -39,7 +40,7 @@ const getDetailInFlightRecommendations = (state, transactionId) => {
39
40
  };
40
41
  exports.getDetailInFlightRecommendations = getDetailInFlightRecommendations;
41
42
  const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
42
- const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
43
+ const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, createTransferEntryState, projectState, projectListState, } = state;
43
44
  const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
44
45
  const transactionDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, detailKey);
45
46
  let fetchState = {
@@ -106,6 +107,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
106
107
  : [];
107
108
  const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
108
109
  const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
110
+ const { transferAccountsList, creditCardTransferAccountsList } = (0, createTransferEntrySelector_1.getResolvedTransferAccounts)(state);
109
111
  const hasInFlightCategoryClassRecommendations = (0, exports.getDetailInFlightRecommendations)(state, transactionId);
110
112
  return {
111
113
  reportId: 'transaction_detail',
@@ -124,6 +126,9 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
124
126
  classList: classList,
125
127
  hasInFlightCategoryClassRecommendations,
126
128
  isAccountingClassesEnabled,
129
+ createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
130
+ creditCardTransferAccountsList,
131
+ transferAccounts: transferAccountsList,
127
132
  isAccountingProjectsEnabled,
128
133
  projectList,
129
134
  isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.81-betaJK7",
3
+ "version": "5.0.81-betaML1",
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
  "module": "lib/esm/index.js",
@@ -1,16 +0,0 @@
1
- import { EMPTY, of } from 'rxjs';
2
- import { filter, switchMap } from 'rxjs/operators';
3
- import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewUIState, } from '../companyTaskManagerViewReducer';
4
- export const updateCompanyTaskManagerViewUIStateEpic = (actions$, state$) => actions$.pipe(filter(updateCompanyTaskManagerViewUIState.match), switchMap((action) => {
5
- const filters = action.payload.filters;
6
- const allCategoriesValid = filters?.categories == null
7
- ? true
8
- : filters?.categories?.every((category) => category.field != null &&
9
- category.values != null &&
10
- category.values.length > 0);
11
- if (!allCategoriesValid) {
12
- return EMPTY;
13
- }
14
- const { uiState } = state$.value.companyTaskManagerViewState;
15
- return of(fetchCompanyTaskManagerView(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
16
- }));
@@ -1,6 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../reducer';
4
- import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewUIState } from '../companyTaskManagerViewReducer';
5
- export type ActionType = ReturnType<typeof updateCompanyTaskManagerViewUIState> | ReturnType<typeof fetchCompanyTaskManagerView>;
6
- export declare const updateCompanyTaskManagerViewUIStateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompanyTaskManagerViewUIStateEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
7
- const updateCompanyTaskManagerViewUIStateEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewUIState.match), (0, operators_1.switchMap)((action) => {
8
- const filters = action.payload.filters;
9
- const allCategoriesValid = filters?.categories == null
10
- ? true
11
- : filters?.categories?.every((category) => category.field != null &&
12
- category.values != null &&
13
- category.values.length > 0);
14
- if (!allCategoriesValid) {
15
- return rxjs_1.EMPTY;
16
- }
17
- const { uiState } = state$.value.companyTaskManagerViewState;
18
- return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
19
- }));
20
- exports.updateCompanyTaskManagerViewUIStateEpic = updateCompanyTaskManagerViewUIStateEpic;