@zeniai/client-epic-state 5.3.20 → 5.3.21

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 (57) hide show
  1. package/lib/entity/genericEntity/customerWithSubCustomersId.d.ts +7 -0
  2. package/lib/entity/genericEntity/customerWithSubCustomersId.js +17 -0
  3. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  4. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  5. package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +6 -4
  6. package/lib/entity/tenant/tenantPayload.d.ts +6 -0
  7. package/lib/entity/tenant/tenantPayload.js +5 -0
  8. package/lib/entity/tenant/tenantReducer.d.ts +6 -2
  9. package/lib/entity/tenant/tenantReducer.js +32 -5
  10. package/lib/entity/tenant/tenantSelector.d.ts +2 -1
  11. package/lib/entity/tenant/tenantSelector.js +4 -1
  12. package/lib/entity/tenant/tenantState.d.ts +10 -0
  13. package/lib/entity/tenant/tenantState.js +5 -0
  14. package/lib/epic.d.ts +2 -1
  15. package/lib/epic.js +2 -0
  16. package/lib/esm/entity/genericEntity/customerWithSubCustomersId.js +12 -0
  17. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  18. package/lib/esm/entity/tenant/epic/fetchAllTenantsEpic.js +6 -4
  19. package/lib/esm/entity/tenant/tenantPayload.js +4 -1
  20. package/lib/esm/entity/tenant/tenantReducer.js +31 -4
  21. package/lib/esm/entity/tenant/tenantSelector.js +2 -0
  22. package/lib/esm/entity/tenant/tenantState.js +4 -1
  23. package/lib/esm/epic.js +2 -0
  24. package/lib/esm/index.js +7 -6
  25. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  26. package/lib/esm/view/companyView/epic/companyPassport/updateCustomersTabSettingEpic.js +47 -0
  27. package/lib/esm/view/companyView/selector/companyPassportViewSelector.js +2 -0
  28. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  29. package/lib/esm/view/customerSummaryView/customerSummaryViewReducer.js +39 -6
  30. package/lib/esm/view/customerSummaryView/customerSummaryViewSelector.js +41 -11
  31. package/lib/esm/view/customerSummaryView/epic/fetchCustomerSummaryListEpic.js +6 -1
  32. package/lib/esm/view/transactionList/fetchTransactionListByEntityEpic.js +11 -2
  33. package/lib/esm/view/transactionList/transactionListReducer.js +24 -15
  34. package/lib/esm/view/trend/fetchIncomeTrendEpic.js +6 -2
  35. package/lib/index.d.ts +9 -8
  36. package/lib/index.js +53 -46
  37. package/lib/view/companyView/companyViewReducer.d.ts +8 -1
  38. package/lib/view/companyView/companyViewReducer.js +28 -3
  39. package/lib/view/companyView/epic/companyPassport/updateCustomersTabSettingEpic.d.ts +11 -0
  40. package/lib/view/companyView/epic/companyPassport/updateCustomersTabSettingEpic.js +51 -0
  41. package/lib/view/companyView/selector/companyPassportViewSelector.d.ts +1 -0
  42. package/lib/view/companyView/selector/companyPassportViewSelector.js +4 -1
  43. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  44. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  45. package/lib/view/customerSummaryView/customerSummaryViewPayload.d.ts +20 -1
  46. package/lib/view/customerSummaryView/customerSummaryViewReducer.d.ts +3 -1
  47. package/lib/view/customerSummaryView/customerSummaryViewReducer.js +42 -6
  48. package/lib/view/customerSummaryView/customerSummaryViewSelector.d.ts +13 -1
  49. package/lib/view/customerSummaryView/customerSummaryViewSelector.js +45 -12
  50. package/lib/view/customerSummaryView/customerSummaryViewState.d.ts +24 -10
  51. package/lib/view/customerSummaryView/epic/fetchCustomerSummaryListEpic.js +6 -1
  52. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  53. package/lib/view/transactionList/fetchTransactionListByEntityEpic.js +11 -2
  54. package/lib/view/transactionList/transactionListReducer.d.ts +3 -1
  55. package/lib/view/transactionList/transactionListReducer.js +24 -15
  56. package/lib/view/trend/fetchIncomeTrendEpic.js +6 -2
  57. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.dismissCapitalizationOnboarding = exports.updateCapitalizationAccountThresholdFailure = exports.updateCapitalizationAccountThresholdSuccess = exports.updateCapitalizationAccountThreshold = exports.clearQboProjectsReconnectRequest = exports.requestQboProjectsReconnect = exports.updateAccountingProjectsEnabledFailure = exports.updateAccountingProjectsEnabledSuccess = exports.disableAccountingProjects = exports.resumeEnableAccountingProjects = exports.enableAccountingProjects = exports.updateCompanyQboRealmIdFailure = exports.updateCompanyQboRealmIdSuccess = exports.updateCompanyQboRealmId = exports.updateCompanyProductServicesFailure = exports.updateCompanyProductServicesSuccess = exports.updateCompanyProductServices = exports.updateAutoReviewIncomeWithoutCustomerFailure = exports.updateAutoReviewIncomeWithoutCustomerSuccess = exports.updateAutoReviewIncomeWithoutCustomer = exports.updateAccountingClassesEnabledFailure = exports.updateAccountingClassesEnabledSuccess = exports.updateAccountingClassesEnabled = exports.companyPassportUpdateCompanyDetailsFailure = exports.companyPassportUpdateCompanyDetailsSuccess = exports.companyPassportUpdateCompanyDetails = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.companyPassportSaveDataInLocalStore = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.updateZeniUsersOnFailure = exports.updateZeniUsersOnSuccess = exports.fetchZeniUsers = exports.fetchCompanyPortfolioView = exports.updateCompanyViewOnFailure = exports.updateCompanyViewOnSuccess = exports.companyManagementSaveUpdatesFailure = exports.companyManagementSaveUpdatesSuccess = exports.companyManagementDiscardUpdates = exports.companyManagementSavePendingUpdates = exports.companyManagementSaveUpdates = exports.fetchCompanyManagementView = exports.fetchPortfolioView = exports.fetchSubscriptionView = exports.fetchManagementView = exports.fetchOnboardingView = exports.fetchAllCockpitViews = exports.fetchCompanyPassportView = exports.initialState = void 0;
5
- exports.updateMetaDataOnSendMonthEndReport = exports.updateCompanyMetaDataOnFailure = exports.updateCompanyMetaDataOnSuccess = exports.fetchCompanyMetaData = exports.updateCompanyDownloadState = exports.updateParentSubsidiaryViewOnFailure = exports.updateParentSubsidiaryView = exports.fetchParentSubsidiaryManagementView = exports.saveCompanyPassportDetails = exports.saveIndustryAndIncDateInCompanyPassportLocalStore = exports.updateCompanyPassportLocalStoreData = exports.companyPassportCreateCompanyOfficersFailure = exports.companyPassportCreateCompanyOfficersSuccess = exports.companyPassportCreateCompanyOfficers = exports.companyPassportUpdateCompanyOfficerFailure = exports.companyPassportUpdateCompanyOfficerSuccess = exports.companyPassportUpdateCompanyOfficer = exports.companyPassportUpdatePrimaryContactFailure = exports.companyPassportUpdatePrimaryContactSuccess = exports.companyPassportUpdatePrimaryContact = void 0;
4
+ exports.updateCapitalizationAccountThreshold = exports.clearQboProjectsReconnectRequest = exports.requestQboProjectsReconnect = exports.updateAccountingProjectsEnabledFailure = exports.updateAccountingProjectsEnabledSuccess = exports.disableAccountingProjects = exports.resumeEnableAccountingProjects = exports.enableAccountingProjects = exports.updateCompanyQboRealmIdFailure = exports.updateCompanyQboRealmIdSuccess = exports.updateCompanyQboRealmId = exports.updateCompanyProductServicesFailure = exports.updateCompanyProductServicesSuccess = exports.updateCompanyProductServices = exports.updateCustomersTabSettingFailure = exports.updateCustomersTabSettingSuccess = exports.updateCustomersTabSetting = exports.updateAutoReviewIncomeWithoutCustomerFailure = exports.updateAutoReviewIncomeWithoutCustomerSuccess = exports.updateAutoReviewIncomeWithoutCustomer = exports.updateAccountingClassesEnabledFailure = exports.updateAccountingClassesEnabledSuccess = exports.updateAccountingClassesEnabled = exports.companyPassportUpdateCompanyDetailsFailure = exports.companyPassportUpdateCompanyDetailsSuccess = exports.companyPassportUpdateCompanyDetails = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.companyPassportSaveDataInLocalStore = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.updateZeniUsersOnFailure = exports.updateZeniUsersOnSuccess = exports.fetchZeniUsers = exports.fetchCompanyPortfolioView = exports.updateCompanyViewOnFailure = exports.updateCompanyViewOnSuccess = exports.companyManagementSaveUpdatesFailure = exports.companyManagementSaveUpdatesSuccess = exports.companyManagementDiscardUpdates = exports.companyManagementSavePendingUpdates = exports.companyManagementSaveUpdates = exports.fetchCompanyManagementView = exports.fetchPortfolioView = exports.fetchSubscriptionView = exports.fetchManagementView = exports.fetchOnboardingView = exports.fetchAllCockpitViews = exports.fetchCompanyPassportView = exports.initialState = void 0;
5
+ exports.updateMetaDataOnSendMonthEndReport = exports.updateCompanyMetaDataOnFailure = exports.updateCompanyMetaDataOnSuccess = exports.fetchCompanyMetaData = exports.updateCompanyDownloadState = exports.updateParentSubsidiaryViewOnFailure = exports.updateParentSubsidiaryView = exports.fetchParentSubsidiaryManagementView = exports.saveCompanyPassportDetails = exports.saveIndustryAndIncDateInCompanyPassportLocalStore = exports.updateCompanyPassportLocalStoreData = exports.companyPassportCreateCompanyOfficersFailure = exports.companyPassportCreateCompanyOfficersSuccess = exports.companyPassportCreateCompanyOfficers = exports.companyPassportUpdateCompanyOfficerFailure = exports.companyPassportUpdateCompanyOfficerSuccess = exports.companyPassportUpdateCompanyOfficer = exports.companyPassportUpdatePrimaryContactFailure = exports.companyPassportUpdatePrimaryContactSuccess = exports.companyPassportUpdatePrimaryContact = exports.dismissCapitalizationOnboarding = exports.updateCapitalizationAccountThresholdFailure = exports.updateCapitalizationAccountThresholdSuccess = void 0;
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const rootActions_1 = require("../../rootActions");
8
8
  const parentSubsidiaryViewState_1 = require("./parentSubsidiaryView/parentSubsidiaryViewState");
@@ -340,6 +340,31 @@ const companyView = (0, toolkit_1.createSlice)({
340
340
  error: action.payload.status,
341
341
  };
342
342
  },
343
+ updateCustomersTabSetting: {
344
+ reducer(draft,
345
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
346
+ _action) {
347
+ draft.passportView.customersTabSettingsUpdateStatus = {
348
+ fetchState: 'In-Progress',
349
+ error: undefined,
350
+ };
351
+ },
352
+ prepare(companyId, setting, enabled, tenantId) {
353
+ return { payload: { companyId, enabled, setting, tenantId } };
354
+ },
355
+ },
356
+ updateCustomersTabSettingSuccess(draft) {
357
+ draft.passportView.customersTabSettingsUpdateStatus = {
358
+ fetchState: 'Completed',
359
+ error: undefined,
360
+ };
361
+ },
362
+ updateCustomersTabSettingFailure(draft, action) {
363
+ draft.passportView.customersTabSettingsUpdateStatus = {
364
+ fetchState: 'Error',
365
+ error: action.payload.status,
366
+ };
367
+ },
343
368
  enableAccountingProjects: {
344
369
  reducer(draft,
345
370
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -784,5 +809,5 @@ const companyView = (0, toolkit_1.createSlice)({
784
809
  });
785
810
  },
786
811
  });
787
- _a = companyView.actions, exports.fetchCompanyPassportView = _a.fetchCompanyPassportView, exports.fetchAllCockpitViews = _a.fetchAllCockpitViews, exports.fetchOnboardingView = _a.fetchOnboardingView, exports.fetchManagementView = _a.fetchManagementView, exports.fetchSubscriptionView = _a.fetchSubscriptionView, exports.fetchPortfolioView = _a.fetchPortfolioView, exports.fetchCompanyManagementView = _a.fetchCompanyManagementView, exports.companyManagementSaveUpdates = _a.companyManagementSaveUpdates, exports.companyManagementSavePendingUpdates = _a.companyManagementSavePendingUpdates, exports.companyManagementDiscardUpdates = _a.companyManagementDiscardUpdates, exports.companyManagementSaveUpdatesSuccess = _a.companyManagementSaveUpdatesSuccess, exports.companyManagementSaveUpdatesFailure = _a.companyManagementSaveUpdatesFailure, exports.updateCompanyViewOnSuccess = _a.updateCompanyViewOnSuccess, exports.updateCompanyViewOnFailure = _a.updateCompanyViewOnFailure, exports.fetchCompanyPortfolioView = _a.fetchCompanyPortfolioView, exports.fetchZeniUsers = _a.fetchZeniUsers, exports.updateZeniUsersOnSuccess = _a.updateZeniUsersOnSuccess, exports.updateZeniUsersOnFailure = _a.updateZeniUsersOnFailure, exports.updateCompanyPortfolioUIState = _a.updateCompanyPortfolioUIState, exports.updateCompanyManagementUIState = _a.updateCompanyManagementUIState, exports.companyPassportSaveDataInLocalStore = _a.companyPassportSaveDataInLocalStore, exports.deleteCompanyOfficerInLocalStore = _a.deleteCompanyOfficerInLocalStore, exports.companyPassportClearDataInLocalStore = _a.companyPassportClearDataInLocalStore, exports.companyPassportUpdateCompanyDetails = _a.companyPassportUpdateCompanyDetails, exports.companyPassportUpdateCompanyDetailsSuccess = _a.companyPassportUpdateCompanyDetailsSuccess, exports.companyPassportUpdateCompanyDetailsFailure = _a.companyPassportUpdateCompanyDetailsFailure, exports.updateAccountingClassesEnabled = _a.updateAccountingClassesEnabled, exports.updateAccountingClassesEnabledSuccess = _a.updateAccountingClassesEnabledSuccess, exports.updateAccountingClassesEnabledFailure = _a.updateAccountingClassesEnabledFailure, exports.updateAutoReviewIncomeWithoutCustomer = _a.updateAutoReviewIncomeWithoutCustomer, exports.updateAutoReviewIncomeWithoutCustomerSuccess = _a.updateAutoReviewIncomeWithoutCustomerSuccess, exports.updateAutoReviewIncomeWithoutCustomerFailure = _a.updateAutoReviewIncomeWithoutCustomerFailure, exports.updateCompanyProductServices = _a.updateCompanyProductServices, exports.updateCompanyProductServicesSuccess = _a.updateCompanyProductServicesSuccess, exports.updateCompanyProductServicesFailure = _a.updateCompanyProductServicesFailure, exports.updateCompanyQboRealmId = _a.updateCompanyQboRealmId, exports.updateCompanyQboRealmIdSuccess = _a.updateCompanyQboRealmIdSuccess, exports.updateCompanyQboRealmIdFailure = _a.updateCompanyQboRealmIdFailure, exports.enableAccountingProjects = _a.enableAccountingProjects, exports.resumeEnableAccountingProjects = _a.resumeEnableAccountingProjects, exports.disableAccountingProjects = _a.disableAccountingProjects, exports.updateAccountingProjectsEnabledSuccess = _a.updateAccountingProjectsEnabledSuccess, exports.updateAccountingProjectsEnabledFailure = _a.updateAccountingProjectsEnabledFailure, exports.requestQboProjectsReconnect = _a.requestQboProjectsReconnect, exports.clearQboProjectsReconnectRequest = _a.clearQboProjectsReconnectRequest, exports.updateCapitalizationAccountThreshold = _a.updateCapitalizationAccountThreshold, exports.updateCapitalizationAccountThresholdSuccess = _a.updateCapitalizationAccountThresholdSuccess, exports.updateCapitalizationAccountThresholdFailure = _a.updateCapitalizationAccountThresholdFailure, exports.dismissCapitalizationOnboarding = _a.dismissCapitalizationOnboarding, exports.companyPassportUpdatePrimaryContact = _a.companyPassportUpdatePrimaryContact, exports.companyPassportUpdatePrimaryContactSuccess = _a.companyPassportUpdatePrimaryContactSuccess, exports.companyPassportUpdatePrimaryContactFailure = _a.companyPassportUpdatePrimaryContactFailure, exports.companyPassportUpdateCompanyOfficer = _a.companyPassportUpdateCompanyOfficer, exports.companyPassportUpdateCompanyOfficerSuccess = _a.companyPassportUpdateCompanyOfficerSuccess, exports.companyPassportUpdateCompanyOfficerFailure = _a.companyPassportUpdateCompanyOfficerFailure, exports.companyPassportCreateCompanyOfficers = _a.companyPassportCreateCompanyOfficers, exports.companyPassportCreateCompanyOfficersSuccess = _a.companyPassportCreateCompanyOfficersSuccess, exports.companyPassportCreateCompanyOfficersFailure = _a.companyPassportCreateCompanyOfficersFailure, exports.updateCompanyPassportLocalStoreData = _a.updateCompanyPassportLocalStoreData, exports.saveIndustryAndIncDateInCompanyPassportLocalStore = _a.saveIndustryAndIncDateInCompanyPassportLocalStore, exports.saveCompanyPassportDetails = _a.saveCompanyPassportDetails, exports.fetchParentSubsidiaryManagementView = _a.fetchParentSubsidiaryManagementView, exports.updateParentSubsidiaryView = _a.updateParentSubsidiaryView, exports.updateParentSubsidiaryViewOnFailure = _a.updateParentSubsidiaryViewOnFailure, exports.updateCompanyDownloadState = _a.updateCompanyDownloadState, exports.fetchCompanyMetaData = _a.fetchCompanyMetaData, exports.updateCompanyMetaDataOnSuccess = _a.updateCompanyMetaDataOnSuccess, exports.updateCompanyMetaDataOnFailure = _a.updateCompanyMetaDataOnFailure, exports.updateMetaDataOnSendMonthEndReport = _a.updateMetaDataOnSendMonthEndReport;
812
+ _a = companyView.actions, exports.fetchCompanyPassportView = _a.fetchCompanyPassportView, exports.fetchAllCockpitViews = _a.fetchAllCockpitViews, exports.fetchOnboardingView = _a.fetchOnboardingView, exports.fetchManagementView = _a.fetchManagementView, exports.fetchSubscriptionView = _a.fetchSubscriptionView, exports.fetchPortfolioView = _a.fetchPortfolioView, exports.fetchCompanyManagementView = _a.fetchCompanyManagementView, exports.companyManagementSaveUpdates = _a.companyManagementSaveUpdates, exports.companyManagementSavePendingUpdates = _a.companyManagementSavePendingUpdates, exports.companyManagementDiscardUpdates = _a.companyManagementDiscardUpdates, exports.companyManagementSaveUpdatesSuccess = _a.companyManagementSaveUpdatesSuccess, exports.companyManagementSaveUpdatesFailure = _a.companyManagementSaveUpdatesFailure, exports.updateCompanyViewOnSuccess = _a.updateCompanyViewOnSuccess, exports.updateCompanyViewOnFailure = _a.updateCompanyViewOnFailure, exports.fetchCompanyPortfolioView = _a.fetchCompanyPortfolioView, exports.fetchZeniUsers = _a.fetchZeniUsers, exports.updateZeniUsersOnSuccess = _a.updateZeniUsersOnSuccess, exports.updateZeniUsersOnFailure = _a.updateZeniUsersOnFailure, exports.updateCompanyPortfolioUIState = _a.updateCompanyPortfolioUIState, exports.updateCompanyManagementUIState = _a.updateCompanyManagementUIState, exports.companyPassportSaveDataInLocalStore = _a.companyPassportSaveDataInLocalStore, exports.deleteCompanyOfficerInLocalStore = _a.deleteCompanyOfficerInLocalStore, exports.companyPassportClearDataInLocalStore = _a.companyPassportClearDataInLocalStore, exports.companyPassportUpdateCompanyDetails = _a.companyPassportUpdateCompanyDetails, exports.companyPassportUpdateCompanyDetailsSuccess = _a.companyPassportUpdateCompanyDetailsSuccess, exports.companyPassportUpdateCompanyDetailsFailure = _a.companyPassportUpdateCompanyDetailsFailure, exports.updateAccountingClassesEnabled = _a.updateAccountingClassesEnabled, exports.updateAccountingClassesEnabledSuccess = _a.updateAccountingClassesEnabledSuccess, exports.updateAccountingClassesEnabledFailure = _a.updateAccountingClassesEnabledFailure, exports.updateAutoReviewIncomeWithoutCustomer = _a.updateAutoReviewIncomeWithoutCustomer, exports.updateAutoReviewIncomeWithoutCustomerSuccess = _a.updateAutoReviewIncomeWithoutCustomerSuccess, exports.updateAutoReviewIncomeWithoutCustomerFailure = _a.updateAutoReviewIncomeWithoutCustomerFailure, exports.updateCustomersTabSetting = _a.updateCustomersTabSetting, exports.updateCustomersTabSettingSuccess = _a.updateCustomersTabSettingSuccess, exports.updateCustomersTabSettingFailure = _a.updateCustomersTabSettingFailure, exports.updateCompanyProductServices = _a.updateCompanyProductServices, exports.updateCompanyProductServicesSuccess = _a.updateCompanyProductServicesSuccess, exports.updateCompanyProductServicesFailure = _a.updateCompanyProductServicesFailure, exports.updateCompanyQboRealmId = _a.updateCompanyQboRealmId, exports.updateCompanyQboRealmIdSuccess = _a.updateCompanyQboRealmIdSuccess, exports.updateCompanyQboRealmIdFailure = _a.updateCompanyQboRealmIdFailure, exports.enableAccountingProjects = _a.enableAccountingProjects, exports.resumeEnableAccountingProjects = _a.resumeEnableAccountingProjects, exports.disableAccountingProjects = _a.disableAccountingProjects, exports.updateAccountingProjectsEnabledSuccess = _a.updateAccountingProjectsEnabledSuccess, exports.updateAccountingProjectsEnabledFailure = _a.updateAccountingProjectsEnabledFailure, exports.requestQboProjectsReconnect = _a.requestQboProjectsReconnect, exports.clearQboProjectsReconnectRequest = _a.clearQboProjectsReconnectRequest, exports.updateCapitalizationAccountThreshold = _a.updateCapitalizationAccountThreshold, exports.updateCapitalizationAccountThresholdSuccess = _a.updateCapitalizationAccountThresholdSuccess, exports.updateCapitalizationAccountThresholdFailure = _a.updateCapitalizationAccountThresholdFailure, exports.dismissCapitalizationOnboarding = _a.dismissCapitalizationOnboarding, exports.companyPassportUpdatePrimaryContact = _a.companyPassportUpdatePrimaryContact, exports.companyPassportUpdatePrimaryContactSuccess = _a.companyPassportUpdatePrimaryContactSuccess, exports.companyPassportUpdatePrimaryContactFailure = _a.companyPassportUpdatePrimaryContactFailure, exports.companyPassportUpdateCompanyOfficer = _a.companyPassportUpdateCompanyOfficer, exports.companyPassportUpdateCompanyOfficerSuccess = _a.companyPassportUpdateCompanyOfficerSuccess, exports.companyPassportUpdateCompanyOfficerFailure = _a.companyPassportUpdateCompanyOfficerFailure, exports.companyPassportCreateCompanyOfficers = _a.companyPassportCreateCompanyOfficers, exports.companyPassportCreateCompanyOfficersSuccess = _a.companyPassportCreateCompanyOfficersSuccess, exports.companyPassportCreateCompanyOfficersFailure = _a.companyPassportCreateCompanyOfficersFailure, exports.updateCompanyPassportLocalStoreData = _a.updateCompanyPassportLocalStoreData, exports.saveIndustryAndIncDateInCompanyPassportLocalStore = _a.saveIndustryAndIncDateInCompanyPassportLocalStore, exports.saveCompanyPassportDetails = _a.saveCompanyPassportDetails, exports.fetchParentSubsidiaryManagementView = _a.fetchParentSubsidiaryManagementView, exports.updateParentSubsidiaryView = _a.updateParentSubsidiaryView, exports.updateParentSubsidiaryViewOnFailure = _a.updateParentSubsidiaryViewOnFailure, exports.updateCompanyDownloadState = _a.updateCompanyDownloadState, exports.fetchCompanyMetaData = _a.fetchCompanyMetaData, exports.updateCompanyMetaDataOnSuccess = _a.updateCompanyMetaDataOnSuccess, exports.updateCompanyMetaDataOnFailure = _a.updateCompanyMetaDataOnFailure, exports.updateMetaDataOnSendMonthEndReport = _a.updateMetaDataOnSendMonthEndReport;
788
813
  exports.default = companyView.reducer;
@@ -0,0 +1,11 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateCompanies } from '../../../../entity/company/companyReducer';
4
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
+ import { updateTenantCustomersTabSetting } from '../../../../entity/tenant/tenantReducer';
6
+ import { RootState } from '../../../../rootStateTypes';
7
+ import { ZeniAPI } from '../../../../zeniAPI';
8
+ import { updateCustomersTabSetting, updateCustomersTabSettingFailure, updateCustomersTabSettingSuccess } from '../../companyViewReducer';
9
+ export type ActionType = ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantCustomersTabSetting> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateCustomersTabSetting> | ReturnType<typeof updateCustomersTabSettingSuccess> | ReturnType<typeof updateCustomersTabSettingFailure>;
10
+ /** Settings › Accounting › Customers: save one Customers tab setting (accounting_config is deep-merged). */
11
+ export declare const updateCustomersTabSettingEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCustomersTabSettingEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const companyReducer_1 = require("../../../../entity/company/companyReducer");
7
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
8
+ const tenantPayload_1 = require("../../../../entity/tenant/tenantPayload");
9
+ const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
10
+ const responsePayload_1 = require("../../../../responsePayload");
11
+ const companyViewReducer_1 = require("../../companyViewReducer");
12
+ const failureActions = (status) => [
13
+ (0, companyViewReducer_1.updateCustomersTabSettingFailure)({ status }),
14
+ (0, snackbarReducer_1.openSnackbar)({
15
+ messageSection: 'customers_tab_settings_update',
16
+ messageText: 'failed',
17
+ type: 'error',
18
+ }),
19
+ ];
20
+ /** Settings › Accounting › Customers: save one Customers tab setting (accounting_config is deep-merged). */
21
+ const updateCustomersTabSettingEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCustomersTabSetting.match),
22
+ // The two settings are separate keys: a quick second toggle mustn't cancel the first save
23
+ (0, operators_1.mergeMap)((action) => {
24
+ const { companyId, enabled, setting, tenantId } = action.payload;
25
+ return zeniAPI
26
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, {
27
+ accounting_config: {
28
+ customers: { [tenantPayload_1.CUSTOMERS_TAB_SETTING_API_KEYS[setting]]: enabled },
29
+ },
30
+ })
31
+ .pipe((0, operators_1.mergeMap)((response) => {
32
+ const companies = response.data?.companies ?? [];
33
+ if (!(0, responsePayload_1.isSuccessResponse)(response) || companies.length === 0) {
34
+ return (0, rxjs_1.from)(failureActions(response.status));
35
+ }
36
+ return (0, rxjs_1.from)([
37
+ (0, companyReducer_1.updateCompanies)({ payload: companies, schema: {} }),
38
+ (0, tenantReducer_1.updateTenantCustomersTabSetting)({ enabled, setting, tenantId }),
39
+ (0, companyViewReducer_1.updateCustomersTabSettingSuccess)(),
40
+ (0, snackbarReducer_1.openSnackbar)({
41
+ messageSection: 'customers_tab_settings_update',
42
+ messageText: 'success',
43
+ type: 'success',
44
+ }),
45
+ ]);
46
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)(failureActions((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Customers tab setting errored out: ' +
47
+ (error instanceof Error
48
+ ? error.message
49
+ : JSON.stringify(error)))))));
50
+ }));
51
+ exports.updateCustomersTabSettingEpic = updateCustomersTabSettingEpic;
@@ -34,3 +34,4 @@ export interface CompanyPassportLocalStoreDataView {
34
34
  export declare const getCompanyPassportView: (state: RootState) => CompanyPassportView;
35
35
  export declare function getCompanyPassportLocalStoreData(state: RootState): CompanyPassportLocalStoreDataView;
36
36
  export declare const isCompanyPassportDataToBeSaved: (companyLocalStoreData: CompanyPassportLocalStoreDataView, companyView: CompanyView, companyFiles: File[]) => boolean;
37
+ export declare const getIsCustomersTabSettingsUpdateInProgress: (state: RootState) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isCompanyPassportDataToBeSaved = exports.getCompanyPassportView = void 0;
6
+ exports.getIsCustomersTabSettingsUpdateInProgress = exports.isCompanyPassportDataToBeSaved = exports.getCompanyPassportView = void 0;
7
7
  exports.getCompanyPassportLocalStoreData = getCompanyPassportLocalStoreData;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const get_1 = __importDefault(require("lodash/get"));
@@ -161,3 +161,6 @@ const isCompanyPassportDataToBeSaved = (companyLocalStoreData, companyView, comp
161
161
  return isCompanyDataUpdated;
162
162
  };
163
163
  exports.isCompanyPassportDataToBeSaved = isCompanyPassportDataToBeSaved;
164
+ const getIsCustomersTabSettingsUpdateInProgress = (state) => state.companyViewState.passportView.customersTabSettingsUpdateStatus
165
+ .fetchState === 'In-Progress';
166
+ exports.getIsCustomersTabSettingsUpdateInProgress = getIsCustomersTabSettingsUpdateInProgress;
@@ -16,6 +16,7 @@ export interface CompanyPassportViewState extends CommonState, FetchedState {
16
16
  updateStatus: FetchStateAndError;
17
17
  localData?: CompanyOfficerLocalData;
18
18
  }>;
19
+ customersTabSettingsUpdateStatus: FetchStateAndError;
19
20
  needsQboProjectsReconnect: boolean;
20
21
  primaryContact: {
21
22
  updateStatus: FetchStateAndError;
@@ -20,6 +20,10 @@ exports.initialCompanyPassportView = {
20
20
  fetchState: 'Not-Started',
21
21
  error: undefined,
22
22
  },
23
+ customersTabSettingsUpdateStatus: {
24
+ fetchState: 'Not-Started',
25
+ error: undefined,
26
+ },
23
27
  needsQboProjectsReconnect: false,
24
28
  companyDetails: {
25
29
  localData: undefined,
@@ -1,4 +1,5 @@
1
1
  import { ZeniAPIResponse } from '../../responsePayload';
2
+ import { CustomerRevenueKey } from './customerSummaryViewState';
2
3
  export interface CustomerSummaryRevenuePayload {
3
4
  last_3_months_revenue?: number;
4
5
  last_6_months_revenue?: number;
@@ -9,7 +10,17 @@ export interface CustomerSummaryRevenuePayload {
9
10
  previous_year_revenue?: number;
10
11
  year_to_date_revenue?: number;
11
12
  }
12
- export interface CustomerSummaryPayload extends CustomerSummaryRevenuePayload {
13
+ interface CustomerSummaryReferencePayload {
14
+ customer_id: string;
15
+ customer_name?: string;
16
+ }
17
+ /** Details: the figures over the customer and its active sub-customers and projects. */
18
+ export type CustomerSummaryTotalsPayload = {
19
+ [Key in CustomerRevenueKey as `total_${Key}`]?: number;
20
+ } & {
21
+ total_balance?: number;
22
+ };
23
+ export interface CustomerSummaryPayload extends CustomerSummaryRevenuePayload, CustomerSummaryTotalsPayload {
13
24
  customer_id: string;
14
25
  account?: {
15
26
  account_id: string;
@@ -23,6 +34,13 @@ export interface CustomerSummaryPayload extends CustomerSummaryRevenuePayload {
23
34
  currency_code?: string | null;
24
35
  currency_symbol?: string | null;
25
36
  customer_name?: string;
37
+ /** Details only: the top-level customer and every active descendant, with own and total figures. */
38
+ family_tree?: CustomerSummaryPayload[];
39
+ has_children?: boolean;
40
+ is_project?: boolean;
41
+ is_sub_customer?: boolean;
42
+ parent_customer_id?: string | null;
43
+ parent_path?: CustomerSummaryReferencePayload[];
26
44
  qbo_id?: string;
27
45
  }
28
46
  export interface CustomerSummaryListPayload {
@@ -36,3 +54,4 @@ export type CustomerSummaryListResponse = ZeniAPIResponse<CustomerSummaryListPay
36
54
  export type CustomerSummaryDetailResponse = ZeniAPIResponse<{
37
55
  customers: CustomerSummaryPayload[];
38
56
  }>;
57
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { FetchState } from '../../commonStateTypes/common';
2
2
  import { PageToken } from '../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { CustomersTabSettings } from '../../entity/tenant/tenantState';
3
4
  import { ZeniAPIStatus } from '../../responsePayload';
4
5
  import { CustomerSummaryListResponse, CustomerSummaryPayload } from './customerSummaryViewPayload';
5
6
  import { CustomerAllTransactionsTabData, CustomerDetailTabType, CustomerSummary, CustomerSummaryDetailChanges, CustomerSummarySortKey, CustomerSummaryViewState } from './customerSummaryViewState';
@@ -9,9 +10,10 @@ export declare const fetchCustomerSummaryList: import("@reduxjs/toolkit").Action
9
10
  keepExistingListItems: boolean;
10
11
  pageToken: PageToken;
11
12
  searchString: any;
12
- }, "customerSummaryView/fetchCustomerSummaryList", never, never>, updateCustomerSummaryList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[response: CustomerSummaryListResponse, keepExistingListItems: boolean], {
13
+ }, "customerSummaryView/fetchCustomerSummaryList", never, never>, updateCustomerSummaryList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[response: CustomerSummaryListResponse, keepExistingListItems: boolean, settings: CustomersTabSettings], {
13
14
  keepExistingListItems: boolean;
14
15
  response: CustomerSummaryListResponse;
16
+ settings: CustomersTabSettings;
15
17
  }, "customerSummaryView/updateCustomerSummaryList", never, never>, updateCustomerSummaryListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "customerSummaryView/updateCustomerSummaryListFailure">, updateCustomerSummarySortUiState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sortKey: CustomerSummarySortKey, sortOrder: "ascending" | "descending"], {
16
18
  sortKey: CustomerSummarySortKey;
17
19
  sortOrder: "ascending" | "descending";
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  var _a;
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  exports.resetCustomerSummaryDetailUiState = exports.updateCustomerTrendFilter = exports.updateCustomerAllTransactionsTabData = exports.updateCustomerDetailSelectedTab = exports.updateCustomerSummarySaveState = exports.saveCustomerSummaryDetail = exports.updateCustomerSummaryDetailFailure = exports.updateCustomerSummaryDetail = exports.fetchCustomerSummaryDetail = exports.updateCustomerSummaryScrollYOffset = exports.updateCustomerSummaryRevenueSelection = exports.updateCustomerSummarySortUiState = exports.updateCustomerSummaryListFailure = exports.updateCustomerSummaryList = exports.fetchCustomerSummaryList = exports.toCustomerSummary = exports.initialState = void 0;
5
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
+ const isEqual_1 = __importDefault(require("lodash/isEqual"));
10
+ const tenantReducer_1 = require("../../entity/tenant/tenantReducer");
6
11
  const rootActions_1 = require("../../rootActions");
7
12
  const customerSummaryViewState_1 = require("./customerSummaryViewState");
8
13
  exports.initialState = {
@@ -24,6 +29,9 @@ exports.initialState = {
24
29
  detailCustomerId: undefined,
25
30
  error: undefined,
26
31
  };
32
+ const toReference = (payload) => payload != null
33
+ ? { id: payload.customer_id, name: payload.customer_name ?? '' }
34
+ : undefined;
27
35
  const toCustomerSummary = (payload) => ({
28
36
  id: payload.customer_id,
29
37
  qboId: payload.qbo_id ?? undefined,
@@ -32,6 +40,22 @@ const toCustomerSummary = (payload) => ({
32
40
  currencyCode: payload.currency_code ?? undefined,
33
41
  currencySymbol: payload.currency_symbol ?? undefined,
34
42
  revenue: Object.fromEntries(customerSummaryViewState_1.CUSTOMER_REVENUE_KEYS.map((key) => [key, payload[key] ?? 0])),
43
+ hasChildren: payload.has_children === true,
44
+ isProject: payload.is_project === true,
45
+ isSubCustomer: payload.is_sub_customer === true,
46
+ parentId: payload.parent_customer_id ?? undefined,
47
+ parentPath: (payload.parent_path ?? []).flatMap((parent) => toReference(parent) ?? []),
48
+ familyTree: payload.family_tree?.map(exports.toCustomerSummary),
49
+ // Only the details response carries them
50
+ totals: payload.total_balance != null
51
+ ? {
52
+ balance: payload.total_balance,
53
+ revenue: Object.fromEntries(customerSummaryViewState_1.CUSTOMER_REVENUE_KEYS.map((key) => [
54
+ key,
55
+ payload[`total_${key}`] ?? 0,
56
+ ])),
57
+ }
58
+ : undefined,
35
59
  account: payload.account?.account_id != null
36
60
  ? {
37
61
  id: payload.account.account_id,
@@ -78,11 +102,16 @@ const customerSummaryView = (0, toolkit_1.createSlice)({
78
102
  },
79
103
  },
80
104
  updateCustomerSummaryList: {
81
- prepare(response, keepExistingListItems) {
82
- return { payload: { keepExistingListItems, response } };
105
+ prepare(response, keepExistingListItems, settings) {
106
+ return { payload: { keepExistingListItems, response, settings } };
83
107
  },
84
108
  reducer(draft, action) {
85
- const { response, keepExistingListItems } = action.payload;
109
+ const { response, keepExistingListItems, settings } = action.payload;
110
+ // A next page fetched under other settings than the listed rows: drop it, the list refetches
111
+ if (keepExistingListItems && !(0, isEqual_1.default)(draft.listSettings, settings)) {
112
+ return;
113
+ }
114
+ draft.listSettings = settings;
86
115
  const customers = (response.data?.customers ?? []).map(exports.toCustomerSummary);
87
116
  const existingIds = new Set(draft.customers.map(({ id }) => id));
88
117
  draft.customers = keepExistingListItems
@@ -131,12 +160,13 @@ const customerSummaryView = (0, toolkit_1.createSlice)({
131
160
  detail.customer = (0, exports.toCustomerSummary)(action.payload.customer);
132
161
  detail.fetchState = 'Completed';
133
162
  // Keep the list row in sync after an edit.
163
+ const { account, accountingClass } = detail.customer;
134
164
  const index = draft.customers.findIndex(({ id }) => id === action.payload.customerId);
135
165
  if (index >= 0) {
136
166
  draft.customers[index] = {
137
167
  ...draft.customers[index],
138
- account: detail.customer.account,
139
- accountingClass: detail.customer.accountingClass,
168
+ account,
169
+ accountingClass,
140
170
  };
141
171
  }
142
172
  },
@@ -193,8 +223,14 @@ const customerSummaryView = (0, toolkit_1.createSlice)({
193
223
  },
194
224
  },
195
225
  extraReducers: (builder) => {
196
- builder.addCase(rootActions_1.clearAll, (draft) => {
226
+ builder
227
+ .addCase(rootActions_1.clearAll, (draft) => {
197
228
  Object.assign(draft, exports.initialState);
229
+ })
230
+ // Totals on / off switch the detail page's All transactions tab to another entity: restart its window.
231
+ // (The list refetches through `getCustomerSummaryList`; the details carry both figures.)
232
+ .addCase(tenantReducer_1.updateTenantCustomersTabSetting, (draft) => {
233
+ draft.allTransactionsTabData = undefined;
198
234
  });
199
235
  },
200
236
  });
@@ -1,17 +1,29 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { NestedClassHierarchyForReport } from '../../commonStateTypes/classesView/nestedClassID';
3
3
  import { ID } from '../../commonStateTypes/common';
4
+ import { CustomersTabSettings } from '../../entity/tenant/tenantState';
4
5
  import { RoleMap } from '../../entity/userRole/userRoleType';
5
6
  import { VendorSpendTrendFilterTabType } from '../../entity/vendorExpense/vendorSpendTrendFilterTabType';
6
7
  import { RootState } from '../../rootStateTypes';
7
- import { CustomerAllTransactionsTabData, CustomerDetailTabType, CustomerSummaryDetailState, CustomerSummaryViewState } from './customerSummaryViewState';
8
+ import { CustomerAllTransactionsTabData, CustomerDetailTabType, CustomerSummaryDetailState, CustomerSummaryFigures, CustomerSummaryViewState } from './customerSummaryViewState';
8
9
  export interface CustomerSummaryDetailView extends CustomerSummaryDetailState {
9
10
  accountsHierarchyList: NestedAccountHierarchyForReport[];
10
11
  classHierarchyList: NestedClassHierarchyForReport[];
12
+ /**
13
+ * The tenant includes sub-customers and projects in totals, and the details (once loaded) carry them: the
14
+ * figures, trend and transactions all cover them. Otherwise all of them are the customer's own.
15
+ */
16
+ includesSubCustomers: boolean;
11
17
  isAccountingClassesEnabled: boolean;
12
18
  /** Account (and, with classes on, class) list still loading: the pickers would show raw ids. */
13
19
  isReferenceDataLoading: boolean;
20
+ /** The trend / transactions entity id: the rolled-up view's id when `includesSubCustomers`. */
21
+ trendEntityId: ID;
22
+ /** The figures on show (see `includesSubCustomers`); undefined until the details load. */
23
+ figures?: CustomerSummaryFigures;
14
24
  }
25
+ export declare const getCustomersTabSettings: (state: RootState) => CustomersTabSettings;
26
+ /** Rows fetched under other Customers tab settings (however those changed) read as not fetched yet. */
15
27
  export declare const getCustomerSummaryList: (state: RootState) => CustomerSummaryViewState;
16
28
  export declare const getCustomerSummaryDetail: (state: RootState, customerId: ID) => CustomerSummaryDetailView;
17
29
  export declare const getCustomerSummarySelectedTabType: (state: RootState) => CustomerDetailTabType;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCustomersTabVisible = exports.getCustomerSummaryTrendFilter = exports.getCustomerSummaryAllTransactionsTabData = exports.getCustomerSummarySelectedTabType = exports.getCustomerSummaryDetail = exports.getCustomerSummaryList = void 0;
6
+ exports.isCustomersTabVisible = exports.getCustomerSummaryTrendFilter = exports.getCustomerSummaryAllTransactionsTabData = exports.getCustomerSummarySelectedTabType = exports.getCustomerSummaryDetail = exports.getCustomerSummaryList = exports.getCustomersTabSettings = void 0;
4
7
  const toolkit_1 = require("@reduxjs/toolkit");
8
+ const isEqual_1 = __importDefault(require("lodash/isEqual"));
9
+ const customerWithSubCustomersId_1 = require("../../entity/genericEntity/customerWithSubCustomersId");
5
10
  const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
11
+ const tenantState_1 = require("../../entity/tenant/tenantState");
6
12
  const accountListSelector_1 = require("../accountList/accountListSelector");
7
13
  const classListSelector_1 = require("../classList/classListSelector");
8
14
  const isLoadingFetchState = (fetchState) => fetchState === 'Not-Started' || fetchState === 'In-Progress';
@@ -10,17 +16,44 @@ const NOT_STARTED_DETAIL = {
10
16
  fetchState: 'Not-Started',
11
17
  saveState: 'Not-Started',
12
18
  };
13
- const getCustomerSummaryList = (state) => state.customerSummaryViewState;
14
- exports.getCustomerSummaryList = getCustomerSummaryList;
15
- exports.getCustomerSummaryDetail = (0, toolkit_1.createSelector)((state, customerId) => state.customerSummaryViewState.detailById[customerId], (state) => state.accountListState, (state) => state.classListState, tenantSelector_1.getIsAccountingClassesEnabled, (detail, accountListState, classListState, isAccountingClassesEnabled) => ({
16
- ...(detail ?? NOT_STARTED_DETAIL),
17
- accountsHierarchyList: (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList'),
18
- classHierarchyList: (0, classListSelector_1.getNestedClassListHierarchy)(classListState),
19
- isAccountingClassesEnabled,
20
- isReferenceDataLoading: isLoadingFetchState(accountListState.byReportId.accountList.fetchState) ||
21
- (isAccountingClassesEnabled &&
22
- isLoadingFetchState(classListState.fetchState)),
23
- }));
19
+ const getCustomersTabSettings = (state) => {
20
+ const { currentTenantId } = state.tenantState;
21
+ return ((currentTenantId != null
22
+ ? (0, tenantSelector_1.getTenantCustomersTabSettings)(state.tenantState, currentTenantId)
23
+ : undefined) ?? tenantState_1.DEFAULT_CUSTOMERS_TAB_SETTINGS);
24
+ };
25
+ exports.getCustomersTabSettings = getCustomersTabSettings;
26
+ /** Rows fetched under other Customers tab settings (however those changed) read as not fetched yet. */
27
+ exports.getCustomerSummaryList = (0, toolkit_1.createSelector)((state) => state.customerSummaryViewState, exports.getCustomersTabSettings, (view, settings) => view.listSettings == null || (0, isEqual_1.default)(view.listSettings, settings)
28
+ ? view
29
+ : {
30
+ ...view,
31
+ customers: [],
32
+ error: undefined,
33
+ fetchState: 'Not-Started',
34
+ totalCount: 0,
35
+ uiState: { ...view.uiState, pageToken: null, scrollYOffset: 0 },
36
+ });
37
+ exports.getCustomerSummaryDetail = (0, toolkit_1.createSelector)((state, customerId) => state.customerSummaryViewState.detailById[customerId], (state) => state.accountListState, (state) => state.classListState, tenantSelector_1.getIsAccountingClassesEnabled, (state) => (0, exports.getCustomersTabSettings)(state).includeSubCustomersInTotals, (_state, customerId) => customerId, (detail, accountListState, classListState, isAccountingClassesEnabled, includeSubCustomersInTotals, customerId) => {
38
+ const customer = detail?.customer;
39
+ // Rolled up from the start (in parallel with the details); own figures if the details turn out to have no totals
40
+ const includesSubCustomers = includeSubCustomersInTotals &&
41
+ (customer == null || customer.totals != null);
42
+ return {
43
+ ...(detail ?? NOT_STARTED_DETAIL),
44
+ accountsHierarchyList: (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList'),
45
+ classHierarchyList: (0, classListSelector_1.getNestedClassListHierarchy)(classListState),
46
+ isAccountingClassesEnabled,
47
+ isReferenceDataLoading: isLoadingFetchState(accountListState.byReportId.accountList.fetchState) ||
48
+ (isAccountingClassesEnabled &&
49
+ isLoadingFetchState(classListState.fetchState)),
50
+ includesSubCustomers,
51
+ figures: includesSubCustomers ? customer?.totals : customer,
52
+ trendEntityId: includesSubCustomers
53
+ ? (0, customerWithSubCustomersId_1.toCustomerWithSubCustomersId)(customerId)
54
+ : customerId,
55
+ };
56
+ });
24
57
  const getCustomerSummarySelectedTabType = (state) => state.customerSummaryViewState.selectedTabType;
25
58
  exports.getCustomerSummarySelectedTabType = getCustomerSummarySelectedTabType;
26
59
  const getCustomerSummaryAllTransactionsTabData = (state) => state.customerSummaryViewState.allTransactionsTabData;
@@ -2,27 +2,38 @@ import { FetchState, ID } from '../../commonStateTypes/common';
2
2
  import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { TimePeriod } from '../../commonStateTypes/timePeriod';
4
4
  import { PageToken } from '../../commonStateTypes/viewAndReport/viewAndReport';
5
+ import { CustomersTabSettings } from '../../entity/tenant/tenantState';
5
6
  import { VendorSpendTrendFilterTabType } from '../../entity/vendorExpense/vendorSpendTrendFilterTabType';
6
7
  import { ZeniAPIStatus } from '../../responsePayload';
7
8
  export declare const CUSTOMER_REVENUE_KEYS: readonly ["last_90_days_revenue", "last_30_days_revenue", "year_to_date_revenue", "last_month_revenue", "last_3_months_revenue", "last_6_months_revenue", "last_12_months_revenue", "previous_year_revenue"];
8
9
  export type CustomerRevenueKey = (typeof CUSTOMER_REVENUE_KEYS)[number];
9
10
  export type CustomerSummarySortKey = 'customer_name' | 'account' | 'accounting_class' | 'balance' | CustomerRevenueKey;
10
- export interface CustomerSummary {
11
- balance: number;
11
+ export interface CustomerSummaryReference {
12
12
  id: ID;
13
13
  name: string;
14
+ }
15
+ export interface CustomerSummaryFigures {
16
+ balance: number;
14
17
  revenue: Record<CustomerRevenueKey, number>;
15
- account?: {
16
- id: ID;
17
- name: string;
18
- };
19
- accountingClass?: {
20
- id: ID;
21
- name: string;
22
- };
18
+ }
19
+ export interface CustomerSummary extends CustomerSummaryFigures {
20
+ hasChildren: boolean;
21
+ id: ID;
22
+ isProject: boolean;
23
+ isSubCustomer: boolean;
24
+ name: string;
25
+ /** Root-first ancestors, for the "Parent › Child" label; empty for a top-level customer. */
26
+ parentPath: CustomerSummaryReference[];
27
+ account?: CustomerSummaryReference;
28
+ accountingClass?: CustomerSummaryReference;
23
29
  currencyCode?: string;
24
30
  currencySymbol?: string;
31
+ /** Details only: the whole family it belongs to (its top-level customer and every active descendant), flat. */
32
+ familyTree?: CustomerSummary[];
33
+ parentId?: ID;
25
34
  qboId?: ID;
35
+ /** Details only: the figures over the customer and all its active sub-customers and projects. */
36
+ totals?: CustomerSummaryFigures;
26
37
  }
27
38
  export interface CustomerSummaryListUIState {
28
39
  pageToken: PageToken;
@@ -48,6 +59,7 @@ export interface CustomerSummaryDetailState {
48
59
  error?: ZeniAPIStatus;
49
60
  }
50
61
  export interface CustomerSummaryViewState {
62
+ /** Every level, or only top-level customers (the tenant's Customers tab settings). */
51
63
  customers: CustomerSummary[];
52
64
  detailById: Record<ID, CustomerSummaryDetailState>;
53
65
  fetchState: FetchState;
@@ -60,4 +72,6 @@ export interface CustomerSummaryViewState {
60
72
  /** Customer the detail page UI state (filter, tab, transactions window) belongs to. */
61
73
  detailCustomerId?: ID;
62
74
  error?: ZeniAPIStatus;
75
+ /** The Customers tab settings the listed rows were fetched with. */
76
+ listSettings?: CustomersTabSettings;
63
77
  }
@@ -5,21 +5,26 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../responsePayload");
7
7
  const customerSummaryViewReducer_1 = require("../customerSummaryViewReducer");
8
+ const customerSummaryViewSelector_1 = require("../customerSummaryViewSelector");
8
9
  const fetchCustomerSummaryListEpic = (actions$, state$, zeniAPI) => {
9
10
  const fetch$ = actions$.pipe((0, operators_1.filter)(customerSummaryViewReducer_1.fetchCustomerSummaryList.match));
10
11
  const fetchPage = (action) => {
11
12
  const { keepExistingListItems, pageToken, searchString } = action.payload;
12
13
  const { uiState } = state$.value.customerSummaryViewState;
14
+ const settings = (0, customerSummaryViewSelector_1.getCustomersTabSettings)(state$.value);
13
15
  const query = {
14
16
  page_token: pageToken,
15
17
  sort_by: uiState.sortKey,
16
18
  sort_order: uiState.sortOrder === 'ascending' ? 'asc' : 'desc',
17
19
  search_text: searchString,
20
+ // Top-level only: a search also finds a customer by its sub-customers' and projects' names
21
+ top_level_only: settings.listTopLevelCustomersOnly,
22
+ include_sub_customers: settings.includeSubCustomersInTotals,
18
23
  };
19
24
  return zeniAPI
20
25
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/customers/summary?query=${encodeURIComponent(JSON.stringify(query))}`)
21
26
  .pipe((0, operators_1.map)((response) => (0, responsePayload_1.isSuccessResponse)(response)
22
- ? (0, customerSummaryViewReducer_1.updateCustomerSummaryList)(response, keepExistingListItems)
27
+ ? (0, customerSummaryViewReducer_1.updateCustomerSummaryList)(response, keepExistingListItems, settings)
23
28
  : (0, customerSummaryViewReducer_1.updateCustomerSummaryListFailure)(response.status)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, customerSummaryViewReducer_1.updateCustomerSummaryListFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch customer summary list REST API call errored out' +
24
29
  JSON.stringify(error))))));
25
30
  };
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
39
39
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
40
40
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
41
41
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
42
- messageSection: "common" | "recommendation_feedback" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "actual_matching_ignore_suggestion" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "update_customer" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "create_transaction" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "auto_review_income_without_customer_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "kyc_kyb_reset" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed" | "invoicing_data_import_download";
42
+ messageSection: "common" | "recommendation_feedback" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "actual_matching_ignore_suggestion" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "update_customer" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "create_transaction" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "auto_review_income_without_customer_update" | "customers_tab_settings_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "kyc_kyb_reset" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed" | "invoicing_data_import_download";
43
43
  messageText: "notification" | "failed" | "success";
44
44
  type: "error" | "success" | "info";
45
45
  variables: {