@zeniai/client-epic-state 4.16.4 → 4.16.5

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 (164) 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 +16 -16
  36. package/lib/index.js +39 -29
  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.d.ts +2 -2
  48. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +4 -0
  49. package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
  50. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +25 -23
  51. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +22 -9
  52. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
  53. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +13 -5
  54. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +245 -115
  55. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -1
  56. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +28 -17
  57. package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +29 -9
  58. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +108 -40
  59. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +40 -15
  60. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
  61. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
  62. package/lib/view/expenseAutomationView/types/transactionsViewState.js +3 -3
  63. package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
  64. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +2 -1
  65. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
  66. package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
  67. package/lib/view/settingsView/settingsViewHelpers.js +9 -8
  68. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
  69. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +6 -1
  70. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +20 -2
  71. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -0
  72. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +9 -2
  73. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
  74. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +4 -3
  75. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +5 -3
  76. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +4 -2
  77. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +8 -3
  78. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +4 -2
  79. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +12 -0
  80. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +26 -0
  81. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
  82. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +43 -4
  83. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +104 -9
  84. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +15 -0
  85. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +70 -16
  86. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -1
  87. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +12 -3
  88. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +2 -1
  89. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +8 -0
  90. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +41 -0
  91. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
  92. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +11 -0
  93. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +42 -0
  94. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +11 -1
  95. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +20 -1
  96. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +16 -1
  97. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -4
  98. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +30 -4
  99. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +5 -2
  100. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +26 -14
  101. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
  102. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +20 -5
  103. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +7 -0
  104. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +23 -0
  105. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +2 -1
  106. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +4 -2
  107. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
  108. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -0
  109. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +19 -2
  110. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +6 -0
  111. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +2 -0
  112. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +8 -0
  113. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +31 -0
  114. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
  115. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +15 -3
  116. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
  117. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +65 -25
  118. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +11 -3
  119. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +45 -11
  120. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +6 -3
  121. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +33 -18
  122. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +41 -8
  123. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +0 -21
  124. package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +9 -0
  125. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +8 -3
  126. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
  127. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
  128. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
  129. package/lib/view/spendManagement/commonSetup/setupViewState.js +13 -1
  130. package/lib/view/spendManagement/helpers.d.ts +3 -0
  131. package/lib/view/spendManagement/helpers.js +13 -1
  132. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
  133. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  134. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +2 -1
  135. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  136. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
  137. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +6 -1
  138. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
  139. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
  140. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
  141. package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
  142. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
  143. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
  144. package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
  145. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
  146. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
  147. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -2
  148. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +44 -19
  149. package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +2 -1
  150. package/lib/view/twoFactorAuthentication/sendOtpEpic.js +45 -18
  151. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +17 -5
  152. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +33 -0
  153. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
  154. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
  155. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +22 -6
  156. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +176 -60
  157. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +5 -3
  158. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +13 -2
  159. package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +5 -2
  160. package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +46 -5
  161. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
  162. package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -3
  163. package/lib/view/userListView/userListViewPayload.d.ts +11 -0
  164. package/package.json +5 -4
@@ -9,9 +9,9 @@ const userSelector_1 = require("../../../entity/user/userSelector");
9
9
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
10
10
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
11
11
  function getExpenseAutomationFluxAnalysisView(state) {
12
- var _a;
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
13
13
  const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
14
- const { fetchState, error, refreshStatus, uiState, reviewOperatingExpensesIds, reviewStatusById, fluxAnalysisEntities, operatingExpenseIdsBySelectedPeriod, bulkReviewStatus, } = expenseAutomationFluxAnalysisViewState;
14
+ const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
15
15
  const fetchStateAndError = {
16
16
  fetchState,
17
17
  error,
@@ -20,57 +20,125 @@ function getExpenseAutomationFluxAnalysisView(state) {
20
20
  const { selectedPeriodByTenantId } = state.expenseAutomationViewState;
21
21
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
22
22
  const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
23
- const operatingExpenseIdsForCurrentPeriod = monthYearPeriodId != null
24
- ? operatingExpenseIdsBySelectedPeriod[monthYearPeriodId]
25
- : null;
26
- const operatingExpenses = [];
27
- operatingExpenseIdsForCurrentPeriod === null || operatingExpenseIdsForCurrentPeriod === void 0 ? void 0 : operatingExpenseIdsForCurrentPeriod.forEach((opExId) => {
28
- const fluxEntity = fluxAnalysisEntities.operatingExpenses.find((fluxEntity) => fluxEntity.operatingExpenseId === opExId);
23
+ const reviewOperatingExpensesIds = selectedPeriod != null &&
24
+ reviewOperatingExpenseIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] !=
25
+ null
26
+ ? reviewOperatingExpenseIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
27
+ : [];
28
+ const selectedSectionIds = selectedPeriod != null
29
+ ? ((_a = selectedSectionIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) !== null && _a !== void 0 ? _a : [])
30
+ : [];
31
+ const generalExpenseState = selectedPeriod != null
32
+ ? (_b = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _b === void 0 ? void 0 : _b.generalExpense
33
+ : undefined;
34
+ const reimbursementOpExState = selectedPeriod != null
35
+ ? (_c = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _c === void 0 ? void 0 : _c.reimbursement
36
+ : undefined;
37
+ const generalExpenseIdsForCurrentPeriod = monthYearPeriodId != null && generalExpenseState != null
38
+ ? generalExpenseState.operatingExpenseIds
39
+ : [];
40
+ const reimbursementIdsForCurrentPeriod = monthYearPeriodId != null && reimbursementOpExState != null
41
+ ? reimbursementOpExState.operatingExpenseIds
42
+ : [];
43
+ const generalExpenses = [];
44
+ const reimbursements = [];
45
+ const expenseMap = new Map(fluxAnalysisEntities.operatingExpenses.map((e) => [
46
+ e.fluxAnalysisEntityId,
47
+ e,
48
+ ]));
49
+ generalExpenseIdsForCurrentPeriod.forEach((opExId) => {
50
+ const fluxEntity = expenseMap.get(opExId);
51
+ if (fluxEntity != null) {
52
+ generalExpenses.push(fluxEntity);
53
+ }
54
+ });
55
+ reimbursementIdsForCurrentPeriod.forEach((opExId) => {
56
+ const fluxEntity = fluxAnalysisEntities.operatingExpenses.find((fluxEntity) => fluxEntity.fluxAnalysisEntityId === opExId);
29
57
  if (fluxEntity != null) {
30
- operatingExpenses.push(fluxEntity);
58
+ reimbursements.push(fluxEntity);
31
59
  }
32
60
  });
33
61
  const allSteps = monthYearPeriodId != null
34
62
  ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
35
63
  : [];
36
- const fluxCompletionStatus = (_a = allSteps.find((step) => step.step === 'flux_analysis')) === null || _a === void 0 ? void 0 : _a.completionStatus;
37
- const operatingExpensesView = [];
38
- operatingExpenses.forEach((operatingExpense) => {
39
- const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, operatingExpense.vendorId);
40
- if (vendor != null) {
41
- operatingExpensesView.push({
42
- operatingExpenseId: operatingExpense.operatingExpenseId,
43
- vendor,
44
- accountBase: operatingExpense.accountId != null
45
- ? (0, accountSelector_1.getAccountBase)(state.accountState, operatingExpense.accountId, 'account_list')
46
- : undefined,
47
- classBase: operatingExpense.classId != null
48
- ? (0, classSelector_1.getClassById)(state.classState, {
49
- classId: operatingExpense.classId,
50
- reportId: 'class_list',
51
- })
52
- : undefined,
53
- reviewedByUser: operatingExpense.userId != null
54
- ? (0, userSelector_1.getUserByUserId)(state.userState, operatingExpense.userId)
55
- : undefined,
56
- varianceAmount: operatingExpense.varianceAmount,
57
- variancePercentage: operatingExpense.variancePercentage,
58
- currency: operatingExpense.currency,
59
- anomalyReason: operatingExpense.anomalyReason,
60
- status: operatingExpense.status,
61
- balancesByMonth: operatingExpense.balancesByMonth,
62
- reviewStatus: reviewStatusById[operatingExpense.operatingExpenseId],
63
- });
64
- }
65
- });
64
+ const fluxCompletionStatus = (_d = allSteps.find((step) => step.step === 'flux_analysis')) === null || _d === void 0 ? void 0 : _d.completionStatus;
65
+ // Get general expense vendors using map and filter
66
+ const generalExpenseVendors = generalExpenses
67
+ .map((operatingExpense) => mapOperatingExpenseToVendorView(state, operatingExpense))
68
+ .filter((vendorView) => vendorView !== null);
69
+ // Get reimbursement vendors using map and filter
70
+ const reimbursementVendors = reimbursements
71
+ .map((operatingExpense) => mapOperatingExpenseToVendorView(state, operatingExpense))
72
+ .filter((vendorView) => vendorView !== null);
73
+ const sections = {
74
+ generalExpense: {
75
+ sectionId: 'generalExpense',
76
+ vendors: generalExpenseVendors,
77
+ fetchStatus: (_e = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.fetchStatus) !== null && _e !== void 0 ? _e : {
78
+ fetchState: 'Not-Started',
79
+ },
80
+ balancesByMonth: (_f = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _f === void 0 ? void 0 : _f.balancesByMonth,
81
+ varianceAmount: (_h = (_g = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _g === void 0 ? void 0 : _g.varianceAmount) !== null && _h !== void 0 ? _h : 0,
82
+ variancePercentage: (_k = (_j = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _j === void 0 ? void 0 : _j.variancePercentage) !== null && _k !== void 0 ? _k : 0,
83
+ },
84
+ reimbursement: {
85
+ sectionId: 'reimbursement',
86
+ vendors: reimbursementVendors,
87
+ fetchStatus: (_l = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.fetchStatus) !== null && _l !== void 0 ? _l : {
88
+ fetchState: 'Not-Started',
89
+ },
90
+ balancesByMonth: (_m = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _m === void 0 ? void 0 : _m.balancesByMonth,
91
+ varianceAmount: (_p = (_o = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _o === void 0 ? void 0 : _o.varianceAmount) !== null && _p !== void 0 ? _p : 0,
92
+ variancePercentage: (_r = (_q = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _q === void 0 ? void 0 : _q.variancePercentage) !== null && _r !== void 0 ? _r : 0,
93
+ },
94
+ };
66
95
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
67
96
  return {
97
+ sections,
98
+ totalBalancesAndVariance,
68
99
  fetchStatus: fetchStateAndError,
69
- operatingExpensesView,
70
100
  bulkReviewStatus,
71
101
  reviewOperatingExpensesIds,
102
+ selectedSectionIds,
72
103
  uiState,
73
104
  refreshStatus,
105
+ currency,
74
106
  completionStatus,
75
107
  };
76
108
  }
109
+ // Helper function to transform operating expense to vendor view
110
+ const mapOperatingExpenseToVendorView = (state, operatingExpense) => {
111
+ const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, operatingExpense.vendorId);
112
+ if (!vendor) {
113
+ return null;
114
+ }
115
+ const vendorAccountsAndClasses = operatingExpense.vendorAccountsAndClasses.map((accAndClass) => ({
116
+ varianceAmount: accAndClass.varianceAmount,
117
+ variancePercentage: accAndClass.variancePercentage,
118
+ currency: operatingExpense.currency,
119
+ accountBase: accAndClass.accountId != null
120
+ ? (0, accountSelector_1.getAccountBase)(state.accountState, accAndClass.accountId, 'account_list')
121
+ : undefined,
122
+ classBase: accAndClass.classId != null
123
+ ? (0, classSelector_1.getClassById)(state.classState, {
124
+ classId: accAndClass.classId,
125
+ reportId: 'class_list',
126
+ })
127
+ : undefined,
128
+ balancesByMonth: accAndClass.balancesByMonth,
129
+ }));
130
+ return {
131
+ fluxAnalysisEntityId: operatingExpense.fluxAnalysisEntityId,
132
+ vendor,
133
+ reviewedByUser: operatingExpense.userId != null
134
+ ? (0, userSelector_1.getUserByUserId)(state.userState, operatingExpense.userId)
135
+ : undefined,
136
+ varianceAmount: operatingExpense.varianceAmount,
137
+ variancePercentage: operatingExpense.variancePercentage,
138
+ currency: operatingExpense.currency,
139
+ anomalyReason: operatingExpense.anomalyReason,
140
+ status: operatingExpense.status,
141
+ balancesByMonth: operatingExpense.balancesByMonth,
142
+ vendorAccountsAndClasses,
143
+ };
144
+ };
@@ -4,7 +4,8 @@ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/
4
4
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
6
6
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
7
- declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "class" | "category";
7
+ import { FluxAnalysisSectionType } from '../selectorTypes/fluxAnalysisViewSelectorTypes';
8
+ declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "status" | "variance";
8
9
  export type FluxAnalysisSortKey = ReturnType<typeof toFluxAnalysisSortKey>;
9
10
  export type FluxAnalysisActionType = 'review' | 'unreview';
10
11
  export type FluxAnalysisReviewStatus = 'Pending Review' | 'Reviewed';
@@ -12,21 +13,32 @@ export interface FluxBalancesByMonth {
12
13
  month1: COABalance;
13
14
  month2: COABalance;
14
15
  }
16
+ export interface BalancesAndVariance {
17
+ balancesByMonth: FluxBalancesByMonth | undefined;
18
+ varianceAmount: number;
19
+ variancePercentage: number;
20
+ }
15
21
  export interface FluxAnalysisEntities {
16
22
  operatingExpenses: FluxAnalysisOperatingExpense[];
17
23
  }
18
- export interface FluxAnalysisOperatingExpense {
19
- operatingExpenseId: ID;
20
- vendorId: ID;
24
+ export interface FluxVendorAccountsAndClasses extends BalancesAndVariance {
21
25
  accountId: ID | undefined;
22
26
  classId: ID | undefined;
27
+ }
28
+ export interface FluxAnalysisOperatingExpense extends BalancesAndVariance {
29
+ fluxAnalysisEntityId: ID;
30
+ vendorId: ID;
31
+ vendorAccountsAndClasses: FluxVendorAccountsAndClasses[];
23
32
  userId: ID | undefined;
24
- varianceAmount: number;
25
- variancePercentage: number;
26
33
  currency: Currency;
27
34
  anomalyReason: string;
28
35
  status: FluxAnalysisReviewStatus;
29
- balancesByMonth?: FluxBalancesByMonth;
36
+ }
37
+ interface GroupPaginationInfo {
38
+ pageToken: PageToken;
39
+ hasMore: boolean;
40
+ limit?: number;
41
+ totalCount: number;
30
42
  }
31
43
  export interface FluxAnalysisViewUIState {
32
44
  sortKey: FluxAnalysisSortKey;
@@ -36,19 +48,32 @@ export interface FluxAnalysisViewUIState {
36
48
  scrollTop: number;
37
49
  scrollLeft?: number;
38
50
  } | undefined;
39
- pageToken: PageToken;
40
- hasMore: boolean;
41
- limit?: number;
42
- totalCount: number;
51
+ paginationInfoByGroup: {
52
+ generalExpense: GroupPaginationInfo;
53
+ reimbursement: GroupPaginationInfo;
54
+ };
55
+ collapsableStatus: {
56
+ [nodeId: string]: boolean;
57
+ };
58
+ }
59
+ export interface FluxAnalysisViewGroup {
60
+ fetchStatus: FetchStateAndError;
61
+ operatingExpenseIds: ID[];
62
+ total: BalancesAndVariance | undefined;
63
+ }
64
+ export interface FluxAnalysisViewGroups {
65
+ generalExpense: FluxAnalysisViewGroup;
66
+ reimbursement: FluxAnalysisViewGroup;
43
67
  }
44
68
  export interface FluxAnalysisViewState extends FetchedState {
45
- fluxAnalysisReportGenerated: boolean;
46
69
  fluxAnalysisEntities: FluxAnalysisEntities;
47
- operatingExpenseIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
48
- reviewStatusById: Record<ID, FetchStateAndError>;
70
+ groupsBySelectedPeriod: Record<MonthYearPeriodId, FluxAnalysisViewGroups>;
71
+ totalBalancesAndVariance: BalancesAndVariance | undefined;
49
72
  bulkReviewStatus: FetchStateAndError;
50
73
  refreshStatus: FetchStateAndError;
51
74
  uiState: FluxAnalysisViewUIState;
52
- reviewOperatingExpensesIds: ID[];
75
+ currency: Currency;
76
+ reviewOperatingExpenseIdsByPeriod: Record<MonthYearPeriodId, ID[]>;
77
+ selectedSectionIdsByPeriod: Record<MonthYearPeriodId, FluxAnalysisSectionType[]>;
53
78
  }
54
79
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
4
- const FLUX_ANALYSIS_SORT_KEYS = ['vendor', 'category', 'class'];
4
+ const FLUX_ANALYSIS_SORT_KEYS = ['vendor', 'variance', 'status'];
5
5
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
6
  const toFluxAnalysisSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, FLUX_ANALYSIS_SORT_KEYS);
@@ -17,6 +17,7 @@ import { EntityRecommendationKey } from '../../recommendation/recommendationStat
17
17
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
18
18
  export declare const toTransactionsSortKey: (v: string) => "date" | "vendor" | "amount" | "class" | "transaction_type" | "memo" | "category";
19
19
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
20
+ export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
20
21
  export declare const toTransactionsTabKey: (v: string) => "review" | "autoCategorized";
21
22
  export type TransactionsTab = ReturnType<typeof toTransactionsTabKey>;
22
23
  export declare const getTransactionCategorizationKey: (transactionId: TransactionID, lineId: ID) => `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialSupportedTransactionCategorization = exports.getTransactionCategorizationKey = exports.toTransactionsTabKey = exports.toTransactionsSortKey = void 0;
3
+ exports.initialSupportedTransactionCategorization = exports.getTransactionCategorizationKey = exports.toTransactionsTabKey = exports.TRANSACTIONS_TABS = exports.toTransactionsSortKey = void 0;
4
4
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
5
  const transactionDetailState_1 = require("../../transactionDetail/transactionDetailState");
6
6
  const TRANSACTIONS_SORT_KEYS = [
@@ -14,8 +14,8 @@ const TRANSACTIONS_SORT_KEYS = [
14
14
  ];
15
15
  const toTransactionsSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, TRANSACTIONS_SORT_KEYS);
16
16
  exports.toTransactionsSortKey = toTransactionsSortKey;
17
- const TRANSACTIONS_TABS = ['review', 'autoCategorized'];
18
- const toTransactionsTabKey = (v) => (0, stringToUnion_1.stringToUnion)(v, TRANSACTIONS_TABS);
17
+ exports.TRANSACTIONS_TABS = ['review', 'autoCategorized'];
18
+ const toTransactionsTabKey = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.TRANSACTIONS_TABS);
19
19
  exports.toTransactionsTabKey = toTransactionsTabKey;
20
20
  // This transaction key only extracts the third party ID and uses that
21
21
  // for the ID
@@ -13,7 +13,7 @@ const addressViewReducer_1 = require("../../../addressView/addressViewReducer");
13
13
  const onboardingCockpitViewReducer_1 = require("../onboardingCockpitViewReducer");
14
14
  const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(onboardingCockpitViewReducer_1.initializeOnboardingCustomerViewUpdateData.match), (0, operators_1.mergeMap)((action) => {
15
15
  var _a, _b, _c;
16
- const { companyId } = action.payload;
16
+ const { companyId, isDebitCardFlagEnabled } = action.payload;
17
17
  const fetchActions = [];
18
18
  if (companyId != null) {
19
19
  const onboardingCustomerInfo = (0, onboardingCustomerSelector_1.getOnboardingCustomersByCompanyId)(state$.value.onboardingCustomerState, companyId);
@@ -57,7 +57,7 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
57
57
  accountingConnectionCreationMode: ((_b = company.company.companyOnboardingInfo.onboardingInfo) === null || _b === void 0 ? void 0 : _b.accountingConnectionCreationMode) != null
58
58
  ? (0, companyStateTypes_1.toAccountingConnectionCreationModeStrict)((_c = company.company.companyOnboardingInfo.onboardingInfo) === null || _c === void 0 ? void 0 : _c.accountingConnectionCreationMode)
59
59
  : undefined,
60
- selectedProducts: getSelectedProducts(tenant),
60
+ selectedProducts: getSelectedProducts(isDebitCardFlagEnabled, tenant),
61
61
  };
62
62
  if (onboardingCustomerId != null) {
63
63
  const onboardingCustomerDetails = (0, userSelector_1.getUserByUserId)(state$.value.userState, onboardingCustomerId);
@@ -106,11 +106,11 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
106
106
  return (0, rxjs_1.from)(fetchActions);
107
107
  }));
108
108
  exports.initializeOnboardingCustomerViewUpdateDataEpic = initializeOnboardingCustomerViewUpdateDataEpic;
109
- const getSelectedProducts = (tenant) => {
109
+ const getSelectedProducts = (isDebitCardFlagEnabled, tenant) => {
110
110
  if (tenant == null) {
111
111
  return [];
112
112
  }
113
- const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(tenant);
113
+ const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, tenant);
114
114
  const isBookkeepingEnabled = (0, tenantSelector_1.isTenantBookkeepingEnabled)(tenant);
115
115
  const isOtherProductsEnabled = (0, tenantSelector_1.isOtherProductsEnabledForTenant)(tenant);
116
116
  const isCardsEnabled = (0, tenantSelector_1.isTenantCardsOnly)(tenant);
@@ -30,8 +30,9 @@ export declare const fetchCompanyOnboardingView: import("@reduxjs/toolkit").Acti
30
30
  onboardingEmailGroup: OnboardingEmailGroupPayload;
31
31
  }, "onboardingCockpitView/updateOnboardingEmailGroupOnSuccess", never, never>, updateOnboardingEmailGroupOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
32
32
  error: ZeniAPIStatus<Record<string, unknown>>;
33
- }, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId?: string | undefined], {
33
+ }, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isDebitCardFlagEnabled: boolean, companyId?: string | undefined], {
34
34
  companyId: string | undefined;
35
+ isDebitCardFlagEnabled: boolean;
35
36
  }, "onboardingCockpitView/initializeOnboardingCustomerViewUpdateData", never, never>, saveOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newOnboardingCustomer: Partial<NewOnboardingCustomer>], {
36
37
  newOnboardingCustomer: Partial<NewOnboardingCustomer>;
37
38
  }, "onboardingCockpitView/saveOnboardingCustomerViewUpdateData", never, never>, clearOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCockpitView/clearOnboardingCustomerViewUpdateData">, saveOnboardingCustomerViewUpdates: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sendInvite: boolean, skipSnackbarOnSuccess?: boolean | undefined], {
@@ -130,8 +130,8 @@ const onboardingCockpitView = (0, toolkit_1.createSlice)({
130
130
  reducer(draft) {
131
131
  draft.customerLocalStoreInitState = 'In-Progress';
132
132
  },
133
- prepare(companyId) {
134
- return { payload: { companyId } };
133
+ prepare(isDebitCardFlagEnabled, companyId) {
134
+ return { payload: { companyId, isDebitCardFlagEnabled } };
135
135
  },
136
136
  },
137
137
  saveOnboardingCustomerViewUpdateData: {
@@ -1,15 +1,15 @@
1
1
  import { CurrentTenant } from '../../entity/tenant/tenantSelector';
2
2
  import { RoleMap, UserRoleType } from '../../entity/userRole/userRoleType';
3
3
  import { MonthEndInsightsNotificationSettingsData, NotificationSettingsData, ReminderNotificationSettingsData } from './settingsViewState';
4
- export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
5
- export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
4
+ export declare const isAccountingTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
5
+ export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
6
6
  export declare const isBillingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
7
7
  export declare const isBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
8
8
  export declare const isBusinessVerificationTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
9
9
  export declare const isCompanyDetailsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
10
- export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
10
+ export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined) => boolean;
11
11
  export declare const isSettingsVisible: (currentTenant: CurrentTenant | undefined) => boolean;
12
12
  export declare const isMyBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
13
13
  export declare const isRemindersSectionVisibleOnSettingsPage: (reminderNotificationSettings: ReminderNotificationSettingsData) => boolean;
14
14
  export declare const isMonthEndNotificationsSectionVisibleOnSettingsPage: (monthEndInsightsNotificationSettings: MonthEndInsightsNotificationSettingsData, signedInUseEmail: string) => boolean;
15
- export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, signedInUseEmail: string, currentTenant: CurrentTenant | undefined) => boolean;
15
+ export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, isDebitCardFlagEnabled: boolean, signedInUseEmail: string, currentTenant: CurrentTenant | undefined) => boolean;
@@ -4,7 +4,7 @@ exports.isNotificationsTabVisible = exports.isMonthEndNotificationsSectionVisibl
4
4
  const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
5
5
  const userRoleType_1 = require("../../entity/userRole/userRoleType");
6
6
  const vendorListSelector_1 = require("../vendorList/vendorListSelector");
7
- const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
7
+ const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant, userRoleMap) => {
8
8
  if (currentTenant == null) {
9
9
  return false;
10
10
  }
@@ -13,7 +13,7 @@ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
13
13
  (0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
14
14
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
15
15
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)) &&
16
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
16
+ (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
17
17
  (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
18
18
  }
19
19
  else {
@@ -21,7 +21,7 @@ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
21
21
  }
22
22
  };
23
23
  exports.isAccountingTabVisible = isAccountingTabVisible;
24
- const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
24
+ const isApprovalRulesTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant, userRoleMap) => {
25
25
  var _a, _b;
26
26
  if (currentTenant == null || userRoleMap == null) {
27
27
  return false;
@@ -33,7 +33,7 @@ const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
33
33
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
34
34
  ((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
35
35
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole))) &&
36
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
36
+ (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
37
37
  (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
38
38
  }
39
39
  else {
@@ -97,13 +97,14 @@ const isCompanyDetailsTabVisible = (userRole, currentTenant, userRoleMap) => {
97
97
  }
98
98
  };
99
99
  exports.isCompanyDetailsTabVisible = isCompanyDetailsTabVisible;
100
- const isIntegrationsTabVisible = (userRole, currentTenant) => {
100
+ const isIntegrationsTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant) => {
101
101
  if (currentTenant == null) {
102
102
  return false;
103
103
  }
104
104
  if ((0, exports.isSettingsVisible)(currentTenant)) {
105
105
  return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) &&
106
- !((0, tenantSelector_1.isTenantBankingOnly)(currentTenant) || (0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
106
+ !((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) ||
107
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
107
108
  }
108
109
  else {
109
110
  return false;
@@ -145,14 +146,14 @@ const isMonthEndNotificationsSectionVisibleOnSettingsPage = (monthEndInsightsNot
145
146
  monthEndInsightsNotificationSettings.recipientEmailIds.includes(signedInUseEmail));
146
147
  };
147
148
  exports.isMonthEndNotificationsSectionVisibleOnSettingsPage = isMonthEndNotificationsSectionVisibleOnSettingsPage;
148
- const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, currentTenant) => {
149
+ const isNotificationsTabVisible = (notificationSettings, isDebitCardFlagEnabled, signedInUseEmail, currentTenant) => {
149
150
  if (currentTenant == null) {
150
151
  return false;
151
152
  }
152
153
  const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
153
154
  return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
154
155
  (0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
155
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
156
+ (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
156
157
  (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
157
158
  };
158
159
  exports.isNotificationsTabVisible = isNotificationsTabVisible;
@@ -48,7 +48,7 @@ const getReviewPageBillDetail = (state, billId) => {
48
48
  let file;
49
49
  let contactDetails = [];
50
50
  const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountListState.paymentAccountIds);
51
- const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState).depositAccounts;
51
+ const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState).depositAccounts;
52
52
  const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount, paymentAccountListState.paymentAccountBalanceFetchStatus);
53
53
  let fetchState = 'Not-Started';
54
54
  let sourceBillDetailFetchState = 'Not-Started';
@@ -2,6 +2,7 @@ import { Amount } from '../../../../commonStateTypes/amount';
2
2
  import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
3
3
  import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
4
4
  import { ZeniAPIStatus } from '../../../../responsePayload';
5
+ import { FundingAccount } from '../../commonSetup/setupViewSelector';
5
6
  import { InvoiceProcessingPayload } from './editBillViewPayload';
6
7
  import { AddBillAutoFields, BillDetailLocalData, EditBillDetailViewState, OutsideZeniPaymentLocalData } from './editBillViewState';
7
8
  export declare const initialState: EditBillDetailViewState;
@@ -82,6 +83,10 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
82
83
  billId?: ID;
83
84
  }, "editBillView/updateOutsideZeniPaymentLocalData">, discardOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
84
85
  billId?: ID;
85
- }, "editBillView/discardOutsideZeniPaymentLocalData">;
86
+ }, "editBillView/discardOutsideZeniPaymentLocalData">, updateNewAddedBillPaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "editBillView/updateNewAddedBillPaymentAccount">, updateWithdrawFromAccountId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
+ billId?: ID;
88
+ withdrawFromAccountId?: ID;
89
+ withdrawFromList: FundingAccount[];
90
+ }, "editBillView/updateWithdrawFromAccountId">;
86
91
  declare const _default: import("redux").Reducer<EditBillDetailViewState>;
87
92
  export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
4
+ exports.updateWithdrawFromAccountId = exports.updateNewAddedBillPaymentAccount = exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
7
  const helpers_1 = require("../../helpers");
@@ -14,6 +14,7 @@ exports.initialState = {
14
14
  fetchState: 'Not-Started',
15
15
  error: undefined,
16
16
  },
17
+ newAddedBillPaymentAccountId: undefined,
17
18
  };
18
19
  const editBillView = (0, toolkit_1.createSlice)({
19
20
  name: 'editBillView',
@@ -366,12 +367,29 @@ const editBillView = (0, toolkit_1.createSlice)({
366
367
  const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
367
368
  draft.editBillStateById[key].isBillMarkedForRetry = true;
368
369
  },
370
+ updateNewAddedBillPaymentAccount(draft, action) {
371
+ draft.newAddedBillPaymentAccountId = action.payload;
372
+ },
373
+ updateWithdrawFromAccountId(draft, action) {
374
+ const { billId, withdrawFromAccountId, withdrawFromList } = action.payload;
375
+ if (withdrawFromAccountId != null && withdrawFromList.length > 0) {
376
+ const newAddedAccount = withdrawFromList.find((account) => account.id === withdrawFromAccountId);
377
+ if (billId != null) {
378
+ const billKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
379
+ draft.editBillStateById[billKey].billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.editBillStateById[billKey].billDetailLocalData
380
+ .paymentDetailsSection), { withdrawFrom: newAddedAccount });
381
+ }
382
+ else {
383
+ draft.newBillState.billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.newBillState.billDetailLocalData.paymentDetailsSection), { withdrawFrom: newAddedAccount });
384
+ }
385
+ }
386
+ },
369
387
  clearEditBillViewDetail(draft) {
370
388
  Object.assign(draft, exports.initialState);
371
389
  },
372
390
  },
373
391
  });
374
- _a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData;
392
+ _a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData, exports.updateNewAddedBillPaymentAccount = _a.updateNewAddedBillPaymentAccount, exports.updateWithdrawFromAccountId = _a.updateWithdrawFromAccountId;
375
393
  exports.default = editBillView.reducer;
376
394
  function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
377
395
  var _a, _b, _c, _d;
@@ -8,6 +8,7 @@ import { AccountBase, RecommendedAccountBase } from '../../../../entity/account/
8
8
  import { BillPayInfo, BillPaymentMethod, BillStageCodeType, BillTransaction, InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/billTransactionState';
9
9
  import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
10
10
  import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classState';
11
+ import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
11
12
  import { PiLabel } from '../../../../entity/paymentInstrument/paymentInstrument';
12
13
  import { LoggedInUser } from '../../../../entity/tenant/tenantState';
13
14
  import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
@@ -22,6 +23,7 @@ import { ClassListSelectorView } from '../../../classList/classListSelector';
22
23
  import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vendorViewState';
23
24
  import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
24
25
  import { FundingAccount } from '../../commonSetup/setupViewSelector';
26
+ import { PlaidConnectionDetails } from '../../plaidAccount/plaidAccountViewState';
25
27
  import { BillActivity } from '../billDetailView/billDetailViewSelector';
26
28
  import { AccountTypeSubConfigCodeKeyType, BillPayConfig, BillPayConfigState } from '../billPayConfig/billPayConfigState';
27
29
  import { DuplicateBillsSelectorView } from '../billPayReview/billPayReviewSelector';
@@ -112,6 +114,9 @@ export interface EditBillDetailSelectorView extends SelectorView {
112
114
  isBillMarkedForRetry?: boolean;
113
115
  internationalWireOnboardingStatus?: AllowedValueWithCode;
114
116
  isEligibleForRetryOBP?: boolean;
117
+ plaidConnectionDetails: PlaidConnectionDetails;
118
+ paymentAccount?: PaymentAccount;
119
+ newAddedBillPaymentAccountId?: ID;
115
120
  }
116
121
  export interface EditBillInitialDetails {
117
122
  vendor?: Vendor;
@@ -25,6 +25,7 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
25
25
  const commonHistorySelector_1 = require("../../commonHistoryView/commonHistorySelector");
26
26
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
27
27
  const helpers_1 = require("../../helpers");
28
+ const plaidAccountViewSelector_1 = require("../../plaidAccount/plaidAccountViewSelector");
28
29
  const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
29
30
  const billDetailViewSelector_1 = require("../billDetailView/billDetailViewSelector");
30
31
  const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
@@ -36,7 +37,7 @@ const billPaySetupApproverViewSelector_1 = require("../billPaySetupApproverView/
36
37
  const previousBillsSelector_1 = require("../previousBills/previousBillsSelector");
37
38
  const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
38
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
39
- const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState, } = state;
40
+ const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, billPaySetupApproverViewState, plaidAccountViewState, } = state;
40
41
  const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
41
42
  let recommendations = {};
42
43
  if (billId != null) {
@@ -85,7 +86,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
85
86
  : undefined;
86
87
  const isCompanyZeniAccountsSetUpDone = (_g = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyZeniAccountInfo.isZeniAccountEnabled) !== null && _g !== void 0 ? _g : false;
87
88
  const allDepositAccounts = isZeniAccountsEnabled && isCompanyZeniAccountsSetUpDone
88
- ? (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState)
89
+ ? (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState)
89
90
  .depositAccounts
90
91
  : [];
91
92
  if (allDepositAccounts.length === 0 && fromDepositAccount != null) {
@@ -324,6 +325,9 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
324
325
  const internationalWireOnboardingStatus = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.internationalWireOnboardingStatus;
325
326
  const billTransactionDetails = (0, get_1.default)(billDetailViewState.billDetailById, key, undefined);
326
327
  const isEligibleForRetryOBP = billTransactionDetails === null || billTransactionDetails === void 0 ? void 0 : billTransactionDetails.zeniAssist.isEligibleForRetryOBP;
328
+ const { plaidConnectionDetails } = (0, plaidAccountViewSelector_1.getPlaidAccountDetails)(plaidAccountViewState, 'bill_pay_detail');
329
+ const { paymentAccount } = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId !== null && companyId !== void 0 ? companyId : '', 'bill_pay', 'bill_pay_detail');
330
+ const newAddedBillPaymentAccountId = editBillDetailViewState.newAddedBillPaymentAccountId;
327
331
  return {
328
332
  showVendorGptRecommendationText,
329
333
  recommendedVendor,
@@ -375,6 +379,9 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
375
379
  isBillMarkedForRetry,
376
380
  internationalWireOnboardingStatus,
377
381
  isEligibleForRetryOBP,
382
+ plaidConnectionDetails,
383
+ paymentAccount,
384
+ newAddedBillPaymentAccountId,
378
385
  };
379
386
  };
380
387
  exports.getEditBillDetail = getEditBillDetail;