@zeniai/client-epic-state 5.1.68-beta0GS → 5.1.68-beta0ND

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  3. package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
  4. package/lib/entity/tenant/clearAllEpic.js +0 -2
  5. package/lib/entity/tenant/tenantReducer.d.ts +5 -1
  6. package/lib/entity/tenant/tenantReducer.js +19 -2
  7. package/lib/epic.d.ts +2 -3
  8. package/lib/epic.js +2 -3
  9. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  10. package/lib/esm/entity/tenant/clearAllEpic.js +0 -2
  11. package/lib/esm/entity/tenant/tenantReducer.js +18 -1
  12. package/lib/esm/epic.js +2 -3
  13. package/lib/esm/index.js +4 -7
  14. package/lib/esm/reducer.js +0 -3
  15. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  16. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +81 -0
  17. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +6 -0
  18. package/lib/esm/view/companyView/types/cockpitTypes.js +1 -0
  19. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  20. package/lib/index.d.ts +4 -9
  21. package/lib/index.js +41 -48
  22. package/lib/reducer.d.ts +0 -3
  23. package/lib/reducer.js +0 -3
  24. package/lib/view/companyView/companyViewReducer.d.ts +11 -1
  25. package/lib/view/companyView/companyViewReducer.js +28 -3
  26. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.d.ts +10 -0
  27. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +85 -0
  28. package/lib/view/companyView/selector/companyManagementViewSelector.js +6 -0
  29. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  30. package/lib/view/companyView/types/cockpitTypes.js +1 -0
  31. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  32. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  33. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/lib/esm/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -21
  36. package/lib/esm/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +0 -20
  37. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +0 -1
  38. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +0 -76
  39. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +0 -9
  40. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +0 -1
  41. package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.d.ts +0 -7
  42. package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -25
  43. package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.d.ts +0 -6
  44. package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +0 -24
  45. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.d.ts +0 -29
  46. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +0 -2
  47. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.d.ts +0 -16
  48. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +0 -80
  49. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.d.ts +0 -12
  50. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +0 -12
  51. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.d.ts +0 -8
  52. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +0 -2
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.companyPassportCreateCompanyOfficersSuccess = exports.companyPassportCreateCompanyOfficers = exports.companyPassportUpdateCompanyOfficerFailure = exports.companyPassportUpdateCompanyOfficerSuccess = exports.companyPassportUpdateCompanyOfficer = exports.companyPassportUpdatePrimaryContactFailure = exports.companyPassportUpdatePrimaryContactSuccess = exports.companyPassportUpdatePrimaryContact = exports.dismissCapitalizationOnboarding = exports.updateCapitalizationAccountThresholdFailure = exports.updateCapitalizationAccountThresholdSuccess = exports.updateCapitalizationAccountThreshold = exports.clearQboProjectsReconnectRequest = exports.requestQboProjectsReconnect = exports.updateAccountingProjectsEnabledFailure = exports.updateAccountingProjectsEnabledSuccess = exports.disableAccountingProjects = exports.resumeEnableAccountingProjects = exports.enableAccountingProjects = exports.updateAccountingClassesEnabledFailure = exports.updateAccountingClassesEnabledSuccess = exports.updateAccountingClassesEnabled = exports.companyPassportUpdateCompanyDetailsFailure = exports.companyPassportUpdateCompanyDetailsSuccess = exports.companyPassportUpdateCompanyDetails = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.companyPassportSaveDataInLocalStore = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.clearCompanyView = 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 = void 0;
4
+ exports.companyPassportUpdateCompanyOfficerSuccess = exports.companyPassportUpdateCompanyOfficer = exports.companyPassportUpdatePrimaryContactFailure = exports.companyPassportUpdatePrimaryContactSuccess = exports.companyPassportUpdatePrimaryContact = exports.dismissCapitalizationOnboarding = exports.updateCapitalizationAccountThresholdFailure = exports.updateCapitalizationAccountThresholdSuccess = exports.updateCapitalizationAccountThreshold = exports.clearQboProjectsReconnectRequest = exports.requestQboProjectsReconnect = exports.updateAccountingProjectsEnabledFailure = exports.updateAccountingProjectsEnabledSuccess = exports.disableAccountingProjects = exports.resumeEnableAccountingProjects = exports.enableAccountingProjects = exports.updateCompanyProductServicesFailure = exports.updateCompanyProductServicesSuccess = exports.updateCompanyProductServices = exports.updateAccountingClassesEnabledFailure = exports.updateAccountingClassesEnabledSuccess = exports.updateAccountingClassesEnabled = exports.companyPassportUpdateCompanyDetailsFailure = exports.companyPassportUpdateCompanyDetailsSuccess = exports.companyPassportUpdateCompanyDetails = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.companyPassportSaveDataInLocalStore = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.clearCompanyView = 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 = void 0;
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const parentSubsidiaryViewState_1 = require("./parentSubsidiaryView/parentSubsidiaryViewState");
8
8
  const companyManagementViewState_1 = require("./types/companyManagementViewState");
@@ -381,6 +381,31 @@ const companyView = (0, toolkit_1.createSlice)({
381
381
  clearQboProjectsReconnectRequest(draft) {
382
382
  draft.passportView.needsQboProjectsReconnect = false;
383
383
  },
384
+ updateCompanyProductServices: {
385
+ reducer(draft,
386
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
387
+ _action) {
388
+ draft.passportView.productServicesUpdateStatus = {
389
+ fetchState: 'In-Progress',
390
+ error: undefined,
391
+ };
392
+ },
393
+ prepare(companyId, services) {
394
+ return { payload: { companyId, services } };
395
+ },
396
+ },
397
+ updateCompanyProductServicesSuccess(draft) {
398
+ draft.passportView.productServicesUpdateStatus = {
399
+ fetchState: 'Completed',
400
+ error: undefined,
401
+ };
402
+ },
403
+ updateCompanyProductServicesFailure(draft, action) {
404
+ draft.passportView.productServicesUpdateStatus = {
405
+ fetchState: 'Error',
406
+ error: action.payload.status,
407
+ };
408
+ },
384
409
  updateCapitalizationAccountThreshold: {
385
410
  prepare(companyId, accountId, threshold, dismissOnboardingForAccount, allOverrides) {
386
411
  return {
@@ -699,5 +724,5 @@ const companyView = (0, toolkit_1.createSlice)({
699
724
  },
700
725
  },
701
726
  });
702
- _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.clearCompanyView = _a.clearCompanyView, 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.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;
727
+ _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.clearCompanyView = _a.clearCompanyView, 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.updateCompanyProductServices = _a.updateCompanyProductServices, exports.updateCompanyProductServicesSuccess = _a.updateCompanyProductServicesSuccess, exports.updateCompanyProductServicesFailure = _a.updateCompanyProductServicesFailure, 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;
703
728
  exports.default = companyView.reducer;
@@ -0,0 +1,10 @@
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 { updateTenantProductSettings } from '../../../../entity/tenant/tenantReducer';
6
+ import { RootState } from '../../../../reducer';
7
+ import { ZeniAPI } from '../../../../zeniAPI';
8
+ import { updateCompanyProductServices, updateCompanyProductServicesFailure, updateCompanyProductServicesSuccess } from '../../companyViewReducer';
9
+ export type ActionType = ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantProductSettings> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateCompanyProductServices> | ReturnType<typeof updateCompanyProductServicesSuccess> | ReturnType<typeof updateCompanyProductServicesFailure>;
10
+ export declare const updateCompanyProductServicesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCompanyProductServicesEpic = 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 tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
9
+ const responsePayload_1 = require("../../../../responsePayload");
10
+ const companyViewReducer_1 = require("../../companyViewReducer");
11
+ const updateCompanyProductServicesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCompanyProductServices.match), (0, operators_1.switchMap)((action) => {
12
+ const { companyId, services } = action.payload;
13
+ const { isBookkeepingEnabled, isBillPayEnabled, isReimbursementEnabled } = services;
14
+ const tenantId = Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
15
+ // Send only the service-enable fields so the backend routes this through
16
+ // its isolated "enable services" path. Bookkeeping is a Tenant product
17
+ // flag and implies spend management; bill pay / reimbursement are Company
18
+ // feature flags.
19
+ const requestBody = {};
20
+ if (isBookkeepingEnabled != null) {
21
+ requestBody.is_book_keeping_enabled = isBookkeepingEnabled;
22
+ requestBody.is_spend_management_enabled = isBookkeepingEnabled;
23
+ }
24
+ if (isBillPayEnabled != null) {
25
+ requestBody.is_bill_pay_feature_enabled = isBillPayEnabled;
26
+ }
27
+ if (isReimbursementEnabled != null) {
28
+ requestBody.is_reimbursement_feature_enabled = isReimbursementEnabled;
29
+ }
30
+ return zeniAPI
31
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, requestBody)
32
+ .pipe((0, operators_1.mergeMap)((response) => {
33
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
34
+ const companies = response.data?.companies ?? [];
35
+ if (companies.length > 0) {
36
+ const actions = [
37
+ (0, companyReducer_1.updateCompanies)({
38
+ payload: companies,
39
+ schema: {},
40
+ }),
41
+ ];
42
+ // The company response carries the company feature flags; the
43
+ // tenant product flags are not part of it, so merge them from
44
+ // the (now-succeeded) request values.
45
+ if (isBookkeepingEnabled != null && tenantId != null) {
46
+ actions.push((0, tenantReducer_1.updateTenantProductSettings)({
47
+ tenantId,
48
+ isBookkeepingEnabled,
49
+ isSpendManagementEnabled: isBookkeepingEnabled,
50
+ }));
51
+ }
52
+ actions.push((0, companyViewReducer_1.updateCompanyProductServicesSuccess)());
53
+ actions.push((0, snackbarReducer_1.openSnackbar)({
54
+ messageSection: 'product_services_update',
55
+ messageText: 'success',
56
+ type: 'success',
57
+ }));
58
+ return (0, rxjs_1.from)(actions);
59
+ }
60
+ }
61
+ return (0, rxjs_1.from)([
62
+ (0, companyViewReducer_1.updateCompanyProductServicesFailure)({
63
+ status: response.status,
64
+ }),
65
+ (0, snackbarReducer_1.openSnackbar)({
66
+ messageSection: 'product_services_update',
67
+ messageText: 'failed',
68
+ type: 'error',
69
+ }),
70
+ ]);
71
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
72
+ (0, companyViewReducer_1.updateCompanyProductServicesFailure)({
73
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Company Product Services errored out' +
74
+ (error instanceof Error
75
+ ? error.message
76
+ : JSON.stringify(error))),
77
+ }),
78
+ (0, snackbarReducer_1.openSnackbar)({
79
+ messageSection: 'product_services_update',
80
+ messageText: 'failed',
81
+ type: 'error',
82
+ }),
83
+ ])));
84
+ }));
85
+ exports.updateCompanyProductServicesEpic = updateCompanyProductServicesEpic;
@@ -201,6 +201,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
201
201
  updatedCompanies.forEach((company) => {
202
202
  switch (sortKey) {
203
203
  case 'companyName':
204
+ case 'productVerticals':
204
205
  companiesWithSortKeyValue.push(company);
205
206
  break;
206
207
  case 'status':
@@ -436,6 +437,11 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
436
437
  primarySortValue = (company.company.company.companyInfo.bookCloseDate ??
437
438
  (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
438
439
  break;
440
+ case 'productVerticals':
441
+ // Not a meaningful sort axis (bookkeeping is tenant-level and not
442
+ // in this view); keep stable order rather than falling through to
443
+ // the status/group default sort.
444
+ break;
439
445
  case 'status':
440
446
  default: {
441
447
  isMultiSortApplicable = true;
@@ -4,9 +4,9 @@ import { SubscriptionViewSortKey } from '../../subscriptionView/types/subscripti
4
4
  import { FilterCategoryValueType } from '../helpers/cockpitHelpers';
5
5
  import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
6
6
  export declare const toPortfolioSortKeyType: (v: string) => "companyName" | "expenses" | "runway" | "cashBalance" | "revenues" | "netIncome";
7
- export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "controller" | "plans" | "monthlyRecurringRevenue" | "notes" | "taxStatus" | "preparer" | "reviewer" | "annualRecurringRevenue" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
7
+ export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "controller" | "plans" | "monthlyRecurringRevenue" | "notes" | "taxStatus" | "preparer" | "reviewer" | "annualRecurringRevenue" | "task" | "productVerticals" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
8
8
  export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "enroller" | "invite" | "latestCreated";
9
- export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "monthlyRecurringRevenue" | "runway" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "customerSuccessManager" | "issues" | "productVerticals" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
9
+ export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "monthlyRecurringRevenue" | "runway" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "productVerticals" | "customerSuccessManager" | "issues" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
10
10
  export declare const toTaskManagerSortKeyType: (v: string) => "status" | "name" | "priority" | "tags" | "createdBy" | "dueDate" | "assignee" | "taskName";
11
11
  export type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
12
12
  export type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
@@ -16,6 +16,7 @@ const ALL_MANAGEMENT_SORT_KEYS = [
16
16
  'status',
17
17
  'group',
18
18
  'plans',
19
+ 'productVerticals',
19
20
  'controller',
20
21
  'customerSuccessManager',
21
22
  'reviewer',
@@ -20,5 +20,6 @@ export interface CompanyPassportViewState extends CommonState, FetchedState {
20
20
  updateStatus: FetchStateAndError;
21
21
  localData?: PrimaryContactLocalData;
22
22
  };
23
+ productServicesUpdateStatus: FetchStateAndError;
23
24
  }
24
25
  export declare const initialCompanyPassportView: CompanyPassportViewState;
@@ -12,6 +12,10 @@ exports.initialCompanyPassportView = {
12
12
  fetchState: 'Not-Started',
13
13
  error: undefined,
14
14
  },
15
+ productServicesUpdateStatus: {
16
+ fetchState: 'Not-Started',
17
+ error: undefined,
18
+ },
15
19
  capitalizationThresholdUpdateStatus: {
16
20
  fetchState: 'Not-Started',
17
21
  error: undefined,
@@ -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" | "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" | "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" | "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" | "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" | "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" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "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";
42
+ messageSection: "common" | "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" | "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" | "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" | "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" | "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" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "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";
43
43
  messageText: "notification" | "failed" | "success";
44
44
  type: "error" | "success" | "info";
45
45
  variables: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.68-beta0GS",
3
+ "version": "5.1.68-beta0ND",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -1,21 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
- import { fetchJEScheduleApprovalRules, fetchJEScheduleApprovalRulesFailure, fetchJEScheduleApprovalRulesSuccess, } from '../jeScheduleApprovalRulesReducer';
5
- export const fetchJEScheduleApprovalRulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchJEScheduleApprovalRules.match), switchMap((action) => {
6
- const { cacheOverride } = action.payload;
7
- const { jeScheduleApprovalRulesState } = state$.value;
8
- const cachedSettings = jeScheduleApprovalRulesState.settings;
9
- if (cacheOverride !== true &&
10
- jeScheduleApprovalRulesState.hasValidState() === true &&
11
- cachedSettings != null) {
12
- return of(fetchJEScheduleApprovalRulesSuccess(cachedSettings));
13
- }
14
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
15
- return zeniAPI.getJSON(endpoint).pipe(mergeMap((response) => {
16
- if (isSuccessResponse(response) && response.data != null) {
17
- return of(fetchJEScheduleApprovalRulesSuccess(response.data.settings));
18
- }
19
- return of(fetchJEScheduleApprovalRulesFailure(response.status));
20
- }), catchError((error) => of(fetchJEScheduleApprovalRulesFailure(createZeniAPIStatus('Unexpected Error', 'Fetch JE approval rules errored out' + JSON.stringify(error))))));
21
- }));
@@ -1,20 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
- import { saveJEScheduleApprovalRules, saveJEScheduleApprovalRulesConflict, saveJEScheduleApprovalRulesFailure, saveJEScheduleApprovalRulesSuccess, } from '../jeScheduleApprovalRulesReducer';
5
- const HTTP_CONFLICT = 409;
6
- export const saveJEScheduleApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(saveJEScheduleApprovalRules.match), mergeMap((action) => {
7
- const { body } = action.payload;
8
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
9
- return zeniAPI
10
- .postAndGetJSON(endpoint, body)
11
- .pipe(mergeMap((response) => {
12
- if (isSuccessResponse(response) && response.data != null) {
13
- return of(saveJEScheduleApprovalRulesSuccess(response.data.settings, response.data.reevaluation_triggered));
14
- }
15
- if (response.status.code === HTTP_CONFLICT) {
16
- return of(saveJEScheduleApprovalRulesConflict(response.status));
17
- }
18
- return of(saveJEScheduleApprovalRulesFailure(response.status));
19
- }), catchError((error) => of(saveJEScheduleApprovalRulesFailure(createZeniAPIStatus('Unexpected Error', 'Save JE approval rules errored out' + JSON.stringify(error))))));
20
- }));
@@ -1,76 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- fetchState: 'Not-Started',
4
- error: undefined,
5
- saveStatus: { fetchState: 'Not-Started', error: undefined },
6
- settings: undefined,
7
- hadVersionConflict: false,
8
- reevaluationTriggered: false,
9
- hasValidState() {
10
- return this.fetchState === 'Completed';
11
- },
12
- };
13
- const jeScheduleApprovalRules = createSlice({
14
- name: 'jeScheduleApprovalRules',
15
- initialState,
16
- reducers: {
17
- fetchJEScheduleApprovalRules: {
18
- reducer(draft) {
19
- draft.fetchState = 'In-Progress';
20
- draft.error = undefined;
21
- },
22
- prepare(cacheOverride = false) {
23
- return { payload: { cacheOverride } };
24
- },
25
- },
26
- fetchJEScheduleApprovalRulesSuccess: {
27
- reducer(draft, action) {
28
- draft.fetchState = 'Completed';
29
- draft.error = undefined;
30
- draft.settings = action.payload.settings;
31
- },
32
- prepare(settings) {
33
- return { payload: { settings } };
34
- },
35
- },
36
- fetchJEScheduleApprovalRulesFailure(draft, action) {
37
- draft.fetchState = 'Error';
38
- draft.error = action.payload;
39
- },
40
- saveJEScheduleApprovalRules: {
41
- reducer(draft) {
42
- draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
43
- draft.hadVersionConflict = false;
44
- draft.reevaluationTriggered = false;
45
- },
46
- prepare(body) {
47
- return { payload: { body } };
48
- },
49
- },
50
- saveJEScheduleApprovalRulesSuccess: {
51
- reducer(draft, action) {
52
- draft.saveStatus = { fetchState: 'Completed', error: undefined };
53
- draft.settings = action.payload.settings;
54
- draft.reevaluationTriggered = action.payload.reevaluationTriggered;
55
- draft.hadVersionConflict = false;
56
- },
57
- prepare(settings, reevaluationTriggered) {
58
- return { payload: { settings, reevaluationTriggered } };
59
- },
60
- },
61
- // 409 — the stored version moved under us. The screen should re-fetch and
62
- // ask the user to re-apply. Kept distinct from a generic save failure.
63
- saveJEScheduleApprovalRulesConflict(draft, action) {
64
- draft.saveStatus = { fetchState: 'Error', error: action.payload };
65
- draft.hadVersionConflict = true;
66
- },
67
- saveJEScheduleApprovalRulesFailure(draft, action) {
68
- draft.saveStatus = { fetchState: 'Error', error: action.payload };
69
- },
70
- clearJEScheduleApprovalRules() {
71
- return initialState;
72
- },
73
- },
74
- });
75
- export const { fetchJEScheduleApprovalRules, fetchJEScheduleApprovalRulesSuccess, fetchJEScheduleApprovalRulesFailure, saveJEScheduleApprovalRules, saveJEScheduleApprovalRulesSuccess, saveJEScheduleApprovalRulesConflict, saveJEScheduleApprovalRulesFailure, clearJEScheduleApprovalRules, } = jeScheduleApprovalRules.actions;
76
- export default jeScheduleApprovalRules.reducer;
@@ -1,9 +0,0 @@
1
- import { createSelector } from '@reduxjs/toolkit';
2
- export const getJEScheduleApprovalRulesView = createSelector((state) => state.jeScheduleApprovalRulesState, (jeScheduleApprovalRulesState) => ({
3
- fetchState: jeScheduleApprovalRulesState.fetchState,
4
- error: jeScheduleApprovalRulesState.error,
5
- saveStatus: jeScheduleApprovalRulesState.saveStatus,
6
- settings: jeScheduleApprovalRulesState.settings,
7
- hadVersionConflict: jeScheduleApprovalRulesState.hadVersionConflict ?? false,
8
- reevaluationTriggered: jeScheduleApprovalRulesState.reevaluationTriggered ?? false,
9
- }));
@@ -1,7 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../../reducer';
4
- import { ZeniAPI } from '../../../../zeniAPI';
5
- import { fetchJEScheduleApprovalRules, fetchJEScheduleApprovalRulesFailure, fetchJEScheduleApprovalRulesSuccess } from '../jeScheduleApprovalRulesReducer';
6
- export type ActionType = ReturnType<typeof fetchJEScheduleApprovalRules> | ReturnType<typeof fetchJEScheduleApprovalRulesSuccess> | ReturnType<typeof fetchJEScheduleApprovalRulesFailure>;
7
- export declare const fetchJEScheduleApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchJEScheduleApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const jeScheduleApprovalRulesReducer_1 = require("../jeScheduleApprovalRulesReducer");
8
- const fetchJEScheduleApprovalRulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRules.match), (0, operators_1.switchMap)((action) => {
9
- const { cacheOverride } = action.payload;
10
- const { jeScheduleApprovalRulesState } = state$.value;
11
- const cachedSettings = jeScheduleApprovalRulesState.settings;
12
- if (cacheOverride !== true &&
13
- jeScheduleApprovalRulesState.hasValidState() === true &&
14
- cachedSettings != null) {
15
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesSuccess)(cachedSettings));
16
- }
17
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
18
- return zeniAPI.getJSON(endpoint).pipe((0, operators_1.mergeMap)((response) => {
19
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
20
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesSuccess)(response.data.settings));
21
- }
22
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesFailure)(response.status));
23
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch JE approval rules errored out' + JSON.stringify(error))))));
24
- }));
25
- exports.fetchJEScheduleApprovalRulesEpic = fetchJEScheduleApprovalRulesEpic;
@@ -1,6 +0,0 @@
1
- import { ActionsObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { ZeniAPI } from '../../../../zeniAPI';
4
- import { saveJEScheduleApprovalRules, saveJEScheduleApprovalRulesConflict, saveJEScheduleApprovalRulesFailure, saveJEScheduleApprovalRulesSuccess } from '../jeScheduleApprovalRulesReducer';
5
- export type ActionType = ReturnType<typeof saveJEScheduleApprovalRules> | ReturnType<typeof saveJEScheduleApprovalRulesSuccess> | ReturnType<typeof saveJEScheduleApprovalRulesConflict> | ReturnType<typeof saveJEScheduleApprovalRulesFailure>;
6
- export declare const saveJEScheduleApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveJEScheduleApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const jeScheduleApprovalRulesReducer_1 = require("../jeScheduleApprovalRulesReducer");
8
- const HTTP_CONFLICT = 409;
9
- const saveJEScheduleApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRules.match), (0, operators_1.mergeMap)((action) => {
10
- const { body } = action.payload;
11
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
12
- return zeniAPI
13
- .postAndGetJSON(endpoint, body)
14
- .pipe((0, operators_1.mergeMap)((response) => {
15
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
16
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesSuccess)(response.data.settings, response.data.reevaluation_triggered));
17
- }
18
- if (response.status.code === HTTP_CONFLICT) {
19
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesConflict)(response.status));
20
- }
21
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesFailure)(response.status));
22
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save JE approval rules errored out' + JSON.stringify(error))))));
23
- }));
24
- exports.saveJEScheduleApprovalRulesEpic = saveJEScheduleApprovalRulesEpic;
@@ -1,29 +0,0 @@
1
- import { ZeniAPIResponse } from '../../../responsePayload';
2
- export type JEScheduleType = 'prepaid_expenses' | 'fixed_assets' | 'accrued_expenses';
3
- export interface JEApprovalThresholdRow {
4
- account_id: string;
5
- account_name: string;
6
- max_auto_post_amount: number | null;
7
- schedule_type: JEScheduleType;
8
- }
9
- export interface JEApprovalSettings {
10
- approver_roles: string[];
11
- reevaluate_ongoing_on_threshold_change: boolean;
12
- thresholds: JEApprovalThresholdRow[];
13
- version: number;
14
- }
15
- export interface JEScheduleApprovalRulesResponseData {
16
- exists: boolean;
17
- settings: JEApprovalSettings;
18
- }
19
- export type JEScheduleApprovalRulesResponse = ZeniAPIResponse<JEScheduleApprovalRulesResponseData>;
20
- export interface SaveJEScheduleApprovalRulesResponseData extends JEScheduleApprovalRulesResponseData {
21
- reevaluation_triggered: boolean;
22
- }
23
- export type SaveJEScheduleApprovalRulesResponse = ZeniAPIResponse<SaveJEScheduleApprovalRulesResponseData>;
24
- export interface SaveJEScheduleApprovalRulesRequestBody extends Record<string, unknown> {
25
- approver_roles: string[];
26
- reevaluate_ongoing_on_threshold_change: boolean;
27
- thresholds: JEApprovalThresholdRow[];
28
- expected_version?: number;
29
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +0,0 @@
1
- import { ZeniAPIStatus } from '../../../responsePayload';
2
- import { JEApprovalSettings, SaveJEScheduleApprovalRulesRequestBody } from './jeScheduleApprovalRulesPayload';
3
- import { JEScheduleApprovalRulesState } from './jeScheduleApprovalRulesState';
4
- export declare const initialState: JEScheduleApprovalRulesState;
5
- export declare const fetchJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
6
- cacheOverride: any;
7
- }, "jeScheduleApprovalRules/fetchJEScheduleApprovalRules", never, never>, fetchJEScheduleApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[settings: JEApprovalSettings], {
8
- settings: JEApprovalSettings;
9
- }, "jeScheduleApprovalRules/fetchJEScheduleApprovalRulesSuccess", never, never>, fetchJEScheduleApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/fetchJEScheduleApprovalRulesFailure">, saveJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[body: SaveJEScheduleApprovalRulesRequestBody], {
10
- body: SaveJEScheduleApprovalRulesRequestBody;
11
- }, "jeScheduleApprovalRules/saveJEScheduleApprovalRules", never, never>, saveJEScheduleApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[settings: JEApprovalSettings, reevaluationTriggered: boolean], {
12
- settings: JEApprovalSettings;
13
- reevaluationTriggered: boolean;
14
- }, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesSuccess", never, never>, saveJEScheduleApprovalRulesConflict: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesConflict">, saveJEScheduleApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesFailure">, clearJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeScheduleApprovalRules/clearJEScheduleApprovalRules">;
15
- declare const _default: import("redux").Reducer<JEScheduleApprovalRulesState>;
16
- export default _default;