@zeniai/client-epic-state 4.20.3-betaRR2 → 4.20.3-betaSS1

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 (76) hide show
  1. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  2. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  3. package/lib/entity/account/accountPayload.d.ts +0 -2
  4. package/lib/entity/account/accountReducer.d.ts +2 -5
  5. package/lib/entity/account/accountReducer.js +2 -7
  6. package/lib/entity/account/accountState.d.ts +1 -1
  7. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  8. package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
  9. package/lib/entity/accountRecon/accountReconPayload.js +2 -4
  10. package/lib/entity/class/classReducer.d.ts +4 -4
  11. package/lib/entity/class/classState.d.ts +1 -1
  12. package/lib/entity/forecast/forecastState.d.ts +1 -1
  13. package/lib/entity/jeSchedules/jeSchedulesReducer.js +6 -2
  14. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  15. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  16. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  17. package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -1
  18. package/lib/epic.d.ts +7 -10
  19. package/lib/epic.js +7 -10
  20. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  21. package/lib/esm/entity/account/accountReducer.js +1 -6
  22. package/lib/esm/entity/accountRecon/accountReconPayload.js +2 -4
  23. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +6 -2
  24. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -1
  25. package/lib/esm/epic.js +7 -10
  26. package/lib/esm/index.js +4 -4
  27. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +1 -19
  28. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -2
  29. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
  30. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +4 -0
  31. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -163
  32. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -1
  33. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -112
  34. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
  35. package/lib/index.d.ts +7 -7
  36. package/lib/index.js +31 -35
  37. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  38. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  39. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  40. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  41. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  42. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  43. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  44. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +2 -20
  45. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -2
  46. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -2
  47. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +1 -9
  48. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  49. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
  50. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -33
  51. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +4 -0
  52. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -18
  53. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -164
  54. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +2 -6
  55. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  56. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -112
  57. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +2 -0
  58. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -13
  59. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  60. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  61. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
  62. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  63. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  64. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  65. package/lib/view/topEx/topExSelector.d.ts +1 -1
  66. package/package.json +1 -1
  67. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +0 -17
  68. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -44
  69. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -44
  70. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  71. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +0 -7
  72. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +0 -21
  73. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +0 -8
  74. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -48
  75. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +0 -9
  76. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -48
@@ -1,7 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../reducer';
4
- import { ZeniAPI } from '../../../zeniAPI';
5
- import { fetchTaskManagerMetrics, updateTaskManagerMetrics, updateTaskManagerMetricsOnFailure } from '../companyTaskManagerViewReducer';
6
- export type ActionType = ReturnType<typeof fetchTaskManagerMetrics> | ReturnType<typeof updateTaskManagerMetrics> | ReturnType<typeof updateTaskManagerMetricsOnFailure>;
7
- export declare const fetchTaskManagerMetricsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchTaskManagerMetricsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
8
- const fetchTaskManagerMetricsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchTaskManagerMetrics.match), (0, operators_1.switchMap)(() => {
9
- const query = JSON.stringify({ is_filter_by_logged_in_user: true });
10
- return zeniAPI
11
- .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks-es-metrics?query=${encodeURIComponent(query)}`)
12
- .pipe((0, operators_1.mergeMap)((response) => {
13
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
14
- return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetrics)(response.data.summary));
15
- }
16
- else {
17
- return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetricsOnFailure)());
18
- }
19
- }), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateTaskManagerMetricsOnFailure)())));
20
- }));
21
- exports.fetchTaskManagerMetricsEpic = fetchTaskManagerMetricsEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
- import { RootState } from '../../../../reducer';
5
- import { ZeniAPI } from '../../../../zeniAPI';
6
- import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
7
- export type ActionType = ReturnType<typeof excludeAccountFromReconciliation> | ReturnType<typeof changeAccountKey> | ReturnType<typeof excludeAccountFromReconciliationSuccess> | ReturnType<typeof excludeAccountFromReconciliationFailure>;
8
- export declare const excludeAccountFromReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.excludeAccountFromReconciliationEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const accountReducer_1 = require("../../../../entity/account/accountReducer");
7
- const accountState_1 = require("../../../../entity/account/accountState");
8
- const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
9
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
10
- const responsePayload_1 = require("../../../../responsePayload");
11
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
12
- const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.excludeAccountFromReconciliation.match), (0, operators_1.mergeMap)((action) => {
13
- const { accountId } = action.payload;
14
- const state = state$.value;
15
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
17
- const reconciliationData = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountId, selectedPeriod);
18
- const payload = {
19
- account_id: accountId,
20
- bank_balance: reconciliationData?.balance?.amount ?? null,
21
- cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
22
- variance: reconciliationData?.variance?.amount ?? null,
23
- };
24
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
25
- return zeniAPI
26
- .postAndGetJSON(apiUrl, payload)
27
- .pipe((0, operators_1.mergeMap)((response) => {
28
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
29
- const newAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', accountId);
30
- const oldAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', accountId);
31
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationSuccess)({
32
- account: response.data?.excluded_account ?? undefined,
33
- selectedPeriod,
34
- }), (0, accountReducer_1.changeAccountKey)({
35
- oldKey: oldAccountKey,
36
- newKey: newAccountKey,
37
- }));
38
- }
39
- else {
40
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
41
- error: response.status,
42
- }));
43
- }
44
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
45
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
46
- }))));
47
- }));
48
- exports.excludeAccountFromReconciliationEpic = excludeAccountFromReconciliationEpic;
@@ -1,9 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
- import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
5
- import { RootState } from '../../../../reducer';
6
- import { ZeniAPI } from '../../../../zeniAPI';
7
- import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
8
- export type ActionType = ReturnType<typeof includeAccountInReconciliation> | ReturnType<typeof includeAccountInReconciliationSuccess> | ReturnType<typeof includeAccountInReconciliationFailure> | ReturnType<typeof changeAccountKey> | ReturnType<typeof updateAccountRecon>;
9
- export declare const includeAccountInReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.includeAccountInReconciliationEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const accountReducer_1 = require("../../../../entity/account/accountReducer");
8
- const accountState_1 = require("../../../../entity/account/accountState");
9
- const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
10
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
- const responsePayload_1 = require("../../../../responsePayload");
12
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
13
- const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.includeAccountInReconciliation.match), (0, operators_1.mergeMap)((action) => {
14
- const { accountId } = action.payload;
15
- const state = state$.value;
16
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
17
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
18
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
19
- const query = JSON.stringify({
20
- start_date: period.start,
21
- end_date: period.end,
22
- });
23
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
24
- return zeniAPI
25
- .deleteAndGetJSON(apiUrl)
26
- .pipe((0, operators_1.mergeMap)((response) => {
27
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
- const reconciliation = response.data.reconciliation;
29
- const oldAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', reconciliation.account_id);
30
- const newAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', reconciliation.account_id);
31
- return (0, rxjs_1.of)((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, [reconciliation]), (0, reconciliationViewReducer_1.includeAccountInReconciliationSuccess)({
32
- reconciliation,
33
- selectedPeriod,
34
- }), (0, accountReducer_1.changeAccountKey)({
35
- oldKey: oldAccountKey,
36
- newKey: newAccountKey,
37
- }));
38
- }
39
- else {
40
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
41
- error: response.status,
42
- }));
43
- }
44
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
45
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
46
- }))));
47
- }));
48
- exports.includeAccountInReconciliationEpic = includeAccountInReconciliationEpic;