@zeniai/client-epic-state 5.0.88-beta0ND → 5.0.88-betaAR2

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 (78) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +0 -1
  3. package/lib/entity/company/companyPayload.d.ts +0 -4
  4. package/lib/entity/company/companyPayload.js +0 -4
  5. package/lib/entity/company/companyStateTypes.d.ts +0 -4
  6. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
  7. package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -4
  8. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  9. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  10. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  11. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  12. package/lib/entity/tenant/tenantPayload.d.ts +0 -1
  13. package/lib/entity/tenant/tenantReducer.d.ts +25 -38
  14. package/lib/entity/tenant/tenantReducer.js +5 -65
  15. package/lib/entity/tenant/tenantState.d.ts +0 -1
  16. package/lib/epic.d.ts +3 -8
  17. package/lib/epic.js +3 -9
  18. package/lib/esm/commonStateTypes/animations.js +0 -1
  19. package/lib/esm/entity/company/companyPayload.js +0 -4
  20. package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -3
  21. package/lib/esm/entity/tenant/tenantReducer.js +3 -63
  22. package/lib/esm/epic.js +3 -9
  23. package/lib/esm/index.js +6 -9
  24. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
  25. package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
  26. package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
  27. package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
  28. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +50 -217
  29. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -7
  30. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +0 -12
  31. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -105
  32. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
  33. package/lib/index.d.ts +7 -11
  34. package/lib/index.js +31 -51
  35. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
  36. package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
  37. package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
  38. package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
  39. package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
  40. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +4 -41
  41. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -219
  42. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -5
  43. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +2 -11
  44. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -40
  45. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +1 -13
  46. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
  47. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -106
  48. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
  49. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
  50. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
  51. package/package.json +1 -1
  52. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
  53. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -54
  54. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -50
  55. package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -42
  56. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
  57. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
  58. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -52
  59. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -59
  60. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
  61. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -205
  62. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -28
  63. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
  64. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -46
  65. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
  66. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
  67. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
  68. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
  69. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
  70. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -56
  71. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -30
  72. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -63
  73. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -33
  74. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
  75. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -24
  76. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -213
  77. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -125
  78. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -32
@@ -1,7 +1,5 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { date } from '../../../zeniDayJS';
3
- import { parseUploadedKybDocument, parseUploadedKybDocumentFailure, parseUploadedKycDocument, parseUploadedKycDocumentFailure, } from '../../spendManagement/commonSetup/kycKybAutofillActions';
4
- import { emptyAiAgentsActivationSubview, } from './onboardingCustomerViewState';
5
3
  const initialStatus = {
6
4
  fetchState: 'Not-Started',
7
5
  error: undefined,
@@ -11,31 +9,61 @@ export const initialState = {
11
9
  saveStatus: initialStatus,
12
10
  dashboardLoadedStatus: initialStatus,
13
11
  currentStep: 'link_payment_account',
14
- parsingDocumentFileIds: [],
15
12
  companyDetails: {
16
- autoFilledFields: [],
17
13
  localData: undefined,
18
14
  },
19
- companyOfficerUpdateStatus: (() => {
20
- const emptyOfficerSlot = {
21
- autoFilledFields: [],
15
+ companyOfficerUpdateStatus: {
16
+ Officer_1: {
22
17
  localData: undefined,
23
18
  sendOtpStatus: initialStatus,
24
19
  otpverificationStatus: initialStatus,
25
- };
26
- return {
27
- Officer_1: { ...emptyOfficerSlot },
28
- Officer_2: { ...emptyOfficerSlot },
29
- Officer_3: { ...emptyOfficerSlot },
30
- Officer_4: { ...emptyOfficerSlot },
31
- Officer_5: { ...emptyOfficerSlot },
32
- Officer_6: { ...emptyOfficerSlot },
33
- Officer_7: { ...emptyOfficerSlot },
34
- Officer_8: { ...emptyOfficerSlot },
35
- Officer_9: { ...emptyOfficerSlot },
36
- Officer_10: { ...emptyOfficerSlot },
37
- };
38
- })(),
20
+ },
21
+ Officer_2: {
22
+ localData: undefined,
23
+ sendOtpStatus: initialStatus,
24
+ otpverificationStatus: initialStatus,
25
+ },
26
+ Officer_3: {
27
+ localData: undefined,
28
+ sendOtpStatus: initialStatus,
29
+ otpverificationStatus: initialStatus,
30
+ },
31
+ Officer_4: {
32
+ localData: undefined,
33
+ sendOtpStatus: initialStatus,
34
+ otpverificationStatus: initialStatus,
35
+ },
36
+ Officer_5: {
37
+ localData: undefined,
38
+ sendOtpStatus: initialStatus,
39
+ otpverificationStatus: initialStatus,
40
+ },
41
+ Officer_6: {
42
+ localData: undefined,
43
+ sendOtpStatus: initialStatus,
44
+ otpverificationStatus: initialStatus,
45
+ },
46
+ Officer_7: {
47
+ localData: undefined,
48
+ sendOtpStatus: initialStatus,
49
+ otpverificationStatus: initialStatus,
50
+ },
51
+ Officer_8: {
52
+ localData: undefined,
53
+ sendOtpStatus: initialStatus,
54
+ otpverificationStatus: initialStatus,
55
+ },
56
+ Officer_9: {
57
+ localData: undefined,
58
+ sendOtpStatus: initialStatus,
59
+ otpverificationStatus: initialStatus,
60
+ },
61
+ Officer_10: {
62
+ localData: undefined,
63
+ sendOtpStatus: initialStatus,
64
+ otpverificationStatus: initialStatus,
65
+ },
66
+ },
39
67
  primaryContactDetails: {},
40
68
  paymentAccountDetails: {
41
69
  fetchStatus: initialStatus,
@@ -63,7 +91,6 @@ export const initialState = {
63
91
  },
64
92
  fetchState: 'Not-Started',
65
93
  error: undefined,
66
- aiAgentsActivation: { ...emptyAiAgentsActivationSubview },
67
94
  uiState: {
68
95
  isQBOPopupOpen: false,
69
96
  isCardPaymentPopupOpen: false,
@@ -153,126 +180,6 @@ const onboardingCustomerView = createSlice({
153
180
  };
154
181
  },
155
182
  },
156
- acknowledgeOnboardingAiFinanceTeam: {
157
- reducer(draft) {
158
- draft.aiFinanceTeamAcknowledgementStatus = {
159
- fetchState: 'In-Progress',
160
- error: undefined,
161
- };
162
- },
163
- prepare(companyId) {
164
- return {
165
- payload: { companyId },
166
- };
167
- },
168
- },
169
- acknowledgeOnboardingAiFinanceTeamSuccess(draft) {
170
- draft.aiFinanceTeamAcknowledgementStatus = {
171
- fetchState: 'Completed',
172
- error: undefined,
173
- };
174
- },
175
- acknowledgeOnboardingAiFinanceTeamFailure: {
176
- reducer(draft, action) {
177
- draft.aiFinanceTeamAcknowledgementStatus = {
178
- fetchState: 'Error',
179
- error: action.payload,
180
- };
181
- },
182
- prepare(error) {
183
- return {
184
- payload: error,
185
- };
186
- },
187
- },
188
- acknowledgeOnboardingAiActivationViewed: {
189
- reducer(draft) {
190
- draft.aiActivationViewedAcknowledgementStatus = {
191
- fetchState: 'In-Progress',
192
- error: undefined,
193
- };
194
- },
195
- prepare(companyId) {
196
- return {
197
- payload: { companyId },
198
- };
199
- },
200
- },
201
- acknowledgeOnboardingAiActivationViewedSuccess(draft) {
202
- draft.aiActivationViewedAcknowledgementStatus = {
203
- fetchState: 'Completed',
204
- error: undefined,
205
- };
206
- },
207
- acknowledgeOnboardingAiActivationViewedFailure: {
208
- reducer(draft, action) {
209
- draft.aiActivationViewedAcknowledgementStatus = {
210
- fetchState: 'Error',
211
- error: action.payload,
212
- };
213
- },
214
- prepare(error) {
215
- return {
216
- payload: error,
217
- };
218
- },
219
- },
220
- fetchAiAgentsActivationStatus(draft) {
221
- draft.aiAgentsActivation.fetchStatus = {
222
- fetchState: 'In-Progress',
223
- error: undefined,
224
- };
225
- },
226
- fetchAiAgentsActivationStatusSuccess: {
227
- reducer(draft, action) {
228
- draft.aiAgentsActivation.fetchStatus = {
229
- fetchState: 'Completed',
230
- error: undefined,
231
- };
232
- draft.aiAgentsActivation.phases = action.payload.phases;
233
- draft.aiAgentsActivation.counts = action.payload.counts;
234
- },
235
- prepare(payload) {
236
- return { payload };
237
- },
238
- },
239
- fetchAiAgentsActivationStatusFailure: {
240
- reducer(draft, action) {
241
- draft.aiAgentsActivation.fetchStatus = {
242
- fetchState: 'Error',
243
- error: action.payload,
244
- };
245
- },
246
- prepare(error) {
247
- return { payload: error };
248
- },
249
- },
250
- aiAgentsActivationCountsUpdated: {
251
- reducer(draft, action) {
252
- draft.aiAgentsActivation.counts = {
253
- ...draft.aiAgentsActivation.counts,
254
- ...action.payload,
255
- };
256
- },
257
- prepare(payload) {
258
- return { payload };
259
- },
260
- },
261
- aiAgentsActivationPhaseChanged: {
262
- reducer(draft, action) {
263
- const target = draft.aiAgentsActivation.phases;
264
- const index = target.findIndex((phase) => phase.key === action.payload.key);
265
- if (index === -1) {
266
- target.push(action.payload);
267
- }
268
- else {
269
- target[index] = { ...target[index], ...action.payload };
270
- }
271
- },
272
- prepare(payload) {
273
- return { payload };
274
- },
275
- },
276
183
  updateOnboardingCustomerViewDashboardLoaded: {
277
184
  reducer(draft) {
278
185
  draft.dashboardLoadedStatus = {
@@ -685,81 +592,7 @@ const onboardingCustomerView = createSlice({
685
592
  clearOnboardingCustomerView(draft) {
686
593
  Object.assign(draft, initialState);
687
594
  },
688
- /** Merge AI-parsed officer fields into the officer's onboarding localData. */
689
- applyKycDocumentAutofillForOnboarding: {
690
- reducer(draft, action) {
691
- const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
692
- const slot = draft.companyOfficerUpdateStatus[officerType];
693
- slot.localData = Object.assign({}, slot.localData, values);
694
- slot.autoFilledFields = Array.from(new Set([...slot.autoFilledFields, ...autoFilledFieldNames]));
695
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
696
- },
697
- prepare(payload) {
698
- return { payload };
699
- },
700
- },
701
- /** Merge AI-parsed company fields into companyDetails onboarding localData. */
702
- applyKybDocumentAutofillForOnboarding: {
703
- reducer(draft, action) {
704
- const { values, autoFilledFieldNames, fileId } = action.payload;
705
- draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
706
- const prev = draft.companyDetails.autoFilledFields ?? [];
707
- draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
708
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
709
- },
710
- prepare(payload) {
711
- return { payload };
712
- },
713
- },
714
- /** Wipe AI-autofill badges during onboarding. */
715
- clearKycKybAutofillForOnboarding: {
716
- reducer(draft, action) {
717
- const { officerType } = action.payload;
718
- if (officerType != null) {
719
- draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
720
- }
721
- else {
722
- draft.companyDetails.autoFilledFields = [];
723
- Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
724
- draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
725
- });
726
- }
727
- },
728
- prepare(payload = {}) {
729
- return { payload };
730
- },
731
- },
732
- },
733
- extraReducers: (builder) => {
734
- const addParsingFileId = (draft, fileId) => {
735
- if (!draft.parsingDocumentFileIds.includes(fileId)) {
736
- draft.parsingDocumentFileIds.push(fileId);
737
- }
738
- };
739
- const removeParsingFileId = (draft, fileId) => {
740
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
741
- };
742
- builder.addCase(parseUploadedKycDocument, (draft, action) => {
743
- if (action.payload.target === 'onboarding') {
744
- addParsingFileId(draft, action.payload.fileId);
745
- }
746
- });
747
- builder.addCase(parseUploadedKybDocument, (draft, action) => {
748
- if (action.payload.target === 'onboarding') {
749
- addParsingFileId(draft, action.payload.fileId);
750
- }
751
- });
752
- builder.addCase(parseUploadedKycDocumentFailure, (draft, action) => {
753
- if (action.payload.target === 'onboarding') {
754
- removeParsingFileId(draft, action.payload.fileId);
755
- }
756
- });
757
- builder.addCase(parseUploadedKybDocumentFailure, (draft, action) => {
758
- if (action.payload.target === 'onboarding') {
759
- removeParsingFileId(draft, action.payload.fileId);
760
- }
761
- });
762
595
  },
763
596
  });
764
- export const { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerSetupViewSuccess, fetchOnboardingCustomerSetupViewFailure, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewCompleteStatusSuccess, updateOnboardingCustomerViewCompleteStatusFailure, acknowledgeOnboardingAiFinanceTeam, acknowledgeOnboardingAiFinanceTeamSuccess, acknowledgeOnboardingAiFinanceTeamFailure, acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiActivationViewedSuccess, acknowledgeOnboardingAiActivationViewedFailure, fetchAiAgentsActivationStatus, fetchAiAgentsActivationStatusSuccess, fetchAiAgentsActivationStatusFailure, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewDashboardLoadedSuccess, updateOnboardingCustomerViewDashboardLoadedFailure, updateOnboardingCustomerView, updateOnboardingCustomerViewSuccess, updateOnboardingCustomerViewFailure, updateOnboardingPaymentAccountStatus, updateOnboardingPaymentAccountStatusSuccess, updateOnboardingPaymentAccountStatusFailure, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountLoginStatusSuccess, updateOnboardingPaymentAccountLoginStatusFailure, establishOnboardingPlaidConnection, establishOnboardingPlaidConnectionSuccess, establishOnboardingPlaidConnectionFailure, getOnboardingPlaidLinkToken, getOnboardingPlaidLinkTokenSuccess, getOnboardingPlaidLinkTokenFailure, updateCurrentStep, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewLocalStoreData, saveOnboardingCustomerViewDataInLocalStore, saveOnboardingCompnayOfficerPhoneInLocalStore, updateOnboardingCustomerViewUIState, sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure, resendOnboardingOfficerOtp, verifyOnboardingOfficerOtp, verifyOnboardingOfficerOtpSuccess, verifyOnboardingOfficerOtpFailure, clearOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, } = onboardingCustomerView.actions;
597
+ export const { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerSetupViewSuccess, fetchOnboardingCustomerSetupViewFailure, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewCompleteStatusSuccess, updateOnboardingCustomerViewCompleteStatusFailure, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewDashboardLoadedSuccess, updateOnboardingCustomerViewDashboardLoadedFailure, updateOnboardingCustomerView, updateOnboardingCustomerViewSuccess, updateOnboardingCustomerViewFailure, updateOnboardingPaymentAccountStatus, updateOnboardingPaymentAccountStatusSuccess, updateOnboardingPaymentAccountStatusFailure, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountLoginStatusSuccess, updateOnboardingPaymentAccountLoginStatusFailure, establishOnboardingPlaidConnection, establishOnboardingPlaidConnectionSuccess, establishOnboardingPlaidConnectionFailure, getOnboardingPlaidLinkToken, getOnboardingPlaidLinkTokenSuccess, getOnboardingPlaidLinkTokenFailure, updateCurrentStep, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewLocalStoreData, saveOnboardingCustomerViewDataInLocalStore, saveOnboardingCompnayOfficerPhoneInLocalStore, updateOnboardingCustomerViewUIState, sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure, resendOnboardingOfficerOtp, verifyOnboardingOfficerOtp, verifyOnboardingOfficerOtpSuccess, verifyOnboardingOfficerOtpFailure, clearOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, } = onboardingCustomerView.actions;
765
598
  export default onboardingCustomerView.reducer;
@@ -11,7 +11,7 @@ import { getCompanyAndIdentityDetails, } from '../../spendManagement/commonSetup
11
11
  import { ALL_ONBOARDING_STEPS, ALL_ZENI_USER_ONBOARDING_STEPS, REQUIRED_ONBOARDING_STEPS, ZENI_USER_REQUIRED_ONBOARDING_STEPS, toOnboardingStepType, } from './onboardingCustomerViewState';
12
12
  export function getOnboardingCustomerView(state, companyId) {
13
13
  const { fileState, paymentAccountState, onboardingCustomerViewState, userState, userRoleState, subscriptionPaymentAccountState, companyConfigState, cardPaymentViewState, countryListState, addressViewState, } = state;
14
- const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails, parsingDocumentFileIds, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
14
+ const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
15
15
  const { paymentAccountIds } = paymentAccountDetails;
16
16
  let subscriptionPaymentAccount;
17
17
  let paymentAccount;
@@ -54,7 +54,6 @@ export function getOnboardingCustomerView(state, companyId) {
54
54
  companyDetails,
55
55
  companyOfficerUpdateStatus,
56
56
  primaryContactDetails,
57
- parsingDocumentFileIds,
58
57
  });
59
58
  const companyAddress = addressViewState.newAddressState?.company_address;
60
59
  if (companyAddress == null &&
@@ -120,7 +119,6 @@ export function getOnboardingCustomerView(state, companyId) {
120
119
  return {
121
120
  companyDetailsLocalData,
122
121
  companyOfficerLocalData,
123
- parsingDocumentFileIds,
124
122
  subscriptionBillingAddress: subscriptionBillingAddress?.addressToCreate,
125
123
  companyView,
126
124
  allNationalityCountries,
@@ -325,7 +323,3 @@ export const getProductSettingsString = (productSettings) => {
325
323
  .map((key) => productKeyMap[key])
326
324
  .join(',');
327
325
  };
328
- const fromActivationView = (state) => state.onboardingCustomerViewState.aiAgentsActivation;
329
- export const getAiAgentsActivationSubview = (state) => fromActivationView(state);
330
- export const getAiAgentsActivationPhases = (state) => fromActivationView(state).phases;
331
- export const getAiAgentsActivationCounts = (state) => fromActivationView(state).counts;
@@ -26,15 +26,3 @@ export const ALL_ONBOARDING_STEPS = [
26
26
  ...ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT,
27
27
  ];
28
28
  export const toOnboardingStepType = (v) => stringToUnion(v, ALL_ONBOARDING_STEPS);
29
- export const emptyAiAgentsActivationCounts = {
30
- customerCount: 0,
31
- glAccountCount: 0,
32
- targetTransactionCount: 0,
33
- transactionCount: 0,
34
- vendorCount: 0,
35
- };
36
- export const emptyAiAgentsActivationSubview = {
37
- counts: emptyAiAgentsActivationCounts,
38
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
39
- phases: [],
40
- };
@@ -1,30 +1,62 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
- import { parseUploadedKybDocument, parseUploadedKybDocumentFailure, parseUploadedKycDocument, parseUploadedKycDocumentFailure, } from './kycKybAutofillActions';
3
2
  const initialFetchStatus = {
4
3
  fetchState: 'Not-Started',
5
4
  error: undefined,
6
5
  };
7
- const emptyOfficerSlot = {
8
- autoFilledFields: [],
9
- localData: undefined,
10
- sendOtpStatus: initialFetchStatus,
11
- otpverificationStatus: initialFetchStatus,
12
- };
13
6
  export const initialState = {
14
7
  updateStatus: { fetchState: 'Not-Started', error: undefined },
15
- parsingDocumentFileIds: [],
16
- companyDetails: { autoFilledFields: [] },
8
+ companyDetails: {},
17
9
  companyOfficerUpdateStatus: {
18
- Officer_1: { ...emptyOfficerSlot },
19
- Officer_2: { ...emptyOfficerSlot },
20
- Officer_3: { ...emptyOfficerSlot },
21
- Officer_4: { ...emptyOfficerSlot },
22
- Officer_5: { ...emptyOfficerSlot },
23
- Officer_6: { ...emptyOfficerSlot },
24
- Officer_7: { ...emptyOfficerSlot },
25
- Officer_8: { ...emptyOfficerSlot },
26
- Officer_9: { ...emptyOfficerSlot },
27
- Officer_10: { ...emptyOfficerSlot },
10
+ Officer_1: {
11
+ localData: undefined,
12
+ sendOtpStatus: initialFetchStatus,
13
+ otpverificationStatus: initialFetchStatus,
14
+ },
15
+ Officer_2: {
16
+ localData: undefined,
17
+ sendOtpStatus: initialFetchStatus,
18
+ otpverificationStatus: initialFetchStatus,
19
+ },
20
+ Officer_3: {
21
+ localData: undefined,
22
+ sendOtpStatus: initialFetchStatus,
23
+ otpverificationStatus: initialFetchStatus,
24
+ },
25
+ Officer_4: {
26
+ localData: undefined,
27
+ sendOtpStatus: initialFetchStatus,
28
+ otpverificationStatus: initialFetchStatus,
29
+ },
30
+ Officer_5: {
31
+ localData: undefined,
32
+ sendOtpStatus: initialFetchStatus,
33
+ otpverificationStatus: initialFetchStatus,
34
+ },
35
+ Officer_6: {
36
+ localData: undefined,
37
+ sendOtpStatus: initialFetchStatus,
38
+ otpverificationStatus: initialFetchStatus,
39
+ },
40
+ Officer_7: {
41
+ localData: undefined,
42
+ sendOtpStatus: initialFetchStatus,
43
+ otpverificationStatus: initialFetchStatus,
44
+ },
45
+ Officer_8: {
46
+ localData: undefined,
47
+ sendOtpStatus: initialFetchStatus,
48
+ otpverificationStatus: initialFetchStatus,
49
+ },
50
+ Officer_9: {
51
+ localData: undefined,
52
+ sendOtpStatus: initialFetchStatus,
53
+ otpverificationStatus: initialFetchStatus,
54
+ },
55
+ Officer_10: {
56
+ localData: undefined,
57
+ sendOtpStatus: initialFetchStatus,
58
+ otpverificationStatus: initialFetchStatus,
59
+ },
28
60
  },
29
61
  primaryContactDetails: {},
30
62
  };
@@ -265,92 +297,7 @@ const setupView = createSlice({
265
297
  clearSetupView(draft) {
266
298
  Object.assign(draft, initialState);
267
299
  },
268
- /**
269
- * Merge AI-parsed officer fields into the selected officer's localData and
270
- * track which field names were autofilled so the form can show the ✦ badge.
271
- */
272
- applyKycDocumentAutofillForSetup: {
273
- reducer(draft, action) {
274
- const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
275
- const slot = draft.companyOfficerUpdateStatus[officerType];
276
- slot.localData = Object.assign({}, slot.localData, values);
277
- slot.autoFilledFields = Array.from(new Set([...slot.autoFilledFields, ...autoFilledFieldNames]));
278
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
279
- },
280
- prepare(payload) {
281
- return { payload };
282
- },
283
- },
284
- /**
285
- * Merge AI-parsed company fields into companyDetails.localData and track
286
- * which field names were autofilled.
287
- */
288
- applyKybDocumentAutofillForSetup: {
289
- reducer(draft, action) {
290
- const { values, autoFilledFieldNames, fileId } = action.payload;
291
- draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
292
- draft.companyDetails.autoFilledFields = Array.from(new Set([
293
- ...draft.companyDetails.autoFilledFields,
294
- ...autoFilledFieldNames,
295
- ]));
296
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
297
- },
298
- prepare(payload) {
299
- return { payload };
300
- },
301
- },
302
- /**
303
- * Wipe AI-autofill badges. If `officerType` is provided, clears only that
304
- * officer; otherwise clears company details too.
305
- */
306
- clearKycKybAutofillForSetup: {
307
- reducer(draft, action) {
308
- const { officerType } = action.payload;
309
- if (officerType != null) {
310
- draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
311
- }
312
- else {
313
- draft.companyDetails.autoFilledFields = [];
314
- Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
315
- draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
316
- });
317
- }
318
- },
319
- prepare(payload = {}) {
320
- return { payload };
321
- },
322
- },
323
- },
324
- extraReducers: (builder) => {
325
- const addParsingFileId = (draft, fileId) => {
326
- if (!draft.parsingDocumentFileIds.includes(fileId)) {
327
- draft.parsingDocumentFileIds.push(fileId);
328
- }
329
- };
330
- const removeParsingFileId = (draft, fileId) => {
331
- draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
332
- };
333
- builder.addCase(parseUploadedKycDocument, (draft, action) => {
334
- if (action.payload.target === 'setup') {
335
- addParsingFileId(draft, action.payload.fileId);
336
- }
337
- });
338
- builder.addCase(parseUploadedKybDocument, (draft, action) => {
339
- if (action.payload.target === 'setup') {
340
- addParsingFileId(draft, action.payload.fileId);
341
- }
342
- });
343
- builder.addCase(parseUploadedKycDocumentFailure, (draft, action) => {
344
- if (action.payload.target === 'setup') {
345
- removeParsingFileId(draft, action.payload.fileId);
346
- }
347
- });
348
- builder.addCase(parseUploadedKybDocumentFailure, (draft, action) => {
349
- if (action.payload.target === 'setup') {
350
- removeParsingFileId(draft, action.payload.fileId);
351
- }
352
- });
353
300
  },
354
301
  });
355
- export const { enableSetup, enableSetupSuccess, enableSetupFailure, updateBusinessVerificationDetails, updateBusinessVerificationDetailsSuccess, updateBusinessVerificationDetailsFailure, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, sendOtp: sendOtpSpendManagementSetUp, resendOtp: resendOtpSpendManagementSetUp, sendOtpSuccess: sendOtpSuccessSpendManagementSetUp, sendOtpFailure: sendOtpFailureSpendManagementSetUp, verifyOtp: verifyOtpSpendManagementSetUp, verifyOtpSuccess: verifyOtpSuccessSpendManagementSetUp, verifyOtpFailure: verifyOtpFailureSpendManagementSetUp, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearSetupView, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, } = setupView.actions;
302
+ export const { enableSetup, enableSetupSuccess, enableSetupFailure, updateBusinessVerificationDetails, updateBusinessVerificationDetailsSuccess, updateBusinessVerificationDetailsFailure, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, sendOtp: sendOtpSpendManagementSetUp, resendOtp: resendOtpSpendManagementSetUp, sendOtpSuccess: sendOtpSuccessSpendManagementSetUp, sendOtpFailure: sendOtpFailureSpendManagementSetUp, verifyOtp: verifyOtpSpendManagementSetUp, verifyOtpSuccess: verifyOtpSuccessSpendManagementSetUp, verifyOtpFailure: verifyOtpFailureSpendManagementSetUp, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearSetupView, } = setupView.actions;
356
303
  export default setupView.reducer;
@@ -87,17 +87,15 @@ export function getBusinessVerificationDetails(state, companyId) {
87
87
  const { setupViewState, countryListState } = state;
88
88
  const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
89
89
  const companyView = getCompanyView(state, companyId, []);
90
- const { companyDetailsLocalData, companyOfficerLocalData, parsingDocumentFileIds } = getCompanyAndIdentityDetails(state, companyId, {
90
+ const { companyDetailsLocalData, companyOfficerLocalData } = getCompanyAndIdentityDetails(state, companyId, {
91
91
  companyDetails,
92
92
  companyOfficerUpdateStatus,
93
93
  primaryContactDetails,
94
- parsingDocumentFileIds: setupViewState.parsingDocumentFileIds,
95
94
  });
96
95
  const allNationalityCountries = countryListState.byCountryListCode.nationalityCountryList.countries;
97
96
  return {
98
97
  companyDetailsLocalData,
99
98
  companyOfficerLocalData,
100
- parsingDocumentFileIds,
101
99
  companyView,
102
100
  updateStatus,
103
101
  allNationalityCountries,
@@ -121,7 +119,6 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
121
119
  const companyAddress = addressViewState.newAddressState?.company_address;
122
120
  const registeredCompanyAddress = addressViewState.newAddressState?.company_registered_address;
123
121
  companyDetailsLocalData = {
124
- autoFilledFields: companyDetails.autoFilledFields,
125
122
  companyId,
126
123
  companyDescription,
127
124
  companyLegalName,
@@ -194,7 +191,6 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
194
191
  const companyOfficerAddress = addressViewState.newAddressState?.[addressType];
195
192
  companyOfficerLocalData[officerType] = {
196
193
  ...companyOfficer.localData,
197
- autoFilledFields: companyOfficer.autoFilledFields,
198
194
  userFiles: getFilesByFileIds(fileState, fileIds),
199
195
  additionalFiles: getFilesByFileIds(fileState, additionalSubmittedDocumentsForVerificationFileIds),
200
196
  deleteFileStatusById,
@@ -208,7 +204,6 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
208
204
  return {
209
205
  companyDetailsLocalData,
210
206
  companyOfficerLocalData,
211
- parsingDocumentFileIds: companyAndIdentityDetails.parsingDocumentFileIds,
212
207
  };
213
208
  };
214
209
  /* This helper function takes deposit accounts and payment accounts