@zeniai/client-epic-state 4.13.37 → 4.13.39

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 (26) hide show
  1. package/lib/entity/company/companyPayload.js +1 -1
  2. package/lib/entity/company/companyReducer.js +2 -2
  3. package/lib/entity/company/companySelector.js +1 -1
  4. package/lib/entity/company/companyStateTypes.d.ts +1 -1
  5. package/lib/view/auditReportView/auditReportViewSelector.js +2 -2
  6. package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +13 -13
  7. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.js +2 -2
  8. package/lib/view/companyView/helpers/cockpitHelpers.js +2 -2
  9. package/lib/view/companyView/selector/companyManagementViewSelector.js +34 -34
  10. package/lib/view/companyView/selectorHelpers/getCompanyView.js +20 -20
  11. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -1
  12. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
  13. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +14 -1
  14. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -1
  15. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  16. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +14 -3
  17. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +4 -1
  18. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +9 -5
  19. package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +2 -2
  20. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewSelector.js +3 -3
  21. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +4 -4
  22. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +2 -2
  23. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +1 -1
  24. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +4 -4
  25. package/lib/view/subscriptionView/subscriptionViewSelector.js +3 -3
  26. package/package.json +1 -1
@@ -372,7 +372,7 @@ const toCompany = (payload, companiesPayload, isUpdate, companyInStore, companyI
372
372
  incInfo: toCompanyIncInfo(payload),
373
373
  questionaire: toCompanyQuestionarie(payload, (_a = payload.currency_code) !== null && _a !== void 0 ? _a : '', (_b = payload.currency_symbol) !== null && _b !== void 0 ? _b : ''),
374
374
  taxInfo: toCompanyTaxInfo(payload),
375
- managegmentInfo: toCompanyManagementInfo(payload),
375
+ managementInfo: toCompanyManagementInfo(payload),
376
376
  companyBillPayInfo: toCompanyBillPayInfo(payload.bill_pay_info),
377
377
  companyReimbursementInfo: toCompanyReimbursementInfo(payload.reimbursement_info),
378
378
  companyZeniAccountInfo: toCompanyZeniAccountInfo(payload.deposit_accounts_info),
@@ -62,9 +62,9 @@ const company = (0, toolkit_1.createSlice)({
62
62
  const lastReportSentDate = (0, zeniDayJS_1.dateNow)();
63
63
  const lastReportSentBusinessDay = (0, zeniDayJS_1.getBusinessDayOfDate)((0, zeniDayJS_1.dateNow)());
64
64
  const { companyId } = action.payload;
65
- draft.companiesById[companyId].managegmentInfo.lastReportSentDate =
65
+ draft.companiesById[companyId].managementInfo.lastReportSentDate =
66
66
  lastReportSentDate;
67
- draft.companiesById[companyId].managegmentInfo.lastReportSentBusinessDay =
67
+ draft.companiesById[companyId].managementInfo.lastReportSentBusinessDay =
68
68
  lastReportSentBusinessDay;
69
69
  },
70
70
  toggleCompanyMonthEndReportDraftFlag(draft, action) {
@@ -61,7 +61,7 @@ exports.getOnboardingCompletedCompanyByCompanyId = getOnboardingCompletedCompany
61
61
  exports.getControllersForCompany = (0, toolkit_1.createSelector)((state) => state.companyState, (state) => state.userState, (_state, companyId) => companyId, (companyState, userState, companyId) => {
62
62
  const company = getCompanyByCompanyId(companyState, companyId);
63
63
  if (company != null) {
64
- const controllerUserIds = company.company.managegmentInfo.controllerUserIds;
64
+ const controllerUserIds = company.company.managementInfo.controllerUserIds;
65
65
  return {
66
66
  controllers: (0, userSelector_1.getUsersByUserIds)(userState, controllerUserIds),
67
67
  controllerUserIds,
@@ -137,7 +137,7 @@ export interface Company {
137
137
  incInfo: CompanyIncInfo;
138
138
  questionaire: CompanyQuestionaire;
139
139
  taxInfo: CompanyTaxInfo;
140
- managegmentInfo: CompanyManagementInfo;
140
+ managementInfo: CompanyManagementInfo;
141
141
  companyBillPayInfo: CompanyBillPayInfo;
142
142
  companyReimbursementInfo: CompanyReimbursementInfo;
143
143
  companyZeniAccountInfo: CompanyZeniAccountInfo;
@@ -30,8 +30,8 @@ const getAuditReportGroupViewSelectorView = (companyId, state, loggedInUser) =>
30
30
  }
31
31
  const managementView = (0, companyManagementViewSelector_1.getCompanyManagementView)(state);
32
32
  const isControllerOrReviewer = managementView.companies.some((company) => {
33
- const { managegmentInfo, companyInfo } = company.company.company;
34
- const { controllerUserIds, reviewerUserIds } = managegmentInfo;
33
+ const { managementInfo, companyInfo } = company.company.company;
34
+ const { controllerUserIds, reviewerUserIds } = managementInfo;
35
35
  if (loggedInUser != null && companyInfo.companyId === companyId) {
36
36
  return (controllerUserIds.includes(loggedInUser.userId) ||
37
37
  reviewerUserIds.includes(loggedInUser.userId));
@@ -107,7 +107,7 @@ const combineCompanyDetails = (companies, companiesHeathMetrics, userState, mana
107
107
  const companiesMap = new Map();
108
108
  companies.forEach((company) => {
109
109
  var _a, _b;
110
- const controllers = (0, userSelector_1.getUsersByUserIds)(userState, company.managegmentInfo.controllerUserIds);
110
+ const controllers = (0, userSelector_1.getUsersByUserIds)(userState, company.managementInfo.controllerUserIds);
111
111
  const companyDetail = managementView.companies.find((companyDetail) => companyDetail.company.company.companyInfo.companyId ===
112
112
  company.companyInfo.companyId);
113
113
  companiesMap.set(company.companyInfo.companyId, Object.assign(Object.assign({}, company), { controllers }));
@@ -202,7 +202,7 @@ const removeDuplicatesFromCompaniesArray = (companies) => {
202
202
  const getCategoryValueForCompany = (key, company) => {
203
203
  var _a, _b, _c, _d;
204
204
  const firstControllerId = (0, companyHelper_1.getFirstControllerIdFromControllers)(company.controllers);
205
- const customerSuccessManagerIds = (0, companyHelper_1.getFirstControllerId)(company.managegmentInfo.customerSuccessManagerUserIds);
205
+ const customerSuccessManagerIds = (0, companyHelper_1.getFirstControllerId)(company.managementInfo.customerSuccessManagerUserIds);
206
206
  const runway = getRunwayInfinity(company.companyHealthMetric.runway);
207
207
  switch (key) {
208
208
  case 'controller':
@@ -210,7 +210,7 @@ const getCategoryValueForCompany = (key, company) => {
210
210
  case 'customerSuccessManager':
211
211
  return customerSuccessManagerIds;
212
212
  case 'lastReportSent':
213
- return (_a = company.managegmentInfo.lastReportSentDate) !== null && _a !== void 0 ? _a : undefined;
213
+ return (_a = company.managementInfo.lastReportSentDate) !== null && _a !== void 0 ? _a : undefined;
214
214
  case 'subscriptionStartDate':
215
215
  return (_b = company.companyHealthMetric.subscriptionStartDate) !== null && _b !== void 0 ? _b : undefined;
216
216
  case 'subscriptionRenewalDate':
@@ -240,8 +240,8 @@ const getCategoryValueForCompany = (key, company) => {
240
240
  case 'companyEngagementMetricsUpdatedAt':
241
241
  return ((_d = company.companyHealthMetric.companyEngagementMetricsUpdatedAt) !== null && _d !== void 0 ? _d : undefined);
242
242
  case 'companyGroupId':
243
- return company.managegmentInfo.companyGroupId != null
244
- ? company.managegmentInfo.companyGroupId.toString()
243
+ return company.managementInfo.companyGroupId != null
244
+ ? company.managementInfo.companyGroupId.toString()
245
245
  : undefined;
246
246
  case 'monthlyRecurringRevenue':
247
247
  return company.monthlyRecurringRevenue != null
@@ -357,7 +357,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
357
357
  }
358
358
  break;
359
359
  case 'lastReportSent':
360
- if (company.managegmentInfo.lastReportSentDate != null) {
360
+ if (company.managementInfo.lastReportSentDate != null) {
361
361
  companiesWithSortKeyValues.push(company);
362
362
  }
363
363
  else {
@@ -397,7 +397,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
397
397
  }
398
398
  break;
399
399
  case 'controller':
400
- if (company.managegmentInfo.controllerUserIds[0] != null) {
400
+ if (company.managementInfo.controllerUserIds[0] != null) {
401
401
  companiesWithSortKeyValues.push(company);
402
402
  }
403
403
  else {
@@ -405,7 +405,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
405
405
  }
406
406
  break;
407
407
  case 'customerSuccessManager':
408
- if (company.managegmentInfo.customerSuccessManagerUserIds[0] != null) {
408
+ if (company.managementInfo.customerSuccessManagerUserIds[0] != null) {
409
409
  companiesWithSortKeyValues.push(company);
410
410
  }
411
411
  else {
@@ -452,7 +452,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
452
452
  break;
453
453
  case 'group':
454
454
  default:
455
- if (company.managegmentInfo.companyGroupId != null) {
455
+ if (company.managementInfo.companyGroupId != null) {
456
456
  companiesWithSortKeyValues.push(company);
457
457
  }
458
458
  else {
@@ -474,7 +474,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
474
474
  ? Infinity
475
475
  : (_b = (_a = company.companyHealthMetric.runway) === null || _a === void 0 ? void 0 : _a.runwayMonths) !== null && _b !== void 0 ? _b : 0;
476
476
  case 'lastReportSent':
477
- return (_c = company.managegmentInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : DEFAULT_DATE;
477
+ return (_c = company.managementInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : DEFAULT_DATE;
478
478
  case 'renewalDate':
479
479
  return ((_d = company.companyHealthMetric.subscriptionRenewalDate) !== null && _d !== void 0 ? _d : DEFAULT_DATE);
480
480
  case 'subscriptionDate':
@@ -484,9 +484,9 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
484
484
  case 'customerSatisfactionScore':
485
485
  return (_g = company.companyHealthMetric.customerSatisfactionScore) !== null && _g !== void 0 ? _g : 0;
486
486
  case 'controller':
487
- return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.controllerUserIds[0]).toLowerCase();
487
+ return (0, userSelector_1.getUserNameById)(userState, company.managementInfo.controllerUserIds[0]).toLowerCase();
488
488
  case 'customerSuccessManager':
489
- return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.customerSuccessManagerUserIds[0]).toLowerCase();
489
+ return (0, userSelector_1.getUserNameById)(userState, company.managementInfo.customerSuccessManagerUserIds[0]).toLowerCase();
490
490
  case 'externalProductServiceExposure':
491
491
  return company.companyHealthMetric.externalProductServiceExposure !=
492
492
  null
@@ -503,7 +503,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
503
503
  ? company.monthlyRecurringRevenue.amount
504
504
  : 0;
505
505
  case 'group':
506
- return (_j = company.managegmentInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase();
506
+ return (_j = company.managementInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase();
507
507
  case 'companyName':
508
508
  default:
509
509
  return company.companyInfo.name;
@@ -85,8 +85,8 @@ const getAuditSummaryData = (companyId, loggedInUser, managementView, reviewStat
85
85
  auditRuleGroupViewState,
86
86
  ]);
87
87
  const isControllerOrReviewer = managementView.companies.some((company) => {
88
- const { managegmentInfo, companyInfo } = company.company.company;
89
- const { controllerUserIds, reviewerUserIds } = managegmentInfo;
88
+ const { managementInfo, companyInfo } = company.company.company;
89
+ const { controllerUserIds, reviewerUserIds } = managementInfo;
90
90
  if (loggedInUser != null && companyInfo.companyId === companyId) {
91
91
  return (controllerUserIds.includes(loggedInUser.userId) ||
92
92
  reviewerUserIds.includes(loggedInUser.userId));
@@ -139,8 +139,8 @@ const canSendMonthEndEmailReport = (companyView, companiesExcludedFromMonthEndRe
139
139
  return false;
140
140
  }
141
141
  const bookCloseDate = companyView.company.company.companyInfo.bookCloseDate;
142
- const reportSentDate = companyView.company.company.managegmentInfo.lastReportSentDate;
143
- const statusCode = companyView.company.company.managegmentInfo.statusCode;
142
+ const reportSentDate = companyView.company.company.managementInfo.lastReportSentDate;
143
+ const statusCode = companyView.company.company.managementInfo.statusCode;
144
144
  // book close date should be the last date of the previous month
145
145
  // if there is no report sent date or last report was sent in the previous month
146
146
  const prevMonthLastDay = (0, zeniDayJS_1.dateNow)().startOf('month').subtract(1, 'day');
@@ -105,10 +105,10 @@ exports.getAddonListZeniSku = getAddonListZeniSku;
105
105
  const getCategoryValueForCompany = (key, company) => {
106
106
  var _a, _b, _c;
107
107
  if (key === 'customerSatisfaction') {
108
- return (_a = company.company.company.managegmentInfo.customerSatisfaction) === null || _a === void 0 ? void 0 : _a.customerRating;
108
+ return (_a = company.company.company.managementInfo.customerSatisfaction) === null || _a === void 0 ? void 0 : _a.customerRating;
109
109
  }
110
110
  if (key === 'zeniSatisfaction') {
111
- return (_b = company.company.company.managegmentInfo.customerSatisfaction) === null || _b === void 0 ? void 0 : _b.teamRating;
111
+ return (_b = company.company.company.managementInfo.customerSatisfaction) === null || _b === void 0 ? void 0 : _b.teamRating;
112
112
  }
113
113
  if (key === 'plans') {
114
114
  const companyPlans = (0, exports.getPlanListZeniSku)(company);
@@ -118,7 +118,7 @@ const getCategoryValueForCompany = (key, company) => {
118
118
  if (key === 'annualRecurringRevenue' || key === 'monthlyRecurringRevenue') {
119
119
  return (_c = company.primarySubscription) === null || _c === void 0 ? void 0 : _c.summary.summary[key].amount.toString();
120
120
  }
121
- return company.company.company.managegmentInfo[key];
121
+ return company.company.company.managementInfo[key];
122
122
  };
123
123
  const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredCompanies = [], index = 0) => {
124
124
  // if there are no filters we will return allCompanies
@@ -192,7 +192,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
192
192
  companiesWithSortKeyValue.push(company);
193
193
  break;
194
194
  case 'status':
195
- if (((_a = company.company.company.managegmentInfo.statusCode) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !=
195
+ if (((_a = company.company.company.managementInfo.statusCode) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !=
196
196
  null) {
197
197
  companiesWithSortKeyValue.push(company);
198
198
  }
@@ -217,7 +217,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
217
217
  }
218
218
  break;
219
219
  case 'controller':
220
- if (company.company.company.managegmentInfo.controllerUserIds[0] != null) {
220
+ if (company.company.company.managementInfo.controllerUserIds[0] != null) {
221
221
  companiesWithSortKeyValue.push(company);
222
222
  }
223
223
  else {
@@ -225,7 +225,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
225
225
  }
226
226
  break;
227
227
  case 'customerSuccessManager':
228
- if (company.company.company.managegmentInfo
228
+ if (company.company.company.managementInfo
229
229
  .customerSuccessManagerUserIds[0] != null) {
230
230
  companiesWithSortKeyValue.push(company);
231
231
  }
@@ -234,7 +234,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
234
234
  }
235
235
  break;
236
236
  case 'reviewer':
237
- if (company.company.company.managegmentInfo.reviewerUserIds[0] != null) {
237
+ if (company.company.company.managementInfo.reviewerUserIds[0] != null) {
238
238
  companiesWithSortKeyValue.push(company);
239
239
  }
240
240
  else {
@@ -242,7 +242,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
242
242
  }
243
243
  break;
244
244
  case 'preparer':
245
- if (company.company.company.managegmentInfo.preparerUserIds[0] != null) {
245
+ if (company.company.company.managementInfo.preparerUserIds[0] != null) {
246
246
  companiesWithSortKeyValue.push(company);
247
247
  }
248
248
  else {
@@ -250,7 +250,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
250
250
  }
251
251
  break;
252
252
  case 'apAnalyst':
253
- if (company.company.company.managegmentInfo.apAnalystUserIds[0] != null) {
253
+ if (company.company.company.managementInfo.apAnalystUserIds[0] != null) {
254
254
  companiesWithSortKeyValue.push(company);
255
255
  }
256
256
  else {
@@ -258,7 +258,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
258
258
  }
259
259
  break;
260
260
  case 'reportSent':
261
- if (company.company.company.managegmentInfo.lastReportSentDate != null) {
261
+ if (company.company.company.managementInfo.lastReportSentDate != null) {
262
262
  companiesWithSortKeyValue.push(company);
263
263
  }
264
264
  else {
@@ -266,7 +266,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
266
266
  }
267
267
  break;
268
268
  case 'taxStatus':
269
- if (((_c = company.company.company.managegmentInfo.taxStatusCode) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !=
269
+ if (((_c = company.company.company.managementInfo.taxStatusCode) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !=
270
270
  null) {
271
271
  companiesWithSortKeyValue.push(company);
272
272
  }
@@ -275,7 +275,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
275
275
  }
276
276
  break;
277
277
  case 'taxLead':
278
- if (company.company.company.managegmentInfo.taxLeadUserIds[0] != null) {
278
+ if (company.company.company.managementInfo.taxLeadUserIds[0] != null) {
279
279
  companiesWithSortKeyValue.push(company);
280
280
  }
281
281
  else {
@@ -299,7 +299,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
299
299
  }
300
300
  break;
301
301
  case 'notes':
302
- if (((_h = company.company.company.managegmentInfo.note) === null || _h === void 0 ? void 0 : _h.length) != null) {
302
+ if (((_h = company.company.company.managementInfo.note) === null || _h === void 0 ? void 0 : _h.length) != null) {
303
303
  companiesWithSortKeyValue.push(company);
304
304
  }
305
305
  else {
@@ -307,7 +307,7 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
307
307
  }
308
308
  break;
309
309
  case 'group':
310
- if (((_j = company.company.company.managegmentInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase()) !=
310
+ if (((_j = company.company.company.managementInfo.companyGroupId) === null || _j === void 0 ? void 0 : _j.toLowerCase()) !=
311
311
  null) {
312
312
  companiesWithSortKeyValue.push(company);
313
313
  }
@@ -316,8 +316,8 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
316
316
  }
317
317
  break;
318
318
  case 'satisfaction':
319
- if (((_k = company.company.company.managegmentInfo.customerSatisfaction) === null || _k === void 0 ? void 0 : _k.customerRating) != null ||
320
- ((_l = company.company.company.managegmentInfo.customerSatisfaction) === null || _l === void 0 ? void 0 : _l.teamRating) != null) {
319
+ if (((_k = company.company.company.managementInfo.customerSatisfaction) === null || _k === void 0 ? void 0 : _k.customerRating) != null ||
320
+ ((_l = company.company.company.managementInfo.customerSatisfaction) === null || _l === void 0 ? void 0 : _l.teamRating) != null) {
321
321
  companiesWithSortKeyValue.push(company);
322
322
  }
323
323
  else {
@@ -355,14 +355,14 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
355
355
  let primarySortValue;
356
356
  let multiSortValues = [];
357
357
  let isMultiSortApplicable = false;
358
- const managegmentInfo = company.company.company.managegmentInfo;
358
+ const managementInfo = company.company.company.managementInfo;
359
359
  switch (sortKey) {
360
360
  case 'companyName':
361
361
  primarySortValue =
362
362
  company.company.company.companyInfo.name.toLowerCase();
363
363
  break;
364
364
  case 'group':
365
- primarySortValue = (_a = managegmentInfo.companyGroupId) === null || _a === void 0 ? void 0 : _a.toLowerCase();
365
+ primarySortValue = (_a = managementInfo.companyGroupId) === null || _a === void 0 ? void 0 : _a.toLowerCase();
366
366
  break;
367
367
  case 'plans':
368
368
  isMultiSortApplicable = true;
@@ -372,28 +372,28 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
372
372
  primarySortValue = (_b = company.taskSummary) === null || _b === void 0 ? void 0 : _b.count;
373
373
  break;
374
374
  case 'controller':
375
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.controllerUserIds[0]).toLowerCase();
375
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.controllerUserIds[0]).toLowerCase();
376
376
  break;
377
377
  case 'customerSuccessManager':
378
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.customerSuccessManagerUserIds[0]).toLowerCase();
378
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.customerSuccessManagerUserIds[0]).toLowerCase();
379
379
  break;
380
380
  case 'reviewer':
381
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.reviewerUserIds[0]).toLowerCase();
381
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.reviewerUserIds[0]).toLowerCase();
382
382
  break;
383
383
  case 'preparer':
384
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.preparerUserIds[0]).toLowerCase();
384
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.preparerUserIds[0]).toLowerCase();
385
385
  break;
386
386
  case 'apAnalyst':
387
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.apAnalystUserIds[0]).toLowerCase();
387
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.apAnalystUserIds[0]).toLowerCase();
388
388
  break;
389
389
  case 'reportSent':
390
- primarySortValue = ((_c = managegmentInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
390
+ primarySortValue = ((_c = managementInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
391
391
  break;
392
392
  case 'taxStatus':
393
- primarySortValue = (_d = managegmentInfo.taxStatusCode) === null || _d === void 0 ? void 0 : _d.toLowerCase();
393
+ primarySortValue = (_d = managementInfo.taxStatusCode) === null || _d === void 0 ? void 0 : _d.toLowerCase();
394
394
  break;
395
395
  case 'taxLead':
396
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.taxLeadUserIds[0]).toLowerCase();
396
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, managementInfo.taxLeadUserIds[0]).toLowerCase();
397
397
  break;
398
398
  case 'monthlyRecurringRevenue':
399
399
  primarySortValue =
@@ -404,15 +404,15 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
404
404
  (_k = (_j = (_h = company.primarySubscription) === null || _h === void 0 ? void 0 : _h.summary) === null || _j === void 0 ? void 0 : _j.summary.annualRecurringRevenue.amount) !== null && _k !== void 0 ? _k : 0;
405
405
  break;
406
406
  case 'notes':
407
- primarySortValue = (_l = managegmentInfo.note) === null || _l === void 0 ? void 0 : _l.length;
407
+ primarySortValue = (_l = managementInfo.note) === null || _l === void 0 ? void 0 : _l.length;
408
408
  break;
409
409
  case 'satisfaction':
410
410
  isMultiSortApplicable = true;
411
- multiSortValues.push(((_m = managegmentInfo.customerSatisfaction) === null || _m === void 0 ? void 0 : _m.customerRating) != null
412
- ? customerSatisfactionState_1.customerRatingValues[managegmentInfo.customerSatisfaction.customerRating]
411
+ multiSortValues.push(((_m = managementInfo.customerSatisfaction) === null || _m === void 0 ? void 0 : _m.customerRating) != null
412
+ ? customerSatisfactionState_1.customerRatingValues[managementInfo.customerSatisfaction.customerRating]
413
413
  : 0);
414
- multiSortValues.push(((_o = managegmentInfo.customerSatisfaction) === null || _o === void 0 ? void 0 : _o.teamRating) != null
415
- ? customerSatisfactionState_1.teamRatingValues[managegmentInfo.customerSatisfaction.teamRating]
414
+ multiSortValues.push(((_o = managementInfo.customerSatisfaction) === null || _o === void 0 ? void 0 : _o.teamRating) != null
415
+ ? customerSatisfactionState_1.teamRatingValues[managementInfo.customerSatisfaction.teamRating]
416
416
  : 0);
417
417
  break;
418
418
  case 'bookCloseDate':
@@ -422,11 +422,11 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
422
422
  default: {
423
423
  isMultiSortApplicable = true;
424
424
  let statusCode = '';
425
- if (managegmentInfo.statusCode != null) {
426
- statusCode = (0, cockpitTypes_1.toManagementStatusCodeType)(managegmentInfo.statusCode.toLowerCase());
425
+ if (managementInfo.statusCode != null) {
426
+ statusCode = (0, cockpitTypes_1.toManagementStatusCodeType)(managementInfo.statusCode.toLowerCase());
427
427
  }
428
428
  multiSortValues.push(cockpitTypes_1.MANAGEMENT_STATUS_CODES.indexOf(statusCode));
429
- multiSortValues.push((_q = managegmentInfo.companyGroupId) === null || _q === void 0 ? void 0 : _q.toLowerCase());
429
+ multiSortValues.push((_q = managementInfo.companyGroupId) === null || _q === void 0 ? void 0 : _q.toLowerCase());
430
430
  }
431
431
  }
432
432
  return isMultiSortApplicable === true
@@ -53,35 +53,35 @@ function getCompanyView(state, companyId, subscriptionIdsOfCompany, mergePending
53
53
  if (company != null) {
54
54
  company.company = Object.assign({}, company.company);
55
55
  const customerSatisfaction = (0, customerSatisfactionSelector_1.getCustomerSatisfactionByCompanyIdWithUserDetails)(state, companyId);
56
- const updatedManagegmentInfo = Object.assign({}, company.company.managegmentInfo, {
56
+ const updatedManagementInfo = Object.assign({}, company.company.managementInfo, {
57
57
  customerSatisfaction,
58
58
  }, mergePendingManagementUpdates !== null && mergePendingManagementUpdates !== void 0 ? mergePendingManagementUpdates : {});
59
- company.company.managegmentInfo = updatedManagegmentInfo;
60
- const companyAddress = updatedManagegmentInfo.companyAddressId != null
61
- ? (0, addressSelector_1.getAddressByAddressId)(state.addressState, updatedManagegmentInfo.companyAddressId)
59
+ company.company.managementInfo = updatedManagementInfo;
60
+ const companyAddress = updatedManagementInfo.companyAddressId != null
61
+ ? (0, addressSelector_1.getAddressByAddressId)(state.addressState, updatedManagementInfo.companyAddressId)
62
62
  : undefined;
63
- const registeredAddress = updatedManagegmentInfo.registeredAddressId != null
64
- ? (0, addressSelector_1.getAddressByAddressId)(state.addressState, updatedManagegmentInfo.registeredAddressId)
63
+ const registeredAddress = updatedManagementInfo.registeredAddressId != null
64
+ ? (0, addressSelector_1.getAddressByAddressId)(state.addressState, updatedManagementInfo.registeredAddressId)
65
65
  : undefined;
66
- const primaryContact = updatedManagegmentInfo.primaryContactUserId != null
67
- ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagegmentInfo.primaryContactUserId)
66
+ const primaryContact = updatedManagementInfo.primaryContactUserId != null
67
+ ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagementInfo.primaryContactUserId)
68
68
  : undefined;
69
- const companyOfficers = updatedManagegmentInfo.companyOfficerUserIds
69
+ const companyOfficers = updatedManagementInfo.companyOfficerUserIds
70
70
  .map((userId) => (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, userId))
71
71
  .filter((value) => value != null);
72
- const companyContact = updatedManagegmentInfo.companyContactUserId != null
73
- ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagegmentInfo.companyContactUserId)
72
+ const companyContact = updatedManagementInfo.companyContactUserId != null
73
+ ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagementInfo.companyContactUserId)
74
74
  : undefined;
75
- const controllerUserIds = [...updatedManagegmentInfo.controllerUserIds];
76
- const reviewerUserIds = [...updatedManagegmentInfo.reviewerUserIds];
77
- const apAnalystUserIds = [...updatedManagegmentInfo.apAnalystUserIds];
78
- const preparerUserIds = [...updatedManagegmentInfo.preparerUserIds];
79
- const taxLeadUserIds = [...updatedManagegmentInfo.taxLeadUserIds];
75
+ const controllerUserIds = [...updatedManagementInfo.controllerUserIds];
76
+ const reviewerUserIds = [...updatedManagementInfo.reviewerUserIds];
77
+ const apAnalystUserIds = [...updatedManagementInfo.apAnalystUserIds];
78
+ const preparerUserIds = [...updatedManagementInfo.preparerUserIds];
79
+ const taxLeadUserIds = [...updatedManagementInfo.taxLeadUserIds];
80
80
  const customerSuccessManagerUserIds = [
81
- ...updatedManagegmentInfo.customerSuccessManagerUserIds,
81
+ ...updatedManagementInfo.customerSuccessManagerUserIds,
82
82
  ];
83
83
  if ((updatesInProgress === null || updatesInProgress === void 0 ? void 0 : updatesInProgress.status.fetchState) != 'Error') {
84
- (_a = updatedManagegmentInfo.users) === null || _a === void 0 ? void 0 : _a.forEach((user) => {
84
+ (_a = updatedManagementInfo.users) === null || _a === void 0 ? void 0 : _a.forEach((user) => {
85
85
  switch (user.role) {
86
86
  case 'controller': {
87
87
  const userIndex = controllerUserIds.findIndex((controller) => controller === user.userId);
@@ -164,8 +164,8 @@ function getCompanyView(state, companyId, subscriptionIdsOfCompany, mergePending
164
164
  const apAnalysts = apAnalystUserIds
165
165
  .map((userId) => (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, userId))
166
166
  .filter((value) => value != null);
167
- const noteLastUpdatedBy = updatedManagegmentInfo.noteLastUpdatedUserId != null
168
- ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagegmentInfo.noteLastUpdatedUserId)
167
+ const noteLastUpdatedBy = updatedManagementInfo.noteLastUpdatedUserId != null
168
+ ? (0, userAndRole_1.getUserAndUserRole)(state.userState, state.userRoleState, state.addressState, updatedManagementInfo.noteLastUpdatedUserId)
169
169
  : undefined;
170
170
  const { subscriptions, primarySubscription } = getCompanySubscriptions(state, subscriptionIdsOfCompany, filterCancelledPlansAndAddOns, filterAddonsWithEmptyZeniSku);
171
171
  const accountingSummary = (0, accountingSummarySelector_1.getAccountingSummaryByCompanyId)(state.accountingSummaryState, companyId);
@@ -8,5 +8,5 @@ import { fetchCompanyMonthEndReportView, fetchCompanyMonthEndReportTemplates } f
8
8
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
9
9
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
10
10
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
11
- export declare type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
11
+ export declare type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
12
12
  export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../../reducer';
3
3
  import { ZeniAPI } from '../../../../zeniAPI';
4
- import { updateStatusForTransactionNotMiscategorizedUpdate, markTransactionAsNotMiscategorized } from '../../reducers/transactionsViewReducer';
4
+ import { updateStatusForTransactionNotMiscategorizedUpdate, markTransactionAsNotMiscategorized, updateTotalCountForTransactionCategorization } from '../../reducers/transactionsViewReducer';
5
5
  import { removeTransactionCategorization } from '../../../../entity/transaction/transactionReducer';
6
6
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
7
- export declare type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdate>;
7
+ export declare type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdate> | ReturnType<typeof updateTotalCountForTransactionCategorization>;
8
8
  export declare const markTransactionAsNotMiscategorizedEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
@@ -9,22 +9,35 @@ const transactionsViewReducer_1 = require("../../reducers/transactionsViewReduce
9
9
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
10
10
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
11
11
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
12
13
  const TRANSACTION_COUNT_VARIABLE_NAME = '_transactions_count_';
13
14
  const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_2.mergeMap)((action) => {
15
+ const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
14
16
  const transactionsInReview = action.payload.transactionsInReview;
15
17
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
16
- const selectedPeriod = state$.value.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
18
+ const selectedPeriod = expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
19
+ const { selectedTab } = action.payload;
20
+ const { uiState } = expenseAutomationTransactionsViewState[selectedTab];
17
21
  if (transactionsInReview.length > 0) {
18
22
  return zeniAPI
19
23
  .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/mark-as-reviewed`, { transactions_reviewed: transactionsInReview })
20
24
  .pipe((0, operators_2.mergeMap)((response) => {
21
25
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
22
26
  const transactionIds = transactionsInReview.map((transaction) => transaction.transaction_id);
27
+ const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
28
+ const updatedTotalCount = transactionIds.length === 0
29
+ ? totalCountByPeriod
30
+ : totalCountByPeriod - transactionIds.length;
23
31
  const actions = [];
24
32
  actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.selectedTab, transactionIds, selectedPeriod, 'Completed'));
25
33
  actions.push((0, transactionReducer_1.removeTransactionCategorization)({
26
34
  transactionIds: transactionIds,
27
35
  }));
36
+ actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
37
+ selectedPeriod,
38
+ selectedTab,
39
+ totalCount: updatedTotalCount,
40
+ }));
28
41
  actions.push((0, snackbarReducer_1.openSnackbar)({
29
42
  messageSection: 'transactions_reviewed',
30
43
  messageText: 'success',
@@ -45,7 +45,7 @@ function getExpenseAutomationView(state) {
45
45
  let allSteps = [];
46
46
  let auditSummary = undefined;
47
47
  const currentCompany = companyState.companiesById[currentTenant.companyId];
48
- const managementInfo = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.managegmentInfo;
48
+ const managementInfo = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.managementInfo;
49
49
  const controllerUserIds = managementInfo != null ? managementInfo.controllerUserIds : [];
50
50
  const reviewerUserIds = managementInfo != null ? managementInfo.reviewerUserIds : [];
51
51
  const isZeniUser = Boolean((_a = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userEmail) === null || _a === void 0 ? void 0 : _a.includes('zeni.ai'));
@@ -8,4 +8,4 @@ export declare const INCOME_QBOID = "30";
8
8
  export declare const EXPENSE_QBOID = "31";
9
9
  export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction) => TransactionReviewLocalData;
10
10
  export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, vendorId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined) => TransactionReviewLocalData;
11
- export declare const checkIfAllLineItemsAreCategoryClassFilled: (transactionDetailLocalData: TransactionReviewLocalData) => boolean;
11
+ export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData) => boolean;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkIfAllLineItemsAreCategoryClassFilled = exports.toSetAllLineItemsToCategoryClass = exports.toTransactionDetailLocalData = exports.EXPENSE_QBOID = exports.INCOME_QBOID = exports.MAX_SELECTION_LIMIT = void 0;
4
4
  const transactionDetailLocalDataHelper_1 = require("../../transactionDetail/transactionDetailLocalDataHelper");
5
5
  const transactionsViewState_1 = require("../types/transactionsViewState");
6
+ const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
6
7
  exports.MAX_SELECTION_LIMIT = 5;
7
8
  exports.INCOME_QBOID = '30';
8
9
  exports.EXPENSE_QBOID = '31';
@@ -165,7 +166,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
165
166
  const newLocalData = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData), { memo: transactionDetailLocalData.memo, lineItemById: newLineItems, transactionDate: transactionDetailLocalData.transactionDate, transactionType: transactionDetailLocalData.transactionType, transactionTypeName: transactionDetailLocalData.transactionTypeName, vendor: transactionDetailLocalData.vendor, vendorUpdates: transactionDetailLocalData.vendorUpdates, vendorDetails: transactionDetailLocalData.vendorDetails });
166
167
  if (transactionDetailLocalData.vendor != null &&
167
168
  transactionDetailLocalData.vendor.id === vendorId) {
168
- if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(newLocalData)) {
169
+ if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData)) {
169
170
  selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
170
171
  }
171
172
  draft.selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds;
@@ -173,8 +174,18 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
173
174
  return newLocalData;
174
175
  };
175
176
  exports.toSetAllLineItemsToCategoryClass = toSetAllLineItemsToCategoryClass;
176
- const checkIfAllLineItemsAreCategoryClassFilled = (transactionDetailLocalData) => {
177
+ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetailLocalData) => {
177
178
  const lineItems = Object.values(transactionDetailLocalData.lineItemById);
178
- return lineItems.every((lineItem) => lineItem.account != null && lineItem.class != null);
179
+ const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
180
+ return lineItems.every((lineItem) => {
181
+ var _a, _b, _c;
182
+ return lineItem.account != null &&
183
+ lineItem.class != null &&
184
+ !(((_a = lineItem.account) === null || _a === void 0 ? void 0 : _a.qboId) != null &&
185
+ [exports.EXPENSE_QBOID, exports.INCOME_QBOID].includes(lineItem.account.qboId)) &&
186
+ (isVendorTransactionAvailable
187
+ ? ((_b = transactionDetailLocalData.vendor) === null || _b === void 0 ? void 0 : _b.id) != null
188
+ : ((_c = lineItem.vendor) === null || _c === void 0 ? void 0 : _c.id) != null);
189
+ });
179
190
  };
180
191
  exports.checkIfAllLineItemsAreCategoryClassFilled = checkIfAllLineItemsAreCategoryClassFilled;
@@ -90,7 +90,10 @@ const expenseAutomationFluxAnalysisView = (0, toolkit_1.createSlice)({
90
90
  else {
91
91
  draft.operatingExpenseIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = fluxOpExEntityIds;
92
92
  draft.fluxAnalysisEntities = {
93
- operatingExpenses: (0, exports.toFluxAnalysisOperatingEexpenses)(expensesPayload, currency),
93
+ operatingExpenses: [
94
+ ...(0, exports.toFluxAnalysisOperatingEexpenses)(expensesPayload, currency),
95
+ ...draft.fluxAnalysisEntities.operatingExpenses,
96
+ ],
94
97
  };
95
98
  }
96
99
  },
@@ -94,7 +94,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
94
94
  scrollLeft: undefined,
95
95
  };
96
96
  }
97
- draft[selectedTab].selectedCheckBoxTransactionIds = [];
97
+ if (action.payload.keepExistingListItems === false) {
98
+ draft[selectedTab].selectedCheckBoxTransactionIds = [];
99
+ }
98
100
  draft[selectedTab].uiState.pageToken = (_a = action.payload.pageToken) !== null && _a !== void 0 ? _a : null;
99
101
  draft[selectedTab].uiState.searchString =
100
102
  (_b = action.payload.searchString) !== null && _b !== void 0 ? _b : '';
@@ -137,6 +139,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
137
139
  const { keepExistingListItems, transactionIds, transactionLocalData, selectedPeriod, selectedTab, pageToken, totalCount, } = action.payload;
138
140
  if (keepExistingListItems === false) {
139
141
  draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIds;
142
+ draft[selectedTab].selectedCheckBoxTransactionIds = [];
140
143
  }
141
144
  else {
142
145
  const previousData = draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
@@ -148,7 +151,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
148
151
  }
149
152
  }
150
153
  draft[selectedTab].transactionReviewLocalDataById = Object.assign(Object.assign({}, draft[selectedTab].transactionReviewLocalDataById), transactionLocalData);
151
- draft[selectedTab].selectedCheckBoxTransactionIds = [];
152
154
  if (action.payload.refreshViewInBackground === true) {
153
155
  draft[selectedTab].refreshStatus = {
154
156
  fetchState: 'Completed',
@@ -311,8 +313,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
311
313
  const selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds;
312
314
  if (newTransactionLocalData.vendor != null &&
313
315
  newTransactionLocalData.vendor.id != null &&
314
- (0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(newTransactionLocalData) ===
315
- true && // check if all line items are filled
316
+ (0, transactionCategorizationLocalDataHelper_1.checkIfAllLineItemsAreCategoryClassFilled)(selectedTransaction, newTransactionLocalData) === true && // check if all line items are filled
316
317
  selectedCheckBoxTransactionIds.length < transactionCategorizationLocalDataHelper_1.MAX_SELECTION_LIMIT &&
317
318
  selectedCheckBoxTransactionIds.includes(transactionId) === false) {
318
319
  draft[selectedTab].selectedCheckBoxTransactionIds = [
@@ -361,7 +362,10 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
361
362
  reducer(draft, action) {
362
363
  const { selectedTab, selectedPeriod, transactionIds } = action.payload;
363
364
  if (action.payload.fetchState === 'Completed') {
364
- draft[selectedTab].selectedCheckBoxTransactionIds = [];
365
+ const selectedCheckBoxTransactionIds = draft[selectedTab].selectedCheckBoxTransactionIds.filter((id) => !transactionIds.includes(id));
366
+ draft[selectedTab].selectedCheckBoxTransactionIds = [
367
+ ...selectedCheckBoxTransactionIds,
368
+ ];
365
369
  const transactionIdsBySelectedPeriod = draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
366
370
  if (transactionIdsBySelectedPeriod != null) {
367
371
  draft[selectedTab].transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = transactionIdsBySelectedPeriod.filter((id) => !transactionIds.includes(id));
@@ -70,8 +70,8 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
70
70
  }
71
71
  }
72
72
  fetchActions.push((0, onboardingCockpitViewReducer_1.clearOnboardingCustomerViewUpdateData)(), (0, onboardingCockpitViewReducer_1.saveOnboardingCustomerViewUpdateData)(newOnboardingCustomerData), (0, onboardingCockpitViewReducer_1.saveOnboardingCustomerDataInLocalStore)(newOnboardingCustomerData), (0, addressViewReducer_1.resetNewAddressesInLocalStore)());
73
- const companyAddress = (company === null || company === void 0 ? void 0 : company.company.managegmentInfo.companyAddressId) != null
74
- ? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, company === null || company === void 0 ? void 0 : company.company.managegmentInfo.companyAddressId)
73
+ const companyAddress = (company === null || company === void 0 ? void 0 : company.company.managementInfo.companyAddressId) != null
74
+ ? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, company === null || company === void 0 ? void 0 : company.company.managementInfo.companyAddressId)
75
75
  : undefined;
76
76
  if (companyAddress != null) {
77
77
  fetchActions.push((0, addressViewReducer_1.newAddressInLocalStore)({
@@ -143,7 +143,7 @@ const getSortedOnboardingCustomers = (onboardingCustomers, sortKey, sortOrder, u
143
143
  companiesWithSortKeyValue.push(company);
144
144
  break;
145
145
  case 'notes':
146
- if (((_a = company.company.company.managegmentInfo.note) === null || _a === void 0 ? void 0 : _a.length) != null) {
146
+ if (((_a = company.company.company.managementInfo.note) === null || _a === void 0 ? void 0 : _a.length) != null) {
147
147
  companiesWithSortKeyValue.push(company);
148
148
  }
149
149
  else {
@@ -179,11 +179,11 @@ const getSortedOnboardingCustomers = (onboardingCustomers, sortKey, sortOrder, u
179
179
  case 'enroller':
180
180
  return (0, userSelector_1.getUserNameById)(userState, company.company.company.companyOnboardingInfo.onboardingUserIds[0]).toLowerCase();
181
181
  case 'notes':
182
- return (_d = company.company.company.managegmentInfo.note) === null || _d === void 0 ? void 0 : _d.length;
182
+ return (_d = company.company.company.managementInfo.note) === null || _d === void 0 ? void 0 : _d.length;
183
183
  case 'invite':
184
184
  return (((_e = company.company.company.companyOnboardingInfo.onboardingInfo) === null || _e === void 0 ? void 0 : _e.inviteSent) === true);
185
185
  default:
186
- return (_f = company.company.company.managegmentInfo.companyGroupId) === null || _f === void 0 ? void 0 : _f.toLowerCase();
186
+ return (_f = company.company.company.managementInfo.companyGroupId) === null || _f === void 0 ? void 0 : _f.toLowerCase();
187
187
  }
188
188
  }, sortOrder === 'ascending' ? 'asc' : 'desc');
189
189
  return [...sortedCompaniesWithSortKeyValue, ...companiesWithNoSortKeyValue];
@@ -27,11 +27,11 @@ const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => act
27
27
  const subscriptionIDs = (0, get_1.default)(companyViewState.passportView.subscriptionIDsByCompanyID, companyId, undefined);
28
28
  const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, subscriptionIDs !== null && subscriptionIDs !== void 0 ? subscriptionIDs : []);
29
29
  const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
30
- const companyOfficers = (0, userSelector_1.getUsersByUserIds)(userState, (_b = company === null || company === void 0 ? void 0 : company.managegmentInfo.companyOfficerUserIds) !== null && _b !== void 0 ? _b : []);
31
- const primaryContact = (company === null || company === void 0 ? void 0 : company.managegmentInfo.primaryContactUserId) != null
32
- ? (0, userSelector_1.getUserByUserId)(userState, company === null || company === void 0 ? void 0 : company.managegmentInfo.primaryContactUserId)
30
+ const companyOfficers = (0, userSelector_1.getUsersByUserIds)(userState, (_b = company === null || company === void 0 ? void 0 : company.managementInfo.companyOfficerUserIds) !== null && _b !== void 0 ? _b : []);
31
+ const primaryContact = (company === null || company === void 0 ? void 0 : company.managementInfo.primaryContactUserId) != null
32
+ ? (0, userSelector_1.getUserByUserId)(userState, company === null || company === void 0 ? void 0 : company.managementInfo.primaryContactUserId)
33
33
  : undefined;
34
- const companyOfficerRoles = (0, userRoleSelector_1.getUserRoleByUserIds)(userRoleState, (_c = company === null || company === void 0 ? void 0 : company.managegmentInfo.companyOfficerUserIds) !== null && _c !== void 0 ? _c : []);
34
+ const companyOfficerRoles = (0, userRoleSelector_1.getUserRoleByUserIds)(userRoleState, (_c = company === null || company === void 0 ? void 0 : company.managementInfo.companyOfficerUserIds) !== null && _c !== void 0 ? _c : []);
35
35
  const fetchActions = [];
36
36
  if (company != null) {
37
37
  const onboardingCustomerViewLocalData = toOnboardingCustomerViewLocalData(company, companyOfficers, companyOfficerRoles, primaryContact);
@@ -21,11 +21,11 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
21
21
  .map((company) => {
22
22
  var _a;
23
23
  const companyWithSchema = (0, companySelector_1.getCompanyByCompanyId)(rootState.companyState, company.companyId);
24
- const controllerUserIds = (_a = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managegmentInfo.controllerUserIds) !== null && _a !== void 0 ? _a : [];
24
+ const controllerUserIds = (_a = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managementInfo.controllerUserIds) !== null && _a !== void 0 ? _a : [];
25
25
  const controllers = controllerUserIds
26
26
  .map((userId) => (0, userAndRole_1.getUserAndUserRole)(rootState.userState, rootState.userRoleState, rootState.addressState, userId))
27
27
  .filter((value) => value != null);
28
- const customerGroup = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managegmentInfo.companyGroupId;
28
+ const customerGroup = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managementInfo.companyGroupId;
29
29
  const reviewViewCompany = Object.assign(Object.assign({}, company), { controllers,
30
30
  customerGroup });
31
31
  if (company.noteLastUpdatedUserId != null) {
@@ -21,7 +21,7 @@ const getIssueChargeCardView = (state) => {
21
21
  }
22
22
  });
23
23
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
24
- const companyAddressId = (_a = currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.company) === null || _a === void 0 ? void 0 : _a.managegmentInfo.companyAddressId;
24
+ const companyAddressId = (_a = currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.company) === null || _a === void 0 ? void 0 : _a.managementInfo.companyAddressId;
25
25
  const companyAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, companyAddressId !== null && companyAddressId !== void 0 ? companyAddressId : '');
26
26
  let customAddressStatus = {};
27
27
  let customAddress = {};
@@ -21,11 +21,11 @@ const updateSetupViewLocalStoreDataEpic = (actions$, state$) => actions$.pipe((0
21
21
  const subscriptionIDs = (0, get_1.default)(state$.value.companyViewState.passportView.subscriptionIDsByCompanyID, companyId, undefined);
22
22
  const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, subscriptionIDs !== null && subscriptionIDs !== void 0 ? subscriptionIDs : []);
23
23
  const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(state$.value.companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
24
- const companyOfficers = (0, userSelector_1.getUsersByUserIds)(state$.value.userState, (_b = company === null || company === void 0 ? void 0 : company.managegmentInfo.companyOfficerUserIds) !== null && _b !== void 0 ? _b : []);
25
- const primaryContact = (company === null || company === void 0 ? void 0 : company.managegmentInfo.primaryContactUserId) != null
26
- ? (0, userSelector_1.getUserByUserId)(state$.value.userState, company === null || company === void 0 ? void 0 : company.managegmentInfo.primaryContactUserId)
24
+ const companyOfficers = (0, userSelector_1.getUsersByUserIds)(state$.value.userState, (_b = company === null || company === void 0 ? void 0 : company.managementInfo.companyOfficerUserIds) !== null && _b !== void 0 ? _b : []);
25
+ const primaryContact = (company === null || company === void 0 ? void 0 : company.managementInfo.primaryContactUserId) != null
26
+ ? (0, userSelector_1.getUserByUserId)(state$.value.userState, company === null || company === void 0 ? void 0 : company.managementInfo.primaryContactUserId)
27
27
  : undefined;
28
- const companyOfficerRoles = (0, userRoleSelector_1.getUserRoleByUserIds)(state$.value.userRoleState, (_c = company === null || company === void 0 ? void 0 : company.managegmentInfo.companyOfficerUserIds) !== null && _c !== void 0 ? _c : []);
28
+ const companyOfficerRoles = (0, userRoleSelector_1.getUserRoleByUserIds)(state$.value.userRoleState, (_c = company === null || company === void 0 ? void 0 : company.managementInfo.companyOfficerUserIds) !== null && _c !== void 0 ? _c : []);
29
29
  const fetchActions = [];
30
30
  if (company != null) {
31
31
  const setupViewLocalData = toSetupViewLocalData(company, companyOfficers, companyOfficerRoles, primaryContact);
@@ -177,7 +177,7 @@ const getCategoryValueForCompany = (key, company) => {
177
177
  return addOns;
178
178
  }
179
179
  if (key == 'controllerUserIds') {
180
- return company.company.company.managegmentInfo.controllerUserIds;
180
+ return company.company.company.managementInfo.controllerUserIds;
181
181
  }
182
182
  return (_f = company.primarySubscription) === null || _f === void 0 ? void 0 : _f.summary.summary[key];
183
183
  };
@@ -286,7 +286,7 @@ const getSubscriptionListOnSortAndFitler = (sortKey, sortOrder, filterText, filt
286
286
  }
287
287
  break;
288
288
  case 'controller':
289
- if (company.company.company.managegmentInfo.controllerUserIds[0] != null) {
289
+ if (company.company.company.managementInfo.controllerUserIds[0] != null) {
290
290
  companiesWithSortKeyValue.push(company);
291
291
  }
292
292
  else {
@@ -383,7 +383,7 @@ const getSubscriptionListOnSortAndFitler = (sortKey, sortOrder, filterText, filt
383
383
  (_c = summary === null || summary === void 0 ? void 0 : summary.summary.recommendedActionCode.toLowerCase()) !== null && _c !== void 0 ? _c : '';
384
384
  break;
385
385
  case 'controller':
386
- primarySortValue = (0, userSelector_1.getUserNameById)(userState, company.company.company.managegmentInfo.controllerUserIds[0]).toLowerCase();
386
+ primarySortValue = (0, userSelector_1.getUserNameById)(userState, company.company.company.managementInfo.controllerUserIds[0]).toLowerCase();
387
387
  break;
388
388
  case 'plans':
389
389
  primarySortValue =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.13.37",
3
+ "version": "4.13.39",
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",