@zeniai/client-epic-state 5.2.72 → 5.2.73

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 (118) hide show
  1. package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
  2. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  3. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  4. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  5. package/lib/entity/invoicing/plan/planPayload.d.ts +40 -0
  6. package/lib/entity/invoicing/plan/planPayload.js +51 -0
  7. package/lib/entity/invoicing/plan/planReducer.d.ts +14 -0
  8. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +21 -20
  9. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.d.ts → plan/planSelector.d.ts} +6 -5
  10. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +12 -12
  11. package/lib/entity/invoicing/plan/planState.d.ts +43 -0
  12. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.d.ts → product/productPayload.d.ts} +6 -44
  13. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +6 -50
  14. package/lib/entity/invoicing/product/productReducer.d.ts +9 -0
  15. package/lib/entity/invoicing/product/productReducer.js +50 -0
  16. package/lib/entity/invoicing/product/productSelector.d.ts +4 -0
  17. package/lib/entity/invoicing/product/productSelector.js +17 -0
  18. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.d.ts → product/productState.d.ts} +6 -42
  19. package/lib/entity/invoicing/product/productState.js +2 -0
  20. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
  21. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  22. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  23. package/lib/epic.d.ts +2 -3
  24. package/lib/epic.js +1 -3
  25. package/lib/esm/entity/invoicing/plan/planPayload.js +47 -0
  26. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +20 -19
  27. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +8 -8
  28. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +3 -46
  29. package/lib/esm/entity/invoicing/product/productReducer.js +43 -0
  30. package/lib/esm/entity/invoicing/product/productSelector.js +10 -0
  31. package/lib/esm/entity/invoicing/product/productState.js +1 -0
  32. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
  33. package/lib/esm/epic.js +1 -3
  34. package/lib/esm/index.js +9 -6
  35. package/lib/esm/reducer.js +7 -4
  36. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +1 -9
  37. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
  38. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  39. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  40. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  41. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  42. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  43. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  44. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +1 -5
  45. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  46. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +1 -8
  47. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  48. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  49. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +22 -55
  50. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +20 -1
  51. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +2 -2
  52. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +1 -21
  53. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  54. package/lib/index.d.ts +13 -9
  55. package/lib/index.js +45 -39
  56. package/lib/reducer.d.ts +2 -1
  57. package/lib/reducer.js +7 -4
  58. package/lib/rootStateTypes.d.ts +5 -3
  59. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  60. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  61. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -3
  62. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -8
  63. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  64. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
  65. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +9 -8
  66. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
  67. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  68. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
  69. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  70. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +4 -3
  71. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
  72. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  73. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +3 -2
  74. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  75. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +3 -2
  76. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  77. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  78. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -3
  79. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +2 -6
  80. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +2 -2
  81. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -3
  82. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  83. package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +1 -3
  84. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +2 -9
  85. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
  86. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
  87. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  88. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
  89. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  90. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
  91. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +15 -33
  92. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +23 -57
  93. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +15 -0
  94. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +22 -0
  95. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  96. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
  97. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  98. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  99. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +2 -2
  100. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  101. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
  102. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  103. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
  104. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
  105. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -22
  106. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
  107. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  108. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
  109. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
  110. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
  111. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
  112. package/package.json +1 -1
  113. package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
  114. package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
  115. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +0 -8
  116. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -41
  117. /package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
  118. /package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
@@ -0,0 +1,10 @@
1
+ import recordGet from 'lodash/get';
2
+ export function getInvoicingProductsByIds(productState, ids) {
3
+ const products = ids
4
+ .map((id) => getInvoicingProductById(productState, id))
5
+ .filter((value) => value != null);
6
+ return products;
7
+ }
8
+ export function getInvoicingProductById(productState, id) {
9
+ return recordGet(productState.productByID, id);
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -237,7 +237,6 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
237
237
  'accounting_projects_qbo_reconnect_failed',
238
238
  'product_services_update',
239
239
  'qbo_realm_id_update',
240
- 'kyc_kyb_reset',
241
240
  'invoicing_dunning_case_resolved',
242
241
  'invoicing_dunning_retry',
243
242
  'invoicing_dunning_cancel',
package/lib/esm/epic.js CHANGED
@@ -530,8 +530,8 @@ import { approveOrRejectBillsBulkActionEpic, } from './view/spendManagement/bill
530
530
  import { cancelOrDeleteBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic';
531
531
  import { submitDraftBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic';
532
532
  import { validateBillsBulkActionEpic, } from './view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts';
533
- import { applyBillRecommendationsToLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic';
534
533
  import { convertAmountToHomeCurrencyEpic, } from './view/spendManagement/billPay/editBillView/epics/convertAmountToHomeCurrencyEpic';
534
+ import { applyBillRecommendationsToLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic';
535
535
  import { fetchBillAndInitializeLocalStoreEpic, waitForBillDetailThenInitializeLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic';
536
536
  import { fetchEditBillDetailPageEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic';
537
537
  import { fetchVendorAndUpdateBillLocalDataEpic, waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic, } from './view/spendManagement/billPay/editBillView/epics/fetchVendorAndUpdateBillLocalDataEpic';
@@ -611,7 +611,6 @@ import { fetchEntityHistoryEpic, } from './view/spendManagement/commonHistoryVie
611
611
  import { enableSetupEpic, } from './view/spendManagement/commonSetup/epic/setup/enableSetupEpic';
612
612
  import { parseUploadedKybDocumentEpic, } from './view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic';
613
613
  import { parseUploadedKycDocumentEpic, } from './view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic';
614
- import { resetKycKybEpic, } from './view/spendManagement/commonSetup/epic/setup/resetKycKybEpic';
615
614
  import { updateBusinessVerificationDetailsEpic, } from './view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic';
616
615
  import { updateSetupViewLocalStoreDataEpic, } from './view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic';
617
616
  import { fetchMerchantListEpic, } from './view/spendManagement/merchantList/fetchMerchantListEpic';
@@ -1351,7 +1350,6 @@ const ALL_EPICS = [
1351
1350
  resendOtpEpic,
1352
1351
  resendReferralInviteEpic,
1353
1352
  resendVerifyDeviceOTPEpic,
1354
- resetKycKybEpic,
1355
1353
  resetTransactionVendorLocalDataEpic,
1356
1354
  resetVendorDetailLocalDataEpic,
1357
1355
  resetVendorsTabVendorDetailLocalDataEpic,
package/lib/esm/index.js CHANGED
@@ -188,7 +188,7 @@ import { toExpenseAutomationViewType, toExpenseAutomationViewTypeStrict, } from
188
188
  import { computeNewScheduleJeDetails } from './view/expenseAutomationView/helpers/newScheduleLocalDataHelper';
189
189
  import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, } from './view/expenseAutomationView/helpers/reconciliationHelpers';
190
190
  import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
191
- import { ackCloseMatchAfterIgnore, ackCloseMatchAfterUndo, clearActualMatchingView as clearExpenseAutomationActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatchingMatch, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingPage as fetchExpenseAutomationActualMatchingPage, ignoreActualMatchingSuggestion, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateActualMatchingUIState as updateExpenseAutomationActualMatchingUIState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
191
+ import { ackCloseMatchAfterIgnore, ackCloseMatchAfterUndo, clearActualMatchingView as clearExpenseAutomationActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingMatch, fetchActualMatchingPage as fetchExpenseAutomationActualMatchingPage, ignoreActualMatchingSuggestion, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateActualMatchingUIState as updateExpenseAutomationActualMatchingUIState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
192
192
  import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
193
193
  import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearSearchTransactionsForNewSchedule as clearJeSearchTransactionsForNewSchedule, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, fetchOneTimeAccrual, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, ignoreOneTimeAccrual, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeNewSchedule as initializeJeNewSchedule, initializeJeScheduleLocalData, promoteOneTimeAccrual, removeJeOneTimeAccrualLocalData, removeJeScheduleTransactionKey, resetNewScheduleLocalData as resetJeNewScheduleLocalData, retryJeSchedule as retryExpenseAutomationJESchedule, revertJeSchedule, revertOneTimeAccrual, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, saveNewSchedule as saveJeNewSchedule, saveNewScheduleFailure as saveJeNewScheduleFailure, saveNewScheduleSuccess as saveJeNewScheduleSuccess, searchTransactionsForNewSchedule as searchJeTransactionsForNewSchedule, searchTransactionsForNewScheduleFailure as searchJeTransactionsForNewScheduleFailure, searchTransactionsForNewScheduleSuccess as searchJeTransactionsForNewScheduleSuccess, toggleJECreatedGroupCollapsed, toggleJEFailedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJEScheduleTypeFilter, updateNewScheduleLocalData as updateJeNewScheduleLocalData, updateJeOneTimeAccrualLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
194
194
  import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearBulkUploadBatchDetailsForScopeChange, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markBatchDetailRefreshAttempted, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
@@ -200,7 +200,7 @@ import { getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatemen
200
200
  import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement, } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
201
201
  import { applyTransactionFilters } from './view/expenseAutomationView/transactionFilterHelpers';
202
202
  import { TRANSACTION_FILTER_CATEGORIES, } from './view/expenseAutomationView/transactionFilterTypes';
203
- import { ALL_ACTUAL_MATCHING_IGNORE_REASONS, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, actualMatchingTransactionLineKey, toActualMatchingIgnoreReasonType, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toActualMatchingStatusFilter as toExpenseAutomationActualMatchingStatusFilter, toMatchAndReverseResultStatus, toUndoReversalResultStatus, } from './view/expenseAutomationView/types/actualMatchingViewState';
203
+ import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, ALL_ACTUAL_MATCHING_IGNORE_REASONS, actualMatchingTransactionLineKey, toActualMatchingIgnoreReasonType, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toActualMatchingStatusFilter as toExpenseAutomationActualMatchingStatusFilter, toMatchAndReverseResultStatus, toUndoReversalResultStatus, } from './view/expenseAutomationView/types/actualMatchingViewState';
204
204
  import { DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab, } from './view/expenseAutomationView/types/completedSubTab';
205
205
  import { ALL_JE_PAGE_TABS, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, toJEPageTab, } from './view/expenseAutomationView/types/jeSchedulesViewState';
206
206
  import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
@@ -360,7 +360,7 @@ import { clearAiCardCreationFormDraft, fetchDepositAccountListForCards, fetchIss
360
360
  import { getAiCardCreationFormDraft, getInFlightIssueChargeCardsCount, getIssueChargeCardView, getIssueChargeCardsSaveStatus, getLastIssueChargeCardsSourceChatSessionId, getLastIssuedChargeCardIds, selectIssueChargeCardLocalDataFromDraft, } from './view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector';
361
361
  import { toIssueChargeCardLocalDataFromDraft } from './view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft';
362
362
  import { parseUploadedKybDocument, parseUploadedKycDocument, } from './view/spendManagement/commonSetup/kycKybAutofillActions';
363
- import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearKycKybResetStatus, clearSetupViewDataInLocalStore, enableSetup, resetKycKyb, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, } from './view/spendManagement/commonSetup/setupViewReducer';
363
+ import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearSetupViewDataInLocalStore, enableSetup, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, } from './view/spendManagement/commonSetup/setupViewReducer';
364
364
  import { getBusinessVerificationDetails, getCommonSetupViewDetails, } from './view/spendManagement/commonSetup/setupViewSelector';
365
365
  import { COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES, COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY, COMPANY_PURPOSE_OF_ACCOUNT_CODES, COMPANY_SOURCE_OF_FUNDS_CODES, COMPANY_TRANSACTION_VOLUME_CODES, COMPANY_US_NEXUS_TYPE_CODES, getCompanyOnboardingSubIndustryCodesForIndustry, } from './view/spendManagement/commonSetup/types/businessVerification';
366
366
  import { checkIfLowBalance, getBillListUniqueType, getBulkOperationSuffix, getRemiListUniqueType, getSelectedCompanyOfficer, getSpendManagementEffectiveListPeriod, isAwaitingMarkAsPaid, isBulkProcessing, isPaymentMethodOutsideZeni, isVerifiedPaymentAccountProviderStatusCode, isVerifiedStatusCode, showBillPayPromoPage, showReimbursementPromoPage, toAccountsPromoConfig, toSameDayAchDisablementConfig, } from './view/spendManagement/helpers';
@@ -613,7 +613,7 @@ export { hideCreatedByFilter, };
613
613
  // not Spend Management. Kept in a separate re-export block to make the
614
614
  // separation visible at the barrel level.
615
615
  export { TRANSACTION_FILTER_CATEGORIES, applyTransactionFilters, };
616
- export { fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, clearKycKybResetStatus, resetKycKyb, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, parseUploadedKycDocument, parseUploadedKybDocument, sendOtp, resendOtp, verifyOtp, getBillPaySetupViewDetails, getPlaidAccountDetails, getPlaidPaymentAccounts, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, };
616
+ export { fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, parseUploadedKycDocument, parseUploadedKybDocument, sendOtp, resendOtp, verifyOtp, getBillPaySetupViewDetails, getPlaidAccountDetails, getPlaidPaymentAccounts, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, };
617
617
  export { getApprovalRuleViewDetails, getBankConnectionsSetupViewDetails, getIntegrationsView, };
618
618
  export { fetchUserFinancialAccount };
619
619
  export { getUserFinancialAccount };
@@ -841,11 +841,14 @@ export { getInvoicingDunningCaseListView } from './view/invoicing/invoicingDunni
841
841
  export { clearInvoicingDunningCaseDetailView, fetchInvoicingDunningCaseDetail, fetchInvoicingDunningCaseDetailPage, fetchInvoicingDunningEmailPreviewPage, invalidateInvoicingDunningEmailPreview, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer';
842
842
  export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail, getInvoicingDunningEmailPreview, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector';
843
843
  // ── Invoicing: catalog (plans + products) ─────────────────────────────────────
844
- export { mergeInvoicingCatalogPricePoint, removeInvoicingCatalogItem, updateInvoicingCatalogItems, } from './entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
844
+ export { mergeInvoicingPlanSubFamily, removeInvoicingPlan, updateInvoicingPlans, } from './entity/invoicing/plan/planReducer';
845
+ export { removeInvoicingProduct, updateInvoicingProducts, } from './entity/invoicing/product/productReducer';
845
846
  export { fetchInvoicingCatalogCounts, fetchInvoicingCatalogListPage, fetchInvoicingCatalogPlanList, fetchInvoicingCatalogProductList, updateInvoicingCatalogPlanFilters, updateInvoicingCatalogProductFilters, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewReducer';
847
+ export { ALL_INVOICING_PRODUCT_SORT_KEYS, INVOICING_PRODUCT_COLUMNS, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState';
846
848
  export { getInvoicingCatalogListView } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector';
847
849
  export { fetchInvoicingCatalogItemDetail } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
848
- export { getInvoicingCatalogItemById, getLowestInvoicingCatalogPricePointAmount, } from './entity/invoicing/invoicingCatalog/invoicingCatalogSelector';
850
+ export { getInvoicingPlanById, getLowestInvoicingPlanPricePointAmount, } from './entity/invoicing/plan/planSelector';
851
+ export { getInvoicingProductById } from './entity/invoicing/product/productSelector';
849
852
  // ── Invoicing: settings ───────────────────────────────────────────────────────
850
853
  export { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, resetInvoicingBrandingFormDraft, resetInvoicingQboSettingsDraft, resetSaveInvoicingSettings, saveInvoicingSettings, submitInvoicingBrandingForm, submitInvoicingQboSettings, updateInvoicingBrandingFormDraft, updateInvoicingQboSettingsDraft, updateInvoicingSettings, } from './view/invoicing/settingsView/settingsViewReducer';
851
854
  export { getInvoicingBrandingFormView, getInvoicingQboSettingsFormView, getInvoicingSettings, getInvoicingSettingsFetchState, getInvoicingSettingsHubView, getInvoicingSettingsView, } from './view/invoicing/settingsView/settingsViewSelector';
@@ -2,7 +2,6 @@ import { combineReducers } from 'redux';
2
2
  import account, { initialState as initialAccountState, } from './entity/account/accountReducer';
3
3
  import accountGroup, { initialState as initialAccountGroupState, } from './entity/accountGroup/accountGroupReducer';
4
4
  import accountRecon, { initialState as initialAccountReconState, } from './entity/accountRecon/accountReconReducer';
5
- import actualMatching, { initialState as initialActualMatchingState, } from './entity/actualMatching/actualMatchingReducer';
6
5
  import address, { initialState as initialAddressState, } from './entity/address/addressReducer';
7
6
  import aiAccountantCustomer, { initialAiAccountantCustomerState, } from './entity/aiAccountantCustomer/aiAccountantCustomerReducer';
8
7
  import aiCfo, { initialAiCfoState } from './entity/aiCfo/aiCfoReducer';
@@ -41,7 +40,9 @@ import invoicingInvoice, { initialState as initialInvoicingInvoiceState, } from
41
40
  import invoicingCustomer, { initialState as initialInvoicingCustomerState, } from './entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
42
41
  import invoicingSubscription, { initialState as initialInvoicingSubscriptionState, } from './entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
43
42
  import invoicingTransaction, { initialState as initialInvoicingTransactionState, } from './entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
44
- import invoicingCatalog, { initialState as initialInvoicingCatalogState, } from './entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
43
+ import invoicingPlan, { initialState as initialInvoicingPlanState, } from './entity/invoicing/plan/planReducer';
44
+ import invoicingProduct, { initialState as initialInvoicingProductState, } from './entity/invoicing/product/productReducer';
45
+ import actualMatching, { initialState as initialActualMatchingState, } from './entity/actualMatching/actualMatchingReducer';
45
46
  import jeSchedules, { initialState as initialJESchedulesState, } from './entity/jeSchedules/jeSchedulesReducer';
46
47
  import merchant, { initialState as initialMerchantState, } from './entity/merchant/merchantReducer';
47
48
  import monthEndCloseChecks, { initialState as initialMonthEndCloseChecksState, } from './entity/monthEndCloseChecks/monthEndCloseChecksReducer';
@@ -315,7 +316,8 @@ const initialEntitiesState = {
315
316
  invoicingCustomerState: initialInvoicingCustomerState,
316
317
  invoicingDunningCaseState: initialInvoicingDunningCaseState,
317
318
  invoicingInvoiceState: initialInvoicingInvoiceState,
318
- invoicingCatalogState: initialInvoicingCatalogState,
319
+ invoicingPlanState: initialInvoicingPlanState,
320
+ invoicingProductState: initialInvoicingProductState,
319
321
  invoicingSubscriptionState: initialInvoicingSubscriptionState,
320
322
  invoicingTransactionState: initialInvoicingTransactionState,
321
323
  jeSchedulesState: initialJESchedulesState,
@@ -601,7 +603,8 @@ const entityReducers = {
601
603
  invoicingCustomerState: invoicingCustomer,
602
604
  invoicingDunningCaseState: invoicingDunningCase,
603
605
  invoicingInvoiceState: invoicingInvoice,
604
- invoicingCatalogState: invoicingCatalog,
606
+ invoicingPlanState: invoicingPlan,
607
+ invoicingProductState: invoicingProduct,
605
608
  invoicingSubscriptionState: invoicingSubscription,
606
609
  invoicingTransactionState: invoicingTransaction,
607
610
  jeSchedulesState: jeSchedules,
@@ -6,8 +6,7 @@ import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer
6
6
  import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
7
7
  import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
8
8
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
9
- import { invalidateInvoicingCustomerDetail } from '../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
10
- import { addInvoiceToList, invalidateInvoiceListForCustomer, } from '../invoiceList/invoiceListReducer';
9
+ import { addInvoiceToList } from '../invoiceList/invoiceListReducer';
11
10
  import { createInvoice, createInvoiceFailure, createInvoiceSuccess, } from './createInvoiceReducer';
12
11
  export const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(createInvoice.match), mergeMap((action) => {
13
12
  const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/invoices`;
@@ -24,13 +23,6 @@ export const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe(f
24
23
  id: response.data.id,
25
24
  status: response.data.status,
26
25
  }),
27
- // The customer's page caches their invoices and totals.
28
- invalidateInvoicingCustomerDetail({
29
- id: response.data.customer_id,
30
- }),
31
- invalidateInvoiceListForCustomer({
32
- customerId: response.data.customer_id,
33
- }),
34
26
  createInvoiceSuccess({ invoiceId: response.data.id }),
35
27
  openSnackbar({
36
28
  messageSection: 'invoicing_invoice_saved',
@@ -1,5 +1,5 @@
1
1
  import { getAddressByAddressId } from '../../../entity/address/addressSelector';
2
- import { invoicingPricePointDisplayAmount } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector';
2
+ import { invoicingPricePointDisplayAmount } from '../../../entity/invoicing/plan/planSelector';
3
3
  import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
4
4
  import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
5
5
  import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
  import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
3
- import { getInvoicingCatalogItemById, getInvoicingCatalogItemsByIds, } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector';
3
+ import { getInvoicingPlanById, getInvoicingPlansByIds, } from '../../../entity/invoicing/plan/planSelector';
4
4
  import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
5
5
  import { getInvoicingFormDraftLocalData, isInvoicingFormDraftPending, } from '../invoicingFormDraft';
6
6
  import { INVOICING_DEFAULT_INCOME_ACCOUNT_TYPES, INVOICING_INCOME_ACCOUNT_MAPPING_SLOT, NO_INVOICING_ACCOUNT_HIERARCHY, NO_INVOICING_ACCOUNT_IDS, NO_INVOICING_CLASS_HIERARCHY, getInvoicingQboAccountOptions, getInvoicingQboView, invoicingQboAccountIdsForMappingSlot, isInvoicingAccountingPickerDataLoading, isInvoicingQboConnected, } from '../invoicingQboView/invoicingQboViewSelector';
@@ -36,7 +36,7 @@ const buildApplicableCatalogItemOptions = (plans) => {
36
36
  * Kept referentially stable across unrelated dispatches; the form view filters
37
37
  * out the item being edited (see `getInvoicingCatalogItemFormView`).
38
38
  */
39
- export const getInvoicingApplicableCatalogItemOptions = createSelector((state) => state.invoicingCatalogState, (state) => state.invoicingCatalogListViewState, (catalogState, listViewState) => buildApplicableCatalogItemOptions(getInvoicingCatalogItemsByIds(catalogState, [
39
+ export const getInvoicingApplicableCatalogItemOptions = createSelector((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (planState, listViewState) => buildApplicableCatalogItemOptions(getInvoicingPlansByIds(planState, [
40
40
  ...listViewState.planIds,
41
41
  ...listViewState.productIds,
42
42
  ])));
@@ -61,9 +61,7 @@ const getInvoicingCatalogIncomeAccountIds = createSelector([
61
61
  : NO_INVOICING_ACCOUNT_IDS);
62
62
  export const getInvoicingCatalogItemFormView = (state, id) => {
63
63
  const { editDraftById, error, fetchState, newItemDraft, savedItemId, savedKind, } = state.editInvoicingCatalogItemDetailViewState;
64
- const plan = id != null
65
- ? getInvoicingCatalogItemById(state.invoicingCatalogState, id)
66
- : undefined;
64
+ const plan = id != null ? getInvoicingPlanById(state.invoicingPlanState, id) : undefined;
67
65
  const kind = plan != null ? 'plan' : undefined;
68
66
  // No entity fallback: the draft is the one source of form values, seeded from
69
67
  // the record by `seedInvoicingCatalogItemFormDraftEpic` when the detail load
@@ -1,6 +1,6 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, switchMap } from 'rxjs/operators';
3
- import { updateInvoicingCatalogItems } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { updateInvoicingPlans } from '../../../entity/invoicing/plan/planReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
5
5
  import { fetchInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetailFailure, } from './editInvoicingCatalogItemDetailViewReducer';
6
6
  export const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingCatalogItemDetail.match), switchMap((action) => {
@@ -9,7 +9,7 @@ export const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI)
9
9
  return zeniAPI.getJSON(apiUrl).pipe(switchMap((response) => {
10
10
  if (isSuccessResponse(response) && response.data != null) {
11
11
  return [
12
- updateInvoicingCatalogItems([response.data], 'merge'),
12
+ updateInvoicingPlans([response.data], 'merge'),
13
13
  updateInvoicingCatalogItemDetail({ id: response.data.id, kind }),
14
14
  ];
15
15
  }
@@ -1,6 +1,6 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { updateInvoicingCatalogItems } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { updateInvoicingPlans } from '../../../entity/invoicing/plan/planReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
5
5
  import { runInvoicingCatalogPlanAction, runInvoicingCatalogPlanActionFailure, runInvoicingCatalogPlanActionSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
6
6
  export const runInvoicingCatalogPlanActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingCatalogPlanAction.match), mergeMap((action) => {
@@ -12,7 +12,7 @@ export const runInvoicingCatalogPlanActionEpic = (actions$, _state$, zeniAPI) =>
12
12
  .pipe(mergeMap((response) => {
13
13
  if (isSuccessResponse(response) && response.data != null) {
14
14
  return [
15
- updateInvoicingCatalogItems([response.data], 'merge'),
15
+ updateInvoicingPlans([response.data], 'merge'),
16
16
  runInvoicingCatalogPlanActionSuccess({ id }),
17
17
  ];
18
18
  }
@@ -1,6 +1,7 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { mergeInvoicingCatalogPricePoint } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { mergeInvoicingPlanSubFamily } from '../../../entity/invoicing/plan/planReducer';
4
+ import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
4
5
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
5
6
  import { runInvoicingCatalogProductAction, runInvoicingCatalogProductActionFailure, runInvoicingCatalogProductActionSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
6
7
  export const runInvoicingCatalogProductActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingCatalogProductAction.match), mergeMap((action) => {
@@ -15,10 +16,9 @@ export const runInvoicingCatalogProductActionEpic = (actions$, _state$, zeniAPI)
15
16
  .pipe(mergeMap((response) => {
16
17
  if (isSuccessResponse(response) && response.data != null) {
17
18
  return [
19
+ updateInvoicingProducts([response.data], 'merge'),
18
20
  ...(parentItemId != null
19
- ? [
20
- mergeInvoicingCatalogPricePoint(parentItemId, response.data),
21
- ]
21
+ ? [mergeInvoicingPlanSubFamily(parentItemId, response.data)]
22
22
  : []),
23
23
  runInvoicingCatalogProductActionSuccess({ id: stateKey }),
24
24
  ];
@@ -1,6 +1,7 @@
1
1
  import { forkJoin, from } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { mergeInvoicingCatalogPricePoint, updateInvoicingCatalogItems, } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { mergeInvoicingPlanSubFamily, updateInvoicingPlans, } from '../../../entity/invoicing/plan/planReducer';
4
+ import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
4
5
  import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
5
6
  import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
6
7
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
@@ -50,8 +51,11 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
50
51
  }
51
52
  const savedProducts = productResponses.flatMap((productResponse) => productResponse.data != null ? [productResponse.data] : []);
52
53
  const resultActions = [
53
- updateInvoicingCatalogItems([savedItem], 'merge'),
54
- ...savedProducts.map((product) => mergeInvoicingCatalogPricePoint(savedItem.id, product)),
54
+ updateInvoicingPlans([savedItem], 'merge'),
55
+ ...(savedProducts.length > 0
56
+ ? [updateInvoicingProducts(savedProducts, 'merge')]
57
+ : []),
58
+ ...savedProducts.map((product) => mergeInvoicingPlanSubFamily(savedItem.id, product)),
55
59
  submitInvoicingCatalogItemFormSuccess({
56
60
  itemId: savedItem.id,
57
61
  kind: 'plan',
@@ -1,6 +1,6 @@
1
1
  import { EMPTY, of } from 'rxjs';
2
2
  import { filter, mergeMap, withLatestFrom } from 'rxjs/operators';
3
- import { getInvoicingCatalogItemById } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector';
3
+ import { getInvoicingPlanById } from '../../../entity/invoicing/plan/planSelector';
4
4
  import { fetchInvoicingCatalogItemDetailPage, seedInvoicingCatalogItemFormDraft, updateInvoicingCatalogItemDetail, } from './editInvoicingCatalogItemDetailViewReducer';
5
5
  import { entityToInvoicingCatalogItemFormLocalData } from './invoicingCatalogItemFormHelper';
6
6
  /**
@@ -34,7 +34,7 @@ export const seedInvoicingCatalogItemFormDraftEpic = (actions$, state$) => actio
34
34
  }
35
35
  // Nothing to seed from on a cold open; the detail response triggers this
36
36
  // again once it lands.
37
- const plan = getInvoicingCatalogItemById(state.invoicingCatalogState, id);
37
+ const plan = getInvoicingPlanById(state.invoicingPlanState, id);
38
38
  if (plan == null) {
39
39
  return EMPTY;
40
40
  }
@@ -95,10 +95,6 @@ const editInvoicingCustomerDetailView = createSlice({
95
95
  error: undefined,
96
96
  };
97
97
  },
98
- // Makes the page epic refetch a record that changed server-side (e.g. a new subscription).
99
- invalidateInvoicingCustomerDetail(draft, action) {
100
- delete draft.recordStateById[action.payload.id];
101
- },
102
98
  fetchInvoicingCustomerDetail(draft, action) {
103
99
  draft.recordStateById[action.payload.id] = {
104
100
  fetchState: 'In-Progress',
@@ -202,5 +198,5 @@ const editInvoicingCustomerDetailView = createSlice({
202
198
  });
203
199
  },
204
200
  });
205
- export const { fetchInvoicingPaymentLinkEmailPreview, fetchInvoicingPaymentLinkEmailPreviewPage, updateInvoicingPaymentLinkEmailPreview, updateInvoicingPaymentLinkEmailPreviewFailure, addPromotionalCreditsFailure, addPromotionalCreditsSuccess, fetchInvoicingCustomerDetail, fetchInvoicingCustomerDetailPage, invalidateInvoicingCustomerDetail, seedInvoicingCustomerFormDraft, updateInvoicingCustomerDetail, resetPromotionalCreditAction, submitAddPromotionalCredits, updateInvoicingCustomerDetailFailure, updateInvoicingCustomerFormDraft, submitInvoicingCustomerForm, submitInvoicingCustomerFormSuccess, submitInvoicingCustomerFormFailure, resetEditInvoicingCustomerDetailView, initializeInvoicingCustomerAddress, claimInvoicingCustomerBillingAddress, } = editInvoicingCustomerDetailView.actions;
201
+ export const { fetchInvoicingPaymentLinkEmailPreview, fetchInvoicingPaymentLinkEmailPreviewPage, updateInvoicingPaymentLinkEmailPreview, updateInvoicingPaymentLinkEmailPreviewFailure, addPromotionalCreditsFailure, addPromotionalCreditsSuccess, fetchInvoicingCustomerDetail, fetchInvoicingCustomerDetailPage, seedInvoicingCustomerFormDraft, updateInvoicingCustomerDetail, resetPromotionalCreditAction, submitAddPromotionalCredits, updateInvoicingCustomerDetailFailure, updateInvoicingCustomerFormDraft, submitInvoicingCustomerForm, submitInvoicingCustomerFormSuccess, submitInvoicingCustomerFormFailure, resetEditInvoicingCustomerDetailView, initializeInvoicingCustomerAddress, claimInvoicingCustomerBillingAddress, } = editInvoicingCustomerDetailView.actions;
206
202
  export default editInvoicingCustomerDetailView.reducer;
@@ -7,8 +7,6 @@ import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiE
7
7
  import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
8
8
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
9
9
  import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
10
- import { invalidateInvoicingCustomerDetail } from '../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
11
- import { invalidateInvoiceListForCustomer } from '../invoiceList/invoiceListReducer';
12
10
  import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
13
11
  import { localDataToSaveInvoicingSubscriptionPayload, } from './editInvoicingSubscriptionDetailViewPayload';
14
12
  import { submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons, } from './editInvoicingSubscriptionDetailViewReducer';
@@ -88,9 +86,7 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
88
86
  resultActions.push(addInvoicingSubscriptionToList({
89
87
  id: saved.id,
90
88
  status: saved.status,
91
- }),
92
- // The service may bill the first invoice on create.
93
- invalidateInvoicingCustomerDetail({ id: saved.customer_id }), invalidateInvoiceListForCustomer({ customerId: saved.customer_id }));
89
+ }));
94
90
  }
95
91
  resultActions.push(openSnackbar({
96
92
  messageSection: 'invoicing_subscription_saved',
@@ -124,13 +124,6 @@ const invoiceList = createSlice({
124
124
  draft.kpisFetchState.fetchState = 'Error';
125
125
  draft.kpisFetchState.error = action.payload;
126
126
  },
127
- // Counts are fetched under the same customer filter, so they go stale with the tabs.
128
- invalidateInvoiceListForCustomer(draft, action) {
129
- if (draft.filters.customerId === action.payload.customerId) {
130
- draft.invoiceByTab = makeInvoiceByTab();
131
- draft.countsFetchState = { fetchState: 'Not-Started', error: undefined };
132
- }
133
- },
134
127
  updateInvoiceListFilters(draft, action) {
135
128
  draft.filters = action.payload;
136
129
  },
@@ -173,5 +166,5 @@ const invoiceList = createSlice({
173
166
  });
174
167
  },
175
168
  });
176
- export const { fetchInvoiceList, fetchInvoiceListPage, updateInvoiceList, updateInvoiceListFailure, fetchInvoiceCounts, updateInvoiceCounts, updateInvoiceCountsFailure, fetchInvoiceKPIs, updateInvoiceKPIs, updateInvoiceKPIsFailure, updateInvoiceListFilters, setInvoiceActiveTab, addInvoiceToList, invalidateInvoiceListForCustomer, } = invoiceList.actions;
169
+ export const { fetchInvoiceList, fetchInvoiceListPage, updateInvoiceList, updateInvoiceListFailure, fetchInvoiceCounts, updateInvoiceCounts, updateInvoiceCountsFailure, fetchInvoiceKPIs, updateInvoiceKPIs, updateInvoiceKPIsFailure, updateInvoiceListFilters, setInvoiceActiveTab, addInvoiceToList, } = invoiceList.actions;
177
170
  export default invoiceList.reducer;
@@ -1,6 +1,6 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, switchMap } from 'rxjs/operators';
3
- import { updateInvoicingCatalogItems } from '../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { updateInvoicingPlans } from '../../../../entity/invoicing/plan/planReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
5
  import { INVOICING_LIST_PAGE_SIZE, applyListSortParams, withQuery, } from '../../invoicingApiHelper';
6
6
  import { fetchInvoicingCatalogPlanList, updateInvoicingCatalogPlanList, updateInvoicingCatalogPlanListFailure, } from '../invoicingCatalogListViewReducer';
@@ -29,7 +29,7 @@ export const fetchInvoicingCatalogPlanListEpic = (actions$, _state$, zeniAPI) =>
29
29
  if (isSuccessResponse(response)) {
30
30
  const items = response.data?.items ?? [];
31
31
  return [
32
- updateInvoicingCatalogItems(items, 'merge'),
32
+ updateInvoicingPlans(items, 'merge'),
33
33
  updateInvoicingCatalogPlanList({
34
34
  ids: items.map((item) => item.id),
35
35
  nextCursor: response.data?.next_cursor ?? null,
@@ -1,6 +1,6 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, switchMap } from 'rxjs/operators';
3
- import { updateInvoicingCatalogItems } from '../../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { updateInvoicingPlans } from '../../../../entity/invoicing/plan/planReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
5
  import { INVOICING_LIST_PAGE_SIZE, applyListSortParams, withQuery, } from '../../invoicingApiHelper';
6
6
  import { fetchInvoicingCatalogProductList, updateInvoicingCatalogProductList, updateInvoicingCatalogProductListFailure, } from '../invoicingCatalogListViewReducer';
@@ -29,7 +29,7 @@ export const fetchInvoicingCatalogProductListEpic = (actions$, _state$, zeniAPI)
29
29
  if (isSuccessResponse(response)) {
30
30
  const items = response.data?.items ?? [];
31
31
  return [
32
- updateInvoicingCatalogItems(items, 'merge'),
32
+ updateInvoicingPlans(items, 'merge'),
33
33
  updateInvoicingCatalogProductList({
34
34
  ids: items.map((item) => item.id),
35
35
  nextCursor: response.data?.next_cursor ?? null,
@@ -1,5 +1,7 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
- import { getInvoicingCatalogItemsByIds, invoicingPricePointDisplayAmount, } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector';
2
+ import { getInvoicingPlansByIds } from '../../../entity/invoicing/plan/planSelector';
3
+ import { runningInvoicingActionId } from '../runningInvoicingActionId';
4
+ import { INVOICING_PRODUCT_COLUMNS, } from './invoicingCatalogListViewState';
3
5
  /**
4
6
  * Flatten catalog items into the price rows the pickers render.
5
7
  *
@@ -20,63 +22,28 @@ export const getInvoicingCatalogPrices = (items) => items.flatMap((item) => (ite
20
22
  priceCode: subFamily.priceCode,
21
23
  productCode: item.productCode,
22
24
  })));
23
- const lowestStartingTier = (tiers) => tiers.reduce((lowest, tier) => lowest == null || tier.startingUnit < lowest.startingUnit ? tier : lowest, undefined);
24
- export const getInvoicingCatalogPlanRows = (items) => items.flatMap((item) => {
25
- const pricePoints = item.subFamilies ?? [];
26
- if (pricePoints.length === 0) {
27
- return [
28
- {
29
- id: item.id,
30
- item,
31
- period: item.period,
32
- periodUnit: item.periodUnit,
33
- price: item.price,
34
- productFamily: item.name,
35
- status: item.status,
36
- tierCount: item.tiers?.length ?? 0,
37
- firstTier: lowestStartingTier(item.tiers ?? []),
38
- },
39
- ];
40
- }
41
- return pricePoints.map((pricePoint) => ({
42
- id: pricePoint.id,
43
- item,
44
- period: pricePoint.period,
45
- periodUnit: pricePoint.periodUnit,
46
- planName: pricePoint.name,
47
- price: invoicingPricePointDisplayAmount(pricePoint),
48
- pricingModel: pricePoint.pricingModel,
49
- productFamily: item.name,
50
- status: pricePoint.status,
51
- tierCount: pricePoint.tiers?.length ?? 0,
52
- firstTier: lowestStartingTier(pricePoint.tiers ?? []),
53
- }));
54
- });
55
25
  /**
56
26
  * Bundled read view for the single catalog page (plans + products tabs).
57
27
  * Memoized over the plan + product entity slices and the list-view slice so the
58
28
  * denormalized arrays keep referential identity. The base `fetchState`/`error`
59
29
  * track the plan list; the product list has its own `productFetchState`.
60
30
  */
61
- export const getInvoicingCatalogListView = createSelector((state) => state.invoicingCatalogState, (state) => state.invoicingCatalogListViewState, (catalogState, listViewState) => {
62
- const plans = getInvoicingCatalogItemsByIds(catalogState, listViewState.planIds);
63
- const products = getInvoicingCatalogItemsByIds(catalogState, listViewState.productIds);
64
- return {
65
- planRows: getInvoicingCatalogPlanRows(plans),
66
- plans,
67
- planSort: listViewState.planSort,
68
- productRows: getInvoicingCatalogPlanRows(products),
69
- products,
70
- productSort: listViewState.productSort,
71
- count: listViewState.counts,
72
- countsFetchState: listViewState.countsFetchState,
73
- planFilters: listViewState.planFilters,
74
- planNextCursor: listViewState.planNextCursor,
75
- productFilters: listViewState.productFilters,
76
- productNextCursor: listViewState.productNextCursor,
77
- productFetchState: listViewState.productFetchState,
78
- fetchState: listViewState.fetchState,
79
- error: listViewState.error,
80
- version: 1.0,
81
- };
82
- });
31
+ export const getInvoicingCatalogListView = createSelector((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (state) => state.invoicingConfigViewState.catalogItemLifecycleActionOptions, (state) => state.editInvoicingCatalogItemDetailViewState.actionStateById, (planState, listViewState, catalogItemLifecycleActionOptions, actionStateById) => ({
32
+ catalogItemLifecycleActionOptions,
33
+ runningActionId: runningInvoicingActionId(actionStateById),
34
+ plans: getInvoicingPlansByIds(planState, listViewState.planIds),
35
+ planSort: listViewState.planSort,
36
+ productColumns: INVOICING_PRODUCT_COLUMNS,
37
+ products: getInvoicingPlansByIds(planState, listViewState.productIds),
38
+ productSort: listViewState.productSort,
39
+ count: listViewState.counts,
40
+ countsFetchState: listViewState.countsFetchState,
41
+ planFilters: listViewState.planFilters,
42
+ planNextCursor: listViewState.planNextCursor,
43
+ productFilters: listViewState.productFilters,
44
+ productNextCursor: listViewState.productNextCursor,
45
+ productFetchState: listViewState.productFetchState,
46
+ fetchState: listViewState.fetchState,
47
+ error: listViewState.error,
48
+ version: 1.0,
49
+ }));
@@ -1 +1,20 @@
1
- export {};
1
+ import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
2
+ export const ALL_INVOICING_PRODUCT_SORT_KEYS = [
3
+ 'product_name',
4
+ 'product_code',
5
+ 'type',
6
+ 'pricing',
7
+ 'usage',
8
+ 'updated',
9
+ 'status',
10
+ ];
11
+ export const toInvoicingProductSortKey = (v) => stringToUnion(v, ALL_INVOICING_PRODUCT_SORT_KEYS);
12
+ export const INVOICING_PRODUCT_COLUMNS = [
13
+ { key: 'product_name', sortable: true },
14
+ { key: 'product_code', sortable: true },
15
+ { key: 'type', sortable: true },
16
+ { key: 'pricing', sortable: false },
17
+ { key: 'usage', sortable: true },
18
+ { key: 'updated', sortable: true },
19
+ { key: 'status', sortable: true },
20
+ ];
@@ -90,8 +90,8 @@ export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => a
90
90
  save: 'onboarding_customer_business_verification_save',
91
91
  },
92
92
  setup_billing: {
93
- save: 'billing_address_view',
94
- sendForVerification: 'billing_address_view',
93
+ save: 'common',
94
+ sendForVerification: 'common',
95
95
  },
96
96
  };
97
97
  let messageSection;
@@ -13,7 +13,6 @@ const emptyOfficerSlot = {
13
13
  };
14
14
  export const initialState = {
15
15
  updateStatus: { fetchState: 'Not-Started', error: undefined },
16
- kycKybResetStatus: { fetchState: 'Not-Started', error: undefined },
17
16
  parsingDocumentFileIds: [],
18
17
  companyDetails: { autoFilledFields: [] },
19
18
  companyOfficerUpdateStatus: {
@@ -85,25 +84,6 @@ const setupView = createSlice({
85
84
  };
86
85
  },
87
86
  },
88
- resetKycKyb(draft) {
89
- draft.kycKybResetStatus = { fetchState: 'In-Progress', error: undefined };
90
- },
91
- resetKycKybSuccess(draft) {
92
- draft.kycKybResetStatus = { fetchState: 'Completed', error: undefined };
93
- },
94
- resetKycKybFailure: {
95
- reducer(draft, action) {
96
- draft.kycKybResetStatus = { fetchState: 'Error', error: action.payload };
97
- },
98
- prepare(error) {
99
- return {
100
- payload: error,
101
- };
102
- },
103
- },
104
- clearKycKybResetStatus(draft) {
105
- draft.kycKybResetStatus = { fetchState: 'Not-Started', error: undefined };
106
- },
107
87
  updateSelectedCompanyOfficer: {
108
88
  reducer(draft, action) {
109
89
  const { selectedOfficerType } = action.payload;
@@ -379,5 +359,5 @@ const setupView = createSlice({
379
359
  });
380
360
  },
381
361
  });
382
- export const { enableSetup, enableSetupSuccess, enableSetupFailure, updateBusinessVerificationDetails, updateBusinessVerificationDetailsSuccess, updateBusinessVerificationDetailsFailure, resetKycKyb, resetKycKybSuccess, resetKycKybFailure, clearKycKybResetStatus, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, sendOtp: sendOtpSpendManagementSetUp, resendOtp: resendOtpSpendManagementSetUp, sendOtpSuccess: sendOtpSuccessSpendManagementSetUp, sendOtpFailure: sendOtpFailureSpendManagementSetUp, verifyOtp: verifyOtpSpendManagementSetUp, verifyOtpSuccess: verifyOtpSuccessSpendManagementSetUp, verifyOtpFailure: verifyOtpFailureSpendManagementSetUp, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, } = setupView.actions;
362
+ export const { enableSetup, enableSetupSuccess, enableSetupFailure, updateBusinessVerificationDetails, updateBusinessVerificationDetailsSuccess, updateBusinessVerificationDetailsFailure, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, sendOtp: sendOtpSpendManagementSetUp, resendOtp: resendOtpSpendManagementSetUp, sendOtpSuccess: sendOtpSuccessSpendManagementSetUp, sendOtpFailure: sendOtpFailureSpendManagementSetUp, verifyOtp: verifyOtpSpendManagementSetUp, verifyOtpSuccess: verifyOtpSuccessSpendManagementSetUp, verifyOtpFailure: verifyOtpFailureSpendManagementSetUp, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, } = setupView.actions;
383
363
  export default setupView.reducer;