@zeniai/client-epic-state 5.1.4-beta7ND → 5.1.4-betaML2

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 (85) hide show
  1. package/lib/entity/company/companyPayload.d.ts +0 -4
  2. package/lib/entity/company/companyPayload.js +0 -6
  3. package/lib/entity/company/companyStateTypes.d.ts +0 -7
  4. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
  5. package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -9
  6. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  7. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  8. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  9. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  10. package/lib/entity/tenant/tenantPayload.d.ts +0 -1
  11. package/lib/entity/tenant/tenantReducer.d.ts +25 -38
  12. package/lib/entity/tenant/tenantReducer.js +5 -65
  13. package/lib/entity/tenant/tenantState.d.ts +0 -1
  14. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
  15. package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -0
  16. package/lib/entity/transaction/stateTypes/transaction.d.ts +2 -0
  17. package/lib/epic.d.ts +1 -6
  18. package/lib/epic.js +1 -7
  19. package/lib/esm/entity/company/companyPayload.js +0 -6
  20. package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -8
  21. package/lib/esm/entity/tenant/tenantReducer.js +3 -63
  22. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -0
  23. package/lib/esm/epic.js +1 -7
  24. package/lib/esm/index.js +7 -11
  25. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
  26. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
  27. package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
  28. package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
  29. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
  30. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +17 -29
  31. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -223
  32. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -24
  33. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +6 -37
  34. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -106
  35. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
  36. package/lib/index.d.ts +10 -14
  37. package/lib/index.js +35 -64
  38. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
  39. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
  40. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
  41. package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
  42. package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
  43. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
  44. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
  45. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +15 -27
  46. package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
  47. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +5 -44
  48. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +52 -225
  49. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -6
  50. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -27
  51. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +8 -52
  52. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +7 -39
  53. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
  54. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -107
  55. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
  56. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
  57. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
  58. package/package.json +1 -1
  59. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
  60. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -59
  61. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -55
  62. package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -40
  63. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
  64. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
  65. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -58
  66. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -77
  67. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
  68. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -207
  69. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -41
  70. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
  71. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -44
  72. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
  73. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
  74. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
  75. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
  76. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
  77. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -62
  78. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -9
  79. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -81
  80. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -24
  81. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
  82. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -29
  83. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -215
  84. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -154
  85. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -46
@@ -21,7 +21,7 @@ const onboardingCustomerViewSelector_1 = require("../../onboardingCustomerViewSe
21
21
  const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.updateOnboardingCustomerView.match), (0, operators_1.mergeMap)((action) => {
22
22
  const { companyId, officerType, sendForVerification, reCalculateCurrentStep = false, isBillingAddressUpdate, } = action.payload;
23
23
  const { onboardingCustomerViewState } = state$.value;
24
- const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, currentSubStep, } = onboardingCustomerViewState;
24
+ const { companyDetails, primaryContactDetails, companyOfficerUpdateStatus, currentStep, } = onboardingCustomerViewState;
25
25
  const companyLocalData = companyDetails.localData;
26
26
  const primaryContactLocalData = primaryContactDetails.localData;
27
27
  let companyOfficerLocalData;
@@ -55,12 +55,8 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
55
55
  Boolean(companyOfficerLocalData.email) === true // Don't save Empty Company Officer details
56
56
  ? (0, updateBusinessVerificationDetailsEpic_1.toBusinessVerificationOfficerDataPayload)(companyOfficerLocalData, false, companyOfficerAddressToCreate)
57
57
  : {};
58
- // Verification step has two sub-steps that share currentStep but save
59
- // different payloads — currentSubStep is the source of truth here.
60
- const isOfficerSave = currentStep === 'verification' &&
61
- currentSubStep === 'company_officer';
62
58
  if (isBillingAddressUpdate === false) {
63
- if (isOfficerSave) {
59
+ if (currentStep === 'company_officer') {
64
60
  payload = {
65
61
  company: toBusinessVerificationMinimalCompanyDataPayload(companyLocalData),
66
62
  company_officer,
@@ -73,11 +69,6 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
73
69
  };
74
70
  }
75
71
  }
76
- const section = isBillingAddressUpdate === true
77
- ? 'setup_billing'
78
- : isOfficerSave
79
- ? 'company_officer'
80
- : 'company_details';
81
72
  const messageSectionMapper = {
82
73
  company_officer: {
83
74
  sendForVerification: 'onboarding_customer_identity_verification_submit',
@@ -87,20 +78,23 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
87
78
  sendForVerification: 'onboarding_customer_business_verification_submit',
88
79
  save: 'onboarding_customer_business_verification_save',
89
80
  },
90
- setup_billing: {
81
+ link_payment_account: {
91
82
  save: 'billing_address_view',
92
83
  sendForVerification: 'billing_address_view',
93
84
  },
94
85
  };
95
86
  let messageSection;
96
87
  if (isBillingAddressUpdate === true) {
97
- messageSection = messageSectionMapper[section].save;
98
- }
99
- else if (sendForVerification === true) {
100
- messageSection = messageSectionMapper[section].sendForVerification;
88
+ messageSection = messageSectionMapper[currentStep].save;
101
89
  }
102
90
  else {
103
- messageSection = messageSectionMapper[section].save;
91
+ if (sendForVerification === true) {
92
+ messageSection =
93
+ messageSectionMapper[currentStep].sendForVerification;
94
+ }
95
+ else {
96
+ messageSection = messageSectionMapper[currentStep].save;
97
+ }
104
98
  }
105
99
  return zeniAPI
106
100
  .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
@@ -123,18 +117,18 @@ const updateOnboardingCustomerViewEpic = (actions$, state$, zeniAPI) => actions$
123
117
  const externalConnections = currentTenant.externalConnections;
124
118
  const isQBOConnection = externalConnections?.accounting?.some((connection) => connection.connectionName.match(/quickbooks/i)) ?? false;
125
119
  const { allSteps } = (0, onboardingCustomerViewSelector_1.getOnboardingCustomerView)(state$.value, companyId);
126
- if (currentStep === 'setup_billing') {
120
+ if (currentStep === 'link_payment_account') {
127
121
  if (isQBOConnection === true &&
128
- allSteps.includes('connect_ledger')) {
129
- actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'connect_ledger' }));
122
+ allSteps.includes('qbo_connection')) {
123
+ actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'qbo_connection' }));
130
124
  }
131
125
  else {
132
- actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'verification' }));
126
+ actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'company_officer' }));
133
127
  }
134
128
  }
135
- // The officer→details transition is now a sub-step change
136
- // handled by the page (currentSubStep dispatch). No
137
- // currentStep update needed for that traversal anymore.
129
+ if (currentStep === 'company_officer') {
130
+ actions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: 'company_details' }));
131
+ }
138
132
  actions.push((0, onboardingCustomerViewReducer_1.updateOnboardingCustomerViewLocalStoreData)({
139
133
  companyId: response.data.companies[0].company_id,
140
134
  currentStep,
@@ -1,6 +1,6 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../../../reducer';
3
3
  import { newAddressInLocalStore, resetNewAddressDataInLocalStore, resetNewAddressesInLocalStore } from '../../../../addressView/addressViewReducer';
4
- import { clearOnboardingCustomerViewDataInLocalStore, saveOnboardingCustomerViewDataInLocalStore, updateCurrentStep, updateCurrentSubStep, updateOnboardingCustomerViewLocalStoreData } from '../../onboardingCustomerViewReducer';
5
- export type ActionType = ReturnType<typeof updateOnboardingCustomerViewLocalStoreData> | ReturnType<typeof saveOnboardingCustomerViewDataInLocalStore> | ReturnType<typeof clearOnboardingCustomerViewDataInLocalStore> | ReturnType<typeof resetNewAddressesInLocalStore> | ReturnType<typeof newAddressInLocalStore> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateCurrentStep> | ReturnType<typeof updateCurrentSubStep>;
4
+ import { clearOnboardingCustomerViewDataInLocalStore, saveOnboardingCustomerViewDataInLocalStore, updateCurrentStep, updateOnboardingCustomerViewLocalStoreData } from '../../onboardingCustomerViewReducer';
5
+ export type ActionType = ReturnType<typeof updateOnboardingCustomerViewLocalStoreData> | ReturnType<typeof saveOnboardingCustomerViewDataInLocalStore> | ReturnType<typeof clearOnboardingCustomerViewDataInLocalStore> | ReturnType<typeof resetNewAddressesInLocalStore> | ReturnType<typeof newAddressInLocalStore> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateCurrentStep>;
6
6
  export declare const updateOnboardingCustomerViewLocalStoreDataEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
@@ -22,7 +22,7 @@ const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewRed
22
22
  const onboardingCustomerViewSelector_1 = require("../../onboardingCustomerViewSelector");
23
23
  const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.updateOnboardingCustomerViewLocalStoreData.match), (0, operators_1.mergeMap)((action) => {
24
24
  const { companyId, currentStep, reCalculateCurrentStep } = action.payload;
25
- const { companyState, companyViewState, userState, userRoleState, onboardingCustomerViewState, subscriptionPaymentAccountState, paymentAccountState, addressState, } = state$.value;
25
+ const { companyState, companyViewState, fileState, userState, userRoleState, onboardingCustomerViewState, subscriptionPaymentAccountState, paymentAccountState, addressState, } = state$.value;
26
26
  const { subscriptionPaymentAccountIds } = onboardingCustomerViewState;
27
27
  const subscriptionIDs = (0, get_1.default)(companyViewState.passportView.subscriptionIDsByCompanyID, companyId, undefined);
28
28
  const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, subscriptionIDs ?? []);
@@ -42,12 +42,7 @@ const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => act
42
42
  const onboardingCustomerViewLocalData = toOnboardingCustomerViewLocalData(company, companyOfficers, companyOfficerRoles, primaryContact);
43
43
  const { companyDetails, officers, primaryContactDetails } = onboardingCustomerViewLocalData;
44
44
  let updatedCompanyDetails = companyDetails;
45
- // After an officer sub-step save inside the verification step, propagate
46
- // the latest syncToken into the cached company-details local data so the
47
- // user's next details-save doesn't 409.
48
- const isOfficerSave = currentStep === 'verification' &&
49
- onboardingCustomerViewState.currentSubStep === 'company_officer';
50
- if (isOfficerSave &&
45
+ if (currentStep === 'company_officer' &&
51
46
  onboardingCustomerViewState.companyDetails.localData != null) {
52
47
  const { companyInfo } = company;
53
48
  const { syncToken } = companyInfo;
@@ -56,7 +51,7 @@ const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => act
56
51
  syncToken,
57
52
  };
58
53
  }
59
- let updatedCurrentStep = 'setup_billing';
54
+ let updatedCurrentStep = 'link_payment_account';
60
55
  let subscriptionPaymentAccount;
61
56
  const { companyOnboardingInfo } = company;
62
57
  const accountingConnectionCreationMode = companyOnboardingInfo?.onboardingInfo
@@ -83,17 +78,18 @@ const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => act
83
78
  cardPaymentViewState.cardPaymentsIds.length > 0) &&
84
79
  companyView?.company.company.companyOnboardingInfo
85
80
  .subscriptionBillingAddressId != null) {
86
- updatedCurrentStep = 'connect_ledger';
87
- const isOnboardingAiActivationViewed = companyOnboardingInfo?.onboardingInfo
88
- ?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed ??
89
- false;
90
- // Past the ledger step we always sit on connect_data_source —
91
- // it has many integrations, so we treat it as never auto-complete
92
- // and only advance to verification on an explicit user dispatch.
93
- // While the AI activation interstitial hasn't been viewed yet,
94
- // stay on connect_ledger so the interstitial gets its chance.
95
- if (isValidConnection && isOnboardingAiActivationViewed) {
96
- updatedCurrentStep = 'connect_data_source';
81
+ updatedCurrentStep = 'qbo_connection';
82
+ if (isValidConnection) {
83
+ updatedCurrentStep = 'company_officer';
84
+ let officerIndex = companyOfficers.length > 0
85
+ ? officers.findIndex((officer) => officer?.isSelectedForVerification === true)
86
+ : 0;
87
+ if (officerIndex === -1) {
88
+ officerIndex = 0;
89
+ }
90
+ if ((0, onboardingCustomerViewSelector_1.isOfficerDetailsCompleted)(companyOfficers, companyOfficerRoles, officers[officerIndex], fileState)) {
91
+ updatedCurrentStep = 'company_details';
92
+ }
97
93
  }
98
94
  }
99
95
  }
@@ -115,14 +111,6 @@ const updateOnboardingCustomerViewLocalStoreDataEpic = (actions$, state$) => act
115
111
  }
116
112
  if (reCalculateCurrentStep === true) {
117
113
  fetchActions.push((0, onboardingCustomerViewReducer_1.updateCurrentStep)({ step: updatedCurrentStep }));
118
- // Whenever the recalc lands the user on a different step, reset
119
- // the sub-step to the step's landing sub-state — otherwise a
120
- // stale subStep (e.g. 'default' carried over from another step)
121
- // leaves verification rendering an empty form.
122
- if (updatedCurrentStep !== onboardingCustomerViewState.currentStep) {
123
- const targetSubStep = updatedCurrentStep === 'verification' ? 'unlock-stack' : 'default';
124
- fetchActions.push((0, onboardingCustomerViewReducer_1.updateCurrentSubStep)({ subStep: targetSubStep }));
125
- }
126
114
  }
127
115
  }
128
116
  if (companyView != null) {
@@ -15,9 +15,6 @@ export interface OnboardingStatusPayload {
15
15
  is_user_landed_to_interim_page: boolean;
16
16
  should_complete_onboarding: boolean;
17
17
  }
18
- export interface AiFinanceTeamAcknowledgementPayload {
19
- is_onboarding_ai_finance_team_acknowledged: boolean;
20
- }
21
18
  interface CompaniesData {
22
19
  companies: CompanyPayload[];
23
20
  }
@@ -1,9 +1,8 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../responsePayload';
3
3
  import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
4
- import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
5
4
  import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
6
- import { AiAgentsActivationCounts, AiAgentsActivationPhase, OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep, OnboardingSubStep } from './onboardingCustomerViewState';
5
+ import { OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
7
6
  export declare const initialState: OnboardingCustomerViewState;
8
7
  export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, reCalculateCurrentStep?: any], {
9
8
  companyId: string;
@@ -17,17 +16,7 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
17
16
  companyId: string;
18
17
  checkOnboardingComplete: boolean;
19
18
  productSuitePage: boolean;
20
- }, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>, acknowledgeOnboardingAiFinanceTeam: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
21
- companyId: string;
22
- }, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeam", never, never>, acknowledgeOnboardingAiFinanceTeamSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamSuccess">, acknowledgeOnboardingAiFinanceTeamFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamFailure", never, never>, acknowledgeOnboardingAiActivationViewed: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
23
- companyId: string;
24
- }, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewed", never, never>, acknowledgeOnboardingAiActivationViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiActivationViewedSuccess">, acknowledgeOnboardingAiActivationViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewedFailure", never, never>, fetchAiAgentsActivationStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/fetchAiAgentsActivationStatus">, fetchAiAgentsActivationStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
25
- counts: AiAgentsActivationCounts;
26
- phases: AiAgentsActivationPhase[];
27
- }], {
28
- counts: AiAgentsActivationCounts;
29
- phases: AiAgentsActivationPhase[];
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], {
19
+ }, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
31
20
  companyId: string;
32
21
  }, "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_3" | "Officer_2" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined], {
33
22
  companyId: string;
@@ -76,46 +65,18 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
76
65
  linkTokenType: PlaidLinkTokenType;
77
66
  }, "onboardingCustomerView/getOnboardingPlaidLinkTokenFailure", never, never>, updateCurrentStep: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
78
67
  step: OnboardingStep;
79
- }, "onboardingCustomerView/updateCurrentStep">, updateCurrentSubStep: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
80
- subStep: OnboardingSubStep;
81
- }, "onboardingCustomerView/updateCurrentSubStep">, updateOnboardingCustomerViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], subscriptionPaymentAccountIds: string[]], {
68
+ }, "onboardingCustomerView/updateCurrentStep">, updateOnboardingCustomerViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], subscriptionPaymentAccountIds: string[]], {
82
69
  paymentAccountIds: string[];
83
70
  subscriptionPaymentAccountIds: string[];
84
71
  }, "onboardingCustomerView/updateOnboardingCustomerViewAccountDetails", never, never>, updateOnboardingCustomerViewLocalStoreData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
85
72
  companyId: ID;
86
73
  currentStep?: OnboardingStep;
87
74
  reCalculateCurrentStep?: boolean;
88
- }, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../spendManagement/commonSetup/setupViewState").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
75
+ }, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../..").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
89
76
  officerType: CompanyOfficerType;
90
77
  phone: string | number;
91
78
  }, "onboardingCustomerView/saveOnboardingCompnayOfficerPhoneInLocalStore">, updateOnboardingCustomerViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<OnboardingCustomerViewUIState>, "onboardingCustomerView/updateOnboardingCustomerViewUIState">, sendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/sendOnboardingOfficerOtp">, sendOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
92
79
  otpChallenge: string;
93
- }, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">, applyKycDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
94
- autoFilledFieldNames: string[];
95
- companyId: ID;
96
- fileId: ID;
97
- officerType: CompanyOfficerType;
98
- values: Partial<CompanyOfficerLocalData>;
99
- }], {
100
- autoFilledFieldNames: string[];
101
- companyId: ID;
102
- fileId: ID;
103
- officerType: CompanyOfficerType;
104
- values: Partial<CompanyOfficerLocalData>;
105
- }, "onboardingCustomerView/applyKycDocumentAutofillForOnboarding", never, never>, applyKybDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
106
- autoFilledFieldNames: string[];
107
- companyId: ID;
108
- fileId: ID;
109
- values: Partial<CompanyDetailsLocalData>;
110
- }], {
111
- autoFilledFieldNames: string[];
112
- companyId: ID;
113
- fileId: ID;
114
- values: Partial<CompanyDetailsLocalData>;
115
- }, "onboardingCustomerView/applyKybDocumentAutofillForOnboarding", never, never>, clearKycKybAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
116
- officerType?: CompanyOfficerType;
117
- } | undefined], {
118
- officerType?: CompanyOfficerType;
119
- }, "onboardingCustomerView/clearKycKybAutofillForOnboarding", never, never>;
80
+ }, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">;
120
81
  declare const _default: import("redux").Reducer<OnboardingCustomerViewState>;
121
82
  export default _default;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentSubStep = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.aiAgentsActivationPhaseChanged = exports.aiAgentsActivationCountsUpdated = exports.fetchAiAgentsActivationStatusFailure = exports.fetchAiAgentsActivationStatusSuccess = exports.fetchAiAgentsActivationStatus = exports.acknowledgeOnboardingAiActivationViewedFailure = exports.acknowledgeOnboardingAiActivationViewedSuccess = exports.acknowledgeOnboardingAiActivationViewed = exports.acknowledgeOnboardingAiFinanceTeamFailure = exports.acknowledgeOnboardingAiFinanceTeamSuccess = exports.acknowledgeOnboardingAiFinanceTeam = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
5
- exports.clearKycKybAutofillForOnboarding = exports.applyKybDocumentAutofillForOnboarding = exports.applyKycDocumentAutofillForOnboarding = exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.verifyOnboardingOfficerOtpFailure = void 0;
4
+ exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
6
5
  const toolkit_1 = require("@reduxjs/toolkit");
7
6
  const zeniDayJS_1 = require("../../../zeniDayJS");
8
- const kycKybAutofillActions_1 = require("../../spendManagement/commonSetup/kycKybAutofillActions");
9
- const onboardingCustomerViewState_1 = require("./onboardingCustomerViewState");
10
7
  const initialStatus = {
11
8
  fetchState: 'Not-Started',
12
9
  error: undefined,
@@ -15,33 +12,62 @@ exports.initialState = {
15
12
  updateStatus: initialStatus,
16
13
  saveStatus: initialStatus,
17
14
  dashboardLoadedStatus: initialStatus,
18
- currentStep: 'setup_billing',
19
- currentSubStep: 'default',
20
- parsingDocumentFileIds: [],
15
+ currentStep: 'link_payment_account',
21
16
  companyDetails: {
22
- autoFilledFields: [],
23
17
  localData: undefined,
24
18
  },
25
- companyOfficerUpdateStatus: (() => {
26
- const emptyOfficerSlot = {
27
- autoFilledFields: [],
19
+ companyOfficerUpdateStatus: {
20
+ Officer_1: {
28
21
  localData: undefined,
29
22
  sendOtpStatus: initialStatus,
30
23
  otpverificationStatus: initialStatus,
31
- };
32
- return {
33
- Officer_1: { ...emptyOfficerSlot },
34
- Officer_2: { ...emptyOfficerSlot },
35
- Officer_3: { ...emptyOfficerSlot },
36
- Officer_4: { ...emptyOfficerSlot },
37
- Officer_5: { ...emptyOfficerSlot },
38
- Officer_6: { ...emptyOfficerSlot },
39
- Officer_7: { ...emptyOfficerSlot },
40
- Officer_8: { ...emptyOfficerSlot },
41
- Officer_9: { ...emptyOfficerSlot },
42
- Officer_10: { ...emptyOfficerSlot },
43
- };
44
- })(),
24
+ },
25
+ Officer_2: {
26
+ localData: undefined,
27
+ sendOtpStatus: initialStatus,
28
+ otpverificationStatus: initialStatus,
29
+ },
30
+ Officer_3: {
31
+ localData: undefined,
32
+ sendOtpStatus: initialStatus,
33
+ otpverificationStatus: initialStatus,
34
+ },
35
+ Officer_4: {
36
+ localData: undefined,
37
+ sendOtpStatus: initialStatus,
38
+ otpverificationStatus: initialStatus,
39
+ },
40
+ Officer_5: {
41
+ localData: undefined,
42
+ sendOtpStatus: initialStatus,
43
+ otpverificationStatus: initialStatus,
44
+ },
45
+ Officer_6: {
46
+ localData: undefined,
47
+ sendOtpStatus: initialStatus,
48
+ otpverificationStatus: initialStatus,
49
+ },
50
+ Officer_7: {
51
+ localData: undefined,
52
+ sendOtpStatus: initialStatus,
53
+ otpverificationStatus: initialStatus,
54
+ },
55
+ Officer_8: {
56
+ localData: undefined,
57
+ sendOtpStatus: initialStatus,
58
+ otpverificationStatus: initialStatus,
59
+ },
60
+ Officer_9: {
61
+ localData: undefined,
62
+ sendOtpStatus: initialStatus,
63
+ otpverificationStatus: initialStatus,
64
+ },
65
+ Officer_10: {
66
+ localData: undefined,
67
+ sendOtpStatus: initialStatus,
68
+ otpverificationStatus: initialStatus,
69
+ },
70
+ },
45
71
  primaryContactDetails: {},
46
72
  paymentAccountDetails: {
47
73
  fetchStatus: initialStatus,
@@ -69,7 +95,6 @@ exports.initialState = {
69
95
  },
70
96
  fetchState: 'Not-Started',
71
97
  error: undefined,
72
- aiAgentsActivation: { ...onboardingCustomerViewState_1.emptyAiAgentsActivationSubview },
73
98
  uiState: {
74
99
  isQBOPopupOpen: false,
75
100
  isCardPaymentPopupOpen: false,
@@ -122,9 +147,6 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
122
147
  updateCurrentStep(draft, action) {
123
148
  draft.currentStep = action.payload.step;
124
149
  },
125
- updateCurrentSubStep(draft, action) {
126
- draft.currentSubStep = action.payload.subStep;
127
- },
128
150
  updateOnboardingCustomerViewAccountDetails: {
129
151
  prepare(paymentAccountIds, subscriptionPaymentAccountIds) {
130
152
  return { payload: { paymentAccountIds, subscriptionPaymentAccountIds } };
@@ -162,126 +184,6 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
162
184
  };
163
185
  },
164
186
  },
165
- acknowledgeOnboardingAiFinanceTeam: {
166
- reducer(draft) {
167
- draft.aiFinanceTeamAcknowledgementStatus = {
168
- fetchState: 'In-Progress',
169
- error: undefined,
170
- };
171
- },
172
- prepare(companyId) {
173
- return {
174
- payload: { companyId },
175
- };
176
- },
177
- },
178
- acknowledgeOnboardingAiFinanceTeamSuccess(draft) {
179
- draft.aiFinanceTeamAcknowledgementStatus = {
180
- fetchState: 'Completed',
181
- error: undefined,
182
- };
183
- },
184
- acknowledgeOnboardingAiFinanceTeamFailure: {
185
- reducer(draft, action) {
186
- draft.aiFinanceTeamAcknowledgementStatus = {
187
- fetchState: 'Error',
188
- error: action.payload,
189
- };
190
- },
191
- prepare(error) {
192
- return {
193
- payload: error,
194
- };
195
- },
196
- },
197
- acknowledgeOnboardingAiActivationViewed: {
198
- reducer(draft) {
199
- draft.aiActivationViewedAcknowledgementStatus = {
200
- fetchState: 'In-Progress',
201
- error: undefined,
202
- };
203
- },
204
- prepare(companyId) {
205
- return {
206
- payload: { companyId },
207
- };
208
- },
209
- },
210
- acknowledgeOnboardingAiActivationViewedSuccess(draft) {
211
- draft.aiActivationViewedAcknowledgementStatus = {
212
- fetchState: 'Completed',
213
- error: undefined,
214
- };
215
- },
216
- acknowledgeOnboardingAiActivationViewedFailure: {
217
- reducer(draft, action) {
218
- draft.aiActivationViewedAcknowledgementStatus = {
219
- fetchState: 'Error',
220
- error: action.payload,
221
- };
222
- },
223
- prepare(error) {
224
- return {
225
- payload: error,
226
- };
227
- },
228
- },
229
- fetchAiAgentsActivationStatus(draft) {
230
- draft.aiAgentsActivation.fetchStatus = {
231
- fetchState: 'In-Progress',
232
- error: undefined,
233
- };
234
- },
235
- fetchAiAgentsActivationStatusSuccess: {
236
- reducer(draft, action) {
237
- draft.aiAgentsActivation.fetchStatus = {
238
- fetchState: 'Completed',
239
- error: undefined,
240
- };
241
- draft.aiAgentsActivation.phases = action.payload.phases;
242
- draft.aiAgentsActivation.counts = action.payload.counts;
243
- },
244
- prepare(payload) {
245
- return { payload };
246
- },
247
- },
248
- fetchAiAgentsActivationStatusFailure: {
249
- reducer(draft, action) {
250
- draft.aiAgentsActivation.fetchStatus = {
251
- fetchState: 'Error',
252
- error: action.payload,
253
- };
254
- },
255
- prepare(error) {
256
- return { payload: error };
257
- },
258
- },
259
- aiAgentsActivationCountsUpdated: {
260
- reducer(draft, action) {
261
- draft.aiAgentsActivation.counts = {
262
- ...draft.aiAgentsActivation.counts,
263
- ...action.payload,
264
- };
265
- },
266
- prepare(payload) {
267
- return { payload };
268
- },
269
- },
270
- aiAgentsActivationPhaseChanged: {
271
- reducer(draft, action) {
272
- const target = draft.aiAgentsActivation.phases;
273
- const index = target.findIndex((phase) => phase.key === action.payload.key);
274
- if (index === -1) {
275
- target.push(action.payload);
276
- }
277
- else {
278
- target[index] = { ...target[index], ...action.payload };
279
- }
280
- },
281
- prepare(payload) {
282
- return { payload };
283
- },
284
- },
285
187
  updateOnboardingCustomerViewDashboardLoaded: {
286
188
  reducer(draft) {
287
189
  draft.dashboardLoadedStatus = {
@@ -694,82 +596,7 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
694
596
  clearOnboardingCustomerView(draft) {
695
597
  Object.assign(draft, exports.initialState);
696
598
  },
697
- /** Merge AI-parsed officer fields into the officer's onboarding localData. */
698
- applyKycDocumentAutofillForOnboarding: {
699
- reducer(draft, action) {
700
- const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
701
- const slot = draft.companyOfficerUpdateStatus[officerType];
702
- slot.localData = Object.assign({}, slot.localData, values);
703
- slot.autoFilledFields = Array.from(new Set([...(slot.autoFilledFields ?? []), ...autoFilledFieldNames]));
704
- draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
705
- },
706
- prepare(payload) {
707
- return { payload };
708
- },
709
- },
710
- /** Merge AI-parsed company fields into companyDetails onboarding localData. */
711
- applyKybDocumentAutofillForOnboarding: {
712
- reducer(draft, action) {
713
- const { values, autoFilledFieldNames, fileId } = action.payload;
714
- draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
715
- const prev = draft.companyDetails.autoFilledFields ?? [];
716
- draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
717
- draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
718
- },
719
- prepare(payload) {
720
- return { payload };
721
- },
722
- },
723
- /** Wipe AI-autofill badges during onboarding. */
724
- clearKycKybAutofillForOnboarding: {
725
- reducer(draft, action) {
726
- const { officerType } = action.payload;
727
- if (officerType != null) {
728
- draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
729
- }
730
- else {
731
- draft.companyDetails.autoFilledFields = [];
732
- Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
733
- draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
734
- });
735
- }
736
- },
737
- prepare(payload = {}) {
738
- return { payload };
739
- },
740
- },
741
- },
742
- extraReducers: (builder) => {
743
- const addParsingFileId = (draft, fileId) => {
744
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds ?? [];
745
- if (!draft.parsingDocumentFileIds.includes(fileId)) {
746
- draft.parsingDocumentFileIds.push(fileId);
747
- }
748
- };
749
- const removeParsingFileId = (draft, fileId) => {
750
- draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
751
- };
752
- builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocument, (draft, action) => {
753
- if (action.payload.target === 'onboarding') {
754
- addParsingFileId(draft, action.payload.fileId);
755
- }
756
- });
757
- builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocument, (draft, action) => {
758
- if (action.payload.target === 'onboarding') {
759
- addParsingFileId(draft, action.payload.fileId);
760
- }
761
- });
762
- builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocumentFailure, (draft, action) => {
763
- if (action.payload.target === 'onboarding') {
764
- removeParsingFileId(draft, action.payload.fileId);
765
- }
766
- });
767
- builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocumentFailure, (draft, action) => {
768
- if (action.payload.target === 'onboarding') {
769
- removeParsingFileId(draft, action.payload.fileId);
770
- }
771
- });
772
599
  },
773
600
  });
774
- _a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.acknowledgeOnboardingAiFinanceTeam = _a.acknowledgeOnboardingAiFinanceTeam, exports.acknowledgeOnboardingAiFinanceTeamSuccess = _a.acknowledgeOnboardingAiFinanceTeamSuccess, exports.acknowledgeOnboardingAiFinanceTeamFailure = _a.acknowledgeOnboardingAiFinanceTeamFailure, exports.acknowledgeOnboardingAiActivationViewed = _a.acknowledgeOnboardingAiActivationViewed, exports.acknowledgeOnboardingAiActivationViewedSuccess = _a.acknowledgeOnboardingAiActivationViewedSuccess, exports.acknowledgeOnboardingAiActivationViewedFailure = _a.acknowledgeOnboardingAiActivationViewedFailure, exports.fetchAiAgentsActivationStatus = _a.fetchAiAgentsActivationStatus, exports.fetchAiAgentsActivationStatusSuccess = _a.fetchAiAgentsActivationStatusSuccess, exports.fetchAiAgentsActivationStatusFailure = _a.fetchAiAgentsActivationStatusFailure, exports.aiAgentsActivationCountsUpdated = _a.aiAgentsActivationCountsUpdated, exports.aiAgentsActivationPhaseChanged = _a.aiAgentsActivationPhaseChanged, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateCurrentSubStep = _a.updateCurrentSubStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView, exports.applyKycDocumentAutofillForOnboarding = _a.applyKycDocumentAutofillForOnboarding, exports.applyKybDocumentAutofillForOnboarding = _a.applyKybDocumentAutofillForOnboarding, exports.clearKycKybAutofillForOnboarding = _a.clearKycKybAutofillForOnboarding;
601
+ _a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView;
775
602
  exports.default = onboardingCustomerView.reducer;