@zeniai/client-epic-state 4.14.65 → 4.14.66

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.
@@ -9,6 +9,7 @@ const companyReducer_1 = require("../../../../../entity/company/companyReducer")
9
9
  const fileReducer_1 = require("../../../../../entity/file/fileReducer");
10
10
  const paymentAccountReducer_1 = require("../../../../../entity/paymentAccount/paymentAccountReducer");
11
11
  const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
12
+ const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
12
13
  const userReducer_1 = require("../../../../../entity/user/userReducer");
13
14
  const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReducer");
14
15
  const responsePayload_1 = require("../../../../../responsePayload");
@@ -76,6 +77,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
76
77
  return zeniAPI
77
78
  .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
78
79
  .pipe((0, operators_1.mergeMap)((response) => {
80
+ var _a, _b;
79
81
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
80
82
  const { users } = response.data;
81
83
  const actions = [
@@ -90,6 +92,17 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
90
92
  (0, accountReducer_1.updateAccounts)(response.data.accounts, 'onboarding'),
91
93
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
92
94
  ];
95
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
96
+ const externalConnections = currentTenant.externalConnections;
97
+ const isQBOConnection = (_b = (_a = externalConnections === null || externalConnections === void 0 ? void 0 : externalConnections.accounting) === null || _a === void 0 ? void 0 : _a.some((connection) => connection.connectionName.match(/quickbooks/i))) !== null && _b !== void 0 ? _b : false;
98
+ if (currentStep === 'link_payment_account') {
99
+ if (isQBOConnection === true) {
100
+ actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'qbo_connection' }));
101
+ }
102
+ else {
103
+ actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'company_officer' }));
104
+ }
105
+ }
93
106
  if (currentStep === 'company_officer') {
94
107
  actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'company_details' }));
95
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.14.65",
3
+ "version": "4.14.66",
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
  "types": "lib/index.d.ts",