@zeniai/client-epic-state 4.20.1 → 4.20.2-beta0ND

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 (128) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonStateTypes/animations.d.ts +1 -1
  4. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  5. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  9. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  10. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  11. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  12. package/lib/entity/tenant/tenantReducer.js +1 -0
  13. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  14. package/lib/entity/tenant/tenantSelector.js +9 -1
  15. package/lib/entity/tenant/tenantState.d.ts +1 -0
  16. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  17. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  18. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  19. package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  21. package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
  22. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  23. package/lib/epic.d.ts +2 -1
  24. package/lib/epic.js +2 -1
  25. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  27. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  28. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  29. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  30. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  31. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  32. package/lib/esm/epic.js +2 -1
  33. package/lib/esm/index.js +10 -8
  34. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  35. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  36. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  37. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  38. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  39. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  41. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  42. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  43. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  44. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  45. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  46. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  47. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  48. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  49. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  50. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  51. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
  52. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
  53. package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +17 -0
  54. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  55. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +20 -29
  56. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  57. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  58. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  59. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  60. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  61. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  62. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  63. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  64. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  65. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  66. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  67. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  68. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  69. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  70. package/lib/index.d.ts +15 -11
  71. package/lib/index.js +44 -32
  72. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  73. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  74. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  75. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  76. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  77. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  78. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  79. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  80. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  81. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  82. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  83. package/lib/view/classList/fetchClassListEpic.js +8 -1
  84. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  85. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  86. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  87. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  89. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  90. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  91. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  92. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  93. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  94. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  95. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  96. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  97. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  98. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  99. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  100. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  101. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  102. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
  103. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  104. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
  105. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +9 -0
  106. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +20 -0
  107. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  108. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +20 -29
  109. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  110. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  111. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  112. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  113. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  114. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  115. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  116. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  117. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  118. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  119. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  120. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  121. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  122. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  123. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  124. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  125. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  126. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  127. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  128. package/package.json +1 -1
@@ -424,6 +424,14 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
424
424
  transactionsWithNoSortKeyValue.push(transaction);
425
425
  }
426
426
  break;
427
+ case 'invoiceNumber':
428
+ if (transaction.documentId != null) {
429
+ transactionsWithSortKeyValue.push(transaction);
430
+ }
431
+ else {
432
+ transactionsWithNoSortKeyValue.push(transaction);
433
+ }
434
+ break;
427
435
  case 'dueDate':
428
436
  if (currentTab === 'draft') {
429
437
  if (Boolean(transaction.dueDate) === true) {
@@ -526,6 +534,8 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
526
534
  return transaction.totalAmountInUSD?.amount ?? 0;
527
535
  case 'paymentMethod':
528
536
  return transaction.billPayInfo.billPaymentMethodType.name;
537
+ case 'invoiceNumber':
538
+ return transaction.documentId;
529
539
  }
530
540
  }, getColumnWiseSortOrder(sortOrder));
531
541
  return [
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
37
37
  export type BillTab = ReturnType<typeof toBillTabType>;
38
38
  declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
39
39
  export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
40
- declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
40
+ declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
41
41
  export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
42
42
  export interface BillPayFilters {
43
43
  categories: BillPayFilterCategory[];
@@ -47,6 +47,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
47
47
  'invoiceDate',
48
48
  'name',
49
49
  'paymentMethod',
50
+ 'invoiceNumber',
50
51
  ];
51
52
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
52
53
  const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
@@ -8,6 +8,7 @@ const get_1 = __importDefault(require("lodash/get"));
8
8
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
9
9
  const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
10
10
  const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
11
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
12
  const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
12
13
  const accountListSelector_1 = require("../../../accountList/accountListSelector");
13
14
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
@@ -80,11 +81,14 @@ const getReviewPageBillDetail = (state, billId) => {
80
81
  }
81
82
  }
82
83
  if (sourceBillDetail != null) {
83
- sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)([
84
+ const fetchStateList = [
84
85
  sourceBillDetail.fetchStatus,
85
86
  accountListState.byReportId['billPayAccountList'],
86
- classListState,
87
- ]).fetchState;
87
+ ];
88
+ if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
89
+ fetchStateList.push(classListState);
90
+ }
91
+ sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
88
92
  }
89
93
  }
90
94
  else {
@@ -9,6 +9,7 @@ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
9
9
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
10
10
  const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
11
11
  const classSelector_1 = require("../../../../entity/class/classSelector");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
13
  const userSelector_1 = require("../../../../entity/user/userSelector");
13
14
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
14
15
  exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
@@ -50,7 +51,7 @@ exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => s
50
51
  newApprovalRuleId,
51
52
  };
52
53
  });
53
- exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
54
+ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => (0, tenantSelector_1.getIsAccountingClassesEnabled)(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
54
55
  const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
55
56
  const { approverIds, attributes } = approverListState;
56
57
  const allApprovalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
@@ -98,10 +99,9 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
98
99
  allAttributes,
99
100
  filteredAttributes,
100
101
  billPaySetupApproverViewUpdateData,
101
- approverListFetchStatus: (0, reduceFetchState_1.reduceAllFetchState)([
102
- approverListState.fetchStatus,
103
- classListState,
104
- ]),
102
+ approverListFetchStatus: isAccountingClassesEnabled
103
+ ? (0, reduceFetchState_1.reduceAllFetchState)([approverListState.fetchStatus, classListState])
104
+ : approverListState.fetchStatus,
105
105
  fetchState,
106
106
  allAccountingClasses,
107
107
  error,
@@ -3,23 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchBillPayApproversDetailsEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
+ const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
6
7
  const classListReducer_1 = require("../../../../classList/classListReducer");
7
8
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
8
9
  const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPayApproversDetails.match), (0, operators_1.mergeMap)((action) => {
9
10
  const { cacheOverride, includeUserRoles } = action.payload;
10
11
  const { billPaySetupApproverViewState, classListState } = state$.value;
11
12
  const { approverListState } = billPaySetupApproverViewState;
13
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
12
14
  const actions = [];
13
15
  if (cacheOverride === true) {
14
16
  actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(cacheOverride, includeUserRoles));
15
- actions.push((0, classListReducer_1.fetchClassList)());
17
+ if (isAccountingClassesEnabled) {
18
+ actions.push((0, classListReducer_1.fetchClassList)());
19
+ }
16
20
  }
17
21
  else {
18
22
  if (billPaySetupApproverViewState.hasValidState() === false &&
19
23
  approverListState.fetchStatus.fetchState !== 'In-Progress') {
20
24
  actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(true, includeUserRoles));
21
25
  }
22
- if (classListState.hasValidState() === false &&
26
+ if (isAccountingClassesEnabled &&
27
+ classListState.hasValidState() === false &&
23
28
  classListState.fetchState !== 'In-Progress') {
24
29
  actions.push((0, classListReducer_1.fetchClassList)());
25
30
  }
@@ -16,6 +16,7 @@ const companySelector_1 = require("../../../../entity/company/companySelector");
16
16
  const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
17
17
  const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
18
18
  const paymentInstrumentSelector_1 = require("../../../../entity/paymentInstrument/paymentInstrumentSelector");
19
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
19
20
  const userSelector_1 = require("../../../../entity/user/userSelector");
20
21
  const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
21
22
  const zeniDayJS_1 = require("../../../../zeniDayJS");
@@ -181,12 +182,15 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
181
182
  isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
182
183
  billStage = billPayInfo?.stage.code ?? 'draft';
183
184
  if (billViewState != null) {
184
- fetchState = (0, reduceFetchState_1.reduceFetchState)([
185
+ const fetchStateList = [
185
186
  sourceBillDetail.fetchStatus,
186
187
  accountListState.byReportId.billPayAccountList,
187
- classListState,
188
188
  billPaySetupApproverViewState,
189
- ]).fetchState;
189
+ ];
190
+ if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
191
+ fetchStateList.push(classListState);
192
+ }
193
+ fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
190
194
  deleteStatus = billViewState.deleteStatus;
191
195
  billActivities = (0, billDetailViewSelector_1.getBillActivities)(state, billId, billPayInfo?.stage.code);
192
196
  }
@@ -200,11 +204,14 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
200
204
  }
201
205
  }
202
206
  else {
203
- fetchState = (0, reduceFetchState_1.reduceFetchState)([
207
+ const newBillFetchStateList = [
204
208
  accountListState.byReportId.billPayAccountList,
205
- classListState,
206
209
  billPaySetupApproverViewState,
207
- ]).fetchState;
210
+ ];
211
+ if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
212
+ newBillFetchStateList.push(classListState);
213
+ }
214
+ fetchState = (0, reduceFetchState_1.reduceFetchState)(newBillFetchStateList).fetchState;
208
215
  }
209
216
  if (sourceBillDetail != null && fetchState == 'Completed') {
210
217
  const updatedRecord = sourceBillDetail.billDetailLocalData;
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
61
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
62
62
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
63
63
  export declare const initialCreditAccountRepayment: CreditAccountRepayment;
64
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
64
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
65
65
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
66
66
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
67
67
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -78,6 +78,7 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
78
78
  'cardName',
79
79
  'department',
80
80
  'cardType',
81
+ 'accountType',
81
82
  'status',
82
83
  'utilisation',
83
84
  'limit',
@@ -233,6 +233,8 @@ const getCardsBySortKey = (card, sortKey) => {
233
233
  return card.cardName.toLowerCase();
234
234
  case 'cardType':
235
235
  return card.type.code;
236
+ case 'accountType':
237
+ return card.type.code.includes('credit') ? 'credit' : 'debit';
236
238
  case 'status':
237
239
  return card.status.code;
238
240
  case 'utilisation':
@@ -69,13 +69,16 @@ const getEditRemiDetail = (state, reimbursementId) => {
69
69
  paymentTo: reimbursementInfo?.toAccount.billAccountId,
70
70
  };
71
71
  if (sourceRemiDetail != null) {
72
- fetchState = (0, reduceFetchState_1.reduceFetchState)([
72
+ const fetchStateList = [
73
73
  sourceRemiDetail.fetchStatus,
74
74
  accountListState.byReportId.reimbursementAccountList,
75
- classListState,
76
75
  merchantListState,
77
76
  reimbursementConfigState,
78
- ]).fetchState;
77
+ ];
78
+ if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
79
+ fetchStateList.push(classListState);
80
+ }
81
+ fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
79
82
  remiStage = reimbursementInfo?.stage.code ?? 'draft';
80
83
  createdBy = (0, userSelector_1.getUserByUserId)(userState, reimbursement?.createdBy ?? '');
81
84
  createTime = reimbursement?.createTime;
@@ -42,6 +42,7 @@ export interface ReimbursementView extends Reimbursement {
42
42
  approvers: Approvers;
43
43
  submittedBy: User | undefined;
44
44
  bulkSelectInfo?: RemiBulkSelectInfo;
45
+ createdByUser?: User;
45
46
  }
46
47
  export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
47
48
  export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
@@ -51,6 +51,7 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
51
51
  return {
52
52
  ...reimbursement,
53
53
  submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
54
+ createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
54
55
  approvers: approvers,
55
56
  };
56
57
  });
@@ -423,6 +424,14 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
423
424
  reimbursementsWithNoSortKeyValue.push(reimbursement);
424
425
  }
425
426
  break;
427
+ case 'createdBy':
428
+ if (reimbursement.createdByUser != null) {
429
+ reimbursementsWithSortKeyValue.push(reimbursement);
430
+ }
431
+ else {
432
+ reimbursementsWithNoSortKeyValue.push(reimbursement);
433
+ }
434
+ break;
426
435
  }
427
436
  });
428
437
  const getColumnWiseSortOrder = (sortOrder) => {
@@ -430,6 +439,7 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
430
439
  case 'reportName':
431
440
  case 'type':
432
441
  case 'status':
442
+ case 'createdBy':
433
443
  return sortOrder === 'ascending' ? 'asc' : 'desc';
434
444
  default:
435
445
  return sortOrder === 'ascending' ? 'desc' : 'asc';
@@ -449,6 +459,8 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
449
459
  return getStatusPerTab(reimbursement);
450
460
  case 'amount':
451
461
  return reimbursement.amount.amount ?? 0;
462
+ case 'createdBy':
463
+ return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
452
464
  }
453
465
  }, getColumnWiseSortOrder(sortOrder));
454
466
  return [
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
38
38
  export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
39
39
  export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
40
40
  export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
41
- declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
41
+ declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
42
42
  export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
43
43
  export interface ReimbursementFilters {
44
44
  categories: ReimbursementFilterCategory[];
@@ -64,6 +64,7 @@ exports.toRemiSubTabUnderScoreType = toRemiSubTabUnderScoreType;
64
64
  const ALL_REIMBURSEMENT_SORT_KEYS = [
65
65
  'reportName',
66
66
  'submittedOn',
67
+ 'createdBy',
67
68
  'type',
68
69
  'status',
69
70
  'amount',
@@ -98,11 +98,11 @@ exports.allTaskStatus = [
98
98
  },
99
99
  {
100
100
  code: 'done',
101
- name: 'Done',
101
+ name: 'In Review',
102
102
  },
103
103
  {
104
104
  code: 'resolved',
105
- name: 'Resolved',
105
+ name: 'Complete',
106
106
  },
107
107
  ];
108
108
  exports.allTaskPriority = [
@@ -78,8 +78,8 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
78
78
  lineItem.account?.qboId !== accountLine.account.qboId &&
79
79
  Boolean(lineItem.account?.qboId);
80
80
  hasClassChanged =
81
- Boolean(lineItem.class?.qboId) &&
82
- lineItem.class?.qboId !== accountLine.class.qboId;
81
+ (lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
82
+ lineItem.class?.qboId !== accountLine.class?.qboId;
83
83
  const recommendedAccountBase = (0, exports.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
84
84
  const recommendedClassBase = (0, exports.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
85
85
  const latestRecommendedCategory = lineItem.recommendedAccount;
@@ -144,13 +144,13 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
144
144
  record.isRetainedCategorySelected = false;
145
145
  }
146
146
  if (Boolean(recommendedClass?.qboId) &&
147
- recommendedClass?.qboId !== accountLine.class.qboId) {
147
+ recommendedClass?.qboId !== accountLine.class?.qboId) {
148
148
  record.isRecommendedClassSelected = false;
149
149
  record.recommendedClass = recommendedClass;
150
150
  record.isClassUpdateSelected = false;
151
151
  }
152
152
  if (accountLine.isClassMiscategorized &&
153
- Boolean(accountLine.class.qboId) &&
153
+ Boolean(accountLine.class?.qboId) &&
154
154
  Boolean(isVendorOrCustomerPresent)) {
155
155
  record.retainedClass = accountLine.class;
156
156
  record.isRetainedClassSelected = false;
@@ -342,14 +342,14 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
342
342
  }
343
343
  };
344
344
  const updateClass = () => {
345
- if (recommendedClass?.qboId !== accountLine.class.qboId &&
345
+ if (recommendedClass?.qboId !== accountLine.class?.qboId &&
346
346
  Boolean(recommendedClass?.qboId)) {
347
347
  record.class = accountLine.class;
348
348
  record.isRecommendedClassSelected = false;
349
349
  record.recommendedClass = recommendedClass;
350
350
  record.isClassUpdateSelected = false;
351
351
  if (accountLine.isClassMiscategorized &&
352
- Boolean(accountLine.class.qboId) &&
352
+ Boolean(accountLine.class?.qboId) &&
353
353
  Boolean(isVendorOrCustomerPresent)) {
354
354
  record.retainedClass = accountLine.class;
355
355
  record.isRetainedClassSelected = false;
@@ -362,7 +362,7 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
362
362
  record.recommendedClass = recommendedClass;
363
363
  record.isClassUpdateSelected = false;
364
364
  if (accountLine.isClassMiscategorized &&
365
- Boolean(accountLine.class.qboId) &&
365
+ Boolean(accountLine.class?.qboId) &&
366
366
  Boolean(isVendorOrCustomerPresent)) {
367
367
  record.retainedClass = recommendedClass;
368
368
  record.isRetainedClassSelected = false;
@@ -659,13 +659,13 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
659
659
  record.isRetainedCategorySelected = false;
660
660
  }
661
661
  }
662
- if (recommendedClass?.qboId !== accountLine.class.qboId &&
662
+ if (recommendedClass?.qboId !== accountLine.class?.qboId &&
663
663
  Boolean(recommendedClass?.qboId)) {
664
664
  record.isRecommendedClassSelected = false;
665
665
  record.recommendedClass = recommendedClass;
666
666
  record.isClassUpdateSelected = false;
667
667
  if (accountLine.isClassMiscategorized &&
668
- Boolean(accountLine.class.qboId)) {
668
+ Boolean(accountLine.class?.qboId)) {
669
669
  record.retainedClass = accountLine.class;
670
670
  record.isRetainedClassSelected = false;
671
671
  }
@@ -673,12 +673,12 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
673
673
  else {
674
674
  record.isRecommendedClassSelected = false;
675
675
  record.recommendedClass = recommendedClass;
676
- if (recommendedClass?.qboId === accountLine.class.qboId) {
676
+ if (recommendedClass?.qboId === accountLine.class?.qboId) {
677
677
  record.recommendedClass = undefined;
678
678
  }
679
679
  record.isClassUpdateSelected = false;
680
680
  if (accountLine.isClassMiscategorized &&
681
- Boolean(accountLine.class.qboId)) {
681
+ Boolean(accountLine.class?.qboId)) {
682
682
  record.retainedClass = recommendedClass;
683
683
  record.isRetainedClassSelected = false;
684
684
  }
@@ -694,7 +694,7 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
694
694
  Boolean(recommendedAccount?.qboId) !== false) {
695
695
  record.account = recommendedAccount;
696
696
  }
697
- if (Boolean(record.class.qboId) === false &&
697
+ if (Boolean(record.class?.qboId) === false &&
698
698
  Boolean(recommendedClass?.qboId) !== false) {
699
699
  record.class = recommendedClass;
700
700
  }
@@ -817,7 +817,9 @@ const getChangedLineItemCountFromLocalData = (transaction, transactionLocalData)
817
817
  accountLineLocal.account?.qboId !== accountLine.account.qboId &&
818
818
  accountLineLocal.account?.accountId !== accountLine.account.accountId;
819
819
  hasClassChanged =
820
- accountLineLocal.class?.qboId !== accountLine.class.qboId;
820
+ (accountLineLocal.class?.qboId != null ||
821
+ accountLine.class?.qboId != null) &&
822
+ accountLineLocal.class?.qboId !== accountLine.class?.qboId;
821
823
  }
822
824
  hasDescriptionChanged =
823
825
  transactionLocalData.lineItemById[lineId] != null
@@ -957,10 +959,10 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
957
959
  record.isRecommendedClassSelected = false;
958
960
  record.recommendedClass = recommendedClass;
959
961
  record.isClassUpdateSelected = false;
960
- if (recommendedClass?.qboId !== accountLine.class.qboId &&
962
+ if (recommendedClass?.qboId !== accountLine.class?.qboId &&
961
963
  Boolean(recommendedClass?.qboId)) {
962
964
  if (accountLine.isClassMiscategorized &&
963
- Boolean(accountLine.class.qboId) &&
965
+ Boolean(accountLine.class?.qboId) &&
964
966
  Boolean(isVendorOrCustomerPresent)) {
965
967
  record.retainedClass = accountLine.class;
966
968
  record.isRetainedClassSelected = false;
@@ -973,7 +975,7 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
973
975
  record.recommendedClass = recommendedClass;
974
976
  record.isClassUpdateSelected = false;
975
977
  if (accountLine.isClassMiscategorized &&
976
- Boolean(accountLine.class.qboId) &&
978
+ Boolean(accountLine.class?.qboId) &&
977
979
  Boolean(isVendorOrCustomerPresent)) {
978
980
  record.retainedClass = recommendedClass;
979
981
  record.isRetainedClassSelected = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.20.1",
3
+ "version": "4.20.2-beta0ND",
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
  "module": "lib/esm/index.js",