@zeniai/client-epic-state 4.16.0 → 4.16.2

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 (174) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +1 -1
  3. package/lib/entity/chargeCard/chargeCard.d.ts +26 -8
  4. package/lib/entity/chargeCard/chargeCard.js +25 -6
  5. package/lib/entity/chargeCard/chargeCardPayload.d.ts +41 -5
  6. package/lib/entity/chargeCard/chargeCardPayload.js +20 -8
  7. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  8. package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +5 -1
  9. package/lib/entity/company/companyPayload.d.ts +12 -1
  10. package/lib/entity/company/companyPayload.js +14 -0
  11. package/lib/entity/company/companyStateTypes.d.ts +11 -0
  12. package/lib/entity/connectedAccount/connectedAccount.d.ts +19 -0
  13. package/lib/entity/connectedAccount/connectedAccount.js +10 -0
  14. package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +11 -0
  15. package/lib/entity/connectedAccount/connectedAccountPayload.js +15 -0
  16. package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +6 -0
  17. package/lib/entity/connectedAccount/connectedAccountReducer.js +27 -0
  18. package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +4 -0
  19. package/lib/entity/connectedAccount/connectedAccountSelector.js +17 -0
  20. package/lib/entity/depositAccount/depositAccount.d.ts +20 -2
  21. package/lib/entity/depositAccount/depositAccountPayload.d.ts +22 -1
  22. package/lib/entity/depositAccount/depositAccountPayload.js +39 -1
  23. package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
  24. package/lib/entity/depositAccount/depositAccountReducer.js +8 -2
  25. package/lib/entity/depositAccount/depositAccountSelector.d.ts +3 -1
  26. package/lib/entity/depositAccount/depositAccountSelector.js +10 -0
  27. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  28. package/lib/entity/snackbar/snackbarTypes.js +2 -0
  29. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  30. package/lib/entity/tenant/clearAllEpic.js +2 -0
  31. package/lib/entity/tenant/tenantSelector.d.ts +6 -2
  32. package/lib/entity/tenant/tenantSelector.js +10 -2
  33. package/lib/epic.d.ts +5 -1
  34. package/lib/epic.js +5 -1
  35. package/lib/index.d.ts +18 -18
  36. package/lib/index.js +26 -17
  37. package/lib/reducer.d.ts +3 -0
  38. package/lib/reducer.js +3 -0
  39. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +8 -0
  40. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +16 -0
  41. package/lib/view/addressView/addressViewState.d.ts +1 -1
  42. package/lib/view/dashboard/dashboardSelector.js +7 -6
  43. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +5 -4
  44. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +1 -2
  45. package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +18 -6
  46. package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +1 -4
  47. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +7 -1
  48. package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -2
  49. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
  50. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +3 -3
  51. package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
  52. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  53. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +27 -24
  54. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +22 -9
  55. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
  56. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +13 -5
  57. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +245 -115
  58. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -3
  59. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -19
  60. package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +29 -9
  61. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +108 -40
  62. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
  63. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +40 -15
  64. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
  65. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
  66. package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -0
  67. package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
  68. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +2 -1
  69. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
  70. package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
  71. package/lib/view/settingsView/settingsViewHelpers.js +9 -8
  72. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
  73. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +6 -1
  74. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +20 -2
  75. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -0
  76. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +9 -2
  77. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
  78. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +4 -3
  79. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +5 -3
  80. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +4 -2
  81. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +8 -3
  82. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +4 -2
  83. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +12 -0
  84. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +26 -0
  85. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
  86. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +43 -4
  87. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +104 -9
  88. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +15 -0
  89. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +70 -16
  90. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -1
  91. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +12 -3
  92. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +2 -1
  93. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +8 -0
  94. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +41 -0
  95. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
  96. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +11 -0
  97. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +42 -0
  98. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +11 -1
  99. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +20 -1
  100. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +16 -1
  101. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -4
  102. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +30 -4
  103. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +5 -2
  104. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +26 -14
  105. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
  106. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +20 -5
  107. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +7 -0
  108. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +23 -0
  109. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +2 -1
  110. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +4 -2
  111. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
  112. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -0
  113. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +19 -2
  114. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +6 -0
  115. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +2 -0
  116. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +8 -0
  117. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +31 -0
  118. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
  119. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +15 -3
  120. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
  121. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +65 -25
  122. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +11 -3
  123. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +45 -11
  124. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +6 -3
  125. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +33 -18
  126. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +41 -8
  127. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +0 -21
  128. package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +9 -0
  129. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +8 -3
  130. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
  131. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
  132. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
  133. package/lib/view/spendManagement/commonSetup/setupViewState.js +13 -1
  134. package/lib/view/spendManagement/helpers.d.ts +3 -0
  135. package/lib/view/spendManagement/helpers.js +13 -1
  136. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
  137. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  138. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +2 -1
  139. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  140. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
  141. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +6 -1
  142. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
  143. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
  144. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
  145. package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
  146. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
  147. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
  148. package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
  149. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
  150. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
  151. package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.d.ts +4 -3
  152. package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +25 -1
  153. package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +1 -1
  154. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
  155. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +4 -2
  156. package/lib/view/transactionDetail/transactionDetailReducer.js +4 -2
  157. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -2
  158. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +44 -19
  159. package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +2 -1
  160. package/lib/view/twoFactorAuthentication/sendOtpEpic.js +45 -18
  161. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +17 -5
  162. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +33 -0
  163. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
  164. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
  165. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +22 -6
  166. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +176 -60
  167. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +5 -3
  168. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +13 -2
  169. package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +5 -2
  170. package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +46 -5
  171. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
  172. package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -3
  173. package/lib/view/userListView/userListViewPayload.d.ts +11 -0
  174. package/package.json +5 -4
@@ -45,16 +45,17 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
45
45
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
46
46
  return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
47
47
  }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, monthEndCloseChecksView, tenantState, additionalExcludedReports) => {
48
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
49
49
  const isReimbursementFeatureEnabled = (_a = tenants.currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
50
- const isAdmin = Boolean((_b = tenants.currentTenant) === null || _b === void 0 ? void 0 : _b.userRole) === true
50
+ const isBillPayFeatureEnabled = (_b = tenants.currentTenant.company) === null || _b === void 0 ? void 0 : _b.featuresActivationInfo.isBillPayFeatureEnabled;
51
+ const isAdmin = Boolean((_c = tenants.currentTenant) === null || _c === void 0 ? void 0 : _c.userRole) === true
51
52
  ? (0, userRoleType_1.hasAdminLevelAccess)(tenants.currentTenant.userRole)
52
53
  : false;
53
- const isInvestorBanker = Boolean((_c = tenants.currentTenant) === null || _c === void 0 ? void 0 : _c.userRole) === true
54
+ const isInvestorBanker = Boolean((_d = tenants.currentTenant) === null || _d === void 0 ? void 0 : _d.userRole) === true
54
55
  ? (0, userRoleType_1.hasInvestorBankerLevelAccess)(tenants.currentTenant.userRole)
55
56
  : false;
56
- const hasTopExAccess = ((_f = (_e = (_d = tenants.currentTenant) === null || _d === void 0 ? void 0 : _d.excludedResources) === null || _e === void 0 ? void 0 : _e.resources) === null || _f === void 0 ? void 0 : _f.find((resource) => resource.resource === '/reports/top_expenses')) == null;
57
- const hasTasksCardAccess = ((_j = (_h = (_g = tenants.currentTenant) === null || _g === void 0 ? void 0 : _g.excludedResources) === null || _h === void 0 ? void 0 : _h.resources) === null || _j === void 0 ? void 0 : _j.find((resource) => resource.resource === '/reports/task_card')) == null;
57
+ const hasTopExAccess = ((_g = (_f = (_e = tenants.currentTenant) === null || _e === void 0 ? void 0 : _e.excludedResources) === null || _f === void 0 ? void 0 : _f.resources) === null || _g === void 0 ? void 0 : _g.find((resource) => resource.resource === '/reports/top_expenses')) == null;
58
+ const hasTasksCardAccess = ((_k = (_j = (_h = tenants.currentTenant) === null || _h === void 0 ? void 0 : _h.excludedResources) === null || _j === void 0 ? void 0 : _j.resources) === null || _k === void 0 ? void 0 : _k.find((resource) => resource.resource === '/reports/task_card')) == null;
58
59
  const reportsInOrder = [
59
60
  cashBalance,
60
61
  cardBalance,
@@ -82,7 +83,7 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
82
83
  if (hasTasksCardAccess) {
83
84
  reportsInOrder.push(tasksCard);
84
85
  }
85
- if (!isInvestorBanker) {
86
+ if (!isInvestorBanker && isBillPayFeatureEnabled === true) {
86
87
  reportsInOrder.push(billPayCard);
87
88
  }
88
89
  if (isReimbursementFeatureEnabled === true && isAdmin) {
@@ -85,20 +85,21 @@ function calculateSplitAmounts(transactions, transactionDirection, currency) {
85
85
  };
86
86
  }
87
87
  let count = 0;
88
- let totalAmount = 0;
88
+ let totalAmount = (0, big_js_1.default)(0);
89
89
  transactions.forEach((transaction) => {
90
90
  if (transaction.transactionDirection === transactionDirection) {
91
91
  count = count + 1;
92
- totalAmount = totalAmount + transaction.amount.amount;
92
+ totalAmount = totalAmount.plus(transaction.amount.amount);
93
93
  }
94
94
  });
95
95
  return {
96
96
  count,
97
- totalAmount: Object.assign({ amount: totalAmount }, currency),
97
+ totalAmount: Object.assign({ amount: parseFloat(totalAmount.toFixed(2)) }, currency),
98
98
  };
99
99
  }
100
100
  function calculateVariance(updatedClearedBalance, bankBalance) {
101
- const variance = Math.abs(bankBalance.amount - updatedClearedBalance.amount);
101
+ const varianceBig = (0, big_js_1.default)(bankBalance.amount).minus(updatedClearedBalance.amount);
102
+ const variance = Math.abs(varianceBig.toNumber());
102
103
  const variancePercent = bankBalance.amount != 0
103
104
  ? parseFloat(((variance / Math.abs(bankBalance.amount)) * 100).toFixed(2))
104
105
  : undefined;
@@ -60,8 +60,7 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
60
60
  if (state.expenseAutomationFluxAnalysisViewState.fetchState !==
61
61
  'In-Progress' &&
62
62
  (!state.expenseAutomationFluxAnalysisViewState.hasValidState() ||
63
- state.expenseAutomationFluxAnalysisViewState
64
- .operatingExpenseIdsBySelectedPeriod[monthYearPeriodId] == null)) {
63
+ state.expenseAutomationFluxAnalysisViewState.groupsBySelectedPeriod[monthYearPeriodId] == null)) {
65
64
  fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
66
65
  }
67
66
  if (state.expenseAutomationJESchedulesViewState.fetchState !==
@@ -13,11 +13,18 @@ const responsePayload_1 = require("../../../../responsePayload");
13
13
  const helpers_1 = require("../../helpers/helpers");
14
14
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
15
15
  const fetchFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fluxAnalysisViewReducer_1.fetchFluxAnalysisView.match), (0, operators_1.mergeMap)((action) => {
16
- var _a;
17
- const { expenseAutomationFluxAnalysisViewState: { fetchState, operatingExpenseIdsBySelectedPeriod, uiState, }, } = state$.value;
18
- const { monthAndYear, cacheOverride, pageToken, keepExistingListItems } = action.payload;
19
- const operatingExpenseIds = (_a = operatingExpenseIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthAndYear)]) !== null && _a !== void 0 ? _a : [];
16
+ var _a, _b, _c;
17
+ const { expenseAutomationFluxAnalysisViewState: { groupsBySelectedPeriod, uiState, }, } = state$.value;
18
+ const { monthAndYear, cacheOverride, pageToken, fetchReimbursement, keepExistingListItems, } = action.payload;
19
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(monthAndYear);
20
+ const periodGroup = groupsBySelectedPeriod[periodId];
21
+ const groupToBeFetched = fetchReimbursement === true
22
+ ? periodGroup === null || periodGroup === void 0 ? void 0 : periodGroup.reimbursement
23
+ : periodGroup === null || periodGroup === void 0 ? void 0 : periodGroup.generalExpense;
24
+ const operatingExpenseIds = (_a = groupToBeFetched === null || groupToBeFetched === void 0 ? void 0 : groupToBeFetched.operatingExpenseIds) !== null && _a !== void 0 ? _a : [];
25
+ const fetchState = (_c = (_b = groupToBeFetched === null || groupToBeFetched === void 0 ? void 0 : groupToBeFetched.fetchStatus) === null || _b === void 0 ? void 0 : _b.fetchState) !== null && _c !== void 0 ? _c : 'Not-Started';
20
26
  if (cacheOverride === true ||
27
+ groupToBeFetched == null ||
21
28
  operatingExpenseIds.length === 0 ||
22
29
  fetchState === 'Not-Started') {
23
30
  const month = monthAndYear.month < 10
@@ -28,6 +35,7 @@ const fetchFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
28
35
  sort_by: (0, helpers_1.toVendorFluxAnalysisSortKeyPayload)(uiState.sortKey),
29
36
  sort_order: (0, sortOrderPayload_1.getSortOrder)(uiState.sortOrder),
30
37
  page_token: pageToken,
38
+ reimbursement_flag: fetchReimbursement,
31
39
  };
32
40
  return zeniAPI
33
41
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/month-close/flux-analysis?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -43,14 +51,17 @@ const fetchFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
43
51
  updateType: 'merge',
44
52
  }));
45
53
  updateActions.push((0, fluxAnalysisViewReducer_1.updateFluxAnalysisViewPageMetaData)({
54
+ fetchReimbursement,
46
55
  pageMetaData: response.data.page_metadata,
47
56
  }));
48
57
  if (((_a = response.data.flux_analysis_entities) === null || _a === void 0 ? void 0 : _a.operating_expenses) !=
49
58
  null) {
50
59
  updateActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewSuccess)({
51
60
  expensesPayload: (_b = response.data.flux_analysis_entities) === null || _b === void 0 ? void 0 : _b.operating_expenses,
61
+ totalsPayload: response.data.total_operating_expenses,
52
62
  currency: response.data.currency,
53
63
  selectedPeriod: monthAndYear,
64
+ fetchReimbursement,
54
65
  keepExistingListItems,
55
66
  }));
56
67
  }
@@ -58,13 +69,14 @@ const fetchFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
58
69
  }
59
70
  else {
60
71
  return (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewFailure)({
72
+ fetchReimbursement,
61
73
  status: response.status,
62
74
  selectedPeriod: monthAndYear,
63
75
  }));
64
76
  }
65
77
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewFailure)({
66
- status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch flux analysis view REST API call errored out' +
67
- JSON.stringify(error)),
78
+ fetchReimbursement,
79
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `fetch flux analysis view REST API call errored out: ${JSON.stringify(error)}`),
68
80
  selectedPeriod: monthAndYear,
69
81
  }))));
70
82
  }
@@ -14,7 +14,7 @@ const monthEndCloseChecksViewReducer_1 = require("../../../monthEndCloseChecksVi
14
14
  const helpers_1 = require("../../helpers/helpers");
15
15
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
16
16
  const reviewFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fluxAnalysisViewReducer_1.reviewFluxAnalysisView.match), (0, operators_1.mergeMap)((action) => {
17
- const { actionType, operatingExpenseIds, selectedPeriod, isBulk } = action.payload;
17
+ const { actionType, operatingExpenseIds, selectedPeriod } = action.payload;
18
18
  const payload = Object.assign({}, getReviewFluxPayload(actionType, operatingExpenseIds));
19
19
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
20
20
  return zeniAPI
@@ -33,7 +33,6 @@ const reviewFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
33
33
  expensesPayload: (_b = (_a = response.data.flux_analysis_entities) === null || _a === void 0 ? void 0 : _a.operating_expenses) !== null && _b !== void 0 ? _b : [],
34
34
  currency: response.data.currency,
35
35
  selectedPeriod: selectedPeriod,
36
- isBulk,
37
36
  }));
38
37
  }
39
38
  if (currentTenant != null) {
@@ -66,14 +65,12 @@ const reviewFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
66
65
  return (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.reviewFluxAnalysisViewFailure)({
67
66
  operatingExpenseIds: operatingExpenseIds,
68
67
  status: response.status,
69
- isBulk,
70
68
  }));
71
69
  }
72
70
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.reviewFluxAnalysisViewFailure)({
73
71
  operatingExpenseIds: operatingExpenseIds,
74
72
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'review flux analysis view REST API call errored out' +
75
73
  JSON.stringify(error)),
76
- isBulk,
77
74
  }))));
78
75
  }));
79
76
  exports.reviewFluxAnalysisViewEpic = reviewFluxAnalysisViewEpic;
@@ -34,11 +34,17 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
34
34
  const updateActions = [];
35
35
  updateActions.push((0, transactionReducer_1.updateTransactions)(response.data.transactions, (value) => value.transaction_id, keepExistingListItems === true ? 'merge' : 'replace'));
36
36
  const transactionIds = response.data.transactions.map((transaction) => transaction.transaction_id);
37
+ const lineItemsByTransactionIds = {};
38
+ response.data.transactions.forEach((transaction) => {
39
+ var _a, _b;
40
+ lineItemsByTransactionIds[transaction.transaction_id] =
41
+ (_b = (_a = transaction.lines) === null || _a === void 0 ? void 0 : _a.map((line) => line.line_id)) !== null && _b !== void 0 ? _b : [];
42
+ });
37
43
  updateActions.push((0, transactionsViewReducer_1.updateTransactionCategorizationUIState)({
38
44
  selectedTab,
39
45
  uiState: Object.assign(Object.assign({}, uiState), { pageToken: (_a = response.data.next_page_token) !== null && _a !== void 0 ? _a : null }),
40
46
  }));
41
- updateActions.push((0, transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData)(selectedTab, transactionIds, selectedPeriod, keepExistingListItems, (_b = response.data.next_page_token) !== null && _b !== void 0 ? _b : null, response.data.total_count, refreshViewInBackground));
47
+ updateActions.push((0, transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData)(selectedTab, transactionIds, selectedPeriod, keepExistingListItems, (_b = response.data.next_page_token) !== null && _b !== void 0 ? _b : null, response.data.total_count, refreshViewInBackground, lineItemsByTransactionIds));
42
48
  updateActions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
43
49
  selectedPeriod,
44
50
  selectedTab,
@@ -8,7 +8,7 @@ const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transa
8
8
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
9
9
  const transactionsViewState_1 = require("../../types/transactionsViewState");
10
10
  const initializeTransactionCategorizationViewLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.initializeTransactionCategorizationViewLocalData.match), (0, operators_1.mergeMap)((action) => {
11
- const { transactionIds, selectedPeriod, keepExistingListItems, selectedTab, pageToken, totalCount, refreshViewInBackground, } = action.payload;
11
+ const { transactionIds, selectedPeriod, keepExistingListItems, selectedTab, pageToken, totalCount, refreshViewInBackground, lineItemsByTransactionIds, } = action.payload;
12
12
  const fetchActions = [];
13
13
  const { transactionState, expenseAutomationTransactionsViewState } = state$.value;
14
14
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
@@ -17,7 +17,7 @@ const initializeTransactionCategorizationViewLocalDataEpic = (actions$, state$)
17
17
  const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
18
18
  transactions.forEach((transaction) => {
19
19
  var _a, _b;
20
- const newTransactionsLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(transaction);
20
+ const newTransactionsLocalData = (0, transactionCategorizationLocalDataHelper_1.toTransactionDetailLocalData)(transaction, selectedTab, lineItemsByTransactionIds[transaction.id]);
21
21
  if (transactionLocalData[transaction.id] == null) {
22
22
  transactionLocalData[transaction.id] = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization), { transactionId: transaction.id, transactionReviewLocalData: Object.assign(Object.assign({}, newTransactionsLocalData), { sortedLineItems: (_b = (_a = transaction.lines) === null || _a === void 0 ? void 0 : _a.map((line) => line.id)) !== null && _b !== void 0 ? _b : [] }) });
23
23
  }
@@ -4,6 +4,6 @@ import { removeTransactionCategorization } from '../../../../entity/transaction/
4
4
  import { RootState } from '../../../../reducer';
5
5
  import { ZeniAPI } from '../../../../zeniAPI';
6
6
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
7
- import { markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdate, updateTotalCountForTransactionCategorization } from '../../reducers/transactionsViewReducer';
8
- export type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdate> | ReturnType<typeof updateTotalCountForTransactionCategorization>;
7
+ import { markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateTotalCountForTransactionCategorization } from '../../reducers/transactionsViewReducer';
8
+ export type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdateForCategorization> | ReturnType<typeof updateTotalCountForTransactionCategorization>;
9
9
  export declare const markTransactionAsNotMiscategorizedEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
@@ -47,7 +47,7 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
47
47
  const updatedTotalCount = transactionIdsSuccess.length === 0
48
48
  ? totalCountByPeriod
49
49
  : totalCountByPeriod - transactionIdsSuccess.length;
50
- actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.selectedTab, transactionIdsSuccess, selectedPeriod, 'Completed'), (0, transactionReducer_1.removeTransactionCategorization)({
50
+ actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, transactionIdsSuccess, selectedPeriod, 'Completed'), (0, transactionReducer_1.removeTransactionCategorization)({
51
51
  transactionIds: transactionIdsSuccess,
52
52
  }), (0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
53
53
  selectedPeriod,
@@ -97,9 +97,9 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
97
97
  return (0, rxjs_1.from)(actions);
98
98
  }
99
99
  else {
100
- return (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.selectedTab, [], selectedPeriod, 'Error', response.status));
100
+ return (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], selectedPeriod, 'Error', response.status));
101
101
  }
102
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.selectedTab, [], selectedPeriod, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark miscategorized as correct REST API call errored out ${JSON.stringify(error)}`)))));
102
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(action.payload.selectedTab, [], selectedPeriod, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark miscategorized as correct REST API call errored out ${JSON.stringify(error)}`)))));
103
103
  }
104
104
  else {
105
105
  return (0, rxjs_1.from)(actions);
@@ -41,10 +41,10 @@ const toVendorFluxAnalysisSortKeyPayload = (sortKey) => {
41
41
  switch (sortKey) {
42
42
  case 'vendor':
43
43
  return 'vendor_name';
44
- case 'category':
45
- return 'account_name';
46
- case 'class':
47
- return 'accounting_class_name';
44
+ case 'status':
45
+ return 'is_reviewed';
46
+ case 'variance':
47
+ return 'variance_amount';
48
48
  }
49
49
  };
50
50
  exports.toVendorFluxAnalysisSortKeyPayload = toVendorFluxAnalysisSortKeyPayload;
@@ -5,9 +5,9 @@ import { Entity } from '../../../entity/genericEntity/entity';
5
5
  import { RecommendationByLineId } from '../../../entity/transaction/stateTypes/transaction';
6
6
  import { SupportedTransaction } from '../../../entity/transaction/transactionState';
7
7
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
8
- import { TransactionReviewLocalData, TransactionsTabViewState } from '../types/transactionsViewState';
8
+ import { TransactionReviewLocalData, TransactionsTab, TransactionsTabViewState } from '../types/transactionsViewState';
9
9
  export declare const MAX_SELECTION_LIMIT = 5;
10
- export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction) => TransactionReviewLocalData;
10
+ export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction, selectedTab: TransactionsTab, lineItemsByTransactionIds: string[]) => TransactionReviewLocalData;
11
11
  export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase) => TransactionReviewLocalData;
12
12
  export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedAccounts: UncategorizedAccounts, recommendationByLineId?: RecommendationByLineId) => TransactionReviewLocalData;
13
13
  export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, uncategorizedAccounts: UncategorizedAccounts) => boolean;
@@ -5,7 +5,7 @@ const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vend
5
5
  const transactionDetailLocalDataHelper_1 = require("../../transactionDetail/transactionDetailLocalDataHelper");
6
6
  const transactionsViewState_1 = require("../types/transactionsViewState");
7
7
  exports.MAX_SELECTION_LIMIT = 5;
8
- const toTransactionDetailLocalData = (transaction) => {
8
+ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds) => {
9
9
  const transactionLocal = Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData);
10
10
  transactionLocal.memo = transaction.memo;
11
11
  transactionLocal.transactionDate = transaction.date;
@@ -30,29 +30,31 @@ const toTransactionDetailLocalData = (transaction) => {
30
30
  logo: transaction.logo,
31
31
  }
32
32
  : undefined;
33
- if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
34
- transaction.vendorId != null &&
35
- transaction.vendorName != null) {
36
- transactionLocal.selectedEntity = {
37
- id: transaction.vendorId,
38
- name: transaction.vendorName,
39
- type: 'vendor',
40
- qboId: transaction.vendorId,
41
- zeniId: transaction.vendorId,
42
- logo: transaction.logo,
43
- };
44
- }
45
- if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
46
- transaction.customerId != null &&
47
- transaction.customerName != null) {
48
- transactionLocal.selectedEntity = {
49
- id: transaction.customerId,
50
- name: transaction.customerName,
51
- type: 'customer',
52
- qboId: transaction.customerId,
53
- zeniId: transaction.customerId,
54
- logo: transaction.logo,
55
- };
33
+ if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
34
+ if (transaction.vendorId != null && transaction.vendorName != null) {
35
+ transactionLocal.selectedEntity = {
36
+ id: transaction.vendorId,
37
+ name: transaction.vendorName,
38
+ type: 'vendor',
39
+ qboId: transaction.vendorId,
40
+ zeniId: transaction.vendorId,
41
+ logo: transaction.logo,
42
+ };
43
+ }
44
+ else if (transaction.customerId != null &&
45
+ transaction.customerName != null) {
46
+ transactionLocal.selectedEntity = {
47
+ id: transaction.customerId,
48
+ name: transaction.customerName,
49
+ type: 'customer',
50
+ qboId: transaction.customerId,
51
+ zeniId: transaction.customerId,
52
+ logo: transaction.logo,
53
+ };
54
+ }
55
+ else {
56
+ transactionLocal.selectedEntity = undefined;
57
+ }
56
58
  }
57
59
  transactionLocal.vendorUpdates = undefined;
58
60
  transactionLocal.customerUpdates = undefined;
@@ -64,6 +66,7 @@ const toTransactionDetailLocalData = (transaction) => {
64
66
  transaction.lines != null && transaction.lines.length > 0
65
67
  ? transaction.lines.map((line) => line.id)
66
68
  : [];
69
+ transactionLocal.tabSpecificLineItems = Object.assign(Object.assign({}, transactionLocal.tabSpecificLineItems), { [selectedTab]: lineItemsByTransactionIds });
67
70
  return transactionLocal;
68
71
  };
69
72
  exports.toTransactionDetailLocalData = toTransactionDetailLocalData;
@@ -5,7 +5,7 @@ import { ClassBasePayload } from '../../../entity/class/classPayload';
5
5
  import { UserPayload } from '../../../entity/user/userPayload';
6
6
  import { VendorPayload } from '../../../entity/vendor/vendorPayload';
7
7
  import { ZeniAPIResponse } from '../../../responsePayload';
8
- declare const toFluxAnalysisQuerySortKey: (v: string) => "accounting_class_name" | "account_name" | "vendor_name";
8
+ declare const toFluxAnalysisQuerySortKey: (v: string) => "vendor_name" | "is_reviewed" | "variance_amount";
9
9
  export type FluxAnalysisQuerySortKey = ReturnType<typeof toFluxAnalysisQuerySortKey>;
10
10
  export type FluxAnalysisActionQueryType = 'mark_as_reviewed' | 'mark_as_un_reviewed';
11
11
  export interface PageMetadataPayload {
@@ -17,6 +17,7 @@ export interface FluxAnalysisQueryPayload {
17
17
  sort_order: string;
18
18
  sort_by: string;
19
19
  page_token: string | null;
20
+ reimbursement_flag: boolean;
20
21
  }
21
22
  export interface FluxAnalysisReviewPayload {
22
23
  action: string;
@@ -28,18 +29,23 @@ export interface MonthBalancePayload extends AgingBalancePayload {
28
29
  label: string;
29
30
  start_date: string;
30
31
  }
31
- export interface FluxAnalysisEntitiesPayload {
32
- operating_expenses?: FluxAnalysisOperatingExpensePayload[];
33
- }
34
- export interface FluxAnalysisOperatingExpensePayload {
35
- flux_analysis_entity_id: string;
36
- vendor_id: string;
37
- account_id: string | undefined;
38
- accounting_class_id: string | undefined;
32
+ export interface MonthBalanceAndVariancePayload {
39
33
  month_1: MonthBalancePayload;
40
34
  month_2: MonthBalancePayload;
41
35
  variance_amount: number;
42
36
  variance_percentage: number;
37
+ }
38
+ export interface FluxAnalysisEntitiesPayload {
39
+ operating_expenses: FluxAnalysisOperatingExpensePayload[];
40
+ }
41
+ export interface FluxAccountAndClassPayload extends MonthBalanceAndVariancePayload {
42
+ accounting_class_id: string;
43
+ account_id: string;
44
+ }
45
+ export interface FluxAnalysisOperatingExpensePayload extends MonthBalanceAndVariancePayload {
46
+ flux_analysis_entity_id: string;
47
+ vendor_id: string;
48
+ category_and_class_json: FluxAccountAndClassPayload[];
43
49
  anomaly_reason: string;
44
50
  status: string;
45
51
  reviewed_by_user_id: string | null;
@@ -47,12 +53,18 @@ export interface FluxAnalysisOperatingExpensePayload {
47
53
  updated_at: string | null;
48
54
  is_reviewed: boolean | null;
49
55
  }
56
+ export interface FluxAnalysisTotalPayload {
57
+ reimbursement: MonthBalanceAndVariancePayload;
58
+ general_expenses: MonthBalanceAndVariancePayload;
59
+ total: MonthBalanceAndVariancePayload;
60
+ }
50
61
  export interface FluxAnalysisReportPayload {
51
62
  vendors: VendorPayload[];
52
63
  accounts: AccountBasePayload[];
53
64
  accounting_class: ClassBasePayload[];
54
65
  users: UserPayload[];
55
66
  flux_analysis_entities?: FluxAnalysisEntitiesPayload;
67
+ total_operating_expenses: FluxAnalysisTotalPayload;
56
68
  page_metadata?: PageMetadataPayload;
57
69
  currency: CurrencyPayload;
58
70
  }
@@ -62,6 +74,7 @@ export interface FluxAnalysisResponsePayload extends FluxAnalysisReportPayload {
62
74
  page_token: string;
63
75
  sort_by: string;
64
76
  sort_order: string;
77
+ reimbursement_flag: boolean;
65
78
  };
66
79
  }
67
80
  export interface ReviewFluxAnalysisResponsePayload extends FluxAnalysisReportPayload {
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
4
4
  const FLUX_ANALYSIS_SORT_KEYS_QUERY = [
5
- 'accounting_class_name',
6
- 'account_name',
5
+ 'is_reviewed',
6
+ 'variance_amount',
7
7
  'vendor_name',
8
8
  ];
9
9
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -3,26 +3,32 @@ import { ID } from '../../../commonStateTypes/common';
3
3
  import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
4
4
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
5
  import { ZeniAPIStatus } from '../../../responsePayload';
6
- import { FluxAnalysisOperatingExpensePayload, PageMetadataPayload } from '../payload/fluxAnalysisPayload';
6
+ import { FluxAnalysisOperatingExpensePayload, FluxAnalysisTotalPayload, PageMetadataPayload } from '../payload/fluxAnalysisPayload';
7
+ import { FluxAnalysisSectionType } from '../selectorTypes/fluxAnalysisViewSelectorTypes';
7
8
  import { FluxAnalysisActionType, FluxAnalysisViewState, FluxAnalysisViewUIState } from '../types/fluxAnalysisViewState';
8
9
  export declare const initialState: FluxAnalysisViewState;
9
- export declare const fetchFluxAnalysisView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[monthAndYear: MonthYearPeriod, cacheOverride: boolean, refreshViewInBackground: boolean, pageToken: PageToken, keepExistingListItems?: boolean | undefined, resetListItems?: boolean | undefined], {
10
+ export declare const fetchFluxAnalysisView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[monthAndYear: MonthYearPeriod, cacheOverride: boolean, refreshViewInBackground: boolean, pageToken: PageToken, fetchReimbursement?: any, keepExistingListItems?: boolean | undefined, resetListItems?: boolean | undefined], {
10
11
  monthAndYear: MonthYearPeriod;
11
12
  refreshViewInBackground: boolean;
12
13
  cacheOverride: boolean;
13
14
  pageToken: PageToken;
15
+ fetchReimbursement: any;
14
16
  keepExistingListItems: boolean | undefined;
15
17
  resetListItems: boolean | undefined;
16
18
  }, "expenseAutomationFluxAnalysisView/fetchFluxAnalysisView", never, never>, fetchFluxAnalysisViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
17
19
  expensesPayload: FluxAnalysisOperatingExpensePayload[];
18
20
  selectedPeriod: MonthYearPeriod;
19
21
  currency: CurrencyPayload;
22
+ fetchReimbursement: boolean;
23
+ totalsPayload?: FluxAnalysisTotalPayload;
20
24
  keepExistingListItems?: boolean;
21
25
  }, "expenseAutomationFluxAnalysisView/fetchFluxAnalysisViewSuccess">, fetchFluxAnalysisViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
+ fetchReimbursement: boolean;
22
27
  status: ZeniAPIStatus;
23
28
  selectedPeriod: MonthYearPeriod;
24
29
  }, "expenseAutomationFluxAnalysisView/fetchFluxAnalysisViewFailure">, clearExpenseAutomationFluxAnalysisView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationFluxAnalysisView/clearExpenseAutomationFluxAnalysisView">, updateOperatingExpensesIdsForReview: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
25
30
  operatingExpenseIds: ID[];
31
+ selectedPeriod: MonthYearPeriod;
26
32
  }, "expenseAutomationFluxAnalysisView/updateOperatingExpensesIdsForReview">, reviewFluxAnalysisView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[actionType: FluxAnalysisActionType, operatingExpenseIds: string[], selectedPeriod: MonthYearPeriod, isBulk?: boolean | undefined], {
27
33
  actionType: FluxAnalysisActionType;
28
34
  operatingExpenseIds: string[];
@@ -32,13 +38,15 @@ export declare const fetchFluxAnalysisView: import("@reduxjs/toolkit").ActionCre
32
38
  expensesPayload: FluxAnalysisOperatingExpensePayload[];
33
39
  currency: CurrencyPayload;
34
40
  selectedPeriod: MonthYearPeriod;
35
- isBulk?: boolean;
36
41
  }, "expenseAutomationFluxAnalysisView/reviewFluxAnalysisViewSuccess">, reviewFluxAnalysisViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
37
42
  operatingExpenseIds: ID[];
38
43
  status: ZeniAPIStatus;
39
- isBulk?: boolean;
40
44
  }, "expenseAutomationFluxAnalysisView/reviewFluxAnalysisViewFailure">, updateFluxAnalysisViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<FluxAnalysisViewUIState>, "expenseAutomationFluxAnalysisView/updateFluxAnalysisViewUIState">, updateFluxAnalysisViewPageMetaData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
45
+ fetchReimbursement: boolean;
41
46
  pageMetaData?: PageMetadataPayload;
42
- }, "expenseAutomationFluxAnalysisView/updateFluxAnalysisViewPageMetaData">;
47
+ }, "expenseAutomationFluxAnalysisView/updateFluxAnalysisViewPageMetaData">, updateSelectedSectionIdsForReview: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
48
+ sectionId: FluxAnalysisSectionType[];
49
+ selectedPeriod: MonthYearPeriod;
50
+ }, "expenseAutomationFluxAnalysisView/updateSelectedSectionIdsForReview">;
43
51
  declare const _default: import("redux").Reducer<FluxAnalysisViewState>;
44
52
  export default _default;