@zeniai/client-epic-state 4.9.75 → 4.9.77

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.
@@ -20,6 +20,7 @@ export interface CompanyHealthMetricPayload {
20
20
  company_engagement_metrics_update_time?: string | null;
21
21
  churn_probability_percentage?: number | null;
22
22
  net_promoter_score?: number | null;
23
+ customer_satisfaction_score?: number | null;
23
24
  finops_engagement_frequency?: {
24
25
  code: string | null;
25
26
  name: string | null;
@@ -4,7 +4,7 @@ exports.toVerticalProductServices = exports.toChurnProbabilityReason = exports.t
4
4
  const zeniDayJS_1 = require("../../zeniDayJS");
5
5
  const companyPayload_1 = require("../company/companyPayload");
6
6
  const toCompanyHealthMetrics = (payload) => {
7
- var _a, _b;
7
+ var _a, _b, _c;
8
8
  return {
9
9
  companyId: payload.company_id,
10
10
  runway: toCompanyRunway(payload.runway),
@@ -25,6 +25,7 @@ const toCompanyHealthMetrics = (payload) => {
25
25
  : undefined,
26
26
  churnProbabilityPercentage: (_a = payload.churn_probability_percentage) !== null && _a !== void 0 ? _a : undefined,
27
27
  netPromoterScore: (_b = payload.net_promoter_score) !== null && _b !== void 0 ? _b : undefined,
28
+ customerSatisfactionScore: (_c = payload.customer_satisfaction_score) !== null && _c !== void 0 ? _c : undefined,
28
29
  finOpsEngagementFrequency: payload.finops_engagement_frequency != null
29
30
  ? (0, companyPayload_1.toAllowedValueWithCode)(payload.finops_engagement_frequency)
30
31
  : undefined,
@@ -23,6 +23,7 @@ export interface CompanyHealthMetric {
23
23
  companyEngagementMetricsUpdatedAt?: ZeniDate;
24
24
  churnProbabilityPercentage?: number;
25
25
  netPromoterScore?: number;
26
+ customerSatisfactionScore?: number;
26
27
  finOpsEngagementFrequency?: AllowedValueWithCode;
27
28
  externalProductServiceExposure?: AllowedValueWithCode;
28
29
  }
@@ -19,6 +19,7 @@ export interface EditCompanyHealthMetrics {
19
19
  }
20
20
  export interface CompanyHealthMetricsLocalData {
21
21
  netPromoterScore?: number;
22
+ customerSatisfactionScore?: number;
22
23
  finOpsEngagementFrequency?: string;
23
24
  externalProductServiceExposure?: string;
24
25
  }
@@ -116,11 +116,13 @@ const hasCompanyHealthMetricFormFieldChanged = (entityData, formData) => {
116
116
  if (entityData.finOpsEngagementFrequency == null ||
117
117
  entityData.externalProductServiceExposure == null ||
118
118
  entityData.netPromoterScore == null ||
119
+ entityData.customerSatisfactionScore == null ||
119
120
  ((_a = entityData.finOpsEngagementFrequency) === null || _a === void 0 ? void 0 : _a.code) !==
120
121
  formData.finOpsEngagementFrequency ||
121
122
  ((_b = entityData.externalProductServiceExposure) === null || _b === void 0 ? void 0 : _b.code) !==
122
123
  formData.externalProductServiceExposure ||
123
- entityData.netPromoterScore !== formData.netPromoterScore) {
124
+ entityData.netPromoterScore !== formData.netPromoterScore ||
125
+ entityData.customerSatisfactionScore !== formData.customerSatisfactionScore) {
124
126
  return true;
125
127
  }
126
128
  else {
@@ -172,6 +174,10 @@ const getCategoryValueForCompany = (key, company) => {
172
174
  return company.companyHealthMetric.netPromoterScore != null
173
175
  ? company.companyHealthMetric.netPromoterScore.toString()
174
176
  : undefined;
177
+ case 'customerSatisfactionScore':
178
+ return company.companyHealthMetric.customerSatisfactionScore != null
179
+ ? company.companyHealthMetric.customerSatisfactionScore.toString()
180
+ : undefined;
175
181
  case 'churnProbabilityPercentage':
176
182
  default:
177
183
  return company.companyHealthMetric.churnProbabilityPercentage != null
@@ -215,6 +221,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
215
221
  'runway',
216
222
  'churnProbabilityPercentage',
217
223
  'netPromoterScore',
224
+ 'customerSatisfactionScore',
218
225
  'subscriptionStartDate',
219
226
  'subscriptionRenewalDate',
220
227
  'lastReportSent',
@@ -299,8 +306,17 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
299
306
  if (company.companyHealthMetric.netPromoterScore != null) {
300
307
  companiesWithSortKeyValues.push(company);
301
308
  }
302
- else
309
+ else {
310
+ companiesWithNoSortKeyValues.push(company);
311
+ }
312
+ break;
313
+ case 'customerSatisfactionScore':
314
+ if (company.companyHealthMetric.customerSatisfactionScore != null) {
315
+ companiesWithSortKeyValues.push(company);
316
+ }
317
+ else {
303
318
  companiesWithNoSortKeyValues.push(company);
319
+ }
304
320
  break;
305
321
  case 'controller':
306
322
  companiesWithSortKeyValues.push(company);
@@ -317,7 +333,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
317
333
  }
318
334
  });
319
335
  const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, (company) => {
320
- var _a, _b, _c, _d, _e, _f;
336
+ var _a, _b, _c, _d, _e, _f, _g;
321
337
  switch (sortKey) {
322
338
  case 'productVerticals':
323
339
  return company.noOfProductVerticalsEnabled;
@@ -338,6 +354,8 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
338
354
  return ((_e = company.companyHealthMetric.subscriptionStartDate) !== null && _e !== void 0 ? _e : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z'));
339
355
  case 'netPromoterScore':
340
356
  return (_f = company.companyHealthMetric.netPromoterScore) !== null && _f !== void 0 ? _f : 0;
357
+ case 'customerSatisfactionScore':
358
+ return (_g = company.companyHealthMetric.customerSatisfactionScore) !== null && _g !== void 0 ? _g : 0;
341
359
  case 'controller':
342
360
  return company.managegmentInfo.controllerUserIds.length;
343
361
  case 'customerSuccessManager':
@@ -12,11 +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, finOpsEngagementFrequency, externalProductServiceExposure, } = companyHealthMetric;
15
+ const { netPromoterScore, finOpsEngagementFrequency, externalProductServiceExposure, customerSatisfactionScore, } = companyHealthMetric;
16
16
  companyHealthMetricActions.push((0, companyHealthMetricViewReducer_1.updateLocalStore)({
17
17
  companyId,
18
18
  updatedLocalData: {
19
- netPromoterScore: netPromoterScore,
19
+ netPromoterScore,
20
+ customerSatisfactionScore,
20
21
  finOpsEngagementFrequency: finOpsEngagementFrequency === null || finOpsEngagementFrequency === void 0 ? void 0 : finOpsEngagementFrequency.code,
21
22
  externalProductServiceExposure: externalProductServiceExposure === null || externalProductServiceExposure === void 0 ? void 0 : externalProductServiceExposure.code,
22
23
  },
@@ -11,12 +11,13 @@ 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, finOpsEngagementFrequency, } = companyHealthMetricData.companyHealthMetricLocalData;
14
+ const { netPromoterScore, externalProductServiceExposure, finOpsEngagementFrequency, customerSatisfactionScore, } = companyHealthMetricData.companyHealthMetricLocalData;
15
15
  return zeniAPI
16
16
  .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-health-metrics/${companyId}`, {
17
17
  net_promoter_score: netPromoterScore,
18
18
  external_product_service_exposure: externalProductServiceExposure,
19
19
  finops_engagement_frequency: finOpsEngagementFrequency,
20
+ customer_satisfaction_score: customerSatisfactionScore,
20
21
  })
21
22
  .pipe((0, operators_1.mergeMap)((response) => {
22
23
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
@@ -6,11 +6,11 @@ import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
6
6
  export declare const ALL_PORTFOLIO_SORT_KEYS: readonly ["companyName", "cashBalance", "runway", "expenses", "revenues", "netIncome"];
7
7
  export declare const ALL_MANAGEMENT_SORT_KEYS: readonly ["companyName", "task", "status", "group", "plans", "controller", "customerSuccessManager", "reviewer", "preparer", "apAnalyst", "reportSent", "taxStatus", "taxLead", "monthlyRecurringRevenue", "annualRecurringRevenue", "notes", "satisfaction", "bookCloseDate"];
8
8
  export declare const ALL_ONBOARDING_SORT_KEYS: readonly ["companyName", "bankAccountLinked", "qboLinked", "identityVerified", "businessVerified", "groupCreated", "customerCreated", "enroller", "notes", "invite"];
9
- export declare const ALL_HEALTH_SORT_KEYS: readonly ["companyName", "issues", "productVerticals", "runway", "churnProbability", "netPromoterScore", "controller", "customerSuccessManager", "lastReportSent", "subscriptionDate", "renewalDate"];
9
+ export declare const ALL_HEALTH_SORT_KEYS: readonly ["companyName", "issues", "productVerticals", "runway", "churnProbability", "netPromoterScore", "customerSatisfactionScore", "controller", "customerSuccessManager", "lastReportSent", "subscriptionDate", "renewalDate"];
10
10
  export declare const toPortfolioSortKeyType: (v: string) => "expenses" | "runway" | "cashBalance" | "netIncome" | "companyName" | "revenues";
11
11
  export declare const toManagementSortKeyType: (v: string) => "status" | "group" | "bookCloseDate" | "controller" | "preparer" | "reviewer" | "companyName" | "monthlyRecurringRevenue" | "annualRecurringRevenue" | "taxStatus" | "plans" | "notes" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
12
12
  export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "identityVerified" | "businessVerified" | "bankAccountLinked" | "qboLinked" | "groupCreated" | "customerCreated" | "notes" | "enroller" | "invite";
13
- export declare const toHealthSortKeyType: (v: string) => "runway" | "controller" | "companyName" | "customerSuccessManager" | "netPromoterScore" | "lastReportSent" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate";
13
+ export declare const toHealthSortKeyType: (v: string) => "runway" | "controller" | "companyName" | "customerSuccessManager" | "netPromoterScore" | "customerSatisfactionScore" | "lastReportSent" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate";
14
14
  export declare type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
15
15
  export declare type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
16
16
  export declare type OnboardingViewSortKey = ReturnType<typeof toOnboardingSortKeyType>;
@@ -18,7 +18,7 @@ export declare type HealthViewSortKey = ReturnType<typeof toHealthSortKeyType>;
18
18
  export declare type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerSuccessManagerUserIds' | 'preparerUserIds' | 'reviewerUserIds' | 'apAnalystUserIds' | 'taxLeadUserIds' | 'companyGroupId' | 'taxStatusCode' | 'statusCode' | 'plans' | 'annualRecurringRevenue' | 'monthlyRecurringRevenue' | 'customerSatisfaction' | 'zeniSatisfaction';
19
19
  export declare type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
20
20
  export declare type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
21
- export declare type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate';
21
+ export declare type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate';
22
22
  export interface CockpitFilterCategory {
23
23
  field?: ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
24
24
  matchingOperator: 'equal' | 'not-equal';
@@ -49,6 +49,7 @@ exports.ALL_HEALTH_SORT_KEYS = [
49
49
  'runway',
50
50
  'churnProbability',
51
51
  'netPromoterScore',
52
+ 'customerSatisfactionScore',
52
53
  'controller',
53
54
  'customerSuccessManager',
54
55
  'lastReportSent',
@@ -42,8 +42,8 @@ function toRemindersPayload(localData) {
42
42
  return remindersPayload;
43
43
  }
44
44
  function toSaveNotificationSettingsPayload(localData, notificationSettingsData) {
45
- const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettingsData;
46
- const { reminders, monthEndInsights } = localData;
45
+ const { reminderNotificationSettings } = notificationSettingsData;
46
+ const { reminders } = localData;
47
47
  const payload = {
48
48
  is_missing_receipt_notification_active: null,
49
49
  missing_receipt_notification: null,
@@ -53,10 +53,6 @@ function toSaveNotificationSettingsPayload(localData, notificationSettingsData)
53
53
  pending_bill_approval_notification: null,
54
54
  pending_reimbursement_approval_notification: null,
55
55
  is_pending_reimbursement_approval_notification_active: null,
56
- is_month_end_insights_active: monthEndInsightsNotificationSettings.enabled != null
57
- ? monthEndInsights.notify
58
- : null,
59
- month_end_email_recipient_email_ids: monthEndInsights.recipientEmailIds,
60
56
  };
61
57
  if (reminderNotificationSettings.missingReceiptNotification != null) {
62
58
  payload.is_missing_receipt_notification_active =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.9.75",
3
+ "version": "4.9.77",
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",