@zeniai/client-epic-state 5.1.62 → 5.1.63

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.
@@ -473,10 +473,16 @@ const expenseAutomationReconciliationView = createSlice({
473
473
  },
474
474
  deleteAccountStatement: (draft, action) => {
475
475
  const { accountId, selectedPeriod } = action.payload;
476
- draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)].reconciliationByAccountID[accountId].statementDeleteStatus = {
476
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)]?.reconciliationByAccountID[accountId];
477
+ if (accountRecon == null) {
478
+ return;
479
+ }
480
+ accountRecon.statementDeleteStatus = {
477
481
  fetchState: 'In-Progress',
478
482
  error: undefined,
479
483
  };
484
+ // Drop sticky parse latch on discard so the drawer shows empty upload UI.
485
+ accountRecon.statementParseInProgress = false;
480
486
  },
481
487
  deleteAccountStatementSuccess: (draft, action) => {
482
488
  const { accountId, selectedPeriod } = action.payload;
@@ -487,6 +493,21 @@ const expenseAutomationReconciliationView = createSlice({
487
493
  error: undefined,
488
494
  };
489
495
  accountRecon.parsedStatementData = undefined;
496
+ accountRecon.statementParseInProgress = false;
497
+ // Reset in-flight parse/upload flags so the follow-up fetch cannot
498
+ // re-latch statementParseInProgress via In-Progress fetch states.
499
+ accountRecon.statementParseStatus = {
500
+ fetchState: 'Not-Started',
501
+ error: undefined,
502
+ };
503
+ accountRecon.reparseStatementStatus = {
504
+ fetchState: 'Not-Started',
505
+ error: undefined,
506
+ };
507
+ accountRecon.statementUploadStatus = {
508
+ fetchState: 'Not-Started',
509
+ error: undefined,
510
+ };
490
511
  accountRecon.statementProcessingDismissedToBackground = false;
491
512
  accountRecon.statementProcessingBackgroundCompletedSteps = 0;
492
513
  accountRecon.statementProcessingStartedAtMs = undefined;
@@ -495,11 +516,18 @@ const expenseAutomationReconciliationView = createSlice({
495
516
  fetchState: 'Not-Started',
496
517
  error: undefined,
497
518
  };
519
+ if (accountRecon.localData != null) {
520
+ accountRecon.localData.statementUpdateLocalData = undefined;
521
+ }
498
522
  }
499
523
  },
500
524
  deleteAccountStatementFailure: (draft, action) => {
501
525
  const { accountId, selectedPeriod } = action.payload;
502
- draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)].reconciliationByAccountID[accountId].statementDeleteStatus = {
526
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)]?.reconciliationByAccountID[accountId];
527
+ if (accountRecon == null) {
528
+ return;
529
+ }
530
+ accountRecon.statementDeleteStatus = {
503
531
  fetchState: 'Error',
504
532
  error: action.payload.error,
505
533
  };
@@ -478,10 +478,16 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
478
478
  },
479
479
  deleteAccountStatement: (draft, action) => {
480
480
  const { accountId, selectedPeriod } = action.payload;
481
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementDeleteStatus = {
481
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
482
+ if (accountRecon == null) {
483
+ return;
484
+ }
485
+ accountRecon.statementDeleteStatus = {
482
486
  fetchState: 'In-Progress',
483
487
  error: undefined,
484
488
  };
489
+ // Drop sticky parse latch on discard so the drawer shows empty upload UI.
490
+ accountRecon.statementParseInProgress = false;
485
491
  },
486
492
  deleteAccountStatementSuccess: (draft, action) => {
487
493
  const { accountId, selectedPeriod } = action.payload;
@@ -492,6 +498,21 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
492
498
  error: undefined,
493
499
  };
494
500
  accountRecon.parsedStatementData = undefined;
501
+ accountRecon.statementParseInProgress = false;
502
+ // Reset in-flight parse/upload flags so the follow-up fetch cannot
503
+ // re-latch statementParseInProgress via In-Progress fetch states.
504
+ accountRecon.statementParseStatus = {
505
+ fetchState: 'Not-Started',
506
+ error: undefined,
507
+ };
508
+ accountRecon.reparseStatementStatus = {
509
+ fetchState: 'Not-Started',
510
+ error: undefined,
511
+ };
512
+ accountRecon.statementUploadStatus = {
513
+ fetchState: 'Not-Started',
514
+ error: undefined,
515
+ };
495
516
  accountRecon.statementProcessingDismissedToBackground = false;
496
517
  accountRecon.statementProcessingBackgroundCompletedSteps = 0;
497
518
  accountRecon.statementProcessingStartedAtMs = undefined;
@@ -500,11 +521,18 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
500
521
  fetchState: 'Not-Started',
501
522
  error: undefined,
502
523
  };
524
+ if (accountRecon.localData != null) {
525
+ accountRecon.localData.statementUpdateLocalData = undefined;
526
+ }
503
527
  }
504
528
  },
505
529
  deleteAccountStatementFailure: (draft, action) => {
506
530
  const { accountId, selectedPeriod } = action.payload;
507
- draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementDeleteStatus = {
531
+ const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
532
+ if (accountRecon == null) {
533
+ return;
534
+ }
535
+ accountRecon.statementDeleteStatus = {
508
536
  fetchState: 'Error',
509
537
  error: action.payload.error,
510
538
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.62",
3
+ "version": "5.1.63",
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",