@zeniai/client-epic-state 4.20.3-betaRD42 → 4.20.3-betaRD43
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.
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +8 -6
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -0
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +2 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +7 -5
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +12 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +2 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { updateCompanies } from '../../../../entity/company/companyReducer';
|
|
4
4
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
5
|
import { updateTenantAccountingClassesEnabled } from '../../../../entity/tenant/tenantReducer';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
7
|
import { updateAccountingClassesEnabled, updateAccountingClassesEnabledFailure, updateAccountingClassesEnabledSuccess, } from '../../companyViewReducer';
|
|
8
|
-
export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAccountingClassesEnabled.match),
|
|
8
|
+
export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAccountingClassesEnabled.match), switchMap((action) => {
|
|
9
9
|
const { companyId, enabled } = action.payload;
|
|
10
|
-
const
|
|
10
|
+
const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
|
|
11
11
|
return zeniAPI
|
|
12
12
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
|
|
13
13
|
.pipe(mergeMap((response) => {
|
|
@@ -19,10 +19,10 @@ export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) =>
|
|
|
19
19
|
schema: {},
|
|
20
20
|
}),
|
|
21
21
|
];
|
|
22
|
-
if (
|
|
22
|
+
if (tenantId != null) {
|
|
23
23
|
actions.push(updateTenantAccountingClassesEnabled({
|
|
24
24
|
enabled,
|
|
25
|
-
tenantId
|
|
25
|
+
tenantId,
|
|
26
26
|
}));
|
|
27
27
|
}
|
|
28
28
|
actions.push(updateAccountingClassesEnabledSuccess());
|
|
@@ -48,7 +48,9 @@ export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) =>
|
|
|
48
48
|
}), catchError((error) => from([
|
|
49
49
|
updateAccountingClassesEnabledFailure({
|
|
50
50
|
status: createZeniAPIStatus('Unexpected error', 'Update Accounting Classes Enabled errored out' +
|
|
51
|
-
|
|
51
|
+
(error instanceof Error
|
|
52
|
+
? error.message
|
|
53
|
+
: JSON.stringify(error))),
|
|
52
54
|
}),
|
|
53
55
|
openSnackbar({
|
|
54
56
|
messageSection: 'accounting_classes_enabled_update',
|
|
@@ -593,6 +593,9 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
593
593
|
? toReconciliationAccountSource(account.reconciliation_source)
|
|
594
594
|
: undefined,
|
|
595
595
|
},
|
|
596
|
+
accountDetectionReason: account?.detection_info != null && account.detection_reason != null
|
|
597
|
+
? account.detection_reason
|
|
598
|
+
: undefined,
|
|
596
599
|
};
|
|
597
600
|
accountReconciliationRecords.accountIDs.push(reconciliation.account_id);
|
|
598
601
|
});
|
|
@@ -674,5 +677,6 @@ const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, recon
|
|
|
674
677
|
statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
675
678
|
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
676
679
|
localData: {},
|
|
680
|
+
accountDetectionReason: undefined,
|
|
677
681
|
};
|
|
678
682
|
};
|
|
@@ -252,6 +252,8 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
252
252
|
.transactionFetchState,
|
|
253
253
|
accountListState.byReportId.accountList,
|
|
254
254
|
]),
|
|
255
|
+
accountDetectionReason: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
256
|
+
.accountDetectionReason,
|
|
255
257
|
};
|
|
256
258
|
});
|
|
257
259
|
const accountReconciliationBySectionID = {
|