@zeniai/client-epic-state 5.1.92-beta0NB → 5.1.92-beta0ND

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 (61) hide show
  1. package/lib/entity/accountRecon/accountReconReducer.js +0 -4
  2. package/lib/entity/accountRecon/accountReconState.d.ts +1 -4
  3. package/lib/entity/accountRecon/accountReconState.js +0 -1
  4. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  5. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  6. package/lib/epic.d.ts +2 -4
  7. package/lib/epic.js +2 -4
  8. package/lib/esm/entity/accountRecon/accountReconReducer.js +0 -4
  9. package/lib/esm/entity/accountRecon/accountReconState.js +0 -1
  10. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
  11. package/lib/esm/epic.js +2 -4
  12. package/lib/esm/index.js +5 -5
  13. package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +18 -15
  14. package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +10 -10
  15. package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +4 -12
  16. package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementEpic.js +2 -8
  17. package/lib/esm/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.js +5 -20
  18. package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +0 -135
  19. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +16 -119
  20. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +7 -28
  21. package/lib/esm/view/expenseAutomationView/selectors/statementParseViewSelector.js +10 -43
  22. package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +1 -15
  23. package/lib/esm/view/recommendation/recommendationReducer.js +17 -1
  24. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +52 -0
  25. package/lib/index.d.ts +6 -6
  26. package/lib/index.js +47 -50
  27. package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.d.ts +1 -21
  28. package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +18 -15
  29. package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +10 -10
  30. package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
  31. package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +4 -12
  32. package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementEpic.js +1 -7
  33. package/lib/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.d.ts +0 -1
  34. package/lib/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.js +4 -20
  35. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  36. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +4 -109
  37. package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -143
  38. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -32
  39. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +18 -121
  40. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -5
  41. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +1 -3
  42. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +7 -29
  43. package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.d.ts +2 -3
  44. package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.js +10 -44
  45. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -74
  46. package/lib/view/expenseAutomationView/types/reconciliationViewState.js +1 -19
  47. package/lib/view/recommendation/recommendationPayload.d.ts +34 -0
  48. package/lib/view/recommendation/recommendationReducer.d.ts +2 -1
  49. package/lib/view/recommendation/recommendationReducer.js +18 -2
  50. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +7 -0
  51. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +56 -0
  52. package/package.json +1 -1
  53. package/lib/esm/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +0 -43
  54. package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseCombinedStatementEpic.js +0 -31
  55. package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateCombinedStatementInfoEpic.js +0 -68
  56. package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.d.ts +0 -34
  57. package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +0 -47
  58. package/lib/view/expenseAutomationView/epics/accountRecon/parseCombinedStatementEpic.d.ts +0 -26
  59. package/lib/view/expenseAutomationView/epics/accountRecon/parseCombinedStatementEpic.js +0 -35
  60. package/lib/view/expenseAutomationView/epics/accountRecon/updateCombinedStatementInfoEpic.d.ts +0 -27
  61. package/lib/view/expenseAutomationView/epics/accountRecon/updateCombinedStatementInfoEpic.js +0 -72
@@ -1,27 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { RootState } from '../../../../reducer';
3
- import { ZeniAPI } from '../../../../zeniAPI';
4
- import { submitCombinedStatementUpdate, submitStatementUpdateFailure, submitStatementUpdateSuccess, updateParsedStatementData } from '../../reducers/reconciliationViewReducer';
5
- export type ActionType = ReturnType<typeof submitCombinedStatementUpdate> | ReturnType<typeof submitStatementUpdateSuccess> | ReturnType<typeof submitStatementUpdateFailure> | ReturnType<typeof updateParsedStatementData>;
6
- export declare const updateCombinedStatementInfoEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: {
8
- accountId: import("../../../..").ID;
9
- parsedStatementData: import("../../types/reconciliationViewState").ParsedStatementData;
10
- selectedPeriod: import("../../../../commonStateTypes/timePeriod").MonthYearPeriod;
11
- };
12
- type: "expenseAutomationReconciliationView/updateParsedStatementData";
13
- } | {
14
- payload: {
15
- accountId: import("../../../..").ID;
16
- selectedPeriod: import("../../../../commonStateTypes/timePeriod").MonthYearPeriod;
17
- };
18
- type: "expenseAutomationReconciliationView/submitStatementUpdateSuccess";
19
- } | {
20
- payload: {
21
- accountId: import("../../../..").ID;
22
- error: import("../../../../responsePayload").ZeniAPIStatus;
23
- selectedPeriod: import("../../../../commonStateTypes/timePeriod").MonthYearPeriod;
24
- dateConflict?: import("../../types/reconciliationViewState").StatementDateConflict | null;
25
- };
26
- type: "expenseAutomationReconciliationView/submitStatementUpdateFailure";
27
- }>;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCombinedStatementInfoEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const responsePayload_1 = require("../../../../responsePayload");
8
- const mapStatementUpdateLocalDataToRequestBody_1 = require("../../helpers/mapStatementUpdateLocalDataToRequestBody");
9
- const statementParseViewSelector_1 = require("../../selectors/statementParseViewSelector");
10
- const reconciliationPayload_1 = require("../../payload/reconciliationPayload");
11
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
12
- const updateCombinedStatementInfoEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.submitCombinedStatementUpdate.match), (0, operators_1.switchMap)((action) => {
13
- const { accountId, selectedPeriod } = action.payload;
14
- const accountRecon = state$.value.expenseAutomationReconciliationViewState
15
- .accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
16
- const parsedStatementData = accountRecon?.parsedStatementData;
17
- const localDataByUploadId = accountRecon?.localData?.statementUpdateLocalDataByUploadId;
18
- const statementUploads = (0, statementParseViewSelector_1.getStatementUploadsFromParsedData)(parsedStatementData);
19
- if (parsedStatementData == null ||
20
- localDataByUploadId == null ||
21
- statementUploads.length === 0 ||
22
- statementUploads.some((statementUpload) => localDataByUploadId[statementUpload.statementMeta.statementUploadId] == null)) {
23
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
24
- accountId,
25
- selectedPeriod,
26
- error: (0, responsePayload_1.createZeniAPIStatus)('Missing Data', 'No statement update data found for combined accounts'),
27
- }));
28
- }
29
- const combinedStatementGroupId = accountRecon?.combinedStatementGroupId ??
30
- parsedStatementData.statementUpload.statementMeta
31
- .combinedStatementGroupId ??
32
- parsedStatementData.statementUpload.combinedStatementDetails
33
- ?.combinedStatementGroupId;
34
- if (combinedStatementGroupId == null || combinedStatementGroupId === '') {
35
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
36
- accountId,
37
- selectedPeriod,
38
- error: (0, responsePayload_1.createZeniAPIStatus)('Missing Data', 'No combined statement group id found for bulk update'),
39
- }));
40
- }
41
- const body = (0, mapStatementUpdateLocalDataToRequestBody_1.mapCombinedStatementUpdateLocalDataToRequestBody)(localDataByUploadId, parsedStatementData);
42
- const updateUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/statement-uploads/combined-statement-groups/${combinedStatementGroupId}`;
43
- return zeniAPI
44
- .putAndGetJSON(updateUrl, body)
45
- .pipe((0, operators_1.mergeMap)((response) => {
46
- if ((0, responsePayload_1.isSuccessResponse)(response) === true && response.data != null) {
47
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.updateParsedStatementData)({
48
- accountId,
49
- selectedPeriod,
50
- parsedStatementData: (0, reconciliationPayload_1.transformUpdateStatementInfoPayloadToState)(response.data),
51
- }), (0, reconciliationViewReducer_1.submitStatementUpdateSuccess)({
52
- accountId,
53
- selectedPeriod,
54
- }));
55
- }
56
- const dateConflict = (0, reconciliationPayload_1.isStatementDateConflictResponse)(response)
57
- ? (0, reconciliationPayload_1.transformStatementDateConflictToState)(response)
58
- : null;
59
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
60
- accountId,
61
- selectedPeriod,
62
- error: response.status,
63
- dateConflict,
64
- }));
65
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
66
- accountId,
67
- selectedPeriod,
68
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Statement REST API call errored out ' +
69
- (error instanceof Error ? error.message : String(error))),
70
- }))));
71
- }));
72
- exports.updateCombinedStatementInfoEpic = updateCombinedStatementInfoEpic;