@zeniai/client-epic-state 5.2.34 → 5.2.35-beta10MM

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 (115) hide show
  1. package/lib/entity/actualMatching/actualMatchingPayload.d.ts +31 -0
  2. package/lib/entity/actualMatching/actualMatchingPayload.js +50 -0
  3. package/lib/entity/actualMatching/actualMatchingReducer.d.ts +9 -0
  4. package/lib/entity/actualMatching/actualMatchingReducer.js +33 -0
  5. package/lib/entity/actualMatching/actualMatchingSelector.d.ts +3 -0
  6. package/lib/entity/actualMatching/actualMatchingSelector.js +6 -0
  7. package/lib/entity/actualMatching/actualMatchingState.d.ts +23 -0
  8. package/lib/entity/actualMatching/actualMatchingState.js +2 -0
  9. package/lib/entity/actualMatching/actualMatchingTypes.d.ts +1 -0
  10. package/lib/entity/actualMatching/actualMatchingTypes.js +2 -0
  11. package/lib/entity/aiCfo/aiCfoReducer.js +78 -4
  12. package/lib/entity/aiCfo/aiCfoState.d.ts +16 -0
  13. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +31 -0
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.js +53 -0
  15. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +33 -0
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +2 -0
  18. package/lib/epic.d.ts +8 -1
  19. package/lib/epic.js +14 -0
  20. package/lib/esm/entity/actualMatching/actualMatchingPayload.js +46 -0
  21. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +30 -0
  22. package/lib/esm/entity/actualMatching/actualMatchingSelector.js +3 -0
  23. package/lib/esm/entity/actualMatching/actualMatchingState.js +1 -0
  24. package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -0
  25. package/lib/esm/entity/aiCfo/aiCfoReducer.js +79 -5
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +53 -0
  27. package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
  28. package/lib/esm/epic.js +14 -0
  29. package/lib/esm/index.js +7 -3
  30. package/lib/esm/reducer.js +6 -0
  31. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +44 -0
  32. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +36 -0
  33. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  34. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +107 -0
  35. package/lib/esm/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +16 -0
  36. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +54 -0
  37. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +74 -0
  38. package/lib/esm/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +76 -0
  39. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +35 -15
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -3
  43. package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  44. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
  45. package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
  46. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +68 -0
  47. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +434 -0
  48. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
  49. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
  50. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +426 -0
  51. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
  52. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +35 -0
  53. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
  54. package/lib/esm/view/financeStatement/financeStatementReducer.js +17 -27
  55. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.js +4 -0
  56. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +3 -3
  57. package/lib/index.d.ts +15 -6
  58. package/lib/index.js +82 -48
  59. package/lib/reducer.d.ts +2 -0
  60. package/lib/reducer.js +6 -0
  61. package/lib/rootStateTypes.d.ts +4 -0
  62. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  63. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +48 -0
  64. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.d.ts +12 -0
  65. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +40 -0
  66. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  67. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  68. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +9 -0
  69. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +111 -0
  70. package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.d.ts +3 -0
  71. package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +19 -0
  72. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +9 -0
  73. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +58 -0
  74. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  75. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +78 -0
  76. package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.d.ts +9 -0
  77. package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +80 -0
  78. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +34 -14
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -3
  84. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
  85. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  86. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
  87. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
  88. package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
  89. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  90. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +85 -0
  91. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +74 -0
  92. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +79 -0
  93. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +438 -0
  94. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
  95. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
  96. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +87 -0
  97. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
  98. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +11 -0
  99. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +38 -0
  100. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +445 -0
  101. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
  102. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +105 -0
  103. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +42 -0
  104. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  105. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
  106. package/lib/view/financeStatement/financeStatementReducer.js +17 -27
  107. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.d.ts +1 -11
  108. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.js +4 -0
  109. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -2
  110. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +1 -2
  111. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +15 -1
  112. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewReducer.d.ts +1 -1
  113. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +1 -1
  114. package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
  115. package/package.json +1 -1
@@ -0,0 +1,105 @@
1
+ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
+ import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
+ import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatchingTypes';
5
+ import { JEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
+ export declare const toActualMatchingSortKey: (v: string) => "type" | "date" | "vendor" | "category" | "class" | "amount" | "variance" | "lifecycle" | "service" | "accrued" | "actual";
7
+ export type ActualMatchingSortKey = ReturnType<typeof toActualMatchingSortKey>;
8
+ export declare const MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
9
+ export declare const MATCH_ACCRUAL_SEARCH_LIMIT = 50;
10
+ export declare const MATCH_SEARCH_DEBOUNCE_MS = 300;
11
+ export declare const toMatchAndReverseResultStatus: (v: string) => "error" | "reversed" | "noop" | "conflict" | "claim_lost";
12
+ export type MatchAndReverseResultStatus = ReturnType<typeof toMatchAndReverseResultStatus>;
13
+ export interface ActualMatchingViewUIState {
14
+ scrollPosition: {
15
+ scrollTop: number;
16
+ scrollLeft?: number;
17
+ } | undefined;
18
+ searchString: string;
19
+ sortKey: ActualMatchingSortKey;
20
+ sortOrder: SortOrder;
21
+ }
22
+ /**
23
+ * Sibling of Missing Receipts `MatchCandidate`. Confirm needs `lineId` and
24
+ * `transactionIntegrationId` on every row — those fields are required here.
25
+ */
26
+ export interface ActualMatchingTransactionSearchResult {
27
+ amount: number;
28
+ currencyCode: string;
29
+ currencySymbol: string;
30
+ lineId: string;
31
+ syncToken: string;
32
+ transactionDate: string;
33
+ transactionId: ID;
34
+ transactionIntegrationId: string;
35
+ transactionType: string;
36
+ vendorName: string;
37
+ accountDescription?: string;
38
+ accountId?: ID;
39
+ accountingClassId?: ID;
40
+ accountingClassName?: string;
41
+ accountName?: string;
42
+ transactionDescription?: string;
43
+ transactionMemo?: string;
44
+ transactionTypeName?: string;
45
+ vendorId?: ID;
46
+ }
47
+ export interface MatchAndReverseResult {
48
+ accrualId: ID;
49
+ status: MatchAndReverseResultStatus;
50
+ reason?: string;
51
+ }
52
+ export interface MatchAndReverseAccrualsParams {
53
+ accrualIds: ID[];
54
+ lineIds: ID[];
55
+ transactionId: ID;
56
+ transactionIntegrationId: string;
57
+ transactionSyncToken: string;
58
+ transactionType: string;
59
+ }
60
+ export declare const toUndoReversalResultStatus: (v: string) => "error" | "claim_lost" | "undone";
61
+ export type UndoReversalResultStatus = ReturnType<typeof toUndoReversalResultStatus>;
62
+ export interface UndoReversalResult {
63
+ accrualId: ID;
64
+ status: UndoReversalResultStatus;
65
+ reason?: string;
66
+ }
67
+ export interface UndoReversalAccrualsParams {
68
+ accrualIds: ID[];
69
+ matchId: ActualMatchingMatchId;
70
+ }
71
+ export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
72
+ isLoadingMore: boolean;
73
+ nextPageToken: string | null;
74
+ query: string;
75
+ results: ActualMatchingTransactionSearchResult[];
76
+ }
77
+ export interface ActualMatchingAccrualSearchState extends FetchStateAndError {
78
+ isLoadingMore: boolean;
79
+ nextPageToken: string | null;
80
+ query: string;
81
+ results: JEOneTimeAccrualKey[];
82
+ }
83
+ export interface ActualMatchingMatchModalState {
84
+ accrualSearch: ActualMatchingAccrualSearchState;
85
+ confirmStatus: FetchStateAndError;
86
+ didPinPrefillTransactions: boolean;
87
+ isOpen: boolean;
88
+ pinnedTransactionResults: ActualMatchingTransactionSearchResult[];
89
+ transactionSearch: ActualMatchingTransactionSearchState;
90
+ lastBatchResults?: MatchAndReverseResult[];
91
+ openedFromMatchId?: ActualMatchingMatchId;
92
+ }
93
+ export declare function actualMatchingTransactionLineKey(transactionType: string, transactionIntegrationId: string, lineId: string): string;
94
+ export interface ActualMatchingViewState extends FetchedState {
95
+ closeMatchAfterUndo: boolean;
96
+ detailFetchStateByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
97
+ detailRefreshStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
98
+ lastMatchResultsByMatchId: Record<ActualMatchingMatchId, MatchAndReverseResult[]>;
99
+ lastUndoResultsByMatchId: Record<ActualMatchingMatchId, UndoReversalResult[]>;
100
+ matchIdsByPeriod: Record<MonthYearPeriodId, ActualMatchingMatchId[]>;
101
+ matchModal: ActualMatchingMatchModalState;
102
+ refreshStatus: FetchStateAndError;
103
+ uiState: ActualMatchingViewUIState;
104
+ undoReversalStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
105
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingSortKey = void 0;
4
+ exports.actualMatchingTransactionLineKey = actualMatchingTransactionLineKey;
5
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
+ const ACTUAL_MATCHING_SORT_KEYS = [
7
+ 'vendor',
8
+ 'date',
9
+ 'amount',
10
+ 'category',
11
+ 'class',
12
+ 'type',
13
+ 'lifecycle',
14
+ 'service',
15
+ 'accrued',
16
+ 'actual',
17
+ 'variance',
18
+ ];
19
+ const toActualMatchingSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_SORT_KEYS);
20
+ exports.toActualMatchingSortKey = toActualMatchingSortKey;
21
+ exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
22
+ exports.MATCH_ACCRUAL_SEARCH_LIMIT = 50;
23
+ exports.MATCH_SEARCH_DEBOUNCE_MS = 300;
24
+ const MATCH_AND_REVERSE_RESULT_STATUSES = [
25
+ 'reversed',
26
+ 'noop',
27
+ 'conflict',
28
+ 'claim_lost',
29
+ 'error',
30
+ ];
31
+ const toMatchAndReverseResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, MATCH_AND_REVERSE_RESULT_STATUSES);
32
+ exports.toMatchAndReverseResultStatus = toMatchAndReverseResultStatus;
33
+ const UNDO_REVERSAL_RESULT_STATUSES = [
34
+ 'undone',
35
+ 'claim_lost',
36
+ 'error',
37
+ ];
38
+ const toUndoReversalResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, UNDO_REVERSAL_RESULT_STATUSES);
39
+ exports.toUndoReversalResultStatus = toUndoReversalResultStatus;
40
+ function actualMatchingTransactionLineKey(transactionType, transactionIntegrationId, lineId) {
41
+ return `${transactionType}:${transactionIntegrationId}:${lineId}`;
42
+ }
@@ -12,7 +12,7 @@ import { ZeniDate } from '../../../zeniDayJS';
12
12
  import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
13
13
  export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
14
14
  export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
15
- export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
15
+ export declare const toJEPageTab: (v: string) => "schedules" | "actual_matching" | "existing_schedules";
16
16
  export type JEPageTab = ReturnType<typeof toJEPageTab>;
17
17
  export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
18
18
  export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
@@ -20,7 +20,14 @@ const JE_SCHEDULE_SORT_KEYS = [
20
20
  ];
21
21
  const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
22
22
  exports.toJEScheduleSortKey = toJEScheduleSortKey;
23
- const JE_PAGE_TABS = ['schedules', 'existing_schedules'];
23
+ // `actual_matching` is chrome only: the JE tab bar includes it, but AM data is
24
+ // `expenseAutomationActualMatchingViewState`, not the schedules period-tab
25
+ // cache below. Walks of ALL_JE_PAGE_TABS that read schedule keys must skip it.
26
+ const JE_PAGE_TABS = [
27
+ 'schedules',
28
+ 'actual_matching',
29
+ 'existing_schedules',
30
+ ];
24
31
  const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
25
32
  exports.toJEPageTab = toJEPageTab;
26
33
  exports.ALL_JE_PAGE_TABS = JE_PAGE_TABS;
@@ -37,9 +37,18 @@ const financeStatement = (0, toolkit_1.createSlice)({
37
37
  },
38
38
  },
39
39
  updateFinanceStatementTimeframe(draft, action) {
40
+ // Unrelated UI re-dispatches the *current* timeframe as a side effect (the
41
+ // reports page hangs its table scroll reset off that callback); dropping the
42
+ // anchor there would silently reset the user's period to the latest one.
43
+ if (draft.timeframe === action.payload) {
44
+ return;
45
+ }
40
46
  draft.timeframe = action.payload;
47
+ // A month anchor is meaningless once the timeframe becomes quarter/year, so
48
+ // a real change drops it and returns the width to the default — 12 months
49
+ // must not become 12 quarters. Order is the user's, so it survives.
41
50
  draft.selectedCOABalancesRange = {
42
- numberOfPeriods: draft.selectedCOABalancesRange.numberOfPeriods,
51
+ numberOfPeriods: exports.initialFinanceStatementState.selectedCOABalancesRange.numberOfPeriods,
43
52
  orderBy: draft.selectedCOABalancesRange.orderBy,
44
53
  };
45
54
  },
@@ -81,8 +90,7 @@ const financeStatement = (0, toolkit_1.createSlice)({
81
90
  draft.selectedReportId = action.payload;
82
91
  },
83
92
  updateFinanceStatementAdditionalBalancesSelection(draft, action) {
84
- const { firstMonthOfFY, additionalBalances: additionalBalancesPayload, coaBalances, maxNumOfPeriodsToHighlight, } = action.payload;
85
- const safeCoaBalances = coaBalances != null ? coaBalances : [];
93
+ const { additionalBalances: additionalBalancesPayload, maxNumOfPeriodsToHighlight, } = action.payload;
86
94
  const additionalBalances = additionalBalancesPayload ?? [];
87
95
  let tempAdditionalBalances = [...additionalBalances];
88
96
  if (additionalBalances.includes('this_period_vs_last_period') ||
@@ -98,30 +106,12 @@ const financeStatement = (0, toolkit_1.createSlice)({
98
106
  draft.maxNumOfPeriodsToHighlight = maxNumOfPeriodsToHighlight;
99
107
  draft.isAdditionalBalancesShown =
100
108
  additionalBalances.length != 0 ? true : false;
101
- const { timeframe, selectedCOABalancesRange } = draft;
102
- if (safeCoaBalances.length > 0) {
103
- const thisPeriod = (0, thisPeriodHelpers_1.extractThisPeriod)(action.payload.firstMonthOfFY, timeframe, selectedCOABalancesRange, safeCoaBalances);
104
- if (thisPeriod != null) {
105
- const selectedCoaBalancesRangeWithThisPeriod = {
106
- ...selectedCOABalancesRange,
107
- thisPeriod,
108
- };
109
- const selectionRanges = (0, getSelectedAndHighlightedRanges_1.getSelectedAndHighlightedRangesForThisPeriod)({
110
- firstMonthOfFY,
111
- thisPeriod: thisPeriod,
112
- coaBalances: safeCoaBalances,
113
- timeframe,
114
- maxNumOfPeriodsToHighlight: maxNumOfPeriodsToHighlight,
115
- currentSelection: {
116
- selectedCOABalancesRange: selectedCoaBalancesRangeWithThisPeriod,
117
- },
118
- orderBy: 'ascending_date',
119
- maxNumOfPeriodsToSelect: maxNumOfPeriodsToHighlight,
120
- });
121
- draft.selectedCOABalancesRange =
122
- selectionRanges.selectedCOABalancesRange;
123
- }
124
- }
109
+ // Column metadata only — must not touch selectedCOABalancesRange. The
110
+ // reports page fires this on load, on resize and on every fetch-state
111
+ // transition (so also on report switch and on remount after a drill-down)
112
+ // with a viewport-derived period count that knows nothing about the range
113
+ // the user picked. The width default comes from initial state, and from
114
+ // updateFinanceStatementTimeframe on a real timeframe change.
125
115
  },
126
116
  updateDownloadState(draft, action) {
127
117
  draft.downloadState = action.payload;
@@ -1,7 +1,7 @@
1
1
  import { InvoicingCustomerPayload } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerPayload';
2
2
  import { ZeniAPIResponse } from '../../../responsePayload';
3
3
  import { AddressUpdatableInfo } from '../../addressView/addressViewState';
4
- import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
4
+ import { InvoicingCustomerFormLocalData, InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewState';
5
5
  export type SaveInvoicingCustomerResponse = ZeniAPIResponse<InvoicingCustomerPayload>;
6
6
  /**
7
7
  * Build the create/update customer request body from the form draft. The
@@ -25,15 +25,5 @@ export type InvoicingPaymentLinkEmailPreviewResponse = ZeniAPIResponse<Invoicing
25
25
  * The email rendered once with sentinel tokens standing in for the subject and
26
26
  * body, so the composer can splice a draft into it without another request.
27
27
  */
28
- export interface InvoicingPaymentLinkEmailPreviewData {
29
- /** Default body prefill, plain text. */
30
- body: string;
31
- bodyToken: string;
32
- renderedHtmlTemplate: string;
33
- /** Default subject prefill. */
34
- subject: string;
35
- subjectToken: string;
36
- to: string;
37
- }
38
28
  export declare const toInvoicingPaymentLinkEmailPreview: (payload: InvoicingPaymentLinkEmailPreviewPayload) => InvoicingPaymentLinkEmailPreviewData;
39
29
  export type AddPromotionalCreditsResponse = ZeniAPIResponse<InvoicingCustomerPayload>;
@@ -34,6 +34,10 @@ const localDataToSaveInvoicingCustomerPayload = (localData, billingAddress) => {
34
34
  };
35
35
  };
36
36
  exports.localDataToSaveInvoicingCustomerPayload = localDataToSaveInvoicingCustomerPayload;
37
+ /**
38
+ * The email rendered once with sentinel tokens standing in for the subject and
39
+ * body, so the composer can splice a draft into it without another request.
40
+ */
37
41
  const toInvoicingPaymentLinkEmailPreview = (payload) => ({
38
42
  body: payload.body,
39
43
  bodyToken: payload.body_token,
@@ -1,7 +1,6 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../responsePayload';
3
- import { InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewPayload';
4
- import { EditInvoicingCustomerDetailViewState, InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
3
+ import { EditInvoicingCustomerDetailViewState, InvoicingCustomerFormLocalData, InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewState';
5
4
  /** Add promotional credits to a customer. */
6
5
  export interface SubmitAddPromotionalCreditsPayload {
7
6
  amount: number;
@@ -5,8 +5,7 @@ import { InvoicingFieldHelpByCode, InvoicingNamedOption } from '../../../entity/
5
5
  import { InvoicingCustomer, InvoicingCustomerPaymentMethod } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerState';
6
6
  import { RootState } from '../../../rootStateTypes';
7
7
  import { InvoicingSetupIntent } from '../customerPaymentMethod/customerPaymentMethodState';
8
- import { InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewPayload';
9
- import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
8
+ import { InvoicingCustomerFormLocalData, InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewState';
10
9
  /**
11
10
  * Read-only view for the customer detail page: the customer entity + its fetch
12
11
  * state, plus everything the page renders in view mode — recent invoices, the
@@ -1,5 +1,19 @@
1
1
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
- import { InvoicingPaymentLinkEmailPreviewData } from './editInvoicingCustomerDetailViewPayload';
2
+ /**
3
+ * The payment-link email the composer opens with: the backend's prefill plus
4
+ * the tokens the frontend splices the user's edits into. State, not wire shape
5
+ * — `toInvoicingPaymentLinkEmailPreview` in the payload file maps onto it.
6
+ */
7
+ export interface InvoicingPaymentLinkEmailPreviewData {
8
+ /** Default body prefill, plain text. */
9
+ body: string;
10
+ bodyToken: string;
11
+ renderedHtmlTemplate: string;
12
+ /** Default subject prefill. */
13
+ subject: string;
14
+ subjectToken: string;
15
+ to: string;
16
+ }
3
17
  /**
4
18
  * Draft form state for the create/edit customer form. Held in CES so the form
5
19
  * flows its data from here (mirrors the bill-pay / reimbursement pattern). The
@@ -26,7 +26,7 @@ export declare const fetchInvoicingCustomerList: import("@reduxjs/toolkit").Acti
26
26
  ids: ID[];
27
27
  keepExistingListItems: boolean;
28
28
  nextCursor: string | null;
29
- }, "invoicingCustomerListView/updateInvoicingCustomerList">, updateInvoicingCustomerListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCustomerListView/updateInvoicingCustomerListFailure">, fetchInvoicingCustomerCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingCustomerListView/fetchInvoicingCustomerCounts">, updateInvoicingCustomerCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingCustomerListView/updateInvoicingCustomerCounts">, updateInvoicingCustomerCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCustomerListView/updateInvoicingCustomerCountsFailure">, updateInvoicingCustomerFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingCustomerFilters, "invoicingCustomerListView/updateInvoicingCustomerFilters">, setInvoicingCustomerActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "all" | "at_risk" | "trial", "invoicingCustomerListView/setInvoicingCustomerActiveTab">, addInvoicingCustomerToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
+ }, "invoicingCustomerListView/updateInvoicingCustomerList">, updateInvoicingCustomerListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCustomerListView/updateInvoicingCustomerListFailure">, fetchInvoicingCustomerCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingCustomerListView/fetchInvoicingCustomerCounts">, updateInvoicingCustomerCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingCustomerListView/updateInvoicingCustomerCounts">, updateInvoicingCustomerCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCustomerListView/updateInvoicingCustomerCountsFailure">, updateInvoicingCustomerFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingCustomerFilters, "invoicingCustomerListView/updateInvoicingCustomerFilters">, setInvoicingCustomerActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "all" | "trial" | "at_risk", "invoicingCustomerListView/setInvoicingCustomerActiveTab">, addInvoicingCustomerToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
30
30
  id: ID;
31
31
  status?: string;
32
32
  }, "invoicingCustomerListView/addInvoicingCustomerToList">;
@@ -20,7 +20,7 @@ export interface InvoicingCustomerColumnConfig {
20
20
  }
21
21
  export declare const INVOICING_CUSTOMER_COLUMNS: InvoicingCustomerColumnConfig[];
22
22
  export declare const ALL_INVOICING_CUSTOMER_TAB_IDS: readonly ["all", "active", "trial", "at_risk"];
23
- export declare const toInvoicingCustomerTabId: (v: string) => "active" | "all" | "at_risk" | "trial";
23
+ export declare const toInvoicingCustomerTabId: (v: string) => "active" | "all" | "trial" | "at_risk";
24
24
  export type InvoicingCustomerTabId = ReturnType<typeof toInvoicingCustomerTabId>;
25
25
  export interface InvoicingCustomerListViewState extends FetchedState {
26
26
  /** Selected status tab (CES-owned so it persists across page revisits). */
@@ -440,7 +440,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
440
440
  }
441
441
  }
442
442
  else {
443
- if (Boolean(transaction.billPayInfo.paymentDate) === true) {
443
+ if (Boolean((0, billListFilterHelpers_1.getActualPaymentDate)(transaction.billPayInfo)) === true) {
444
444
  transactionsWithSortKeyValue.push(transaction);
445
445
  }
446
446
  else {
@@ -525,7 +525,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
525
525
  case 'dueDate':
526
526
  return currentTab === 'draft'
527
527
  ? transaction.dueDate
528
- : transaction.billPayInfo.paymentDate;
528
+ : (0, billListFilterHelpers_1.getActualPaymentDate)(transaction.billPayInfo);
529
529
  case 'status':
530
530
  return getStatusPerTab(transaction);
531
531
  case 'amount':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.34",
3
+ "version": "5.2.35-beta10MM",
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",