@zeniai/client-epic-state 5.3.5 → 5.3.6

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 (56) hide show
  1. package/lib/entity/customerIncome/customerIncomeTrend.d.ts +18 -2
  2. package/lib/entity/customerIncome/customerIncomeTrend.js +65 -5
  3. package/lib/entity/insights/insightSummary.d.ts +3 -0
  4. package/lib/entity/insights/insightSummaryPayload.js +2 -0
  5. package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
  6. package/lib/entity/invoicing/invoice/invoicePayload.js +3 -0
  7. package/lib/entity/invoicing/invoice/invoiceState.d.ts +2 -0
  8. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  9. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  10. package/lib/entity/vendorExpense/vendorSpendTrendFilterTabType.d.ts +2 -2
  11. package/lib/epic.d.ts +4 -1
  12. package/lib/epic.js +6 -0
  13. package/lib/esm/entity/customerIncome/customerIncomeTrend.js +63 -4
  14. package/lib/esm/entity/insights/insightSummaryPayload.js +2 -0
  15. package/lib/esm/entity/invoicing/invoice/invoicePayload.js +3 -0
  16. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  17. package/lib/esm/epic.js +6 -0
  18. package/lib/esm/index.js +3 -0
  19. package/lib/esm/reducer.js +3 -0
  20. package/lib/esm/view/customerSummaryView/customerSummaryViewPayload.js +1 -0
  21. package/lib/esm/view/customerSummaryView/customerSummaryViewReducer.js +197 -0
  22. package/lib/esm/view/customerSummaryView/customerSummaryViewSelector.js +35 -0
  23. package/lib/esm/view/customerSummaryView/customerSummaryViewState.js +10 -0
  24. package/lib/esm/view/customerSummaryView/epic/fetchCustomerSummaryDetailEpic.js +30 -0
  25. package/lib/esm/view/customerSummaryView/epic/fetchCustomerSummaryListEpic.js +27 -0
  26. package/lib/esm/view/customerSummaryView/epic/saveCustomerSummaryDetailEpic.js +44 -0
  27. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +2 -1
  28. package/lib/esm/view/trend/fetchIncomeTrendEpic.js +29 -6
  29. package/lib/esm/view/trend/trendReducer.js +4 -2
  30. package/lib/index.d.ts +6 -0
  31. package/lib/index.js +21 -1
  32. package/lib/reducer.d.ts +1 -0
  33. package/lib/reducer.js +3 -0
  34. package/lib/rootStateTypes.d.ts +2 -0
  35. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
  36. package/lib/view/customerSummaryView/customerSummaryViewPayload.d.ts +38 -0
  37. package/lib/view/customerSummaryView/customerSummaryViewPayload.js +2 -0
  38. package/lib/view/customerSummaryView/customerSummaryViewReducer.d.ts +32 -0
  39. package/lib/view/customerSummaryView/customerSummaryViewReducer.js +202 -0
  40. package/lib/view/customerSummaryView/customerSummaryViewSelector.d.ts +20 -0
  41. package/lib/view/customerSummaryView/customerSummaryViewSelector.js +43 -0
  42. package/lib/view/customerSummaryView/customerSummaryViewState.d.ts +63 -0
  43. package/lib/view/customerSummaryView/customerSummaryViewState.js +13 -0
  44. package/lib/view/customerSummaryView/epic/fetchCustomerSummaryDetailEpic.d.ts +9 -0
  45. package/lib/view/customerSummaryView/epic/fetchCustomerSummaryDetailEpic.js +34 -0
  46. package/lib/view/customerSummaryView/epic/fetchCustomerSummaryListEpic.d.ts +7 -0
  47. package/lib/view/customerSummaryView/epic/fetchCustomerSummaryListEpic.js +31 -0
  48. package/lib/view/customerSummaryView/epic/saveCustomerSummaryDetailEpic.d.ts +8 -0
  49. package/lib/view/customerSummaryView/epic/saveCustomerSummaryDetailEpic.js +48 -0
  50. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +2 -1
  51. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  52. package/lib/view/trend/fetchIncomeTrendEpic.d.ts +1 -1
  53. package/lib/view/trend/fetchIncomeTrendEpic.js +28 -5
  54. package/lib/view/trend/trendReducer.d.ts +8 -1
  55. package/lib/view/trend/trendReducer.js +4 -2
  56. package/package.json +1 -1
@@ -116,6 +116,7 @@ import companyTaskManagerView, { initialState as initialCompanyTaskManagerViewSt
116
116
  import companyView, { initialState as initialCompanyViewState, } from './view/companyView/companyViewReducer';
117
117
  import createTransferEntry, { initialState as initialCreateTransferEntryState, } from './view/createTransferEntry/createTransferEntryReducer';
118
118
  import creditAgentView, { initialState as initialCreditAgentViewState, } from './view/creditAgentView/creditAgentViewReducer';
119
+ import customerSummaryView, { initialState as initialCustomerSummaryViewState, } from './view/customerSummaryView/customerSummaryViewReducer';
119
120
  import dashboard, { initialState as initialDashboardState, } from './view/dashboard/dashboardReducer';
120
121
  import dashboardLayout, { initialState as initialDashboardLayoutState, } from './view/dashboardLayout/dashboardLayoutReducer';
121
122
  import expenseAutomationView, { initialState as initialExpenseAutomationViewState, } from './view/expenseAutomationView/expenseAutomationViewReducer';
@@ -545,6 +546,7 @@ const initialViewsState = {
545
546
  vendorFirstReviewViewState: initialVendorFirstReviewViewState,
546
547
  vendorGlobalReviewViewState: initialVendorGlobalReviewViewState,
547
548
  vendorListState: initialVendorListState,
549
+ customerSummaryViewState: initialCustomerSummaryViewState,
548
550
  vendorFiling1099ListState: initialVendorFiling1099ListState,
549
551
  vendorFiling1099UploadDetailsState: initialVendorFiling1099UploadDetails,
550
552
  vendorsTabVendorViewState: initialVendorsTabVendorViewReducer,
@@ -833,6 +835,7 @@ const viewReducers = {
833
835
  vendorFirstReviewViewState: vendorFirstReviewView,
834
836
  vendorGlobalReviewViewState: vendorGlobalReviewView,
835
837
  vendorListState: vendorList,
838
+ customerSummaryViewState: customerSummaryView,
836
839
  vendorFiling1099ListState: vendorFiling1099List,
837
840
  vendorFiling1099UploadDetailsState: vendorFiling1099UploadDetails,
838
841
  vendorsTabVendorViewState: vendorsTabVendorView,
@@ -0,0 +1,197 @@
1
+ import { createSlice } from '@reduxjs/toolkit';
2
+ import { clearAll } from '../../rootActions';
3
+ import { CUSTOMER_REVENUE_KEYS, } from './customerSummaryViewState';
4
+ export const initialState = {
5
+ customers: [],
6
+ detailById: {},
7
+ fetchState: 'Not-Started',
8
+ searchString: '',
9
+ selectedTabType: 'income_transactions',
10
+ totalCount: 0,
11
+ trendFilter: 'last_12_months',
12
+ uiState: {
13
+ pageToken: null,
14
+ revenueSelection: 'year_to_date_revenue',
15
+ scrollYOffset: 0,
16
+ sortKey: 'year_to_date_revenue',
17
+ sortOrder: 'descending',
18
+ },
19
+ allTransactionsTabData: undefined,
20
+ detailCustomerId: undefined,
21
+ error: undefined,
22
+ };
23
+ export const toCustomerSummary = (payload) => ({
24
+ id: payload.customer_id,
25
+ qboId: payload.qbo_id ?? undefined,
26
+ name: payload.customer_name ?? '',
27
+ balance: payload.balance ?? 0,
28
+ currencyCode: payload.currency_code ?? undefined,
29
+ currencySymbol: payload.currency_symbol ?? undefined,
30
+ revenue: Object.fromEntries(CUSTOMER_REVENUE_KEYS.map((key) => [key, payload[key] ?? 0])),
31
+ account: payload.account?.account_id != null
32
+ ? {
33
+ id: payload.account.account_id,
34
+ name: payload.account.account_name ?? '',
35
+ }
36
+ : undefined,
37
+ accountingClass: payload.accounting_class?.accounting_class_id != null
38
+ ? {
39
+ id: payload.accounting_class.accounting_class_id,
40
+ name: payload.accounting_class.accounting_class_name ?? '',
41
+ }
42
+ : undefined,
43
+ });
44
+ const getDetail = (draft, customerId) => {
45
+ var _a;
46
+ return ((_a = draft.detailById)[customerId] ?? (_a[customerId] = {
47
+ fetchState: 'Not-Started',
48
+ saveState: 'Not-Started',
49
+ }));
50
+ };
51
+ const customerSummaryView = createSlice({
52
+ name: 'customerSummaryView',
53
+ initialState,
54
+ reducers: {
55
+ fetchCustomerSummaryList: {
56
+ prepare(keepExistingListItems, searchString = '', pageToken = null) {
57
+ return { payload: { keepExistingListItems, pageToken, searchString } };
58
+ },
59
+ reducer(draft, action) {
60
+ const { keepExistingListItems, pageToken, searchString } = action.payload;
61
+ // Load-more while a page is in flight: keep that page (the epic drops this fetch too).
62
+ if (keepExistingListItems && draft.fetchState === 'In-Progress') {
63
+ return;
64
+ }
65
+ if (!keepExistingListItems) {
66
+ draft.customers = [];
67
+ draft.uiState.scrollYOffset = 0;
68
+ }
69
+ draft.searchString = searchString;
70
+ draft.uiState.pageToken = pageToken;
71
+ draft.fetchState = 'In-Progress';
72
+ draft.error = undefined;
73
+ },
74
+ },
75
+ updateCustomerSummaryList: {
76
+ prepare(response, keepExistingListItems) {
77
+ return { payload: { keepExistingListItems, response } };
78
+ },
79
+ reducer(draft, action) {
80
+ const { response, keepExistingListItems } = action.payload;
81
+ const customers = (response.data?.customers ?? []).map(toCustomerSummary);
82
+ const existingIds = new Set(draft.customers.map(({ id }) => id));
83
+ draft.customers = keepExistingListItems
84
+ ? [
85
+ ...draft.customers,
86
+ ...customers.filter(({ id }) => !existingIds.has(id)),
87
+ ]
88
+ : customers;
89
+ draft.totalCount = response.data?.total_count ?? 0;
90
+ draft.uiState.pageToken = response.data?.query?.page_token ?? null;
91
+ draft.fetchState = 'Completed';
92
+ },
93
+ },
94
+ updateCustomerSummaryListFailure(draft, action) {
95
+ draft.fetchState = 'Error';
96
+ draft.error = action.payload;
97
+ // No more pages after a failure, so load-more doesn't keep retrying.
98
+ draft.uiState.pageToken = null;
99
+ },
100
+ updateCustomerSummarySortUiState: {
101
+ prepare(sortKey, sortOrder) {
102
+ return { payload: { sortKey, sortOrder } };
103
+ },
104
+ reducer(draft, action) {
105
+ draft.uiState.sortKey = action.payload.sortKey;
106
+ draft.uiState.sortOrder = action.payload.sortOrder;
107
+ },
108
+ },
109
+ updateCustomerSummaryRevenueSelection(draft, action) {
110
+ draft.uiState.revenueSelection = action.payload;
111
+ },
112
+ updateCustomerSummaryScrollYOffset(draft, action) {
113
+ draft.uiState.scrollYOffset = action.payload;
114
+ },
115
+ fetchCustomerSummaryDetail(draft, action) {
116
+ const detail = getDetail(draft, action.payload);
117
+ detail.fetchState = 'In-Progress';
118
+ detail.error = undefined;
119
+ },
120
+ updateCustomerSummaryDetail: {
121
+ prepare(customerId, customer) {
122
+ return { payload: { customer, customerId } };
123
+ },
124
+ reducer(draft, action) {
125
+ const detail = getDetail(draft, action.payload.customerId);
126
+ detail.customer = toCustomerSummary(action.payload.customer);
127
+ detail.fetchState = 'Completed';
128
+ // Keep the list row in sync after an edit.
129
+ const index = draft.customers.findIndex(({ id }) => id === action.payload.customerId);
130
+ if (index >= 0) {
131
+ draft.customers[index] = {
132
+ ...draft.customers[index],
133
+ account: detail.customer.account,
134
+ accountingClass: detail.customer.accountingClass,
135
+ };
136
+ }
137
+ },
138
+ },
139
+ updateCustomerSummaryDetailFailure: {
140
+ prepare(customerId, status) {
141
+ return { payload: { customerId, status } };
142
+ },
143
+ reducer(draft, action) {
144
+ const detail = getDetail(draft, action.payload.customerId);
145
+ detail.fetchState = 'Error';
146
+ detail.error = action.payload.status;
147
+ },
148
+ },
149
+ saveCustomerSummaryDetail: {
150
+ prepare(customerId, changes) {
151
+ return { payload: { changes, customerId } };
152
+ },
153
+ reducer(draft, action) {
154
+ getDetail(draft, action.payload.customerId).saveState = 'In-Progress';
155
+ },
156
+ },
157
+ updateCustomerSummarySaveState: {
158
+ prepare(customerId, saveState) {
159
+ return { payload: { customerId, saveState } };
160
+ },
161
+ reducer(draft, action) {
162
+ getDetail(draft, action.payload.customerId).saveState =
163
+ action.payload.saveState;
164
+ },
165
+ },
166
+ updateCustomerAllTransactionsTabData(draft, action) {
167
+ draft.allTransactionsTabData = action.payload;
168
+ },
169
+ updateCustomerDetailSelectedTab(draft, action) {
170
+ draft.selectedTabType = action.payload;
171
+ },
172
+ updateCustomerTrendFilter(draft, action) {
173
+ draft.trendFilter = action.payload;
174
+ },
175
+ // Detail page opened for `customerId`: a different customer starts from the default filter / tab /
176
+ // transactions window / save state; the same one (e.g. back from a transaction) keeps them.
177
+ resetCustomerSummaryDetailUiState(draft, action) {
178
+ if (draft.detailCustomerId === action.payload) {
179
+ return;
180
+ }
181
+ draft.detailCustomerId = action.payload;
182
+ draft.trendFilter = initialState.trendFilter;
183
+ draft.selectedTabType = initialState.selectedTabType;
184
+ draft.allTransactionsTabData = undefined;
185
+ Object.values(draft.detailById).forEach((detail) => {
186
+ detail.saveState = 'Not-Started';
187
+ });
188
+ },
189
+ },
190
+ extraReducers: (builder) => {
191
+ builder.addCase(clearAll, (draft) => {
192
+ Object.assign(draft, initialState);
193
+ });
194
+ },
195
+ });
196
+ export const { fetchCustomerSummaryList, updateCustomerSummaryList, updateCustomerSummaryListFailure, updateCustomerSummarySortUiState, updateCustomerSummaryRevenueSelection, updateCustomerSummaryScrollYOffset, fetchCustomerSummaryDetail, updateCustomerSummaryDetail, updateCustomerSummaryDetailFailure, saveCustomerSummaryDetail, updateCustomerSummarySaveState, updateCustomerDetailSelectedTab, updateCustomerAllTransactionsTabData, updateCustomerTrendFilter, resetCustomerSummaryDetailUiState, } = customerSummaryView.actions;
197
+ export default customerSummaryView.reducer;
@@ -0,0 +1,35 @@
1
+ import { createSelector } from '@reduxjs/toolkit';
2
+ import { getIsAccountingClassesEnabled } from '../../entity/tenant/tenantSelector';
3
+ import { getNestedAccountListHierarchy } from '../accountList/accountListSelector';
4
+ import { getNestedClassListHierarchy } from '../classList/classListSelector';
5
+ const isLoadingFetchState = (fetchState) => fetchState === 'Not-Started' || fetchState === 'In-Progress';
6
+ const NOT_STARTED_DETAIL = {
7
+ fetchState: 'Not-Started',
8
+ saveState: 'Not-Started',
9
+ };
10
+ export const getCustomerSummaryList = (state) => state.customerSummaryViewState;
11
+ export const getCustomerSummaryDetail = createSelector((state, customerId) => state.customerSummaryViewState.detailById[customerId], (state) => state.accountListState, (state) => state.classListState, getIsAccountingClassesEnabled, (detail, accountListState, classListState, isAccountingClassesEnabled) => ({
12
+ ...(detail ?? NOT_STARTED_DETAIL),
13
+ accountsHierarchyList: getNestedAccountListHierarchy(accountListState, 'accountList'),
14
+ classHierarchyList: getNestedClassListHierarchy(classListState),
15
+ isAccountingClassesEnabled,
16
+ isReferenceDataLoading: isLoadingFetchState(accountListState.byReportId.accountList.fetchState) ||
17
+ (isAccountingClassesEnabled &&
18
+ isLoadingFetchState(classListState.fetchState)),
19
+ }));
20
+ export const getCustomerSummarySelectedTabType = (state) => state.customerSummaryViewState.selectedTabType;
21
+ export const getCustomerSummaryAllTransactionsTabData = (state) => state.customerSummaryViewState.allTransactionsTabData;
22
+ export const getCustomerSummaryTrendFilter = (state) => state.customerSummaryViewState.trendFilter;
23
+ // Roles holding the customers / customers.read_only scopes (tenant role_scopes_v32). Same roles as the
24
+ // Vendors tab today, kept separate so AR access can diverge; bookkeeping_user is read-only.
25
+ export const isCustomersTabVisible = (roleMap) => [
26
+ 'admin',
27
+ 'bookkeeping_admin',
28
+ 'bookkeeping_user',
29
+ 'ap_analyst',
30
+ 'controller',
31
+ 'customer_success_manager',
32
+ 'reviewer',
33
+ 'tax_lead',
34
+ 'preparer',
35
+ ].some((role) => roleMap?.[role] === true);
@@ -0,0 +1,10 @@
1
+ export const CUSTOMER_REVENUE_KEYS = [
2
+ 'last_90_days_revenue',
3
+ 'last_30_days_revenue',
4
+ 'year_to_date_revenue',
5
+ 'last_month_revenue',
6
+ 'last_3_months_revenue',
7
+ 'last_6_months_revenue',
8
+ 'last_12_months_revenue',
9
+ 'previous_year_revenue',
10
+ ];
@@ -0,0 +1,30 @@
1
+ import { concat, from, of } from 'rxjs';
2
+ import { catchError, filter, map, mergeMap } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
+ import { fetchAccountList } from '../../accountList/accountListReducer';
5
+ import { fetchClassList } from '../../classList/classListReducer';
6
+ import { fetchCustomerSummaryDetail, updateCustomerSummaryDetail, updateCustomerSummaryDetailFailure, } from '../customerSummaryViewReducer';
7
+ export const fetchCustomerSummaryDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCustomerSummaryDetail.match), mergeMap(({ payload: customerId }) => {
8
+ // Category / class pickers on the detail page need the account and class lists.
9
+ const { accountListState, classListState } = state$.value;
10
+ const listActions = [];
11
+ const accountList = accountListState.byReportId.accountList;
12
+ if (!accountList.hasValidState() &&
13
+ accountList.fetchState !== 'In-Progress') {
14
+ listActions.push(fetchAccountList('accountList', true));
15
+ }
16
+ if (!classListState.hasValidState() &&
17
+ classListState.fetchState !== 'In-Progress') {
18
+ listActions.push(fetchClassList());
19
+ }
20
+ const customer$ = zeniAPI
21
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/customers/summary/${encodeURIComponent(customerId)}`)
22
+ .pipe(map((response) => {
23
+ const customer = response.data?.customers?.[0];
24
+ return isSuccessResponse(response) && customer != null
25
+ ? updateCustomerSummaryDetail(customerId, customer)
26
+ : updateCustomerSummaryDetailFailure(customerId, response.status);
27
+ }), catchError((error) => of(updateCustomerSummaryDetailFailure(customerId, createZeniAPIStatus('Unexpected Error', 'Fetch customer summary REST API call errored out' +
28
+ JSON.stringify(error))))));
29
+ return concat(from(listActions), customer$);
30
+ }));
@@ -0,0 +1,27 @@
1
+ import { of } from 'rxjs';
2
+ import { catchError, exhaustMap, filter, map, startWith, switchMap, } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
+ import { fetchCustomerSummaryList, updateCustomerSummaryList, updateCustomerSummaryListFailure, } from '../customerSummaryViewReducer';
5
+ export const fetchCustomerSummaryListEpic = (actions$, state$, zeniAPI) => {
6
+ const fetch$ = actions$.pipe(filter(fetchCustomerSummaryList.match));
7
+ const fetchPage = (action) => {
8
+ const { keepExistingListItems, pageToken, searchString } = action.payload;
9
+ const { uiState } = state$.value.customerSummaryViewState;
10
+ const query = {
11
+ page_token: pageToken,
12
+ sort_by: uiState.sortKey,
13
+ sort_order: uiState.sortOrder === 'ascending' ? 'asc' : 'desc',
14
+ search_text: searchString,
15
+ };
16
+ return zeniAPI
17
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/customers/summary?query=${encodeURIComponent(JSON.stringify(query))}`)
18
+ .pipe(map((response) => isSuccessResponse(response)
19
+ ? updateCustomerSummaryList(response, keepExistingListItems)
20
+ : updateCustomerSummaryListFailure(response.status)), catchError((error) => of(updateCustomerSummaryListFailure(createZeniAPIStatus('Unexpected Error', 'Fetch customer summary list REST API call errored out' +
21
+ JSON.stringify(error))))));
22
+ };
23
+ // A new search / sort cancels whatever is in flight; a load-more is dropped while any page is in flight
24
+ // (the reducer ignores it too), so the in-flight page isn't restarted.
25
+ const loadMore$ = fetch$.pipe(filter(({ payload }) => payload.keepExistingListItems));
26
+ return fetch$.pipe(filter(({ payload }) => !payload.keepExistingListItems), map((action) => loadMore$.pipe(startWith(action))), startWith(loadMore$), switchMap((fetches$) => fetches$.pipe(exhaustMap(fetchPage))));
27
+ };
@@ -0,0 +1,44 @@
1
+ import { from } from 'rxjs';
2
+ import { catchError, concatMap, filter, mergeMap } from 'rxjs/operators';
3
+ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
4
+ import { isSuccessResponse } from '../../../responsePayload';
5
+ import { saveCustomerSummaryDetail, updateCustomerSummaryDetail, updateCustomerSummarySaveState, } from '../customerSummaryViewReducer';
6
+ // Zeni-only edit of a customer's default category / class from the Customers tab.
7
+ export const saveCustomerSummaryDetailEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(saveCustomerSummaryDetail.match),
8
+ // concatMap: quick successive saves resolve in order, so the latest one wins
9
+ concatMap(({ payload: { customerId, changes } }) => {
10
+ const failure = () => [
11
+ updateCustomerSummarySaveState(customerId, 'Error'),
12
+ openSnackbar({
13
+ messageSection: 'update_customer',
14
+ messageText: 'failed',
15
+ type: 'error',
16
+ }),
17
+ ];
18
+ return zeniAPI
19
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/customers/summary/${encodeURIComponent(customerId)}`,
20
+ // Only the changed fields: an omitted one keeps its (possibly history-based) default
21
+ {
22
+ ...(changes.accountId !== undefined
23
+ ? { account_id: changes.accountId }
24
+ : {}),
25
+ ...(changes.accountingClassId !== undefined
26
+ ? { accounting_class_id: changes.accountingClassId }
27
+ : {}),
28
+ })
29
+ .pipe(mergeMap((response) => {
30
+ const customer = response.data?.customers?.[0];
31
+ if (!isSuccessResponse(response) || customer == null) {
32
+ return from(failure());
33
+ }
34
+ return from([
35
+ updateCustomerSummaryDetail(customerId, customer),
36
+ updateCustomerSummarySaveState(customerId, 'Completed'),
37
+ openSnackbar({
38
+ messageSection: 'update_customer',
39
+ messageText: 'success',
40
+ type: 'success',
41
+ }),
42
+ ]);
43
+ }), catchError(() => from(failure())));
44
+ }));
@@ -26,9 +26,10 @@ export const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => action
26
26
  }
27
27
  let fetchState;
28
28
  if (accountId != null) {
29
+ // Period bucket can be unhydrated during app-shell load.
29
30
  fetchState =
30
31
  accountReconciliationRecords[toMonthYearPeriodId(selectedPeriod)]
31
- .reconciliationByAccountID[accountId].transactionFetchState
32
+ ?.reconciliationByAccountID[accountId]?.transactionFetchState
32
33
  .fetchState;
33
34
  }
34
35
  else {
@@ -1,16 +1,38 @@
1
1
  import { concat, from, of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { toTimePeriod, } from '../../commonStateTypes/timeframeTick';
4
+ import { getCustomerIncomeTrendKey } from '../../entity/customerIncome/customerIncomeTrendKey';
3
5
  import { updateCustomerIncomeTrend } from '../../entity/customerIncome/customerIncomeTrendReducer';
4
6
  import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
5
7
  import { date as zeniDate } from '../../zeniDayJS';
6
8
  import { fetchIncomeTrend, updateTrendFailure, updateTrendSuccess, } from './trendReducer';
7
- export const fetchIncomeTrendEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(fetchIncomeTrend.match), mergeMap((action) => {
8
- const { customerId, customerName } = action.payload;
9
+ export const fetchIncomeTrendEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchIncomeTrend.match),
10
+ // switchMap: a late response for the previously selected customer must not land on the current one
11
+ switchMap((action) => {
12
+ const { customerId, customerName, dateRange } = action.payload;
13
+ // Customers tab: the trend for this exact range is already loaded (e.g. back from a transaction) ->
14
+ // just re-select it instead of re-running the live QBO report
15
+ const requestedPeriod = dateRange != null
16
+ ? {
17
+ startDate: zeniDate(dateRange.startDate),
18
+ endDate: zeniDate(dateRange.endDate),
19
+ }
20
+ : undefined;
21
+ if (requestedPeriod != null) {
22
+ const key = getCustomerIncomeTrendKey(customerId, toTimePeriod(requestedPeriod));
23
+ if (state$.value.customerIncomeState.customerIncomeTrendByPeriod[key] !=
24
+ null) {
25
+ return of(updateTrendSuccess(requestedPeriod));
26
+ }
27
+ }
9
28
  const query = {
10
29
  entity_id: customerId,
11
30
  entity_type: 'customer',
12
31
  customer_id: customerId,
13
32
  customer_name: customerName,
33
+ ...(dateRange != null
34
+ ? { start_date: dateRange.startDate, end_date: dateRange.endDate }
35
+ : {}),
14
36
  };
15
37
  const getIncomeTrend$ = zeniAPI
16
38
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reports/income_trend?query=${encodeURIComponent(JSON.stringify(query))}`)
@@ -20,7 +42,7 @@ export const fetchIncomeTrendEpic = (actions$, _, zeniAPI) => actions$.pipe(filt
20
42
  id: customerId,
21
43
  name: customerName,
22
44
  };
23
- return from(updateTrendActions(customer, response));
45
+ return from(updateTrendActions(customer, response, requestedPeriod));
24
46
  }
25
47
  else {
26
48
  return of(updateTrendFailure(action.payload.customerId, response.status));
@@ -33,13 +55,14 @@ export const fetchIncomeTrendEpic = (actions$, _, zeniAPI) => actions$.pipe(filt
33
55
  *
34
56
  * @param customer
35
57
  * @param incomeResponse
58
+ * @param requestedPeriod stored under the requested range (not data_available_*) so the cache lookup hits
36
59
  * @returns actions for updating the trend
37
60
  */
38
- const updateTrendActions = (customer, incomeResponse) => {
61
+ const updateTrendActions = (customer, incomeResponse, requestedPeriod) => {
39
62
  const updateActions = [];
40
63
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
41
64
  /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
42
- const trendPeriod = {
65
+ const trendPeriod = requestedPeriod ?? {
43
66
  startDate: zeniDate(incomeResponse.data?.report.data_available_start_date),
44
67
  endDate: zeniDate(incomeResponse.data?.report.data_available_end_date),
45
68
  };
@@ -14,8 +14,10 @@ const trend = createSlice({
14
14
  initialState: initialTrendState,
15
15
  reducers: {
16
16
  fetchIncomeTrend: {
17
- prepare(customerId, customerName) {
18
- return { payload: { customerId, customerName } };
17
+ prepare(customerId, customerName,
18
+ // ISO dates; omitted = the API default (last 8 months)
19
+ dateRange) {
20
+ return { payload: { customerId, customerName, dateRange } };
19
21
  },
20
22
  reducer(draft, action) {
21
23
  draft.selectedEntity = Object.assign({}, {
package/lib/index.d.ts CHANGED
@@ -831,6 +831,7 @@ export { getTrendWithTransactions, TrendWithTransactionsView, getLatestTimeFrame
831
831
  export { fetchIncomeTrend, fetchExpenseTrend, clearTrendData };
832
832
  export { getTrendForEntity, TrendView, getCurrentFiscalQuarterDateRange };
833
833
  export { CustomerIncomeTrend };
834
+ export type { CustomerIncomeTrendFilter } from './entity/customerIncome/customerIncomeTrend';
834
835
  export { VendorExpenseTrend, VendorExpenseState, VendorSpend };
835
836
  export { Entity, toEntityType, TransactionEntityType };
836
837
  export { fetchEntityAutoCompleteEpic };
@@ -1270,3 +1271,8 @@ export type { ExpenseAutomationActualMatchingMatchView } from './view/expenseAut
1270
1271
  export type { ActualMatchingMatch, ActualMatchingMatchKind, } from './entity/actualMatching/actualMatchingState';
1271
1272
  export type { ActualMatchingMatchId } from './entity/actualMatching/actualMatchingTypes';
1272
1273
  export type { DisplayCurrencyFallback } from './entity/actualMatching/actualMatchingPayload';
1274
+ export { fetchCustomerSummaryDetail, fetchCustomerSummaryList, resetCustomerSummaryDetailUiState, saveCustomerSummaryDetail, updateCustomerAllTransactionsTabData, updateCustomerDetailSelectedTab, updateCustomerSummaryRevenueSelection, updateCustomerSummaryScrollYOffset, updateCustomerSummarySortUiState, updateCustomerTrendFilter, } from './view/customerSummaryView/customerSummaryViewReducer';
1275
+ export { getCustomerSummaryAllTransactionsTabData, getCustomerSummaryDetail, getCustomerSummaryList, getCustomerSummarySelectedTabType, getCustomerSummaryTrendFilter, isCustomersTabVisible, } from './view/customerSummaryView/customerSummaryViewSelector';
1276
+ export type { CustomerSummaryDetailView } from './view/customerSummaryView/customerSummaryViewSelector';
1277
+ export { CUSTOMER_REVENUE_KEYS } from './view/customerSummaryView/customerSummaryViewState';
1278
+ export type { CustomerAllTransactionsTabData, CustomerDetailTabType, CustomerRevenueKey, CustomerSummary, CustomerSummaryDetailChanges, CustomerSummaryDetailState, CustomerSummarySortKey, CustomerSummaryViewState, } from './view/customerSummaryView/customerSummaryViewState';
package/lib/index.js CHANGED
@@ -86,7 +86,7 @@ exports.INVOICING_CUSTOMER_COLUMNS = exports.ALL_INVOICING_CUSTOMER_TAB_IDS = ex
86
86
  exports.fetchInvoicingCreditNoteListPage = exports.fetchInvoicingCreditNoteList = exports.fetchInvoicingCreditNoteCounts = exports.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.getInvoicingTransactionListView = exports.INVOICING_TRANSACTION_COLUMNS = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = exports.updateInvoicingTransactionFilters = exports.setInvoicingTransactionActiveTab = exports.fetchInvoicingTransactionListPage = exports.fetchInvoicingTransactionList = exports.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscriptionFilters = exports.setInvoicingSubscriptionActiveTab = exports.fetchInvoicingSubscriptionListPage = exports.fetchInvoicingSubscriptionList = exports.fetchInvoicingSubscriptionCounts = exports.updateInvoicingSubscriptions = exports.removeInvoicingSubscription = exports.resetPromotionalCreditAction = exports.submitAddPromotionalCredits = exports.getInvoicingSetupIntentFetchState = exports.getInvoicingSetupIntent = exports.getInvoicingSentPaymentLinkMagicUrl = exports.getInvoicingSentPaymentLinkEmail = exports.getInvoicingPlaidLinkToken = exports.getInvoicingPaymentMethodSaveState = exports.getInvoicingPaymentLinkSendState = exports.sendInvoicingPaymentLink = exports.saveInvoicingPaymentMethod = exports.resetInvoicingCustomerPaymentMethod = exports.fetchInvoicingPlaidLinkToken = exports.createInvoicingSetupIntent = exports.fetchInvoicingPaymentLinkEmailPreviewPage = exports.fetchInvoicingCustomerDetailPage = exports.fetchInvoicingCustomerDetail = exports.getInvoicingCustomerListView = void 0;
87
87
  exports.updateInvoicingCatalogItems = exports.removeInvoicingCatalogItem = exports.mergeInvoicingCatalogPricePoint = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetailPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = exports.INVOICING_DUNNING_CASE_COLUMNS = exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = exports.updateInvoicingDunningCaseFilters = exports.setInvoicingDunningCaseActiveTab = exports.fetchInvoicingDunningCaseListPage = exports.fetchInvoicingDunningCaseList = exports.fetchInvoicingDunningCaseCounts = exports.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.fetchInvoicingCouponDetail = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = exports.getInvoicingCouponListItems = exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteListView = exports.INVOICING_CREDIT_NOTE_COLUMNS = exports.ALL_INVOICING_CREDIT_NOTE_TAB_IDS = exports.ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = exports.updateInvoicingCreditNoteFilters = exports.setInvoicingCreditNoteActiveTab = void 0;
88
88
  exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingQboSettingsFormView = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingQboSettingsDraft = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingQboSettings = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = exports.resetSaveInvoicingSettings = exports.resetInvoicingQboSettingsDraft = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.getLowestInvoicingCatalogPricePointAmount = exports.getInvoicingCatalogItemById = exports.fetchInvoicingCatalogItemDetail = exports.getInvoicingCatalogListView = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = void 0;
89
- exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = void 0;
89
+ exports.CUSTOMER_REVENUE_KEYS = exports.isCustomersTabVisible = exports.getCustomerSummaryTrendFilter = exports.getCustomerSummarySelectedTabType = exports.getCustomerSummaryList = exports.getCustomerSummaryDetail = exports.getCustomerSummaryAllTransactionsTabData = exports.updateCustomerTrendFilter = exports.updateCustomerSummarySortUiState = exports.updateCustomerSummaryScrollYOffset = exports.updateCustomerSummaryRevenueSelection = exports.updateCustomerDetailSelectedTab = exports.updateCustomerAllTransactionsTabData = exports.saveCustomerSummaryDetail = exports.resetCustomerSummaryDetailUiState = exports.fetchCustomerSummaryList = exports.fetchCustomerSummaryDetail = exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = void 0;
90
90
  const allowedValue_1 = require("./commonStateTypes/allowedValue");
91
91
  Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
92
92
  Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
@@ -3282,3 +3282,23 @@ Object.defineProperty(exports, "getExpenseAutomationActualMatchingView", { enume
3282
3282
  Object.defineProperty(exports, "isAutoReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isAutoReversedAccrual; } });
3283
3283
  Object.defineProperty(exports, "isManuallyReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isManuallyReversedAccrual; } });
3284
3284
  Object.defineProperty(exports, "isPendingReviewAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isPendingReviewAccrual; } });
3285
+ var customerSummaryViewReducer_1 = require("./view/customerSummaryView/customerSummaryViewReducer");
3286
+ Object.defineProperty(exports, "fetchCustomerSummaryDetail", { enumerable: true, get: function () { return customerSummaryViewReducer_1.fetchCustomerSummaryDetail; } });
3287
+ Object.defineProperty(exports, "fetchCustomerSummaryList", { enumerable: true, get: function () { return customerSummaryViewReducer_1.fetchCustomerSummaryList; } });
3288
+ Object.defineProperty(exports, "resetCustomerSummaryDetailUiState", { enumerable: true, get: function () { return customerSummaryViewReducer_1.resetCustomerSummaryDetailUiState; } });
3289
+ Object.defineProperty(exports, "saveCustomerSummaryDetail", { enumerable: true, get: function () { return customerSummaryViewReducer_1.saveCustomerSummaryDetail; } });
3290
+ Object.defineProperty(exports, "updateCustomerAllTransactionsTabData", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerAllTransactionsTabData; } });
3291
+ Object.defineProperty(exports, "updateCustomerDetailSelectedTab", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerDetailSelectedTab; } });
3292
+ Object.defineProperty(exports, "updateCustomerSummaryRevenueSelection", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerSummaryRevenueSelection; } });
3293
+ Object.defineProperty(exports, "updateCustomerSummaryScrollYOffset", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerSummaryScrollYOffset; } });
3294
+ Object.defineProperty(exports, "updateCustomerSummarySortUiState", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerSummarySortUiState; } });
3295
+ Object.defineProperty(exports, "updateCustomerTrendFilter", { enumerable: true, get: function () { return customerSummaryViewReducer_1.updateCustomerTrendFilter; } });
3296
+ var customerSummaryViewSelector_1 = require("./view/customerSummaryView/customerSummaryViewSelector");
3297
+ Object.defineProperty(exports, "getCustomerSummaryAllTransactionsTabData", { enumerable: true, get: function () { return customerSummaryViewSelector_1.getCustomerSummaryAllTransactionsTabData; } });
3298
+ Object.defineProperty(exports, "getCustomerSummaryDetail", { enumerable: true, get: function () { return customerSummaryViewSelector_1.getCustomerSummaryDetail; } });
3299
+ Object.defineProperty(exports, "getCustomerSummaryList", { enumerable: true, get: function () { return customerSummaryViewSelector_1.getCustomerSummaryList; } });
3300
+ Object.defineProperty(exports, "getCustomerSummarySelectedTabType", { enumerable: true, get: function () { return customerSummaryViewSelector_1.getCustomerSummarySelectedTabType; } });
3301
+ Object.defineProperty(exports, "getCustomerSummaryTrendFilter", { enumerable: true, get: function () { return customerSummaryViewSelector_1.getCustomerSummaryTrendFilter; } });
3302
+ Object.defineProperty(exports, "isCustomersTabVisible", { enumerable: true, get: function () { return customerSummaryViewSelector_1.isCustomersTabVisible; } });
3303
+ var customerSummaryViewState_1 = require("./view/customerSummaryView/customerSummaryViewState");
3304
+ Object.defineProperty(exports, "CUSTOMER_REVENUE_KEYS", { enumerable: true, get: function () { return customerSummaryViewState_1.CUSTOMER_REVENUE_KEYS; } });
package/lib/reducer.d.ts CHANGED
@@ -188,6 +188,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
188
188
  vendorFirstReviewViewState: import("./view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState").VendorFirstReviewViewState;
189
189
  vendorGlobalReviewViewState: import(".").VendorGlobalReviewViewState;
190
190
  vendorListState: import("./view/vendorList/vendorListState").VendorListState;
191
+ customerSummaryViewState: import(".").CustomerSummaryViewState;
191
192
  vendorFiling1099ListState: import("./view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState").VendorFiling1099ListState;
192
193
  vendorFiling1099UploadDetailsState: import(".").VendorFiling1099UploadDetailsState;
193
194
  vendorsTabVendorViewState: import("./view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState").VendorsTabVendorViewState;
package/lib/reducer.js CHANGED
@@ -155,6 +155,7 @@ const companyTaskManagerViewReducer_1 = __importStar(require("./view/companyTask
155
155
  const companyViewReducer_1 = __importStar(require("./view/companyView/companyViewReducer"));
156
156
  const createTransferEntryReducer_1 = __importStar(require("./view/createTransferEntry/createTransferEntryReducer"));
157
157
  const creditAgentViewReducer_1 = __importStar(require("./view/creditAgentView/creditAgentViewReducer"));
158
+ const customerSummaryViewReducer_1 = __importStar(require("./view/customerSummaryView/customerSummaryViewReducer"));
158
159
  const dashboardReducer_1 = __importStar(require("./view/dashboard/dashboardReducer"));
159
160
  const dashboardLayoutReducer_1 = __importStar(require("./view/dashboardLayout/dashboardLayoutReducer"));
160
161
  const expenseAutomationViewReducer_1 = __importStar(require("./view/expenseAutomationView/expenseAutomationViewReducer"));
@@ -584,6 +585,7 @@ const initialViewsState = {
584
585
  vendorFirstReviewViewState: vendorFirstReviewViewReducer_1.initialState,
585
586
  vendorGlobalReviewViewState: vendorGlobalReviewViewReducer_1.initialState,
586
587
  vendorListState: vendorListReducer_1.initialState,
588
+ customerSummaryViewState: customerSummaryViewReducer_1.initialState,
587
589
  vendorFiling1099ListState: vendorFiling1099ListReducer_1.initialState,
588
590
  vendorFiling1099UploadDetailsState: vendorFiling1099UploadDetailsReducer_1.initialState,
589
591
  vendorsTabVendorViewState: vendorsTabVendorViewReducer_1.initialState,
@@ -872,6 +874,7 @@ const viewReducers = {
872
874
  vendorFirstReviewViewState: vendorFirstReviewViewReducer_1.default,
873
875
  vendorGlobalReviewViewState: vendorGlobalReviewViewReducer_1.default,
874
876
  vendorListState: vendorListReducer_1.default,
877
+ customerSummaryViewState: customerSummaryViewReducer_1.default,
875
878
  vendorFiling1099ListState: vendorFiling1099ListReducer_1.default,
876
879
  vendorFiling1099UploadDetailsState: vendorFiling1099UploadDetailsReducer_1.default,
877
880
  vendorsTabVendorViewState: vendorsTabVendorViewReducer_1.default,
@@ -114,6 +114,7 @@ import { CompanyTaskManagerViewState } from './view/companyTaskManagerView/compa
114
114
  import { CompanyViewState } from './view/companyView/companyViewState';
115
115
  import { CreateTransferEntryState } from './view/createTransferEntry/createTransferEntryState';
116
116
  import { CreditAgentViewState } from './view/creditAgentView/creditAgentViewState';
117
+ import { CustomerSummaryViewState } from './view/customerSummaryView/customerSummaryViewState';
117
118
  import { DashboardState } from './view/dashboard/dashboardState';
118
119
  import { DashboardLayoutState } from './view/dashboardLayout/dashboardLayoutState';
119
120
  import { ExpenseAutomationViewState } from './view/expenseAutomationView/expenseAutomationViewState';
@@ -413,6 +414,7 @@ export type ViewsState = {
413
414
  createTransferEntryState: CreateTransferEntryState;
414
415
  creditAgentEntityState: CreditAgentEntityState;
415
416
  creditAgentViewState: CreditAgentViewState;
417
+ customerSummaryViewState: CustomerSummaryViewState;
416
418
  dashboardLayoutState: DashboardLayoutState;
417
419
  dashboardState: DashboardState;
418
420
  depositAccountListState: DepositAccountListState;
@@ -36,8 +36,8 @@ export declare const fetchVendorsTabVendorDetails: import("@reduxjs/toolkit").Ac
36
36
  }, "vendorsTabVendorView/fetchVendorsTabVendorDetailPageView", never, never>, updateVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
37
37
  numberOfQuartersFetched: number;
38
38
  timePeriod: TimePeriod;
39
- }, "vendorsTabVendorView/updateVendorsTabVendorAllTransactionsTabData">, resetSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetSelectedTabType">, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", "vendorsTabVendorView/updateSelectedTabType">, updateVendorSpendTrendFilterTabValue: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year"], {
40
- vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year";
39
+ }, "vendorsTabVendorView/updateVendorsTabVendorAllTransactionsTabData">, resetSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetSelectedTabType">, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", "vendorsTabVendorView/updateSelectedTabType">, updateVendorSpendTrendFilterTabValue: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorSpendTrendfilterTabValue: "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_month" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year"], {
40
+ vendorSpendTrendfilterTabValue: "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_month" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year";
41
41
  }, "vendorsTabVendorView/updateVendorSpendTrendFilterTabValue", never, never>, resetVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetVendorsTabVendorAllTransactionsTabData">, updateContactsInVendorTabDetailLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
42
42
  vendorId: ID;
43
43
  localData?: Partial<VendorsTabVendorDetailLocalData>;