@zeniai/client-epic-state 4.14.49 → 4.14.50
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.
- package/lib/entity/companyHealthMetric/companyHealthMetricPayload.js +0 -3
- package/lib/entity/companyHealthMetric/companyHealthMetricState.d.ts +0 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/view/companyHealthMetricView/companyHealthMetricView.d.ts +0 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -23
- package/lib/view/companyHealthMetricView/epic/initializeCompanyHealthMetricViewLocalData.js +1 -2
- package/lib/view/companyHealthMetricView/epic/saveCompanyHealthMetricByIdEpic.js +1 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.js +0 -1
- package/package.json +1 -1
|
@@ -25,9 +25,6 @@ const toCompanyHealthMetrics = (payload) => {
|
|
|
25
25
|
churnProbabilityPercentage: (_a = payload.churn_probability_percentage) !== null && _a !== void 0 ? _a : undefined,
|
|
26
26
|
netPromoterScore: (_b = payload.net_promoter_score) !== null && _b !== void 0 ? _b : undefined,
|
|
27
27
|
customerSatisfactionScore: (_c = payload.customer_satisfaction_score) !== null && _c !== void 0 ? _c : undefined,
|
|
28
|
-
finOpsEngagementFrequency: payload.finops_engagement_frequency != null
|
|
29
|
-
? (0, companyPayload_1.toAllowedValueWithCode)(payload.finops_engagement_frequency)
|
|
30
|
-
: undefined,
|
|
31
28
|
externalProductServiceExposure: payload.external_product_service_exposure != null
|
|
32
29
|
? (0, companyPayload_1.toAllowedValueWithCode)(payload.external_product_service_exposure)
|
|
33
30
|
: undefined,
|
|
@@ -23,7 +23,6 @@ export interface CompanyHealthMetric {
|
|
|
23
23
|
churnProbabilityPercentage?: number;
|
|
24
24
|
netPromoterScore?: number;
|
|
25
25
|
customerSatisfactionScore?: number;
|
|
26
|
-
finOpsEngagementFrequency?: AllowedValueWithCode;
|
|
27
26
|
externalProductServiceExposure?: AllowedValueWithCode;
|
|
28
27
|
lastEngagements: LastEngagement[];
|
|
29
28
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ import { updateChargeCardTransactionAttachments } from './entity/chargeCardTrans
|
|
|
58
58
|
import { getControllersName, getFirstControllerEmail, getFirstControllerId } from './entity/company/companyHelper';
|
|
59
59
|
import { CompanyWithSchema, ControllerUserDetails, getCompanyByCompanyId, getCompanyInfoForAllCockpitCompaniesInState, getControllersForCompany } from './entity/company/companySelector';
|
|
60
60
|
import { ALL_ACCOUNTING_CONNECTION_CREATION_MODES, AccountingConnectionCreationMode, Company, CompanyBillPayInfo, CompanyConfigInfo, CompanyFeaturesActivationInfo, CompanyIncInfo, CompanyInfo, CompanyLocaleInfo, CompanyManagementInfo, CompanyManagementUserRole, CompanyMileageConfigInfo, CompanyQuestionaire, CompanyReimbursementInfo, CompanyTaxInfo, CompanyZeniAccountInfo, IdentityVerificationStatus, OnboardingIdentityVerficationStatus, OnboardingInfo, OnboardingStepInfo, OnboardingStepsInfo, ParentSubsidiaryInfo, UserReimbursementInfo } from './entity/company/companyStateTypes';
|
|
61
|
+
import { updateCompaniesHealth, updateCompanyHealth } from './entity/companyHealthMetric/companyHealthMetricReducer';
|
|
62
|
+
import { CompanyHealthMetric, CompanyRunway, LastEngagement, VerticalProductServices } from './entity/companyHealthMetric/companyHealthMetricState';
|
|
61
63
|
import { Country } from './entity/countryList/countryListState';
|
|
62
64
|
import { CountryWithCurrency } from './entity/currency/currency';
|
|
63
65
|
import { Customer, CustomerBase, defaultCustomerCurrency } from './entity/customer/customerState';
|
|
@@ -204,8 +206,6 @@ import { VendorDetailTabsType, VendorsTabVendorBasic, VendorsTabVendorDetailPage
|
|
|
204
206
|
import { CollapsableStatusKey, VendorsTabVendorDetailLocalData, VendorsTabVendorViewUIState } from './view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState';
|
|
205
207
|
import { fetchCompanyConfig } from './view/companyConfigView/companyConfigReducer';
|
|
206
208
|
import { getCompanyConfig } from './view/companyConfigView/companyConfigSelector';
|
|
207
|
-
import { updateCompanyHealth, updateCompaniesHealth } from './entity/companyHealthMetric/companyHealthMetricReducer';
|
|
208
|
-
import { CompanyHealthMetric, VerticalProductServices, CompanyRunway, LastEngagement } from './entity/companyHealthMetric/companyHealthMetricState';
|
|
209
209
|
import { CompanyHealthMetricsLocalData, CompanyHealthViewUIState } from './view/companyHealthMetricView/companyHealthMetricView';
|
|
210
210
|
import { clearCompanyHealthMetricView, fetchCompanyHealthMetricView, initializeCompanyHealthMetricViewLocalData, removeSelectedCompanyId, saveCompanyHealthMetricById, updateLocalStore as updateCompanyHealthMetricLocalStore, updateCompanyHealthMetricViewErrorStatus, updateCompanyHealthMetricViewSuccessStatus, updateCompanyHealthViewUIState } from './view/companyHealthMetricView/companyHealthMetricViewReducer';
|
|
211
211
|
import { CompanyDetailWithHealthMetric, CompanyHealthMetricDropDownOption, CompanyHealthMetricViewSelector, ProductServiceKey, ProductServices, companyHealthMetricDropDownOptions, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, isCompanyRunwayInfinite } from './view/companyHealthMetricView/companyHealthMetricViewSelector';
|
package/lib/index.js
CHANGED
|
@@ -186,6 +186,9 @@ Object.defineProperty(exports, "getCompanyInfoForAllCockpitCompaniesInState", {
|
|
|
186
186
|
Object.defineProperty(exports, "getControllersForCompany", { enumerable: true, get: function () { return companySelector_1.getControllersForCompany; } });
|
|
187
187
|
const companyStateTypes_1 = require("./entity/company/companyStateTypes");
|
|
188
188
|
Object.defineProperty(exports, "ALL_ACCOUNTING_CONNECTION_CREATION_MODES", { enumerable: true, get: function () { return companyStateTypes_1.ALL_ACCOUNTING_CONNECTION_CREATION_MODES; } });
|
|
189
|
+
const companyHealthMetricReducer_1 = require("./entity/companyHealthMetric/companyHealthMetricReducer");
|
|
190
|
+
Object.defineProperty(exports, "updateCompaniesHealth", { enumerable: true, get: function () { return companyHealthMetricReducer_1.updateCompaniesHealth; } });
|
|
191
|
+
Object.defineProperty(exports, "updateCompanyHealth", { enumerable: true, get: function () { return companyHealthMetricReducer_1.updateCompanyHealth; } });
|
|
189
192
|
const customerState_1 = require("./entity/customer/customerState");
|
|
190
193
|
Object.defineProperty(exports, "defaultCustomerCurrency", { enumerable: true, get: function () { return customerState_1.defaultCustomerCurrency; } });
|
|
191
194
|
const customerIncomeTrend_1 = require("./entity/customerIncome/customerIncomeTrend");
|
|
@@ -540,9 +543,6 @@ const companyConfigReducer_1 = require("./view/companyConfigView/companyConfigRe
|
|
|
540
543
|
Object.defineProperty(exports, "fetchCompanyConfig", { enumerable: true, get: function () { return companyConfigReducer_1.fetchCompanyConfig; } });
|
|
541
544
|
const companyConfigSelector_1 = require("./view/companyConfigView/companyConfigSelector");
|
|
542
545
|
Object.defineProperty(exports, "getCompanyConfig", { enumerable: true, get: function () { return companyConfigSelector_1.getCompanyConfig; } });
|
|
543
|
-
const companyHealthMetricReducer_1 = require("./entity/companyHealthMetric/companyHealthMetricReducer");
|
|
544
|
-
Object.defineProperty(exports, "updateCompanyHealth", { enumerable: true, get: function () { return companyHealthMetricReducer_1.updateCompanyHealth; } });
|
|
545
|
-
Object.defineProperty(exports, "updateCompaniesHealth", { enumerable: true, get: function () { return companyHealthMetricReducer_1.updateCompaniesHealth; } });
|
|
546
546
|
const companyHealthMetricViewReducer_1 = require("./view/companyHealthMetricView/companyHealthMetricViewReducer");
|
|
547
547
|
Object.defineProperty(exports, "clearCompanyHealthMetricView", { enumerable: true, get: function () { return companyHealthMetricViewReducer_1.clearCompanyHealthMetricView; } });
|
|
548
548
|
Object.defineProperty(exports, "fetchCompanyHealthMetricView", { enumerable: true, get: function () { return companyHealthMetricViewReducer_1.fetchCompanyHealthMetricView; } });
|
|
@@ -46,7 +46,6 @@ const ALL_PRODUCT_SERVICE = [
|
|
|
46
46
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
47
|
const toProductServiceKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_PRODUCT_SERVICE);
|
|
48
48
|
const ALL_HEALTH_METRIC_KEYS = [
|
|
49
|
-
'finOpsEngagementFrequency',
|
|
50
49
|
'externalProductServiceExposure',
|
|
51
50
|
'netPromoterScore',
|
|
52
51
|
'customerSatisfactionScore',
|
|
@@ -54,8 +53,7 @@ const ALL_HEALTH_METRIC_KEYS = [
|
|
|
54
53
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
54
|
const toHealthMetricKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_HEALTH_METRIC_KEYS);
|
|
56
55
|
const toCompanyHealthMetricEntityType = (key) => {
|
|
57
|
-
if (key === '
|
|
58
|
-
key === 'externalProductServiceExposure') {
|
|
56
|
+
if (key === 'externalProductServiceExposure') {
|
|
59
57
|
return `${key}.code`;
|
|
60
58
|
}
|
|
61
59
|
else {
|
|
@@ -146,10 +144,6 @@ const hasCompanyHealthMetricFormFieldChanged = (entityData, formData) => {
|
|
|
146
144
|
}
|
|
147
145
|
// Define the fields to compare with their respective property paths
|
|
148
146
|
const fieldsToCompare = [
|
|
149
|
-
{
|
|
150
|
-
entityKey: toCompanyHealthMetricEntityType('finOpsEngagementFrequency'),
|
|
151
|
-
formKey: 'finOpsEngagementFrequency',
|
|
152
|
-
},
|
|
153
147
|
{
|
|
154
148
|
entityKey: toCompanyHealthMetricEntityType('externalProductServiceExposure'),
|
|
155
149
|
formKey: 'externalProductServiceExposure',
|
|
@@ -237,10 +231,6 @@ const getCategoryValueForCompany = (key, company) => {
|
|
|
237
231
|
return company.companyHealthMetric.externalProductServiceExposure != null
|
|
238
232
|
? company.companyHealthMetric.externalProductServiceExposure.code
|
|
239
233
|
: undefined;
|
|
240
|
-
case 'finOpsEngagementFrequency':
|
|
241
|
-
return company.companyHealthMetric.finOpsEngagementFrequency != null
|
|
242
|
-
? company.companyHealthMetric.finOpsEngagementFrequency.code
|
|
243
|
-
: undefined;
|
|
244
234
|
case 'companyEngagementMetricsUpdatedAt':
|
|
245
235
|
return ((_d = company.companyHealthMetric.companyEngagementMetricsUpdatedAt) !== null && _d !== void 0 ? _d : undefined);
|
|
246
236
|
case 'companyGroupId':
|
|
@@ -430,14 +420,6 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
430
420
|
companiesWithNoSortKeyValues.push(company);
|
|
431
421
|
}
|
|
432
422
|
break;
|
|
433
|
-
case 'finOpsEngagementFrequency':
|
|
434
|
-
if (company.companyHealthMetric.finOpsEngagementFrequency != null) {
|
|
435
|
-
companiesWithSortKeyValues.push(company);
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
companiesWithNoSortKeyValues.push(company);
|
|
439
|
-
}
|
|
440
|
-
break;
|
|
441
423
|
case 'companyEngagementMetricsUpdatedAt':
|
|
442
424
|
if (company.companyHealthMetric.companyEngagementMetricsUpdatedAt != null) {
|
|
443
425
|
companiesWithSortKeyValues.push(company);
|
|
@@ -496,10 +478,6 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
496
478
|
null
|
|
497
479
|
? getSortOrderForFrequency(company.companyHealthMetric.externalProductServiceExposure.code.toLowerCase())
|
|
498
480
|
: MAX_FREQUENCY_VALUE;
|
|
499
|
-
case 'finOpsEngagementFrequency':
|
|
500
|
-
return company.companyHealthMetric.finOpsEngagementFrequency != null
|
|
501
|
-
? getSortOrderForFrequency(company.companyHealthMetric.finOpsEngagementFrequency.code.toLowerCase())
|
|
502
|
-
: MAX_FREQUENCY_VALUE;
|
|
503
481
|
case 'companyEngagementMetricsUpdatedAt':
|
|
504
482
|
return ((_h = company.companyHealthMetric.companyEngagementMetricsUpdatedAt) !== null && _h !== void 0 ? _h : DEFAULT_DATE);
|
|
505
483
|
case 'monthlyRecurringRevenue':
|
|
@@ -12,13 +12,12 @@ const initializeCompanyHealthMetricViewLocalDataEpic = (actions$, state$) => act
|
|
|
12
12
|
const { companyHealthMetricState } = state;
|
|
13
13
|
const companyHealthMetric = (0, companyHealthMetricSelector_1.getCompanyHealthMetricByCompanyId)(companyHealthMetricState, companyId);
|
|
14
14
|
if (companyHealthMetric != null) {
|
|
15
|
-
const { netPromoterScore,
|
|
15
|
+
const { netPromoterScore, externalProductServiceExposure, customerSatisfactionScore, } = companyHealthMetric;
|
|
16
16
|
companyHealthMetricActions.push((0, companyHealthMetricViewReducer_1.updateLocalStore)({
|
|
17
17
|
companyId,
|
|
18
18
|
updatedLocalData: {
|
|
19
19
|
netPromoterScore,
|
|
20
20
|
customerSatisfactionScore,
|
|
21
|
-
finOpsEngagementFrequency: finOpsEngagementFrequency === null || finOpsEngagementFrequency === void 0 ? void 0 : finOpsEngagementFrequency.code,
|
|
22
21
|
externalProductServiceExposure: externalProductServiceExposure === null || externalProductServiceExposure === void 0 ? void 0 : externalProductServiceExposure.code,
|
|
23
22
|
},
|
|
24
23
|
}));
|
|
@@ -11,12 +11,11 @@ const saveCompanyHealthMetricByIdEpic = (actions$, _state$, zeniAPI) => actions$
|
|
|
11
11
|
const companyId = action.payload;
|
|
12
12
|
const { companyHealthMetricViewState } = _state$.value;
|
|
13
13
|
const companyHealthMetricData = companyHealthMetricViewState.companyHealthMetricUpdateStatusById[companyId];
|
|
14
|
-
const { netPromoterScore, externalProductServiceExposure,
|
|
14
|
+
const { netPromoterScore, externalProductServiceExposure, customerSatisfactionScore, } = companyHealthMetricData.companyHealthMetricLocalData;
|
|
15
15
|
return zeniAPI
|
|
16
16
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-health-metrics/${companyId}`, {
|
|
17
17
|
net_promoter_score: Boolean(netPromoterScore) === true ? netPromoterScore : null,
|
|
18
18
|
external_product_service_exposure: externalProductServiceExposure,
|
|
19
|
-
finops_engagement_frequency: finOpsEngagementFrequency,
|
|
20
19
|
customer_satisfaction_score: Boolean(customerSatisfactionScore) === true
|
|
21
20
|
? customerSatisfactionScore
|
|
22
21
|
: null,
|
|
@@ -6,7 +6,7 @@ import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
|
|
|
6
6
|
export declare const toPortfolioSortKeyType: (v: string) => "expenses" | "runway" | "companyName" | "cashBalance" | "revenues" | "netIncome";
|
|
7
7
|
export declare const toManagementSortKeyType: (v: string) => "status" | "group" | "bookCloseDate" | "controller" | "preparer" | "reviewer" | "annualRecurringRevenue" | "monthlyRecurringRevenue" | "companyName" | "taxStatus" | "notes" | "plans" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
|
|
8
8
|
export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "bankAccountLinked" | "qboLinked" | "identityVerified" | "businessVerified" | "groupCreated" | "customerCreated" | "enroller" | "invite" | "latestCreated";
|
|
9
|
-
export declare const toHealthSortKeyType: (v: string) => "group" | "runway" | "controller" | "monthlyRecurringRevenue" | "companyName" | "
|
|
9
|
+
export declare const toHealthSortKeyType: (v: string) => "group" | "runway" | "controller" | "monthlyRecurringRevenue" | "companyName" | "companyEngagementMetricsUpdatedAt" | "netPromoterScore" | "customerSatisfactionScore" | "externalProductServiceExposure" | "customerSuccessManager" | "issues" | "productVerticals" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
|
|
10
10
|
export declare const toTaskManagerSortKeyType: (v: string) => "name" | "priority" | "status" | "dueDate" | "tags" | "createdBy" | "taskName" | "assignee";
|
|
11
11
|
export type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
|
|
12
12
|
export type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
|
|
@@ -16,7 +16,7 @@ export type TaskManagerViewSortKey = ReturnType<typeof toTaskManagerSortKeyType>
|
|
|
16
16
|
export type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerSuccessManagerUserIds' | 'preparerUserIds' | 'reviewerUserIds' | 'apAnalystUserIds' | 'taxLeadUserIds' | 'companyGroupId' | 'taxStatusCode' | 'statusCode' | 'plans' | 'annualRecurringRevenue' | 'monthlyRecurringRevenue' | 'customerSatisfaction' | 'zeniSatisfaction';
|
|
17
17
|
export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
|
|
18
18
|
export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
|
|
19
|
-
export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | '
|
|
19
|
+
export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
|
|
20
20
|
export interface CockpitFilterCategory {
|
|
21
21
|
field?: ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
22
22
|
matchingOperator: 'equal' | 'not-equal';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.50",
|
|
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",
|