@zeniai/client-epic-state 5.2.67 → 5.2.68

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.
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, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingMatch, 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, fetchActualMatchingMatch, fetchActualMatching as fetchExpenseAutomationActualMatching, 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 { 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';
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';
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, clearSetupViewDataInLocalStore, enableSetup, clearKycKybResetStatus, resetKycKyb, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, } from './view/spendManagement/commonSetup/setupViewReducer';
363
+ import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearKycKybResetStatus, clearSetupViewDataInLocalStore, enableSetup, resetKycKyb, 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';
@@ -16,7 +16,7 @@ import { toBusinessVerificationCompanyDataPayload, toBusinessVerificationOfficer
16
16
  import { updateCurrentStep, updateOnboardingCustomerView, updateOnboardingCustomerViewFailure, updateOnboardingCustomerViewLocalStoreData, updateOnboardingCustomerViewSuccess, } from '../../onboardingCustomerViewReducer';
17
17
  import { getOnboardingCustomerView } from '../../onboardingCustomerViewSelector';
18
18
  export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateOnboardingCustomerView.match), mergeMap((action) => {
19
- const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, } = action.payload;
19
+ const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, businessProfile, } = action.payload;
20
20
  const { onboardingCustomerViewState } = state$.value;
21
21
  const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, currentSubStep, } = onboardingCustomerViewState;
22
22
  const companyLocalData = companyDetails.localData;
@@ -28,12 +28,17 @@ export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => a
28
28
  }
29
29
  const { newAddressState } = state$.value.addressViewState;
30
30
  let payload = {};
31
+ const isSetupBillingSave = isBillingAddressUpdate === true || businessProfile != null;
31
32
  if (companyLocalData != null) {
32
- if (isBillingAddressUpdate === true &&
33
- newAddressState?.subscription_billing_address.addressToCreate != null) {
34
- payload = prepareEditBillingAddressPayload(companyLocalData, newAddressState.subscription_billing_address.addressToCreate);
35
- }
36
33
  const companyView = getCompanyView(state$.value, companyId, []);
34
+ const billingAddressToCreate = isBillingAddressUpdate === true
35
+ ? newAddressState?.subscription_billing_address.addressToCreate
36
+ : undefined;
37
+ if (billingAddressToCreate != null || businessProfile != null) {
38
+ payload = prepareEditBillingAddressPayload(companyLocalData, billingAddressToCreate, businessProfile != null
39
+ ? toBusinessProfilePayload(businessProfile, companyView?.company.company.incInfo)
40
+ : {});
41
+ }
37
42
  const companyAddressToCreate = newAddressState?.company_address?.addressToCreate;
38
43
  const registeredAddressToCreate = newAddressState?.company_registered_address?.addressToCreate;
39
44
  const addressType = officerType
@@ -56,7 +61,7 @@ export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => a
56
61
  // different payloads — currentSubStep is the source of truth here.
57
62
  const isOfficerSave = currentStep === 'verification' &&
58
63
  currentSubStep === 'company_officer';
59
- if (isBillingAddressUpdate === false) {
64
+ if (isBillingAddressUpdate === false && businessProfile == null) {
60
65
  if (isOfficerSave) {
61
66
  payload = {
62
67
  company: toBusinessVerificationMinimalCompanyDataPayload(companyLocalData),
@@ -70,7 +75,7 @@ export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => a
70
75
  };
71
76
  }
72
77
  }
73
- const section = isBillingAddressUpdate === true
78
+ const section = isSetupBillingSave
74
79
  ? 'setup_billing'
75
80
  : isOfficerSave
76
81
  ? 'company_officer'
@@ -90,7 +95,7 @@ export const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => a
90
95
  },
91
96
  };
92
97
  let messageSection;
93
- if (isBillingAddressUpdate === true) {
98
+ if (isSetupBillingSave) {
94
99
  messageSection = messageSectionMapper[section].save;
95
100
  }
96
101
  else if (sendForVerification === true) {
@@ -173,13 +178,28 @@ const toBusinessVerificationMinimalCompanyDataPayload = (companyLocalData) => {
173
178
  }
174
179
  return company;
175
180
  };
176
- const prepareEditBillingAddressPayload = (companyDetailsLocalData, address) => {
181
+ const toBusinessProfilePayload = (businessProfile, persistedIncInfo) => {
182
+ const isIndustryTypeChanged = businessProfile.companyIndustryType !==
183
+ persistedIncInfo?.companyIndustryType;
184
+ return {
185
+ company_business_model: businessProfile.companyBusinessModel,
186
+ company_industry_type: businessProfile.companyIndustryType,
187
+ // A sub-industry kept from the old industry would fail the backend subtype check on the next KYB save.
188
+ ...(isIndustryTypeChanged &&
189
+ persistedIncInfo?.companySubIndustry != null && {
190
+ company_industry_sub_type: null,
191
+ }),
192
+ };
193
+ };
194
+ const prepareEditBillingAddressPayload = (companyDetailsLocalData, address, businessProfilePayload) => {
177
195
  const { syncToken } = companyDetailsLocalData;
178
- const addressPayload = toAddressUpdatableInfoPayload(address);
179
196
  return {
180
197
  company: {
181
198
  sync_token: syncToken,
182
- subscription_billing_address: addressPayload,
199
+ ...(address != null && {
200
+ subscription_billing_address: toAddressUpdatableInfoPayload(address),
201
+ }),
202
+ ...businessProfilePayload,
183
203
  },
184
204
  };
185
205
  };
@@ -523,7 +523,7 @@ const onboardingCustomerView = createSlice({
523
523
  reducer(draft) {
524
524
  draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
525
525
  },
526
- prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType) {
526
+ prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType, businessProfile) {
527
527
  return {
528
528
  payload: {
529
529
  companyId,
@@ -531,6 +531,7 @@ const onboardingCustomerView = createSlice({
531
531
  reCalculateCurrentStep,
532
532
  isBillingAddressUpdate,
533
533
  officerType,
534
+ businessProfile,
534
535
  },
535
536
  };
536
537
  },
package/lib/index.d.ts CHANGED
@@ -310,7 +310,7 @@ import { computeNewScheduleJeDetails } from './view/expenseAutomationView/helper
310
310
  import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType } from './view/expenseAutomationView/helpers/reconciliationHelpers';
311
311
  import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
312
312
  import { UploadStatementDocumentAIPayload, UploadStatementDocumentAIResponse } from './view/expenseAutomationView/payload/reconciliationPayload';
313
- 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';
313
+ 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';
314
314
  import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
315
315
  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';
316
316
  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';
@@ -334,7 +334,7 @@ import { getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatemen
334
334
  import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
335
335
  import { applyTransactionFilters } from './view/expenseAutomationView/transactionFilterHelpers';
336
336
  import { TRANSACTION_FILTER_CATEGORIES, TransactionFilterAmountMatchingOperator, TransactionFilterCategory, TransactionFilterCategoryDropdownOption, TransactionFilterCategoryField, TransactionFilterEntityType, TransactionFilters } from './view/expenseAutomationView/transactionFilterTypes';
337
- import { ActualMatchingTransactionSearchResult, ActualMatchingSortKey as ExpenseAutomationActualMatchingSortKey, ActualMatchingStatusFilter as ExpenseAutomationActualMatchingStatusFilter, ActualMatchingViewUIState as ExpenseAutomationActualMatchingViewUIState, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, MatchAndReverseAccrualsParams, MatchAndReverseResult, MatchAndReverseResultStatus, ALL_ACTUAL_MATCHING_IGNORE_REASONS, ActualMatchingIgnoreReasonType, IgnoreActualMatchingSuggestionParams, UndoReversalAccrualsParams, UndoReversalResult, UndoReversalResultStatus, actualMatchingTransactionLineKey, toActualMatchingIgnoreReasonType, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toActualMatchingStatusFilter as toExpenseAutomationActualMatchingStatusFilter, toMatchAndReverseResultStatus, toUndoReversalResultStatus } from './view/expenseAutomationView/types/actualMatchingViewState';
337
+ import { ALL_ACTUAL_MATCHING_IGNORE_REASONS, ActualMatchingIgnoreReasonType, ActualMatchingTransactionSearchResult, ActualMatchingSortKey as ExpenseAutomationActualMatchingSortKey, ActualMatchingStatusFilter as ExpenseAutomationActualMatchingStatusFilter, ActualMatchingViewUIState as ExpenseAutomationActualMatchingViewUIState, IgnoreActualMatchingSuggestionParams, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, MatchAndReverseAccrualsParams, MatchAndReverseResult, MatchAndReverseResultStatus, UndoReversalAccrualsParams, UndoReversalResult, UndoReversalResultStatus, actualMatchingTransactionLineKey, toActualMatchingIgnoreReasonType, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toActualMatchingStatusFilter as toExpenseAutomationActualMatchingStatusFilter, toMatchAndReverseResultStatus, toUndoReversalResultStatus } from './view/expenseAutomationView/types/actualMatchingViewState';
338
338
  import { CompletedSubTab, DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab } from './view/expenseAutomationView/types/completedSubTab';
339
339
  import { FluxAnalysisActionType, FluxAnalysisReviewStatus, FluxAnalysisSectionType, FluxAnalysisSortKey, FluxAnalysisViewUIState, FluxBalancesByMonth } from './view/expenseAutomationView/types/fluxAnalysisViewState';
340
340
  import { ALL_JE_PAGE_TABS, AccountSettingsLocalData, JEScheduleSortKey as ExpenseAutomationJEScheduleSortKey, JESchedulesViewUIState as ExpenseAutomationJESchedulesViewUIState, JEPageTab, JEScheduleLocalData, NewJeDetailLocalData, NewJeScheduleState, NewOneTimeAccrualLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets, SearchTransactionsState, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, toJEPageTab } from './view/expenseAutomationView/types/jeSchedulesViewState';
@@ -393,7 +393,7 @@ import { OnboardingCustomerListUIState, QBOConnectionPool } from './view/onboard
393
393
  import { CustomerCreationStatus, NewOnboardingCustomer, OnboardingCompanyDetails, OnboardingCustomer, OnboardingCustomerCompletedStatus, ProductGroupType, ProductType, toProductType, toProductTypeStrict } from './view/onboardingView/cockpitView/types/onboardingCockpitViewTypes';
394
394
  import { acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, applyKybDocumentAutofillForOnboarding, applyKycDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, clearOnboardingCustomerViewDataInLocalStore, establishOnboardingPlaidConnection, fetchAiAgentsActivationStatus, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerView, getOnboardingPlaidLinkToken, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, updateCurrentStep, updateCurrentSubStep, updateOnboardingCustomerView, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewLocalStoreData, updateOnboardingCustomerViewUIState, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus } from './view/onboardingView/customerView/onboardingCustomerViewReducer';
395
395
  import { OnboardingCustomerView, getAiAgentsActivationCounts, getAiAgentsActivationPhases, getAiAgentsActivationSubview, getOnboardingCustomerView, getProductSettingsString } from './view/onboardingView/customerView/onboardingCustomerViewSelector';
396
- import { ALL_ONBOARDING_STEPS, ALL_ONBOARDING_SUB_STEPS, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, OnboardingCustomerViewLocalData, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep, toOnboardingStepType, toOnboardingSubStepType } from './view/onboardingView/customerView/onboardingCustomerViewState';
396
+ import { ALL_ONBOARDING_STEPS, ALL_ONBOARDING_SUB_STEPS, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, OnboardingBusinessProfileUpdate, OnboardingCustomerViewLocalData, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep, toOnboardingStepType, toOnboardingSubStepType } from './view/onboardingView/customerView/onboardingCustomerViewState';
397
397
  import { fetchOpEx, fetchOpExWithForecast, updateOpExCOABalancesRange, updateOpExDownloadState, updateOpExUIState } from './view/opEx/opExReducer';
398
398
  import { getOperatingExpensesForHighlightedRange, getOperatingExpensesForSelectedRange, getOperatingExpensesReport, getOperatingExpensesReportFetchState, getOperatingExpensesUIState } from './view/opEx/opExSelector';
399
399
  import { OpExReport, OpExUIStateSelectorView } from './view/opEx/opExSelectorTypes';
@@ -550,7 +550,7 @@ import { toIssueChargeCardLocalDataFromDraft } from './view/spendManagement/char
550
550
  import { CommonHistoryView, HistoricEvent, HistoricEventUpdate } from './view/spendManagement/commonHistoryView/commonHistory';
551
551
  import { ActivityHistorySelectorView } from './view/spendManagement/commonHistoryView/commonHistorySelector';
552
552
  import { parseUploadedKybDocument, parseUploadedKycDocument } from './view/spendManagement/commonSetup/kycKybAutofillActions';
553
- import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearSetupViewDataInLocalStore, enableSetup, clearKycKybResetStatus, resetKycKyb, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData } from './view/spendManagement/commonSetup/setupViewReducer';
553
+ import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearKycKybResetStatus, clearSetupViewDataInLocalStore, enableSetup, resetKycKyb, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData } from './view/spendManagement/commonSetup/setupViewReducer';
554
554
  import { BusinessVerificationDetails, SetupView, getBusinessVerificationDetails, getCommonSetupViewDetails } from './view/spendManagement/commonSetup/setupViewSelector';
555
555
  import { CompanyDetails, CompanyOfficersDetails, FundingAccount, SetupViewLocalData, SetupViewState } from './view/spendManagement/commonSetup/setupViewState';
556
556
  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, CompanyOnboardingIndustryTypeCode, CompanyOnboardingSubIndustryTypeCode, CompanyPurposeOfAccountCode, CompanySourceOfFundsCode, CompanyTransactionVolumeCode, CompanyUsNexusTypeCode, getCompanyOnboardingSubIndustryCodesForIndustry } from './view/spendManagement/commonSetup/types/businessVerification';
@@ -935,7 +935,7 @@ export { CountryWithCurrency };
935
935
  export { fetchCompanyConfig };
936
936
  export { getCompanyConfig };
937
937
  export { isZeniClearingAccountReport, ZENI_CLEARING_ACCOUNT, isZeniClearingAccount, };
938
- export { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, getOnboardingPlaidLinkToken, establishOnboardingPlaidConnection, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus, updateOnboardingCustomerView, updateOnboardingCustomerViewLocalStoreData, updateCurrentStep, updateCurrentSubStep, updateOnboardingCustomerViewUIState, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerViewDataInLocalStore, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, fetchAiAgentsActivationStatus, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, getAiAgentsActivationCounts, getAiAgentsActivationPhases, getAiAgentsActivationSubview, getOnboardingCustomerView, getProductSettingsString, OnboardingCustomerView, OnboardingStep, OnboardingSubStep, ALL_ONBOARDING_STEPS, ALL_ONBOARDING_SUB_STEPS, toOnboardingStepType, toOnboardingSubStepType, OnboardingCustomerViewUIState, OnboardingCustomerViewLocalData, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, };
938
+ export { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, getOnboardingPlaidLinkToken, establishOnboardingPlaidConnection, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus, updateOnboardingCustomerView, updateOnboardingCustomerViewLocalStoreData, updateCurrentStep, updateCurrentSubStep, updateOnboardingCustomerViewUIState, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerViewDataInLocalStore, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, fetchAiAgentsActivationStatus, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, getAiAgentsActivationCounts, getAiAgentsActivationPhases, getAiAgentsActivationSubview, getOnboardingCustomerView, getProductSettingsString, OnboardingCustomerView, OnboardingStep, OnboardingSubStep, ALL_ONBOARDING_STEPS, ALL_ONBOARDING_SUB_STEPS, toOnboardingStepType, toOnboardingSubStepType, OnboardingCustomerViewUIState, OnboardingCustomerViewLocalData, OnboardingBusinessProfileUpdate, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, };
939
939
  export { saveAccountMapping, saveAccountMappingLocalData, clearAccountMappingLocalData, AccountMappingLocalData, AccountMappingView, VendorAccountMappingView, getAccountMappingView, initializeAccountMappingView, ExpenseCategory1099Filing, };
940
940
  export { MagicLinkView, getMagicLinkView, getMagicLinkBankAccountView, getMagicLinkCurrentAddressState, };
941
941
  export { fetchMagicLinkTenant, fetchBillAttachment, saveBankAccount, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, saveMagicLinkAddressInLocalStore, };
package/lib/index.js CHANGED
@@ -869,8 +869,8 @@ Object.defineProperty(exports, "ackCloseMatchAfterUndo", { enumerable: true, get
869
869
  Object.defineProperty(exports, "clearExpenseAutomationActualMatchingView", { enumerable: true, get: function () { return actualMatchingViewReducer_1.clearActualMatchingView; } });
870
870
  Object.defineProperty(exports, "clearMatchNewModal", { enumerable: true, get: function () { return actualMatchingViewReducer_1.clearMatchNewModal; } });
871
871
  Object.defineProperty(exports, "closeMatchNewModal", { enumerable: true, get: function () { return actualMatchingViewReducer_1.closeMatchNewModal; } });
872
- Object.defineProperty(exports, "fetchExpenseAutomationActualMatching", { enumerable: true, get: function () { return actualMatchingViewReducer_1.fetchActualMatching; } });
873
872
  Object.defineProperty(exports, "fetchActualMatchingMatch", { enumerable: true, get: function () { return actualMatchingViewReducer_1.fetchActualMatchingMatch; } });
873
+ Object.defineProperty(exports, "fetchExpenseAutomationActualMatching", { enumerable: true, get: function () { return actualMatchingViewReducer_1.fetchActualMatching; } });
874
874
  Object.defineProperty(exports, "fetchExpenseAutomationActualMatchingPage", { enumerable: true, get: function () { return actualMatchingViewReducer_1.fetchActualMatchingPage; } });
875
875
  Object.defineProperty(exports, "ignoreActualMatchingSuggestion", { enumerable: true, get: function () { return actualMatchingViewReducer_1.ignoreActualMatchingSuggestion; } });
876
876
  Object.defineProperty(exports, "matchAndReverseAccruals", { enumerable: true, get: function () { return actualMatchingViewReducer_1.matchAndReverseAccruals; } });
@@ -1059,10 +1059,10 @@ Object.defineProperty(exports, "applyTransactionFilters", { enumerable: true, ge
1059
1059
  const transactionFilterTypes_1 = require("./view/expenseAutomationView/transactionFilterTypes");
1060
1060
  Object.defineProperty(exports, "TRANSACTION_FILTER_CATEGORIES", { enumerable: true, get: function () { return transactionFilterTypes_1.TRANSACTION_FILTER_CATEGORIES; } });
1061
1061
  const actualMatchingViewState_1 = require("./view/expenseAutomationView/types/actualMatchingViewState");
1062
+ Object.defineProperty(exports, "ALL_ACTUAL_MATCHING_IGNORE_REASONS", { enumerable: true, get: function () { return actualMatchingViewState_1.ALL_ACTUAL_MATCHING_IGNORE_REASONS; } });
1062
1063
  Object.defineProperty(exports, "MATCH_ACCRUAL_SEARCH_LIMIT", { enumerable: true, get: function () { return actualMatchingViewState_1.MATCH_ACCRUAL_SEARCH_LIMIT; } });
1063
1064
  Object.defineProperty(exports, "MATCH_SEARCH_DEBOUNCE_MS", { enumerable: true, get: function () { return actualMatchingViewState_1.MATCH_SEARCH_DEBOUNCE_MS; } });
1064
1065
  Object.defineProperty(exports, "MATCH_TRANSACTION_SEARCH_PAGE_SIZE", { enumerable: true, get: function () { return actualMatchingViewState_1.MATCH_TRANSACTION_SEARCH_PAGE_SIZE; } });
1065
- Object.defineProperty(exports, "ALL_ACTUAL_MATCHING_IGNORE_REASONS", { enumerable: true, get: function () { return actualMatchingViewState_1.ALL_ACTUAL_MATCHING_IGNORE_REASONS; } });
1066
1066
  Object.defineProperty(exports, "actualMatchingTransactionLineKey", { enumerable: true, get: function () { return actualMatchingViewState_1.actualMatchingTransactionLineKey; } });
1067
1067
  Object.defineProperty(exports, "toActualMatchingIgnoreReasonType", { enumerable: true, get: function () { return actualMatchingViewState_1.toActualMatchingIgnoreReasonType; } });
1068
1068
  Object.defineProperty(exports, "toExpenseAutomationActualMatchingSortKey", { enumerable: true, get: function () { return actualMatchingViewState_1.toActualMatchingSortKey; } });
@@ -1897,9 +1897,9 @@ const setupViewReducer_1 = require("./view/spendManagement/commonSetup/setupView
1897
1897
  Object.defineProperty(exports, "applyKybDocumentAutofillForSetup", { enumerable: true, get: function () { return setupViewReducer_1.applyKybDocumentAutofillForSetup; } });
1898
1898
  Object.defineProperty(exports, "applyKycDocumentAutofillForSetup", { enumerable: true, get: function () { return setupViewReducer_1.applyKycDocumentAutofillForSetup; } });
1899
1899
  Object.defineProperty(exports, "clearKycKybAutofillForSetup", { enumerable: true, get: function () { return setupViewReducer_1.clearKycKybAutofillForSetup; } });
1900
+ Object.defineProperty(exports, "clearKycKybResetStatus", { enumerable: true, get: function () { return setupViewReducer_1.clearKycKybResetStatus; } });
1900
1901
  Object.defineProperty(exports, "clearSetupViewDataInLocalStore", { enumerable: true, get: function () { return setupViewReducer_1.clearSetupViewDataInLocalStore; } });
1901
1902
  Object.defineProperty(exports, "enableSetup", { enumerable: true, get: function () { return setupViewReducer_1.enableSetup; } });
1902
- Object.defineProperty(exports, "clearKycKybResetStatus", { enumerable: true, get: function () { return setupViewReducer_1.clearKycKybResetStatus; } });
1903
1903
  Object.defineProperty(exports, "resetKycKyb", { enumerable: true, get: function () { return setupViewReducer_1.resetKycKyb; } });
1904
1904
  Object.defineProperty(exports, "saveCompnayOfficerAdditionalDocumentsInLocalStore", { enumerable: true, get: function () { return setupViewReducer_1.saveCompnayOfficerAdditionalDocumentsInLocalStore; } });
1905
1905
  Object.defineProperty(exports, "saveCompnayOfficerPhoneInLocalStore", { enumerable: true, get: function () { return setupViewReducer_1.saveCompnayOfficerPhoneInLocalStore; } });
@@ -19,7 +19,7 @@ const updateBusinessVerificationDetailsEpic_1 = require("../../../../spendManage
19
19
  const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
20
20
  const onboardingCustomerViewSelector_1 = require("../../onboardingCustomerViewSelector");
21
21
  const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.updateOnboardingCustomerView.match), (0, operators_1.mergeMap)((action) => {
22
- const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, } = action.payload;
22
+ const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, businessProfile, } = action.payload;
23
23
  const { onboardingCustomerViewState } = state$.value;
24
24
  const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, currentSubStep, } = onboardingCustomerViewState;
25
25
  const companyLocalData = companyDetails.localData;
@@ -31,12 +31,17 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
31
31
  }
32
32
  const { newAddressState } = state$.value.addressViewState;
33
33
  let payload = {};
34
+ const isSetupBillingSave = isBillingAddressUpdate === true || businessProfile != null;
34
35
  if (companyLocalData != null) {
35
- if (isBillingAddressUpdate === true &&
36
- newAddressState?.subscription_billing_address.addressToCreate != null) {
37
- payload = prepareEditBillingAddressPayload(companyLocalData, newAddressState.subscription_billing_address.addressToCreate);
38
- }
39
36
  const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, []);
37
+ const billingAddressToCreate = isBillingAddressUpdate === true
38
+ ? newAddressState?.subscription_billing_address.addressToCreate
39
+ : undefined;
40
+ if (billingAddressToCreate != null || businessProfile != null) {
41
+ payload = prepareEditBillingAddressPayload(companyLocalData, billingAddressToCreate, businessProfile != null
42
+ ? toBusinessProfilePayload(businessProfile, companyView?.company.company.incInfo)
43
+ : {});
44
+ }
40
45
  const companyAddressToCreate = newAddressState?.company_address?.addressToCreate;
41
46
  const registeredAddressToCreate = newAddressState?.company_registered_address?.addressToCreate;
42
47
  const addressType = officerType
@@ -59,7 +64,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
59
64
  // different payloads — currentSubStep is the source of truth here.
60
65
  const isOfficerSave = currentStep === 'verification' &&
61
66
  currentSubStep === 'company_officer';
62
- if (isBillingAddressUpdate === false) {
67
+ if (isBillingAddressUpdate === false && businessProfile == null) {
63
68
  if (isOfficerSave) {
64
69
  payload = {
65
70
  company: toBusinessVerificationMinimalCompanyDataPayload(companyLocalData),
@@ -73,7 +78,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
73
78
  };
74
79
  }
75
80
  }
76
- const section = isBillingAddressUpdate === true
81
+ const section = isSetupBillingSave
77
82
  ? 'setup_billing'
78
83
  : isOfficerSave
79
84
  ? 'company_officer'
@@ -93,7 +98,7 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
93
98
  },
94
99
  };
95
100
  let messageSection;
96
- if (isBillingAddressUpdate === true) {
101
+ if (isSetupBillingSave) {
97
102
  messageSection = messageSectionMapper[section].save;
98
103
  }
99
104
  else if (sendForVerification === true) {
@@ -177,13 +182,28 @@ const toBusinessVerificationMinimalCompanyDataPayload = (companyLocalData) => {
177
182
  }
178
183
  return company;
179
184
  };
180
- const prepareEditBillingAddressPayload = (companyDetailsLocalData, address) => {
185
+ const toBusinessProfilePayload = (businessProfile, persistedIncInfo) => {
186
+ const isIndustryTypeChanged = businessProfile.companyIndustryType !==
187
+ persistedIncInfo?.companyIndustryType;
188
+ return {
189
+ company_business_model: businessProfile.companyBusinessModel,
190
+ company_industry_type: businessProfile.companyIndustryType,
191
+ // A sub-industry kept from the old industry would fail the backend subtype check on the next KYB save.
192
+ ...(isIndustryTypeChanged &&
193
+ persistedIncInfo?.companySubIndustry != null && {
194
+ company_industry_sub_type: null,
195
+ }),
196
+ };
197
+ };
198
+ const prepareEditBillingAddressPayload = (companyDetailsLocalData, address, businessProfilePayload) => {
181
199
  const { syncToken } = companyDetailsLocalData;
182
- const addressPayload = (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address);
183
200
  return {
184
201
  company: {
185
202
  sync_token: syncToken,
186
- subscription_billing_address: addressPayload,
203
+ ...(address != null && {
204
+ subscription_billing_address: (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address),
205
+ }),
206
+ ...businessProfilePayload,
187
207
  },
188
208
  };
189
209
  };
@@ -3,7 +3,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
3
3
  import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
4
4
  import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
5
5
  import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
6
- import { AiAgentsActivationCounts, AiAgentsActivationPhase, OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep } from './onboardingCustomerViewState';
6
+ import { AiAgentsActivationCounts, AiAgentsActivationPhase, OnboardingBusinessProfileUpdate, OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep } from './onboardingCustomerViewState';
7
7
  export declare const initialState: OnboardingCustomerViewState;
8
8
  export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, reCalculateCurrentStep?: any], {
9
9
  companyId: string;
@@ -29,12 +29,13 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
29
29
  phases: AiAgentsActivationPhase[];
30
30
  }, "onboardingCustomerView/fetchAiAgentsActivationStatusSuccess", never, never>, fetchAiAgentsActivationStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/fetchAiAgentsActivationStatusFailure", never, never>, aiAgentsActivationCountsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<AiAgentsActivationCounts>], Partial<AiAgentsActivationCounts>, "onboardingCustomerView/aiAgentsActivationCountsUpdated", never, never>, aiAgentsActivationPhaseChanged: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AiAgentsActivationPhase], AiAgentsActivationPhase, "onboardingCustomerView/aiAgentsActivationPhaseChanged", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
31
31
  companyId: string;
32
- }, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined], {
32
+ }, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined, businessProfile?: OnboardingBusinessProfileUpdate | undefined], {
33
33
  companyId: string;
34
34
  sendForVerification: boolean;
35
35
  reCalculateCurrentStep: boolean | undefined;
36
36
  isBillingAddressUpdate: boolean | undefined;
37
37
  officerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined;
38
+ businessProfile: OnboardingBusinessProfileUpdate | undefined;
38
39
  }, "onboardingCustomerView/updateOnboardingCustomerView", never, never>, updateOnboardingCustomerViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewSuccess">, updateOnboardingCustomerViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewFailure", never, never>, updateOnboardingPaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, linkTokenType?: PlaidLinkTokenType | undefined], {
39
40
  verificationStatusCode: string;
40
41
  paymentAccountId: string;
@@ -528,7 +528,7 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
528
528
  reducer(draft) {
529
529
  draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
530
530
  },
531
- prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType) {
531
+ prepare(companyId, sendForVerification, reCalculateCurrentStep, isBillingAddressUpdate, officerType, businessProfile) {
532
532
  return {
533
533
  payload: {
534
534
  companyId,
@@ -536,6 +536,7 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
536
536
  reCalculateCurrentStep,
537
537
  isBillingAddressUpdate,
538
538
  officerType,
539
+ businessProfile,
539
540
  },
540
541
  };
541
542
  },
@@ -20,6 +20,10 @@ export type OnboardingSubStep = ReturnType<typeof toOnboardingSubStepType>;
20
20
  * Onboarding Custiner View Local Data - Intefaces
21
21
  */
22
22
  export type OnboardingCustomerViewLocalData = SetupViewLocalData;
23
+ export interface OnboardingBusinessProfileUpdate {
24
+ companyBusinessModel: string;
25
+ companyIndustryType: string;
26
+ }
23
27
  export interface OnboardingCustomerViewUIState {
24
28
  isCardPaymentPopupOpen: boolean;
25
29
  isQBOPopupOpen: boolean;
@@ -92,9 +92,10 @@ export interface CompanyDetailsVerificationPayload {
92
92
  source_of_funds: string;
93
93
  sync_token: string;
94
94
  tax_id: string;
95
+ company_business_model?: string;
95
96
  company_countries_of_operations?: string[];
96
97
  company_inc_state?: string | null;
97
- company_industry_sub_type?: string;
98
+ company_industry_sub_type?: string | null;
98
99
  company_industry_type?: string;
99
100
  company_purpose_of_account?: CompanyPurposeOfAccountCode;
100
101
  company_purpose_of_account_desc?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.67",
3
+ "version": "5.2.68",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",