@zeniai/client-epic-state 4.11.76 → 4.11.78
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/chargeCardTransaction/chargeCardTransaction.d.ts +3 -0
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.d.ts +4 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.js +7 -0
- package/lib/index.d.ts +2 -2
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.d.ts +5 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +118 -14
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -3
- package/lib/view/companyView/types/cockpitTypes.js +5 -0
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +1 -0
- package/package.json +1 -1
|
@@ -13,6 +13,8 @@ export interface ChargeCardTransaction {
|
|
|
13
13
|
summary: string;
|
|
14
14
|
createTime: ZeniDate;
|
|
15
15
|
transactionTime?: ZeniDate;
|
|
16
|
+
thirdPartyTransactionId?: ID;
|
|
17
|
+
zeniAccountId?: ID;
|
|
16
18
|
}
|
|
17
19
|
export interface ChargeCardTransactionType {
|
|
18
20
|
code: ChargeCardTransactionTypeCode;
|
|
@@ -24,6 +26,7 @@ export interface ChargeCardTransactionStatus {
|
|
|
24
26
|
}
|
|
25
27
|
export interface ChargeCardMerchant {
|
|
26
28
|
name: string;
|
|
29
|
+
brandName?: string;
|
|
27
30
|
logo?: Logo;
|
|
28
31
|
}
|
|
29
32
|
export interface ChargeCardTransactionState {
|
|
@@ -13,9 +13,12 @@ export interface ChargeCardTransactionPayload {
|
|
|
13
13
|
merchant: ChargeCardMerchantPayload;
|
|
14
14
|
transaction_id: string;
|
|
15
15
|
transaction_summary: string;
|
|
16
|
+
third_party_transaction_id?: string;
|
|
17
|
+
zeni_account_id?: string;
|
|
16
18
|
}
|
|
17
19
|
export interface ChargeCardMerchantPayload {
|
|
18
|
-
logo?: URLPayload;
|
|
19
20
|
name: string;
|
|
21
|
+
logo?: URLPayload;
|
|
22
|
+
brand_name?: string | null;
|
|
20
23
|
}
|
|
21
24
|
export declare const toChargeCardTransaction: (payload: ChargeCardTransactionPayload) => ChargeCardTransaction;
|
|
@@ -26,6 +26,9 @@ const toChargeCardTransaction = (payload) => {
|
|
|
26
26
|
: undefined,
|
|
27
27
|
merchant: {
|
|
28
28
|
name: payload.merchant.name,
|
|
29
|
+
brandName: payload.merchant.brand_name != null
|
|
30
|
+
? payload.merchant.brand_name
|
|
31
|
+
: undefined,
|
|
29
32
|
logo: payload.merchant.logo != null
|
|
30
33
|
? {
|
|
31
34
|
url: (0, urlPayload_1.toURL)(payload.merchant.logo),
|
|
@@ -34,6 +37,10 @@ const toChargeCardTransaction = (payload) => {
|
|
|
34
37
|
: undefined,
|
|
35
38
|
},
|
|
36
39
|
summary: payload.transaction_summary,
|
|
40
|
+
thirdPartyTransactionId: payload.third_party_transaction_id != null
|
|
41
|
+
? payload.third_party_transaction_id
|
|
42
|
+
: undefined,
|
|
43
|
+
zeniAccountId: payload.zeni_account_id != null ? payload.zeni_account_id : undefined,
|
|
37
44
|
});
|
|
38
45
|
};
|
|
39
46
|
exports.toChargeCardTransaction = toChargeCardTransaction;
|
package/lib/index.d.ts
CHANGED
|
@@ -594,11 +594,11 @@ import { fetchChargeCardListPage, issueChargeCard, resetIssueChargeCardForm, upd
|
|
|
594
594
|
import { fetchChargeCardDetailPage, fetchChargeCardTransactionList, updateChargeCardDetail } from './view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
595
595
|
import { ChargeCardDetailSelectorView, getChargeCardDetailView } from './view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector';
|
|
596
596
|
import { ChargeCardConfigState } from './view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState';
|
|
597
|
-
import { ChargeCardTransaction, ChargeCardTransactionStatus, ChargeCardTransactionStatusCode } from './entity/chargeCardTransaction/chargeCardTransaction';
|
|
597
|
+
import { ChargeCardTransaction, ChargeCardTransactionStatus, ChargeCardTransactionStatusCode, ChargeCardTransactionTypeCode } from './entity/chargeCardTransaction/chargeCardTransaction';
|
|
598
598
|
import { ChargeCardDetailUiState } from './view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail';
|
|
599
599
|
import { getChargeCardSetupViewDetails, ChargeCardSetupView, getChargeCardBusinessVerificationDetails } from './view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector';
|
|
600
600
|
import { acceptChargeCardTerms, fetchChargeCardSetupView } from './view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer';
|
|
601
|
-
export { ProductServices, ProductServiceKey, isCompanyRunwayInfinite, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, companyHealthMetricDropDownOptions, CompanyHealthMetricViewSelector, CompanyHealthMetricDropDownOption, CompanyDetailWithHealthMetric, getChargeCardBusinessVerificationDetails, fetchChargeCardListPage, getChargeCardListView, fetchChargeCardDetailPage, getChargeCardDetailView, fetchChargeCardTransactionList, fetchCashbackDetail, ChargeCard, ChargeCardWithUser, ChargeCardViewSortKey, toChargeCardSortKeyType, CashbackPeriod, CashbackDetailUIState, CashbackViewSortKey, getCashbackDetail, CashbackDetailSelectorView, toCreditLimitFrequencyCodeType, ChargeCardListSelectorView, ChargeCardDetailSelectorView, ChargeCardConfigState, ChargeCardListUIState, ChargeCardTransaction, ChargeCardTransactionStatusCode, ChargeCardTransactionStatus, ChargeCardDetailUiState, getChargeCardSetupViewDetails, ChargeCardSetupView, fetchChargeCardSetupView, acceptChargeCardTerms, ChargeCardLocalData, IssueChargeCard, CreditLimitFrequencyCodeType, CreditLimitFrequency, issueChargeCard, updateChargeCardLocalStore, resetIssueChargeCardForm, updateChargeCardListSearchText, updateChargeCardListUIState, updateCashbackDetailUIState, updateChargeCardDetail, };
|
|
601
|
+
export { ProductServices, ProductServiceKey, isCompanyRunwayInfinite, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, companyHealthMetricDropDownOptions, CompanyHealthMetricViewSelector, CompanyHealthMetricDropDownOption, CompanyDetailWithHealthMetric, getChargeCardBusinessVerificationDetails, fetchChargeCardListPage, getChargeCardListView, fetchChargeCardDetailPage, getChargeCardDetailView, fetchChargeCardTransactionList, fetchCashbackDetail, ChargeCard, ChargeCardWithUser, ChargeCardViewSortKey, toChargeCardSortKeyType, CashbackPeriod, CashbackDetailUIState, CashbackViewSortKey, getCashbackDetail, CashbackDetailSelectorView, toCreditLimitFrequencyCodeType, ChargeCardListSelectorView, ChargeCardDetailSelectorView, ChargeCardConfigState, ChargeCardListUIState, ChargeCardTransaction, ChargeCardTransactionStatusCode, ChargeCardTransactionTypeCode, ChargeCardTransactionStatus, ChargeCardDetailUiState, getChargeCardSetupViewDetails, ChargeCardSetupView, fetchChargeCardSetupView, acceptChargeCardTerms, ChargeCardLocalData, IssueChargeCard, CreditLimitFrequencyCodeType, CreditLimitFrequency, issueChargeCard, updateChargeCardLocalStore, resetIssueChargeCardForm, updateChargeCardListSearchText, updateChargeCardListUIState, updateCashbackDetailUIState, updateChargeCardDetail, };
|
|
602
602
|
import { AgingBalance, AgingPeriod } from './commonStateTypes/agingBalance/agingBalance';
|
|
603
603
|
import { fetchApAging, updateApAgingUIState } from './view/apAgingView/apAgingReport/apAgingReducer';
|
|
604
604
|
import { ApAgingReport, getApAgingReport, AgingBalancesByVendor } from './view/apAgingView/apAgingReport/apAgingSelector';
|
|
@@ -6,6 +6,8 @@ import { Company } from '../../entity/company/companyStateTypes';
|
|
|
6
6
|
import { CompanyHealthMetric, CompanyRunway } from '../../entity/companyHealthMetric/companyHealthMetricState';
|
|
7
7
|
import { CompanyHealthMetricsLocalData, CompanyHealthViewUIState, EditCompanyHealthMetrics } from './companyHealthMetricView';
|
|
8
8
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
9
|
+
import { Amount } from '../../commonStateTypes/amount';
|
|
10
|
+
import { AllowedValueWithID } from '../../commonStateTypes/allowedValue';
|
|
9
11
|
export declare const ALL_FREQUENCY_LABEL_TYPE: readonly ["Low", "Very Low", "Mid", "High", "Very High"];
|
|
10
12
|
export declare const toFrequencyLabelType: (v: string) => "High" | "Low" | "Very Low" | "Mid" | "Very High";
|
|
11
13
|
export declare type FrequencyLabelType = ReturnType<typeof toFrequencyLabelType>;
|
|
@@ -16,7 +18,7 @@ export declare const ALL_PRODUCT_SERVICE: readonly ["reimbursement", "billpay",
|
|
|
16
18
|
export declare const toProductServiceKeyType: (v: string) => "reimbursement" | "accounts" | "cards" | "billpay" | "zeni_tax_plan" | "cfo_plan" | "payroll_manager_service_plan";
|
|
17
19
|
export declare type ProductServiceKey = ReturnType<typeof toProductServiceKeyType>;
|
|
18
20
|
export declare const ALL_HEALTH_METRIC_KEYS: readonly ["finOpsEngagementFrequency", "externalProductServiceExposure", "netPromoterScore", "customerSatisfactionScore"];
|
|
19
|
-
export declare const toHealthMetricKeyType: (v: string) => "netPromoterScore" | "customerSatisfactionScore" | "
|
|
21
|
+
export declare const toHealthMetricKeyType: (v: string) => "netPromoterScore" | "customerSatisfactionScore" | "externalProductServiceExposure" | "finOpsEngagementFrequency";
|
|
20
22
|
export declare type CompanyHealthMetricsDataKey = ReturnType<typeof toHealthMetricKeyType>;
|
|
21
23
|
export declare type CompanyHealthMetricDropDownOption = {
|
|
22
24
|
label: FrequencyLabelType;
|
|
@@ -39,6 +41,8 @@ export interface CompanyDetailWithHealthMetric extends Company {
|
|
|
39
41
|
companyHealthMetric: CompanyHealthMetric;
|
|
40
42
|
controllers: User[];
|
|
41
43
|
noOfProductVerticalsEnabled: number;
|
|
44
|
+
companyGroup?: AllowedValueWithID[];
|
|
45
|
+
monthlyRecurringRevenue?: Amount;
|
|
42
46
|
}
|
|
43
47
|
export interface ProductServices {
|
|
44
48
|
productServiceKey: ProductServiceKey;
|
|
@@ -13,6 +13,9 @@ const companyHealthMetricSelector_1 = require("../../entity/companyHealthMetric/
|
|
|
13
13
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
14
14
|
const cockpitHelpers_1 = require("../companyView/helpers/cockpitHelpers");
|
|
15
15
|
const companyHelper_1 = require("../../entity/company/companyHelper");
|
|
16
|
+
const companyManagementViewSelector_1 = require("../companyView/selector/companyManagementViewSelector");
|
|
17
|
+
const MAX_FREQUENCY_VALUE = 5;
|
|
18
|
+
const DEFAULT_DATE = (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z');
|
|
16
19
|
exports.ALL_FREQUENCY_LABEL_TYPE = [
|
|
17
20
|
'Low',
|
|
18
21
|
'Very Low',
|
|
@@ -68,12 +71,13 @@ exports.companyHealthMetricDropDownOptions = [
|
|
|
68
71
|
];
|
|
69
72
|
const getCompanyHealthMetricView = (state) => {
|
|
70
73
|
const { companyViewState, companyHealthMetricViewState, companyHealthMetricState, companyState, userState, } = state;
|
|
74
|
+
const managementView = (0, companyManagementViewSelector_1.getCompanyManagementView)(state);
|
|
71
75
|
const { companyIds, companyHealthMetricUpdateStatusById, uiState, selectedCompanyId, } = companyHealthMetricViewState;
|
|
72
76
|
const { sortKey, sortOrder, filterText, filters } = uiState;
|
|
73
77
|
const companies = (0, companySelector_1.getCompanyByCompanyIds)(companyState, companyIds).map((company) => company.company);
|
|
74
78
|
let selectedCompanyDetail = undefined;
|
|
75
79
|
const companiesHealthMetrics = (0, companyHealthMetricSelector_1.getCompanyHealthMetricByCompanyIds)(companyHealthMetricState, companyIds);
|
|
76
|
-
let companyDetailWithHealthMetric = combineCompanyDetails(companies, companiesHealthMetrics, userState);
|
|
80
|
+
let companyDetailWithHealthMetric = combineCompanyDetails(companies, companiesHealthMetrics, userState, managementView);
|
|
77
81
|
if (selectedCompanyId != null) {
|
|
78
82
|
selectedCompanyDetail = companyDetailWithHealthMetric.find((company) => company.companyInfo.companyId === selectedCompanyId);
|
|
79
83
|
}
|
|
@@ -102,11 +106,18 @@ const getCompanyHealthMetricView = (state) => {
|
|
|
102
106
|
};
|
|
103
107
|
};
|
|
104
108
|
exports.getCompanyHealthMetricView = getCompanyHealthMetricView;
|
|
105
|
-
const combineCompanyDetails = (companies, companiesHeathMetrics, userState) => {
|
|
106
|
-
const
|
|
109
|
+
const combineCompanyDetails = (companies, companiesHeathMetrics, userState, managementView) => {
|
|
110
|
+
const companiesMap = new Map();
|
|
107
111
|
companies.forEach((company) => {
|
|
112
|
+
var _a, _b;
|
|
108
113
|
const controllers = (0, userSelector_1.getUsersByUserIds)(userState, company.managegmentInfo.controllerUserIds);
|
|
109
|
-
|
|
114
|
+
const companyDetail = managementView.companies.find((companyDetail) => companyDetail.company.company.companyInfo.companyId ===
|
|
115
|
+
company.companyInfo.companyId);
|
|
116
|
+
companiesMap.set(company.companyInfo.companyId, Object.assign(Object.assign({}, company), { controllers }));
|
|
117
|
+
if (companyDetail != null) {
|
|
118
|
+
const companyInfo = companiesMap.get(company.companyInfo.companyId);
|
|
119
|
+
companiesMap.set(company.companyInfo.companyId, Object.assign(Object.assign({}, companyInfo), { monthlyRecurringRevenue: (_a = companyDetail.primarySubscription) === null || _a === void 0 ? void 0 : _a.summary.summary.monthlyRecurringRevenue, companyGroup: (_b = companyDetail.company.schema.companyGroup) !== null && _b !== void 0 ? _b : [] }));
|
|
120
|
+
}
|
|
110
121
|
});
|
|
111
122
|
companiesHeathMetrics.forEach((companyHealthMetric) => {
|
|
112
123
|
let noOfProductVerticalsEnabled = 0;
|
|
@@ -115,16 +126,16 @@ const combineCompanyDetails = (companies, companiesHeathMetrics, userState) => {
|
|
|
115
126
|
noOfProductVerticalsEnabled++;
|
|
116
127
|
}
|
|
117
128
|
});
|
|
118
|
-
if (
|
|
119
|
-
const company =
|
|
120
|
-
|
|
129
|
+
if (companiesMap.has(companyHealthMetric.companyId)) {
|
|
130
|
+
const company = companiesMap.get(companyHealthMetric.companyId);
|
|
131
|
+
companiesMap.set(companyHealthMetric.companyId, Object.assign(Object.assign({}, company), { companyHealthMetric,
|
|
121
132
|
noOfProductVerticalsEnabled }));
|
|
122
133
|
}
|
|
123
134
|
else {
|
|
124
|
-
|
|
135
|
+
companiesMap.set(companyHealthMetric.companyId, Object.assign(Object.assign({}, companyHealthMetric), { noOfProductVerticalsEnabled }));
|
|
125
136
|
}
|
|
126
137
|
});
|
|
127
|
-
const companyWithCompanyHealthMetrics = Array.from(
|
|
138
|
+
const companyWithCompanyHealthMetrics = Array.from(companiesMap.values());
|
|
128
139
|
return companyWithCompanyHealthMetrics;
|
|
129
140
|
};
|
|
130
141
|
const hasCompanyHealthMetricFormFieldChanged = (entityData, formData) => {
|
|
@@ -192,7 +203,7 @@ const removeDuplicatesFromCompaniesArray = (companies) => {
|
|
|
192
203
|
});
|
|
193
204
|
};
|
|
194
205
|
const getCategoryValueForCompany = (key, company) => {
|
|
195
|
-
var _a, _b, _c;
|
|
206
|
+
var _a, _b, _c, _d;
|
|
196
207
|
const firstControllerId = (0, companyHelper_1.getFirstControllerIdFromControllers)(company.controllers);
|
|
197
208
|
const customerSuccessManagerIds = (0, companyHelper_1.getFirstControllerId)(company.managegmentInfo.customerSuccessManagerUserIds);
|
|
198
209
|
const runway = (0, exports.getRunwayInfinity)(company.companyHealthMetric.runway);
|
|
@@ -221,6 +232,24 @@ const getCategoryValueForCompany = (key, company) => {
|
|
|
221
232
|
return company.companyHealthMetric.customerSatisfactionScore != null
|
|
222
233
|
? company.companyHealthMetric.customerSatisfactionScore.toString()
|
|
223
234
|
: undefined;
|
|
235
|
+
case 'externalProductServiceExposure':
|
|
236
|
+
return company.companyHealthMetric.externalProductServiceExposure != null
|
|
237
|
+
? company.companyHealthMetric.externalProductServiceExposure.code
|
|
238
|
+
: undefined;
|
|
239
|
+
case 'finOpsEngagementFrequency':
|
|
240
|
+
return company.companyHealthMetric.finOpsEngagementFrequency != null
|
|
241
|
+
? company.companyHealthMetric.finOpsEngagementFrequency.code
|
|
242
|
+
: undefined;
|
|
243
|
+
case 'companyEngagementMetricsUpdatedAt':
|
|
244
|
+
return ((_d = company.companyHealthMetric.companyEngagementMetricsUpdatedAt) !== null && _d !== void 0 ? _d : undefined);
|
|
245
|
+
case 'companyGroupId':
|
|
246
|
+
return company.managegmentInfo.companyGroupId != null
|
|
247
|
+
? company.managegmentInfo.companyGroupId.toString()
|
|
248
|
+
: undefined;
|
|
249
|
+
case 'monthlyRecurringRevenue':
|
|
250
|
+
return company.monthlyRecurringRevenue != null
|
|
251
|
+
? company.monthlyRecurringRevenue.amount.toString()
|
|
252
|
+
: undefined;
|
|
224
253
|
case 'churnProbabilityPercentage':
|
|
225
254
|
default:
|
|
226
255
|
return company.companyHealthMetric.churnProbabilityPercentage != null
|
|
@@ -268,6 +297,8 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
268
297
|
'subscriptionStartDate',
|
|
269
298
|
'subscriptionRenewalDate',
|
|
270
299
|
'lastReportSent',
|
|
300
|
+
'companyEngagementMetricsUpdatedAt',
|
|
301
|
+
'monthlyRecurringRevenue',
|
|
271
302
|
]);
|
|
272
303
|
}
|
|
273
304
|
return (0, cockpitHelpers_1.filterCompanyOnCategoriesWithMultipleValues)(categoryValue, currentFilter);
|
|
@@ -390,10 +421,51 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
390
421
|
case 'issues':
|
|
391
422
|
companiesWithSortKeyValues.push(company);
|
|
392
423
|
break;
|
|
424
|
+
case 'externalProductServiceExposure':
|
|
425
|
+
if (company.companyHealthMetric.externalProductServiceExposure != null) {
|
|
426
|
+
companiesWithSortKeyValues.push(company);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
companiesWithNoSortKeyValues.push(company);
|
|
430
|
+
}
|
|
431
|
+
break;
|
|
432
|
+
case 'finOpsEngagementFrequency':
|
|
433
|
+
if (company.companyHealthMetric.finOpsEngagementFrequency != null) {
|
|
434
|
+
companiesWithSortKeyValues.push(company);
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
companiesWithNoSortKeyValues.push(company);
|
|
438
|
+
}
|
|
439
|
+
break;
|
|
440
|
+
case 'companyEngagementMetricsUpdatedAt':
|
|
441
|
+
if (company.companyHealthMetric.companyEngagementMetricsUpdatedAt != null) {
|
|
442
|
+
companiesWithSortKeyValues.push(company);
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
companiesWithNoSortKeyValues.push(company);
|
|
446
|
+
}
|
|
447
|
+
break;
|
|
448
|
+
case 'monthlyRecurringRevenue':
|
|
449
|
+
if (company.monthlyRecurringRevenue != null) {
|
|
450
|
+
companiesWithSortKeyValues.push(company);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
companiesWithNoSortKeyValues.push(company);
|
|
454
|
+
}
|
|
455
|
+
break;
|
|
456
|
+
case 'group':
|
|
457
|
+
default:
|
|
458
|
+
if (company.managegmentInfo.companyGroupId != null) {
|
|
459
|
+
companiesWithSortKeyValues.push(company);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
companiesWithNoSortKeyValues.push(company);
|
|
463
|
+
}
|
|
464
|
+
break;
|
|
393
465
|
}
|
|
394
466
|
});
|
|
395
467
|
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, (company) => {
|
|
396
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
468
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
397
469
|
switch (sortKey) {
|
|
398
470
|
case 'productVerticals':
|
|
399
471
|
return company.noOfProductVerticalsEnabled;
|
|
@@ -405,11 +477,11 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
405
477
|
? Infinity
|
|
406
478
|
: (_b = (_a = company.companyHealthMetric.runway) === null || _a === void 0 ? void 0 : _a.runwayMonths) !== null && _b !== void 0 ? _b : 0;
|
|
407
479
|
case 'lastReportSent':
|
|
408
|
-
return ((_c = company.managegmentInfo.lastReportSentDate) !== null && _c !== void 0 ? _c :
|
|
480
|
+
return ((_c = company.managegmentInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : DEFAULT_DATE);
|
|
409
481
|
case 'renewalDate':
|
|
410
|
-
return ((_d = company.companyHealthMetric.subscriptionRenewalDate) !== null && _d !== void 0 ? _d :
|
|
482
|
+
return ((_d = company.companyHealthMetric.subscriptionRenewalDate) !== null && _d !== void 0 ? _d : DEFAULT_DATE);
|
|
411
483
|
case 'subscriptionDate':
|
|
412
|
-
return ((_e = company.companyHealthMetric.subscriptionStartDate) !== null && _e !== void 0 ? _e :
|
|
484
|
+
return ((_e = company.companyHealthMetric.subscriptionStartDate) !== null && _e !== void 0 ? _e : DEFAULT_DATE);
|
|
413
485
|
case 'netPromoterScore':
|
|
414
486
|
return (_f = company.companyHealthMetric.netPromoterScore) !== null && _f !== void 0 ? _f : 0;
|
|
415
487
|
case 'customerSatisfactionScore':
|
|
@@ -418,6 +490,23 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
418
490
|
return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.controllerUserIds[0]).toLowerCase();
|
|
419
491
|
case 'customerSuccessManager':
|
|
420
492
|
return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.customerSuccessManagerUserIds[0]).toLowerCase();
|
|
493
|
+
case 'externalProductServiceExposure':
|
|
494
|
+
return company.companyHealthMetric.externalProductServiceExposure !=
|
|
495
|
+
null
|
|
496
|
+
? getSortOrderForFrequency(company.companyHealthMetric.externalProductServiceExposure.code.toLowerCase())
|
|
497
|
+
: MAX_FREQUENCY_VALUE;
|
|
498
|
+
case 'finOpsEngagementFrequency':
|
|
499
|
+
return company.companyHealthMetric.finOpsEngagementFrequency != null
|
|
500
|
+
? getSortOrderForFrequency(company.companyHealthMetric.finOpsEngagementFrequency.code.toLowerCase())
|
|
501
|
+
: MAX_FREQUENCY_VALUE;
|
|
502
|
+
case 'companyEngagementMetricsUpdatedAt':
|
|
503
|
+
return ((_h = company.companyHealthMetric.companyEngagementMetricsUpdatedAt) !== null && _h !== void 0 ? _h : DEFAULT_DATE);
|
|
504
|
+
case 'monthlyRecurringRevenue':
|
|
505
|
+
return company.monthlyRecurringRevenue != null
|
|
506
|
+
? company.monthlyRecurringRevenue.amount
|
|
507
|
+
: 0;
|
|
508
|
+
case 'group':
|
|
509
|
+
return (_j = company.managegmentInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase();
|
|
421
510
|
case 'companyName':
|
|
422
511
|
default:
|
|
423
512
|
return company.companyInfo.name;
|
|
@@ -447,3 +536,18 @@ const getRunwayInfinity = (runway) => {
|
|
|
447
536
|
: undefined;
|
|
448
537
|
};
|
|
449
538
|
exports.getRunwayInfinity = getRunwayInfinity;
|
|
539
|
+
const getSortOrderForFrequency = (value) => {
|
|
540
|
+
switch (value) {
|
|
541
|
+
case 'low':
|
|
542
|
+
return 1;
|
|
543
|
+
case 'mid':
|
|
544
|
+
return 2;
|
|
545
|
+
case 'high':
|
|
546
|
+
return 3;
|
|
547
|
+
case 'very_high':
|
|
548
|
+
return 4;
|
|
549
|
+
case 'very_low':
|
|
550
|
+
default:
|
|
551
|
+
return 0;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
@@ -6,12 +6,12 @@ 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", "customerSatisfactionScore", "controller", "customerSuccessManager", "lastReportSent", "subscriptionDate", "renewalDate"];
|
|
9
|
+
export declare const ALL_HEALTH_SORT_KEYS: readonly ["companyName", "issues", "group", "externalProductServiceExposure", "finOpsEngagementFrequency", "companyEngagementMetricsUpdatedAt", "monthlyRecurringRevenue", "productVerticals", "runway", "churnProbability", "netPromoterScore", "customerSatisfactionScore", "controller", "customerSuccessManager", "lastReportSent", "subscriptionDate", "renewalDate"];
|
|
10
10
|
export declare const ALL_TASK_MANAGER_SORT_KEYS: readonly ["name", "taskName", "status", "priority", "dueDate", "assignee", "tags", "createdBy"];
|
|
11
11
|
export declare const toPortfolioSortKeyType: (v: string) => "expenses" | "runway" | "cashBalance" | "netIncome" | "companyName" | "revenues";
|
|
12
12
|
export declare const toManagementSortKeyType: (v: string) => "status" | "group" | "bookCloseDate" | "controller" | "preparer" | "reviewer" | "companyName" | "monthlyRecurringRevenue" | "annualRecurringRevenue" | "taxStatus" | "plans" | "notes" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
|
|
13
13
|
export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "bankAccountLinked" | "qboLinked" | "identityVerified" | "businessVerified" | "groupCreated" | "customerCreated" | "enroller" | "invite";
|
|
14
|
-
export declare const toHealthSortKeyType: (v: string) => "runway" | "controller" | "companyName" | "customerSuccessManager" | "netPromoterScore" | "customerSatisfactionScore" | "lastReportSent" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate";
|
|
14
|
+
export declare const toHealthSortKeyType: (v: string) => "group" | "runway" | "controller" | "companyName" | "monthlyRecurringRevenue" | "customerSuccessManager" | "netPromoterScore" | "customerSatisfactionScore" | "lastReportSent" | "externalProductServiceExposure" | "finOpsEngagementFrequency" | "companyEngagementMetricsUpdatedAt" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate";
|
|
15
15
|
export declare const toTaskManagerSortKeyType: (v: string) => "priority" | "name" | "status" | "dueDate" | "taskName" | "assignee" | "tags" | "createdBy";
|
|
16
16
|
export declare type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
|
|
17
17
|
export declare type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
|
|
@@ -21,7 +21,7 @@ export declare type TaskManagerViewSortKey = ReturnType<typeof toTaskManagerSort
|
|
|
21
21
|
export declare type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerSuccessManagerUserIds' | 'preparerUserIds' | 'reviewerUserIds' | 'apAnalystUserIds' | 'taxLeadUserIds' | 'companyGroupId' | 'taxStatusCode' | 'statusCode' | 'plans' | 'annualRecurringRevenue' | 'monthlyRecurringRevenue' | 'customerSatisfaction' | 'zeniSatisfaction';
|
|
22
22
|
export declare type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
|
|
23
23
|
export declare type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
|
|
24
|
-
export declare type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate';
|
|
24
|
+
export declare type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'finOpsEngagementFrequency' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
|
|
25
25
|
export interface CockpitFilterCategory {
|
|
26
26
|
field?: ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
27
27
|
matchingOperator: 'equal' | 'not-equal';
|
|
@@ -45,6 +45,11 @@ exports.ALL_ONBOARDING_SORT_KEYS = [
|
|
|
45
45
|
exports.ALL_HEALTH_SORT_KEYS = [
|
|
46
46
|
'companyName',
|
|
47
47
|
'issues',
|
|
48
|
+
'group',
|
|
49
|
+
'externalProductServiceExposure',
|
|
50
|
+
'finOpsEngagementFrequency',
|
|
51
|
+
'companyEngagementMetricsUpdatedAt',
|
|
52
|
+
'monthlyRecurringRevenue',
|
|
48
53
|
'productVerticals',
|
|
49
54
|
'runway',
|
|
50
55
|
'churnProbability',
|
|
@@ -5,6 +5,7 @@ export interface ChargeCardConfigPayload {
|
|
|
5
5
|
allowed_credit_limit_span_options: AllowedValueWithCode[];
|
|
6
6
|
credit_terms: CreditTermsPayload;
|
|
7
7
|
repayment_info: RePaymentInfoPayload;
|
|
8
|
+
is_ai_categorization_enabled_for_cards_transactions: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface CreditTermsPayload {
|
|
10
11
|
credit_terms_id: string;
|
|
@@ -12,6 +12,7 @@ exports.initialState = {
|
|
|
12
12
|
name: '',
|
|
13
13
|
maxVirtualCard: 0,
|
|
14
14
|
},
|
|
15
|
+
isAiCategorizationEnabledForCardsTransactions: false,
|
|
15
16
|
rePaymentInfo: undefined,
|
|
16
17
|
fetchState: 'Not-Started',
|
|
17
18
|
error: undefined,
|
|
@@ -36,6 +37,8 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
|
|
|
36
37
|
}));
|
|
37
38
|
draft.creditTerm = (0, chargeCardConfigPayload_1.toCreditTerm)(payload.credit_terms);
|
|
38
39
|
draft.rePaymentInfo = (0, chargeCardConfigPayload_1.toRePaymentInfo)(payload.repayment_info);
|
|
40
|
+
draft.isAiCategorizationEnabledForCardsTransactions =
|
|
41
|
+
payload.is_ai_categorization_enabled_for_cards_transactions;
|
|
39
42
|
draft.fetchState = 'Completed';
|
|
40
43
|
draft.error = undefined;
|
|
41
44
|
},
|
|
@@ -5,6 +5,7 @@ import { ZeniDate } from '../../../../zeniDayJS';
|
|
|
5
5
|
export interface ChargeCardConfigState extends FetchedState {
|
|
6
6
|
creditLimitFrequency: CreditLimitFrequency[];
|
|
7
7
|
creditTerm: CreditTerm;
|
|
8
|
+
isAiCategorizationEnabledForCardsTransactions: boolean;
|
|
8
9
|
rePaymentInfo?: RePaymentInfo;
|
|
9
10
|
}
|
|
10
11
|
export interface CreditTerm {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.78",
|
|
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",
|